libgetdata-0.9.0/0000740000175000017500000000000012614323571014000 5ustar alastairalastairlibgetdata-0.9.0/install-sh0000740000175000017500000003325512614323564016016 0ustar alastairalastair#!/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: libgetdata-0.9.0/Makefile.in0000640000175000017500000010772712614323564016067 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) $(dist_doc_DATA) \ AUTHORS COPYING COPYING.DOC ChangeLog INSTALL NEWS README TODO \ compile config.guess config.sub depcomp install-sh missing \ ltmain.sh ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.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 = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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 cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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).tar.xz GZIP_ENV = --best DIST_TARGETS = dist-xz dist-gzip 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign dist-xz check-news 1.13 EXTRA_DIST = ChangeLog ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src . test bindings util man doc dist_doc_DATA = COPYING.DOC DISTCHECK_CONFIGURE_FLAGS = --enable-legacy-api --enable-modules \ --with-idl-dlm-dir="$$dc_install_base/idl" \ --with-perl-dir="$$dc_install_base/perl" \ --with-php-dir="$$dc_install_base/php" \ --with-python-module-dir="$$dc_install_base/python" # package lists PACKAGES = $(distdir).tar.gz $(distdir).tar.xz idl_$(distdir).tar.gz \ idl_$(distdir).tar.xz getdata_win-$(PACKAGE_VERSION).zip \ matlab_$(distdir).tar.gz matlab_$(distdir).tar.xz SIGS = $(addsuffix .sig,$(PACKAGES)) all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(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: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): 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) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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-recursive 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 distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac $(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 @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 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 \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=.. --prefix="$$dc_install_base" \ && $(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)"; 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 clean-local 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-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 .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool clean-local cscope cscopelist-am ctags ctags-am \ 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-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-am uninstall uninstall-am \ uninstall-dist_docDATA clean-local: if [ -e $(distdir) ]; then chmod -R u+w $(distdir); fi if [ -e idl_$(distdir) ]; then chmod -R u+w idl_$(distdir); fi if [ -e matlab_$(distdir) ]; then chmod -R u+w matlab_$(distdir); fi rm -rf *~ m4/*~ README.txt $(distdir) idl_$(distdir) matlab_$(distdir) %.sig: % gpg -abo $@ $< # a locally-installed library for building and testing the IDL and matlab packages $(distdir)/_inst/lib/pkgconfig: $(distdir).tar.gz tar -zxvf $(distdir).tar.gz cd $(distdir) && \ mkdir _inst && \ ./configure --enable-legacy-api --disable-bindings --prefix=`pwd`/_inst && \ ${MAKE} && \ ${MAKE} install # matlab-only package matlabdist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig rm -rf svn_export svn export $(top_srcdir) svn_export PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ( cd svn_export && \ mkdir matlab_getdata && \ mkdir matlab_getdata/m4 && \ mkdir matlab_getdata/src && \ cp bindings/matlab/package/* matlab_getdata && \ cp -r bindings/matlab/Makefile.am bindings/matlab/gd_*.[cm] \ bindings/matlab/matlab.c bindings/matlab/gd_matlab.h bindings/matlab/test \ bindings/matlab/doc.tail bindings/matlab/Contents.m.head \ bindings/matlab/make_contents.sh.in \ matlab_getdata/src && \ cp -r bindings/make_parameters.c matlab_getdata && \ cp -r m4/matlab.m4 m4/compiler.m4 m4/version.m4 matlab_getdata/m4 && \ cp -r doc/README.matlab COPYING AUTHORS ChangeLog INSTALL NEWS \ matlab_getdata && \ ( cd matlab_getdata && \ aclocal -I m4 && \ libtoolize && \ autoconf && \ autoheader && \ automake --add-missing --force-missing && \ ./configure && \ ${MAKE} dist && \ cp matlab_${distdir}* ../.. \ ) ) rm -rf svn_export matlabdistcheck: matlab_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig if [ -e matlab_$(distdir) ]; then \ chmod -R u+w matlab_$(distdir); rm -rf matlab_$(distdir); \ fi tar -zxvf $< PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \ cd matlab_$(distdir) && ./configure && make dist && make distcheck rm -rf matlab_$(distdir) rm -rf $(distdir) # idl-only package idldist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig rm -rf svn_export svn export $(top_srcdir) svn_export PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ( cd svn_export && \ mkdir idl_getdata && \ mkdir idl_getdata/m4 && \ mkdir idl_getdata/src && \ cp bindings/idl/package/* idl_getdata && \ cp -r bindings/idl/Makefile.am bindings/idl/makedlm.sh.in \ bindings/idl/getdata.c bindings/idl/test idl_getdata/src && \ cp -r bindings/make_parameters.c idl_getdata && \ cp -r m4/idl.m4 m4/compiler.m4 m4/ax_compare_version.m4 m4/version.m4 \ idl_getdata/m4 && \ cp -r doc/README.idl COPYING AUTHORS ChangeLog INSTALL NEWS idl_getdata && \ ( cd idl_getdata && \ aclocal -I m4 && \ libtoolize && \ autoconf && \ autoheader && \ automake --add-missing --force-missing && \ ./configure && \ ${MAKE} dist && \ cp idl_${distdir}* ../.. \ ) ) rm -rf svn_export idldistcheck: idl_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig if [ -e idl_$(distdir) ]; then \ chmod -R u+w idl_$(distdir); rm -rf idl_$(distdir); \ fi tar -zxvf $< PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \ cd idl_$(distdir) && ./configure && make dist && make distcheck rm -rf idl_$(distdir) rm -rf $(distdir) # windows source package windist: $(DISTFILES) rm -rf crlf_export cd man && $(MAKE) htmlman svn --native-eol CRLF export $(top_srcdir) crlf_export ( cd crlf_export && \ mkdir $(distdir) && \ mkdir $(distdir)/bindings && \ mkdir $(distdir)/doc && \ mkdir $(distdir)/man && \ cp ../man/*[35].html $(distdir)/man && \ cp -r bindings/cxx $(distdir)/bindings && \ cp -r cmake util src test $(distdir) && \ $(SED) cmake/CMakeLists.txt \ -e 's/-DPACKAGE_VERSION=\\".*\\"/-DPACKAGE_VERSION=\\"$(PACKAGE_VERSION)\\"/' \ > $(distdir)/cmake/CMakeLists.txt && \ cp -r doc/README.cxx doc/unclean_database_recovery.txt $(distdir)/doc && \ cp AUTHORS COPYING COPYING.DOC ChangeLog NEWS TODO $(distdir) && \ cp README.win $(distdir)/README && \ rm -f $(distdir)/*/Makefile.am $(distdir)/*/*/Makefile.am && \ zip -rq getdata_win-$(PACKAGE_VERSION).zip $(distdir) && \ cp getdata_win*.zip .. \ ) rm -rf crlf_export # coverity scan target cov-scan: rm -rf cov-int make clean ./config.status --recheck cov-build --dir cov-int make tar -zcvf getdata-cov-int-${PACKAGE_VERSION}.tgz cov-int/ # release stuff README.txt: NEWS RELEASE_NOTES.in cp -f RELEASE_NOTES.in $@ head -n `grep -nm 1 '^|' NEWS | awk 'BEGIN {FS=":"} {print $$1-1}'` NEWS >> $@ dist-post: $(SIGS) dist-push: $(PACKAGES) $(SIGS) README.txt @if [ -z "${SFUSER}" ]; then echo "ERROR: SFUSER unset"; false; fi rsync -avP -e ssh $^ $(SFUSER),getdata@frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/ # 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: libgetdata-0.9.0/bindings/0000740000175000017500000000000012614323564015577 5ustar alastairalastairlibgetdata-0.9.0/bindings/Makefile.in0000640000175000017500000006340512614323564017656 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = make_parameters$(EXEEXT) subdir = bindings DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_make_parameters_OBJECTS = make_parameters.$(OBJEXT) nodist_make_parameters_OBJECTS = make_parameters_OBJECTS = $(am_make_parameters_OBJECTS) \ $(nodist_make_parameters_OBJECTS) make_parameters_LDADD = $(LDADD) 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)/src 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 = $(make_parameters_SOURCES) $(nodist_make_parameters_SOURCES) DIST_SOURCES = $(make_parameters_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 DIST_SUBDIRS = . f77 cxx idl python perl matlab php 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign @MAKE_CXXBINDINGS_TRUE@CXX_SUBDIR = cxx @MAKE_F77BINDINGS_TRUE@F77_SUBDIR = f77 @MAKE_IDLBINDINGS_TRUE@IDL_SUBDIR = idl @MAKE_MATLABBINDINGS_TRUE@MATLAB_SUBDIR = matlab @MAKE_PYBINDINGS_TRUE@PY_SUBDIR = python @MAKE_PERLBINDINGS_TRUE@PERL_SUBDIR = perl @MAKE_PHPBINDINGS_TRUE@PHP_SUBDIR = php make_parameters_SOURCES = make_parameters.c nodist_make_parameters_SOURCES = ../src/getdata.h ../src/gd_config.h SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${PY_SUBDIR} \ ${PERL_SUBDIR} ${MATLAB_SUBDIR} ${PHP_SUBDIR} all: all-recursive .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 bindings/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/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-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 mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/make_parameters.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 -o $@ $< .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 -o $@ `$(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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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-local 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: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool clean-local \ clean-noinstPROGRAMS cscopelist-am ctags ctags-am 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-am uninstall \ uninstall-am make_parameters$(EXEEXT): $(make_parameters_SOURCES) \ $(nodist_make_parameters_SOURCES) ${BUILDCC} $(DEFS) -I../src -o make_parameters$(EXEEXT) \ $(srcdir)/$(make_parameters_SOURCES) clean-local: rm -rf *~ # 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: libgetdata-0.9.0/bindings/perl/0000740000175000017500000000000012614323564016541 5ustar alastairalastairlibgetdata-0.9.0/bindings/perl/Makefile.in0000640000175000017500000006071312614323564020617 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/perl DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/Build.PL.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = Build.PL 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)$(perldir)" \ "$(DESTDIR)$(perlautogetdatadir)" "$(DESTDIR)$(man3dir)" SCRIPTS = $(nodist_perl_SCRIPTS) $(nodist_perlautogetdata_SCRIPTS) 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 NROFF = nroff MANS = $(nodist_man3_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign @GETDATA_DEBUG_TRUE@TEST_VERBOSE = verbose=1 plTESTS = t/big_test.t t/callback.t PERL_TESTS = $(addprefix ${srcdir}/, $(plTESTS)) EXTRA_DIST = funclist.pl GetData.xs simple_funcs.pl simple_funcs.xsin typemap \ GetData.pm.in MANIFEST.in ${plTESTS} man3dir = ${perlmandir} nodist_man3_MANS = blib/libdoc/GetData.$(PERL_MAN3EXT) nodist_perl_SCRIPTS = blib/lib/GetData.pm perlautogetdatadir = ${perldir}/auto/GetData nodist_perlautogetdata_SCRIPTS = blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so all: all-am .SUFFIXES: $(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 bindings/perl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/perl/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): Build.PL: $(top_builddir)/config.status $(srcdir)/Build.PL.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-nodist_perlSCRIPTS: $(nodist_perl_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nodist_perl_SCRIPTS)'; test -n "$(perldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(perldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(perldir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(perldir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(perldir)$$dir" || exit $$?; \ } \ ; done uninstall-nodist_perlSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nodist_perl_SCRIPTS)'; test -n "$(perldir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(perldir)'; $(am__uninstall_files_from_dir) install-nodist_perlautogetdataSCRIPTS: $(nodist_perlautogetdata_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nodist_perlautogetdata_SCRIPTS)'; test -n "$(perlautogetdatadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(perlautogetdatadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(perlautogetdatadir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(perlautogetdatadir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(perlautogetdatadir)$$dir" || exit $$?; \ } \ ; done uninstall-nodist_perlautogetdataSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nodist_perlautogetdata_SCRIPTS)'; test -n "$(perlautogetdatadir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(perlautogetdatadir)'; $(am__uninstall_files_from_dir) mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man3: $(nodist_man3_MANS) @$(NORMAL_INSTALL) @list1='$(nodist_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='$(nodist_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: 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 $(SCRIPTS) $(MANS) installdirs: for dir in "$(DESTDIR)$(perldir)" "$(DESTDIR)$(perlautogetdatadir)" "$(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 clean-local 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-nodist_perlSCRIPTS \ install-nodist_perlautogetdataSCRIPTS 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-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-nodist_perlSCRIPTS \ uninstall-nodist_perlautogetdataSCRIPTS @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man3 .MAKE: install-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local cscopelist-am ctags-am 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-man3 install-nodist_perlSCRIPTS \ install-nodist_perlautogetdataSCRIPTS 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 tags-am uninstall \ uninstall-am uninstall-hook uninstall-man uninstall-man3 \ uninstall-nodist_perlSCRIPTS \ uninstall-nodist_perlautogetdataSCRIPTS lib: mkdir -p $@ lib/GetData.xs: GetData.xs $(MAKE) lib cat $(srcdir)/GetData.xs > $@ lib/typemap: typemap $(MAKE) lib cat $(srcdir)/typemap > $@ lib/simple_funcs.xs: simple_funcs.xsin simple_funcs.pl $(MAKE) lib $(PERL) $(srcdir)/simple_funcs.pl $(srcdir)/simple_funcs.xsin > $@ MANIFEST: MANIFEST.in cat $(srcdir)/MANIFEST.in > $@ make_parameters.sed: ../make_parameters ../../src/getdata.h ../make_parameters P > $@ ../make_parameters: ../make_parameters.c ../../src/gd_config.h cd .. && ${MAKE} make_parameters GetData.pm: GetData.pm.in make_parameters.sed funclist.pl lib/GetData.xs \ lib/simple_funcs.xs rm -f $@ $(SED) -f make_parameters.sed $(srcdir)/GetData.pm.in | \ $(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@ chmod a-w $@ blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so \ blib/lib/GetData.pm blib/libdoc/GetData.$(PERL_MAN3EXT): build.stamp build.stamp: Build lib/GetData.xs lib/simple_funcs.xs lib/typemap $(PERL) Build build touch $@ .PRECIOUS: Build Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \ MANIFEST $(PERL) Build.PL clean-local: rm -rf lib blib if test -e Build; then \ $(PERL) Build clean || true; \ fi rm -f $(BUILT_SOURCES) make_parameters.sed MYMETA.yml MYMETA.json GetData.pm rm -rf Build _build MANIFEST build.stamp t/*~ uninstall-hook: rmdir $(DESTDIR)${perlautogetdatadir} @TEST_PERL_TRUE@check: $(PERL_TESTS) @TEST_PERL_TRUE@ ${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build test ${TEST_VERBOSE} @TEST_PERL_TRUE@testdb testcover: $(PERL_TESTS) @TEST_PERL_TRUE@ ${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build $@ ${TEST_VERBOSE} @TEST_PERL_TRUE@.PHONY: check testdb testcover # 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: libgetdata-0.9.0/bindings/perl/typemap0000640000175000017500000000722712614323564020155 0ustar alastairalastair# Copyright (C) 2011-2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., TYPEMAP # basic C types const char ** T_CONST_AVPV _Complex double T_COMPLEX unsigned long int T_UV # GetData types DIRFILE * T_DIRFILE gd_entry_t T_ENTRY gd_entype_t T_UV gd_off64_t T_IV gd_shift_t T_IV gd_triplet_t T_TRIPLET gd_type_t T_IV gd_windop_t T_IV # GetData Perl pseudotypes gdp_complex_in T_COMPLEXIN gdp_bitnum_t T_IV_FFFF gdp_char * T_PV_NULL gdp_int T_IV_ZERO gdp_numbits_t T_IV_ZERO gdp_shift_t T_IV_ZERO gdp_uint_t T_UV_ZERO gdp_type_t T_IV_ZERO gdp_complex T_COMPLEX_ZERO gdp_pentry_t T_PENTRY INPUT T_DIRFILE struct gdp_dirfile_t *gdp_dirfile; if (sv_isa($arg, \"GetData::Dirfile\")) { gdp_dirfile = INT2PTR(struct gdp_dirfile_t*, SvIV((SV*)SvRV($arg))); $var = gdp_dirfile->D; if ($var == NULL) $var = gdp_invalid; } else croak(\"%s::${func_name}() - Invalid dirfile object\", gdp_package); T_COMPLEXIN if ($arg == undef) $var = NULL; else if (SvROK($arg) && SvTYPE(SvRV($arg)) == SVt_PVAV) { AV *av = (AV*)SvRV($arg); I32 i, len = av_len(av); $var = ($type)safemalloc(2 * sizeof(double) * (1 + len)); for (i = 0; i <= len; ++i) { SV **sv = av_fetch(av, i, 0); if (sv == NULL) { safefree($var); croak(\"%s::${func_name}() - Expected array of complex numbers\", gdp_package); } gdp_convert_cmp(gd_cap_(${var}, i), *sv, NULL, gdp_package, \"${func_name}\"); } } else { $var = NULL; croak(\"%s::${func_name}() - Expected array of complex numbers\", gdp_package); } T_CONST_AVPV { $var = gdp_convert_const_avpv($arg, NULL, gdp_package, \"${func_name}\"); } T_COMPLEX { gdp_convert_cmp(gd_csp_($var), $arg, NULL, gdp_package, \"${func_name}\"); } T_ENTRY gdp_to_entry(&$var, $arg, NULL, gdp_package, \"${func_name}\"); T_PENTRY { gd_entry_t old_E; if (gd_entry(dirfile, field_code, &old_E)) { dreturnvoid(); XSRETURN_UNDEF; } gd_free_entry_strings(&old_E); gdp_to_entry(&$var, $arg, &old_E, gdp_package, \"${func_name}\"); } T_IV_FFFF if ($arg == undef) $var = ($type)-1; else $var = ($type)SvIV($arg); T_IV_ZERO if ($arg == undef) $var = ($type)0; else $var = ($type)SvIV($arg); T_UV_ZERO if ($arg == undef) $var = ($type)0; else $var = ($type)SvUV($arg); T_PV_NULL if ($arg == undef) $var = NULL; else $var = SvPV_nolen($arg); T_COMPLEX_ZERO if ($arg == undef) gd_rs2cs_($var, 0); else gdp_convert_cmp(gd_csp_($var), $arg, NULL, gdp_package, \"${func_name}\"); T_TRIPLET { switch (windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: $var.i = (int64_t)SvIV($arg); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: $var.u = (uint64_t)SvUV($arg); break; default: $var.r = SvNV($arg); break; }} OUTPUT T_DIRFILE gdp_dirfile->D = $var; sv_setref_uv($arg, \"${Package}::Dirfile\", PTR2UV(gdp_dirfile)); libgetdata-0.9.0/bindings/perl/simple_funcs.pl0000640000175000017500000001034012614323564021565 0ustar alastairalastair#!/usr/bin/perl -w # Copyright (C) 2011-2013, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # use strict; use warnings; my %rec; my $i; sub printcleanup { $_ = shift; my ($t, $n) = @$_; return "\t\tsafefree($n);\n" if ( $t eq "gdp_complex_in" or $t eq "const char **" or $t eq "gdp_data_in *" or $t eq "gdp_double_in *" ); return ""; } sub printmunge { $_ = shift; my ($t, $n) = @$_; return "&$n" if ($t =~ /&$/); return "(long long)$n" if ($t eq "gd_off64_t" or $t eq "gd_shift_t" or $t eq "gdp_shift_t" or $t eq "int64_t"); return "(unsigned long long)$n" if ($t eq "uint64_t"); return "creal($n), cimag($n)" if ($t eq "_Complex double" or $t eq "gdp_complex"); return "$n.r, (unsigned long long)$n.u, (long long)$n.i" if ($t eq "gd_triplet_t"); return $n; } sub printfmt { $_ = shift; s/^const //g; if (/char \*$/) { return "\\\"%s\\\""; } elsif (/[\*&]$/ or $_ eq "gdp_complex_in") { return "%p"; } elsif ($_ eq "_Complex double" or $_ eq "gdp_complex") { return "%g;%g"; } elsif ($_ eq "double") { return "%g"; } elsif ($_ eq "gdp_bitnum_t" or $_ eq "gdp_numbits_t" or $_ eq "gd_windop_t") { return "%i"; } elsif ($_ eq "gd_entype_t") { return "%02x"; } elsif ($_ eq "gd_shift_t" or $_ eq "gdp_shift_t") { return "%lli"; } elsif ($_ eq "gdp_uint_t") { return "%u"; } elsif ($_ eq "gd_type_t" or $_ eq "gdp_type_t") { return "%03x"; } elsif ($_ eq "int" or $_ eq "gdp_int") { return "%i"; } elsif ($_ eq "gd_off64_t") { return "%lli"; } elsif ($_ eq "size_t") { return "%zi"; } elsif ($_ eq "unsigned int") { return "%u"; } elsif ($_ eq "unsigned long int") { return "%lu"; } elsif ($_ eq "gd_triplet_t") { return "{%g,%llX,%lli}"; } else { die "Can't format \"$_\""; } } while (<>) { chomp; until (/\)/) { $_ .= " " . <>; chomp; } my ($ret, $func, $args) = /(.*?) *([:\w]+)\((.*)\)/; die "Spurious gd_" if ($func =~ /^gd_/); my $lfs = ($func =~ /64$/); $func =~ s/64$// if ($lfs); my $name = $func; if ($func =~ /:/) { ($func, $name) = $func =~ /(.*):(.*)/; } die $_ unless $args; my @args = split ",", $args; my (@argtype, @arg); my $arglist = undef; my $prmlist = undef; for (@args) { my ($t, $n, $d) = /\s*(.*?)\s*(\w+)(?:=(.*))?$/; push @argtype, $t; push @arg, [ $t, $n ]; $_ = "$t $n"; $arglist .= ", " if $arglist; $prmlist .= ", " if $prmlist; $arglist .= "&" if ($t =~ /&$/); $arglist .= $n; $prmlist .= $n; $prmlist .= "=$d" if defined $d; } s/^\s*// for @args; print "$ret\n$name($prmlist)\n\t", join("\n\t", @args), "\n"; print "\tPREINIT:\n\t\tGDP_DIRFILE_ALIAS;\n" . "\tALIAS:\n\t\tGetData::Dirfile::$name = 1\n" if ($args[0] =~ /DIRFILE/); print "\tCODE:\n\t\tdtrace(\"", join(", ", map(printfmt($_), @argtype)); print "\", ", join(", ", map(printmunge($_), @arg)), ");\n"; print "\t\t"; if ($ret ne "void") { print "RETVAL = "; } print "gd_$func" . (($lfs) ? "64" : ""); print "($arglist);\n"; if ($ret ne "void") { print "\t\tGDP_UNDEF_ON_ERROR();\n"; print "\tOUTPUT:\n\t\tRETVAL\n"; } print "\tCLEANUP:\n", map(printcleanup($_), @arg); if ($ret eq "void") { print "\t\tdreturnvoid();\n"; } else { print "\t\tdreturn(\"", &printfmt($ret), "\", "; print &printmunge([$ret, "RETVAL"]), ");\n"; } print "\t\tsafefree(RETVAL);\n" if $ret eq "char *"; print "\n"; } libgetdata-0.9.0/bindings/perl/simple_funcs.xsin0000640000175000017500000002147612614323564022147 0ustar alastairalastairint add_bit(DIRFILE *dirfile, const char *field_code, const char *in_field, int bitnum, int numbits, int fragment_index=0) int add_clincom:add_lincom(DIRFILE *dirfile, const char *field_code, int n_fields, const char **in_fields, gdp_complex_in cm, gdp_complex_in cb, int fragment_index=0) int add_cpolynom:add_polynom(DIRFILE *dirfile, const char *field_code, int poly_ord, const char *in_field, gdp_complex_in ca, int fragment_index=0) int add_crecip:add_recip(DIRFILE *dirfile, const char *field_code, const char *in_field, gdp_complex cdividend, int fragment_index=0) int add_divide(DIRFILE *dirfile, const char *field_code, const char *in_field1, const char *in_field2, int fragment_index=0) int add_linterp(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *table, int fragment_index=0) int add_multiply(DIRFILE *dirfile, const char *field_code, const char *in_field1, const char *in_field2, int fragment_index=0) int add_phase(DIRFILE *dirfile, const char *field_code, const char *in_field, gd_shift_t shift, int fragment_index=0) int add_sbit(DIRFILE *dirfile, const char *field_code, const char *in_field, int bitnum, int numbits, int fragment_index=0) int add_string(DIRFILE *dirfile, const char *field_code, const char *value, int fragment_index=0) int alter_bit(DIRFILE *dirfile, const char *field_code, gdp_char *in_field=NULL, gdp_bitnum_t bitnum=-1, gdp_numbits_t numbits=0) int alter_carray(DIRFILE* dirfile, const char* field_code, gd_type_t const_type, size_t array_len) int alter_clincom:alter_lincom(DIRFILE *dirfile, const char *field_code, gdp_int n_fields=0, const char **in_fields=NULL, gdp_complex_in m=NULL, gdp_complex_in b=NULL) int alter_cpolynom:alter_polynom(DIRFILE *dirfile, const char *field_code, gdp_int poly_ord=0, gdp_char *in_field=NULL, gdp_complex_in a=NULL) int alter_crecip:alter_recip(DIRFILE *dirfile, const char *field_code, gdp_char *in_field=NULL, gdp_complex cdividend) int alter_divide(DIRFILE *dirfile, const char *field_code, gdp_char *in_field1=NULL, gdp_char *in_field2=NULL) int alter_multiply(DIRFILE *dirfile, const char *field_code, gdp_char *in_field1=NULL, gdp_char *in_field2=NULL) int alter_phase(DIRFILE *dirfile, const char *field_code, gdp_char *in_field, gdp_shift_t shift) int alter_sbit(DIRFILE *dirfile, const char *field_code, gdp_char *in_field=NULL, gdp_bitnum_t bitnum=-1, gdp_numbits_t numbits=0) size_t array_len(DIRFILE *dirfile, const char *field_code) unsigned long int encoding(DIRFILE *dirfile, int fragment) unsigned long int endianness(DIRFILE *dirfile, int fragment) int fragment_index(DIRFILE *dirfile, const char *field_code) const char *fragmentname(DIRFILE *dirfile, int index) int madd(DIRFILE *dirfile, gd_entry_t &entry, const char *parent) int madd_bit(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, int bitnum, int numbits) int madd_clincom:madd_lincom(DIRFILE *dirfile, const char *parent, const char *field_code, int n_fields, const char **in_fields, gdp_complex_in cm, gdp_complex_in cb) int madd_cpolynom:madd_polynom(DIRFILE *dirfile, const char *parent, const char *field_code, int poly_ord, const char *in_field, gdp_complex_in ca) int madd_crecip:madd_recip(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, gdp_complex cdividend) int madd_divide(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field1, const char *in_field2) int madd_linterp(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const char *table) int madd_multiply(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field1, const char *in_field2) int madd_phase(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, gd_shift_t shift) int madd_sbit(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, int bitnum, int numbits) int madd_spec(DIRFILE *dirfile, const char *line, const char *parent) int madd_string(DIRFILE *dirfile, const char *parent, const char *field_code, const char *value) int dirfile_standards(DIRFILE *dirfile, int version=GD_VERSION_CURRENT) const char *dirfilename(DIRFILE *dirfile) gd_type_t native_type(DIRFILE *dirfile, const char *field_code) int parent_fragment(DIRFILE *dirfile, int fragment_index) int alter_protection(DIRFILE *dirfile, int protection_level, int fragment_index) int protection(DIRFILE *dirfile, int fragment_index) const char *raw_filename(DIRFILE *dirfile, const char *field_code) const char *reference(DIRFILE *dirfile, gdp_char *field_code=NULL) unsigned int spf(DIRFILE *dirfile, const char *field_code) size_t put_string(DIRFILE *dirfile, const char *field_code, const char *data) int validate(DIRFILE *dirfile, const char *field_code) int add(DIRFILE *dirfile, gd_entry_t &entry) int add_raw(DIRFILE *dirfile, const char *field_code, gd_type_t data_type, unsigned int spf, int fragment_index=0) int add_spec(DIRFILE *dirfile, const char *line, int fragment_index=0) int alter_const(DIRFILE *dirfile, const char *field_code, gdp_type_t const_type=GD_NULL); int alter_encoding(DIRFILE *dirfile, unsigned long int encoding, int fragment=0, int recode=0) int alter_endianness(DIRFILE *dirfile, unsigned long int byte_sex, int fragment=0, int recode=0) int alter_entry(DIRFILE *dirfile, const char *field_code, gdp_pentry_t &entry, int recode=0) int alter_linterp(DIRFILE *dirfile, const char *field_code, gdp_char *in_field=NULL, gdp_char *table=NULL, int recode=0) int alter_raw(DIRFILE *dirfile, const char *field_code, gdp_type_t data_type=GD_NULL, gdp_uint_t spf=0, int recode=0) int alter_spec(DIRFILE *dirfile, const char *line, int recode=0) int delete(DIRFILE *dirfile, const char *field_code, int flags=0) int flush(DIRFILE *dirfile, const char *field_code) int malter_spec(DIRFILE *dirfile, const char *line, const char *parent, int recode=0) int metaflush(DIRFILE *dirfile) int move(DIRFILE *dirfile, const char *field_code, int new_fragment, unsigned int flags=0) int rename(DIRFILE *dirfile, const char *old_code, const char *new_name, int move_data=0) int rewrite_fragment(DIRFILE *dirfile, int fragment) int uninclude(DIRFILE *dirfile, int fragment_index, int del=0) int alter_frameoffset64(DIRFILE *dirfile, gd_off64_t offset, int fragment=0, int recode=0) gd_off64_t frameoffset64(DIRFILE *dirfile, int fragment) double framenum_subset64:framenum(DIRFILE *dirfile, const char* field_code_in, double value, gd_off64_t field_start=0, gd_off64_t field_end=0) gd_off64_t nframes64(DIRFILE *dirfile) gd_off64_t bof64(DIRFILE *dirfile, const char* field_code) gd_off64_t eof64(DIRFILE *dirfile, const char* field_code) int error_count(DIRFILE *dirfile) gd_off64_t seek(DIRFILE *dirfile, const char* field_code, gd_off64_t frame_num, gd_off64_t sample_num, int flags=GD_SEEK_SET) gd_off64_t tell(DIRFILE *dirfile, const char* field_code) int hide(DIRFILE *dirfile, const char *field_code) int hidden(DIRFILE *dirfile, const char *field_code) int unhide(DIRFILE *dirfile, const char *field_code) int sync(DIRFILE *dirfile, const char *field_code) const char *alias_target(DIRFILE *dirfile, const char *field_code) int add_alias(DIRFILE *dirfile, const char *field_code, const char *target, int fragment_index=0) int madd_alias(DIRFILE *dirfile, const char *parent, const char *field_code, const char *target) int add_window(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold, int fragment_index=0) int madd_window(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold) int alter_window(DIRFILE *dirfile, const char *field_code, gdp_char *in_field, gdp_char *check_field, gd_windop_t windop, gd_triplet_t threshold) int alter_affixes(DIRFILE *dirfile, int index, gdp_char *prefix, gdp_char *suffix=NULL) int add_mplex(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *count_field, int count_val, int period, int fragment_index=0) int alter_mplex(DIRFILE *dirfile, const char *field_code, gdp_char *in_field=NULL, gdp_char *count_field=NULL, int count_val=-1, int period=-1) int madd_mplex(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const char *count_field, int count_val, int period) int raw_close(DIRFILE *dirfile, const char *field_code) int desync(DIRFILE *dirfile, unsigned int flags=0) unsigned long int flags(DIRFILE *dirfile, unsigned long int set=0, unsigned long int reset=0) int verbose_prefix(DIRFILE *dirfile, gdp_char *prefix=NULL) void mplex_lookback(DIRFILE *dirfile, int lookback) char *linterp_tablename(DIRFILE *dirfile, const char *field_code) libgetdata-0.9.0/bindings/perl/Makefile.am0000640000175000017500000000611112614323564020576 0ustar alastairalastair# Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign if GETDATA_DEBUG TEST_VERBOSE=verbose=1 endif plTESTS=t/big_test.t t/callback.t PERL_TESTS=$(addprefix ${srcdir}/, $(plTESTS)) EXTRA_DIST=funclist.pl GetData.xs simple_funcs.pl simple_funcs.xsin typemap \ GetData.pm.in MANIFEST.in ${plTESTS} man3dir=${perlmandir} nodist_man3_MANS=blib/libdoc/GetData.$(PERL_MAN3EXT) nodist_perl_SCRIPTS=blib/lib/GetData.pm perlautogetdatadir=${perldir}/auto/GetData nodist_perlautogetdata_SCRIPTS=blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so lib: mkdir -p $@ lib/GetData.xs: GetData.xs $(MAKE) lib cat $(srcdir)/GetData.xs > $@ lib/typemap: typemap $(MAKE) lib cat $(srcdir)/typemap > $@ lib/simple_funcs.xs: simple_funcs.xsin simple_funcs.pl $(MAKE) lib $(PERL) $(srcdir)/simple_funcs.pl $(srcdir)/simple_funcs.xsin > $@ MANIFEST: MANIFEST.in cat $(srcdir)/MANIFEST.in > $@ make_parameters.sed: ../make_parameters ../../src/getdata.h ../make_parameters P > $@ ../make_parameters: ../make_parameters.c ../../src/gd_config.h cd .. && ${MAKE} make_parameters GetData.pm: GetData.pm.in make_parameters.sed funclist.pl lib/GetData.xs \ lib/simple_funcs.xs rm -f $@ $(SED) -f make_parameters.sed $(srcdir)/GetData.pm.in | \ $(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@ chmod a-w $@ blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so \ blib/lib/GetData.pm blib/libdoc/GetData.$(PERL_MAN3EXT): build.stamp build.stamp: Build lib/GetData.xs lib/simple_funcs.xs lib/typemap $(PERL) Build build touch $@ .PRECIOUS: Build Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \ MANIFEST $(PERL) Build.PL clean-local: rm -rf lib blib if test -e Build; then \ $(PERL) Build clean || true; \ fi rm -f $(BUILT_SOURCES) make_parameters.sed MYMETA.yml MYMETA.json GetData.pm rm -rf Build _build MANIFEST build.stamp t/*~ uninstall-hook: rmdir $(DESTDIR)${perlautogetdatadir} if TEST_PERL check: $(PERL_TESTS) ${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build test ${TEST_VERBOSE} testdb testcover: $(PERL_TESTS) ${DL_LIBRARY_PATH}=../../src/.libs:${${DL_LIBRARY_PATH}} $(PERL) ./Build $@ ${TEST_VERBOSE} .PHONY: check testdb testcover endif libgetdata-0.9.0/bindings/perl/GetData.xs0000640000175000017500000017313612614323564020443 0ustar alastairalastair/* Copyright (C) 2011-2015 D. V. Wiebe * ************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #undef _BSD_SOURCE #undef _POSIX_SOURCE #undef _SVID_SOURCE #undef VERSION #include "internal.h" #ifdef GETDATA_DEBUG #include "debug.c" #endif /* Perl 5.8.9 and earlier don't provide hv_fetchs */ #ifdef hv_fetchs # define gdp_hv_fetchs hv_fetchs #else # define gdp_hv_fetchs(hv,key,lval) hv_fetch(hv, key, sizeof(key) - 1, lval) #endif #define undef &PL_sv_undef /* fake data types to simplify our typemap */ typedef GD_DCOMPLEXP_t gdp_complex_in; typedef GD_DCOMPLEXA(gdp_complex); typedef int gdp_bitnum_t; typedef int gdp_numbits_t; typedef gd_shift_t gdp_shift_t; typedef unsigned int gdp_uint_t; typedef gd_type_t gdp_type_t; typedef int gdp_int; typedef const char gdp_char; typedef gd_entry_t gdp_pentry_t; #define GDP_DIRFILE_ALIAS \ const char *gdp_package = ix ? "GetData::Dirifle" : "GetData"; #define GDP_UNDEF_ON_ERROR(x) \ if (gd_error(dirfile)) { x; dreturnvoid(); XSRETURN_UNDEF; } #define GDP_PUSHpvn(s) XPUSHs(sv_2mortal(newSVpvn(s, sizeof(s) - 1))) #define GDP_PUSHpvz(s) XPUSHs(sv_2mortal(newSVpv(s, 0))) #define GDP_PUSHuv(s) XPUSHs(sv_2mortal(newSVuv(s))) #define GDP_PUSHiv(s) XPUSHs(sv_2mortal(newSViv(s))) #define GDP_PUSHnv(s) XPUSHs(sv_2mortal(newSVnv(s))) #define GDP_PUSHrv(s) XPUSHs(sv_2mortal(newRV_noinc((SV*)s))) #define GDP_PUSHcmp(r,i) XPUSHs(sv_2mortal(gdp_newSVcmp(r,i))) #define GDP_PUSHrvavpv(s,n) XPUSHs(sv_2mortal(gdp_newRVavpv((const char**)s,n))) #define GDP_PUSHrvavcmp(s,n) XPUSHs(sv_2mortal(gdp_newRVavcmp(s,n))) #define GDP_PUSHrvavnv(s,n) XPUSHs(sv_2mortal(gdp_newRVavnv(s,n))) struct gdp_callback_stuff_t { SV *func; SV *data; }; struct gdp_dirfile_t { DIRFILE *D; struct gdp_callback_stuff_t cbdata; }; static DIRFILE *gdp_invalid = NULL; /* sv might be NULL, indicating undef */ static gd_type_t gdp_get_type(SV **sv, const char *pkg, const char *func) { dtrace("%p, \"%s\", \"%s\"", sv, pkg, func); if (sv == NULL || *sv == undef) croak("%s::%s() - Value may not be undef", pkg, func); if (sv_isa(*sv, "Math::Complex")) { dreturn("%03x", GD_COMPLEX128); return GD_COMPLEX128; } else if (SvTYPE(*sv) == SVt_IV) { dreturn("%03x", GD_INT64); return GD_INT64; } dreturn("%03x", GD_FLOAT64); return GD_FLOAT64; } /* convert a reference to a list of strings into a const char** */ static const char **gdp_convert_const_avpv(SV *src, size_t *len_out, const char *pkg, const char *func) { const char **dst; dtrace("%p, %p, \"%s\", \"%s\"", src, len_out, pkg, func); if (src == undef) { dst = NULL; if (len_out) *len_out = 0; } else if (SvROK(src) && SvTYPE(SvRV(src)) == SVt_PVAV) { AV *av = (AV*)SvRV(src); I32 i, len = av_len(av); dst = safemalloc(sizeof(char*) * (1 + len)); for (i = 0; i <= len; ++i) { SV **sv = av_fetch(av, i, 0); if (sv == NULL || SvTYPE(*sv) != SVt_PV) { safefree(dst); croak("%s::%s() - Expected array of strings", pkg, func); } dst[i] = SvPV_nolen(*av_fetch(av, i, 0)); } if (len_out) *len_out = (size_t)len + 1; } else croak("%s::%s - Expected array of strings", pkg, func); dreturn("%p", dst); return dst; } /* convert a string list or a reference to a list into a const char ** */ static const char **gdp_convert_strarr(size_t *len_out, I32 items, I32 ax, int offs, const char *pkg, const char *func) { const char **dst; dtrace("%p, %i, %i, %i, \"%s\", \"%s\"", len_out, (int)items, (int)ax, offs, pkg, func); /* if we have more than one data argument, or the first argument is a * string, assume it's not a reference */ if (items - offs > 1 || SvTYPE(ST(offs)) == SVt_PVAV) { I32 i, len; len = items - offs; dst = safemalloc(sizeof(char*) * (items - offs)); for (i = 0; i < len; ++i) { SV *sv = ST(offs + i); if (SvTYPE(sv) != SVt_PV) { safefree(dst); croak("%s::%s() - Expected array of strings", pkg, func); } dst[i] = SvPV_nolen(sv); } if (len_out) *len_out = len; } else dst = gdp_convert_const_avpv(ST(offs), len_out, pkg, func); dreturn("%p", dst); return dst; } /* convert a Perl object into a complex number */ static void gdp_convert_cmp(GD_DCOMPLEXP_t val, SV *src, int *ok, const char* pkg, const char *func) { dtrace("%p, %p, %p, \"%s\", \"%s\"", val, src, ok, pkg, func); if (sv_isa(src, "Math::Complex")) { HV *hv = (HV *)SvRV(src); SV **c_dirty = gdp_hv_fetchs(hv, "c_dirty", 0); if (c_dirty == NULL) croak("%s::%s() - Malformed Math::Complex object", pkg, func); if (SvIV(*c_dirty)) { SV **sv = gdp_hv_fetchs(hv, "polar", 0); if (sv == NULL || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV) croak("%s::%s() - Malformed Math::Complex object", pkg, func); AV *data = (AV*)SvRV(*sv); SV **m = av_fetch(data, 0, 0); SV **a = av_fetch(data, 1, 0); if (m == NULL || a == NULL) croak("%s::%s() - Malformed Math::Complex object", pkg, func); gd_po2cp_(val, SvNV(*m), SvNV(*a)); } else { SV **sv = gdp_hv_fetchs(hv, "cartesian", 0); if (sv == NULL || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV) croak("%s::%s() - Malformed Math::Complex object", pkg, func); AV *data = (AV*)SvRV(*sv); SV **r = av_fetch(data, 0, 0); SV **i = av_fetch(data, 1, 0); if (r == NULL || i == NULL) croak("%s::%s() - Malformed Math::Complex object", pkg, func); gd_li2cp_(val, SvNV(*r), SvNV(*i)); } } else if (ok) { /* if ok is non-NULL, the caller is prepared to handle non-complex data */ *ok = 0; } else { gd_rs2cp_(val, SvNV(src)); } dreturn("(%g;%g)", crealp(val), cimagp(val)); } #define GDP_EHASH_FETCH(part,key) \ v = gdp_hv_fetchs((HV*)sv, key, 0); \ if (!part && v == NULL) \ croak("%s::%s() - Missing required key '" key "' in entry hash", pkg, func) /* handle both "" and "c" names */ #define GDP_EHASH_FETCH_CMP(part,key,member) do { \ GDP_EHASH_FETCH(1,"c" key); \ if (v == NULL) GDP_EHASH_FETCH(part,key); \ if (v) gdp_convert_cmp(gd_csp_(E->member), *v, NULL, pkg, func); \ } while(0) #define GDP_EHASH_FETCH_IV(part,key,variable,type) \ do { GDP_EHASH_FETCH(part,key); if (v) variable = (type)SvIV(*v); } while(0) #define GDP_EHASH_FETCH_NV(part,key,member) \ do { GDP_EHASH_FETCH(part,key); if (v) E->member = SvNV(*v); } while(0) #define GDP_EHASH_FETCH_UV(part,key,member,type) \ do { GDP_EHASH_FETCH(part,key); if (v) E->member = (type)SvUV(*v); } while(0) #define GDP_EHASH_FETCH_PV(part,key,member) \ do { \ GDP_EHASH_FETCH(part,key); \ if (v) E->member = (!SvOK(*v)) ? NULL : SvPV_nolen(*v); \ } while(0) /* populate a complex double array in gd_entry_t */ static int gdp_fetch_cmp_list(GD_DCOMPLEXV(c), HV *hv, int partial, char key, int min, int max, unsigned mask, const char *pkg, const char *func) { dtrace("%p, %p, %i, '%c', %i, %i, 0x%X, \"%s\", \"%s\"", c, hv, partial, key, min, max, mask, pkg, func); int i, n = 0; char ckey[3] = { 'c', key, 0 }; int have[GD_MAX_POLYORD + 1]; SV **v, *sv = NULL; /* try without the 'c' prefix */ v = hv_fetch(hv, ckey + 1, 1, 0); /* try with the 'c' prefix */ if (v == NULL) v = hv_fetch(hv, ckey, 2, 0); /* de-reference as needed */ if (v) { sv = *v; while (SvROK(sv)) sv = SvRV(sv); } if (sv == NULL || SvTYPE(sv) == SVt_NULL) { if (partial) { dreturn("%i", 0); return 0; } croak("%s::%s() - Missing required key '%c' in entry hash", pkg, func, key); } memset(have, 0, sizeof(int) * (GD_MAX_POLYORD + 1)); for (i = 0; i < max; ++i) if (mask & (1 << i)) have[i] = 1; if (SvTYPE(sv) != SVt_PVAV) croak("%s::%s() - Key '%c' must be list in entry hash (%i)", pkg, func, key, SvTYPE(sv)); for (i = 0; i < GD_MAX_LINCOM; ++i) if (!have[i]) { v = av_fetch((AV*)sv, i, 0); if (v) { if (i < max) gdp_convert_cmp(gd_cap_(c,i), *v, NULL, pkg, func); have[i] = 1; } } /* find n */ for (i = 0; i < GD_MAX_POLYORD + 1; ++i) if (i >= n && have[n]) n = i + 1; if (n < min || n > max) croak("%s::%s() - Bad array length (%i) for key '%c' in entry hash", pkg, func, n, key); dreturn("%i", n); return n; } /* populate in_fields in gd_entry_t */ static int gdp_fetch_in_fields(char **in_fields, SV *sv, int partial, int min, int max, const char *pkg, const char *func) { dtrace("%p, %p, %i, %i, %i, \"%s\", \"%s\"", in_fields, sv, partial, min, max, pkg, func); int i, n = 0; SV **v, *vv; GDP_EHASH_FETCH(partial, "in_fields"); if (partial && !v) { dreturn("%i", 0); return 0; } /* de-reference as needed */ vv = *v; while (SvROK(vv)) vv = SvRV(vv); if (SvTYPE(vv) == SVt_NULL) { /* undef */ dreturn("%i", 0); return 0; } if (SvTYPE(vv) != SVt_PVAV) { if (SvOK(vv)) { n = 1; in_fields[0] = SvPV_nolen(vv); } else croak("%s::%s() - Key 'in_fields' must be list or string in entry hash", pkg, func); } else { int have[GD_MAX_LINCOM * 2]; memset(have, 0, sizeof(int) * GD_MAX_LINCOM * 2); for (i = 0; i < GD_MAX_LINCOM; ++i) { v = av_fetch((AV*)vv, i, 0); if (v) { if (i < max) in_fields[i] = SvPV_nolen(*v); have[i] = 1; } } /* find n */ for (i = 0; i < GD_MAX_LINCOM; ++i) if (i >= n && have[n]) n = i + 1; } if (n < min || n > max) { croak("%s::%s() - Bad array length (%i) for key 'in_fields' in entry hash", pkg, func, n); } dreturn("%i", n); return n; } /* populate scalar elements of gd_entry_t */ static unsigned gdp_fetch_scalars(gd_entry_t *E, HV *hv, unsigned int mask, const char *pkg, const char* func) { dtrace("%p, %p, %06x \"%s\", \"%s\"", E, hv, mask, pkg, func); int i; unsigned mask_out = 0; SV *scalar, *scalar_ind = NULL; SV **v = gdp_hv_fetchs(hv, "scalar", 0); /* there's no point in recording scalar indicies if we don't have scalars */ if (v == NULL) { dreturn("%i", 0); return 0; } scalar = *v; while (SvROK(scalar)) scalar = SvRV(scalar); if (SvTYPE(scalar) == SVt_NULL) { /* drop undef */ dreturn("%i", 0); return 0; } v = gdp_hv_fetchs(hv, "scalar_ind", 0); if (v) { scalar_ind = *v; while (SvROK(scalar_ind)) scalar_ind = SvRV(scalar_ind); if (SvTYPE(scalar_ind) == SVt_NULL) scalar_ind == NULL; } if (SvTYPE(scalar) != SVt_PVAV) croak("%s::%s() - Key 'scalar' must be list in entry hash", pkg, func); if (scalar_ind && SvTYPE(scalar_ind) != SVt_PVAV) croak("%s::%s() - Key 'scalar_ind' must be list in entry hash", pkg, func); for (i = 0; i <= GD_MAX_POLYORD; ++i) if (mask & (1 << i)) { v = av_fetch((AV*)scalar, i, 0); if (v == NULL || SvTYPE(*v) == SVt_NULL) E->scalar[i] = NULL; /* skip */ else { E->scalar[i] = SvPV_nolen(*v); mask_out |= (1 << i); if (scalar_ind) { v = av_fetch((AV*)scalar_ind, i, 0); if (v && SvTYPE(*v) != SVt_NULL) E->scalar_ind[i] = SvIV(*v); else E->scalar_ind[i] = 0; } else E->scalar_ind[i] = 0; } } dreturn("%u", mask_out); return mask_out; } /* convert a Perl hash into a gd_entry_t */ static void gdp_to_entry(gd_entry_t *E, SV *sv, const gd_entry_t *old_E, const char *pkg, const char *func) { dtrace("%p, %p, %p, \"%s\", \"%s\"", E, sv, old_E, pkg, func); SV **v; int n, min, max; unsigned mask, tmask; const int partial = (old_E != NULL); if (partial) memcpy(E, old_E, sizeof(gd_entry_t)); else memset(E, 0, sizeof(gd_entry_t)); /* de-reference as needed */ while (SvROK(sv)) sv = SvRV(sv); if (SvTYPE(sv) != SVt_PVHV) croak("%s::%s() - Entry must be hash", pkg, func); GDP_EHASH_FETCH_UV(0, "field_type", field_type, gd_entype_t); GDP_EHASH_FETCH_PV(partial, "field", field); GDP_EHASH_FETCH_UV(partial, "fragment_index", fragment_index, int); switch (E->field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func); mask = gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func); if (!(mask & 1)) GDP_EHASH_FETCH_UV(partial, "bitnum", EN(bit,bitnum), int); if (!(mask & 2)) { GDP_EHASH_FETCH_UV(1, "numbits", EN(bit,numbits), int); if (v == NULL) if (!partial) E->EN(bit,numbits) = 1; } break; case GD_CARRAY_ENTRY: GDP_EHASH_FETCH_IV(partial, "array_len", E->EN(scalar,array_len), size_t); /* fallthrough */ case GD_CONST_ENTRY: GDP_EHASH_FETCH_UV(partial, "const_type", EN(scalar,const_type), gd_type_t); break; case GD_LINCOM_ENTRY: GDP_EHASH_FETCH_IV(1, "n_fields", n, int); if (v) { if (n > GD_MAX_LINCOM || n < 1) croak("%s::%s() - n_fields out of range", pkg, func); min = max = n; } else { min = 1; max = GD_MAX_LINCOM; } E->EN(lincom,n_fields) = gdp_fetch_in_fields(E->in_fields, sv, partial, min, max, pkg, func); if (E->EN(lincom,n_fields) != 0) min = max = E->EN(lincom,n_fields); E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; mask = gdp_fetch_scalars(E, (HV*)sv, ((1 << max) - 1) * 9, pkg, func); if ((mask & tmask) != tmask) { E->EN(lincom,n_fields) = gdp_fetch_cmp_list(E->EN(lincom,cm), (HV*)sv, partial, 'm', min, max, mask, pkg, func); if (E->EN(lincom,n_fields) != 0) min = max = E->EN(lincom,n_fields); } if (((mask >> GD_MAX_LINCOM) & tmask) != tmask) E->EN(lincom,n_fields) = gdp_fetch_cmp_list(E->EN(lincom,cb), (HV*)sv, partial, 'b', min, max, mask >> GD_MAX_LINCOM, pkg, func); else E->EN(lincom,n_fields) = max; break; case GD_LINTERP_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func); GDP_EHASH_FETCH_PV(partial, "table", EN(linterp,table)); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 2, 2, pkg, func); break; case GD_PHASE_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func); mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); if (!(mask & 1)) GDP_EHASH_FETCH_IV(partial, "shift", E->EN(phase,shift), gd_shift_t); break; case GD_POLYNOM_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func); GDP_EHASH_FETCH_IV(1, "poly_ord", n, int); if (v) { if (n > GD_MAX_POLYORD || n < 1) croak("%s::%s() - poly_ord out of range", pkg, func); min = max = n + 1; } else { min = 2; max = GD_MAX_POLYORD + 1; } mask = gdp_fetch_scalars(E, (HV*)sv, (1 << (max + 1)) - 1, pkg, func); tmask = (1 << max) - 1; E->flags |= GD_EN_COMPSCAL; if ((mask & tmask) != tmask) E->EN(polynom,poly_ord) = gdp_fetch_cmp_list(E->EN(polynom,ca), (HV*)sv, partial, 'a', min, max, mask, pkg, func) - 1; else E->EN(polynom,poly_ord) = max - 1; break; case GD_RECIP_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 1, 1, pkg, func); mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); E->flags |= GD_EN_COMPSCAL; if (!(mask & 1)) GDP_EHASH_FETCH_CMP(partial, "dividend", EN(recip,cdividend)); break; case GD_WINDOW_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 2, 2, pkg, func); GDP_EHASH_FETCH_IV(partial, "windop", E->EN(window,windop), gd_windop_t); mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); if (!(mask & 1)) switch(E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: GDP_EHASH_FETCH_IV(partial, "threshold", E->EN(window,threshold).i, int64_t); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: GDP_EHASH_FETCH_UV(partial, "threshold", EN(window,threshold).u, uint64_t); break; default: GDP_EHASH_FETCH_NV(partial, "threshold", EN(window,threshold).r); break; } break; case GD_MPLEX_ENTRY: gdp_fetch_in_fields(E->in_fields, sv, partial, 2, 2, pkg, func); mask = gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func); if (!(mask & 1)) GDP_EHASH_FETCH_UV(partial, "count_val", EN(mplex,count_val), int); if (!(mask & 2)) GDP_EHASH_FETCH_UV(1, "period", EN(mplex,period), int); break; case GD_RAW_ENTRY: GDP_EHASH_FETCH_UV(partial, "data_type", EN(raw,data_type), gd_type_t); mask = gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); if (!(mask & 1)) GDP_EHASH_FETCH_UV(partial, "spf", EN(raw,spf), unsigned int); break; case GD_NO_ENTRY: case GD_INDEX_ENTRY: case GD_STRING_ENTRY: break; default: croak("%s::%s() - Invalid field type %x in entry hash", pkg, func, E->field_type); } dreturnvoid(); } /* convert a single perl datum into the desired type */ static void gdp_convert_from_perl(void *dest, SV *src, gd_type_t type, const char *pkg, const char *func) { dtrace("%p, %p, %03x, \"%s\", \"%s\"", dest, src, type, pkg, func); GD_DCOMPLEXA(c); int cmp = 1; /* undef results in randomness */ if (src == NULL) { dreturnvoid(); return; } /* check for and convert complex data */ gdp_convert_cmp(gd_csp_(c), src, &cmp, pkg, func); switch (type) { case GD_UINT8: *(uint8_t*)dest = cmp ? (uint8_t)creal(c) : (uint8_t)SvUV(src); break; case GD_INT8: *(int8_t*)dest = cmp ? (int8_t)creal(c) : (int8_t)SvIV(src); break; case GD_UINT16: *(uint16_t*)dest = cmp ? (uint16_t)creal(c) : (uint16_t)SvUV(src); break; case GD_INT16: *(int16_t*)dest = cmp ? (int16_t)creal(c) : (int16_t)SvIV(src); break; case GD_UINT32: *(uint32_t*)dest = cmp ? (uint32_t)creal(c) : (uint32_t)SvUV(src); break; case GD_INT32: *(int32_t*)dest = cmp ? (int32_t)creal(c) : (int32_t)SvIV(src); break; case GD_UINT64: *(uint64_t*)dest = cmp ? (uint64_t)creal(c) : (uint64_t)SvUV(src); break; case GD_INT64: *(int64_t*)dest = cmp ? (int64_t)creal(c) : (int64_t)SvIV(src); break; case GD_FLOAT32: *(float*)dest = cmp ? (float)creal(c) : (float)SvNV(src); break; case GD_FLOAT64: *(double*)dest = cmp ? (double)creal(c) : (double)SvNV(src); break; case GD_COMPLEX64: if (cmp) gd_cs2ca_(dest,0,c,float); else gd_rs2ca_(dest,0,SvNV(src),float); break; case GD_COMPLEX128: if (cmp) gd_cs2ca_(dest,0,c,double); else gd_rs2ca_(dest,0,SvNV(src),double); break; case GD_NULL: case GD_UNKNOWN: ; } dreturnvoid(); } struct gdp_din { void *data_in; gd_type_t type; int arg_type; size_t nsamp; }; #define GDP_DATA_IN_LIST 0 #define GDP_DATA_IN_PACK 1 #define GDP_DATA_IN_REF 2 static struct gdp_din gdp_convert_data(SV *d, I32 items, I32 ax, size_t idx, const char *pkg, const char *func) { struct gdp_din din = {NULL, GD_NULL, GDP_DATA_IN_PACK, 0}; size_t i; AV *av = NULL; dtrace("%p, %i, %i, %zi, \"%s\", \"%s\"", d, (int)items, (int)ax, idx, pkg, func); /* argument grokking goes thus (in order!): * if d == undef, the remaining arguments are taken to be data * if d == reference to an array, the array is taken to be data, and * remaining arguments ignored * if there is exactly one argument after d, d is taken as a type code * and the following argument as either packed data or a * reference to a list. * otherwise, d is taken to be the first datum in a list of data. */ if (d == undef) { idx++; din.arg_type = GDP_DATA_IN_LIST; } else if (sv_isa(d, "Math::Complex")) din.arg_type = GDP_DATA_IN_LIST; else if (SvROK(d)) { av = (AV*)SvRV(d); din.arg_type = GDP_DATA_IN_REF; } else if (items != 6) din.arg_type = GDP_DATA_IN_LIST; else if (SvROK(ST(5))) { av = (AV*)SvRV(ST(5)); din.arg_type = GDP_DATA_IN_REF; } if (din.arg_type == GDP_DATA_IN_LIST) { din.nsamp = items - idx; din.type = gdp_get_type(&ST(idx), pkg, func); } else if (din.arg_type == GDP_DATA_IN_REF) { if (SvTYPE((SV*)av) != SVt_PVAV) croak("%s::%s() - Expected array reference, but found some other " "type of object", pkg, func); din.nsamp = (size_t)av_len(av) + 1; din.type = gdp_get_type(av_fetch(av, 0, 0), pkg, func); } else { din.type = (gd_type_t)SvIV(d); if (GD_SIZE(din.type) == 0) croak("%s::%s() - Invalid type code", pkg, func); STRLEN n; din.data_in = SvPV(ST(5), n); din.nsamp = (size_t)n / GD_SIZE(din.type); } if (din.arg_type != GDP_DATA_IN_PACK) din.data_in = safemalloc(din.nsamp * GD_SIZE(din.type)); if (din.arg_type == GDP_DATA_IN_LIST) { for (i = idx; i < items; ++i) gdp_convert_from_perl((char*)din.data_in + GD_SIZE(din.type) * (i - idx), ST(i), din.type, pkg, func); } else if (din.arg_type == GDP_DATA_IN_REF) { for (i = 0; i < din.nsamp; ++i) { SV **sv = av_fetch(av, i, 0); if (sv == NULL) croak("%s::%s() - Undefined datum encountered", pkg, func); gdp_convert_from_perl((char*)din.data_in + GD_SIZE(din.type) * i, *sv, din.type, pkg, func); } } dreturn("{ %p, %03x, %i, %zi }", din.data_in, din.type, din.arg_type, din.nsamp); return din; } /* convert perl datum (in some sort of format) into an appropriate * C datum, with type */ static gd_type_t gdp_to_voidp(void *dest, SV *src, gd_type_t hint, const char *pkg, const char *func) { dtrace("%p, %p, %03x, \"%s\", \"%s\"", dest, src, hint, pkg, func); gd_type_t type = GD_UNKNOWN; /* treat undef as zero */ if (src == undef) { memset(dest, 0, 1); type = GD_UINT8; } else { int cmp = 0; GD_DCOMPLEXA(c); gdp_convert_cmp(gd_csp_(c), src, &cmp, pkg, func); if (cmp) { gd_cs2ca_(dest, 0, c, double); type = GD_COMPLEX128; } else if (SvNOK(src)) { *(double*)dest = SvNV(src); type = GD_FLOAT64; } else if (SvUOK(src)) { *(uint64_t*)dest = (uint64_t)SvUV(src); type = GD_UINT64; } else if (SvIOK(src)) { *(int64_t*)dest = (int64_t)SvIV(src); type = GD_INT64; } else if (hint & GD_COMPLEX || hint & GD_IEEE754) { *(double*)dest = SvNV(src); type = GD_FLOAT64; } else if (hint & GD_SIGNED) { *(int64_t*)dest = (int64_t)SvIV(src); type = GD_INT64; } else { *(uint64_t*)dest = (uint64_t)SvUV(src); type = GD_UINT64; } } dreturn("%03x", type); return type; } static SV *gdp_newSVcmp(double r, double i) { SV **dummy; SV *sv; AV *av; HV *hv, *stash; dtrace("%g; %g", r, i); /* build a list containing the data, and take it's reference */ av = newAV(); av_extend(av, 1); av_store(av, 0, newSVnv(r)); av_store(av, 1, newSVnv(i)); sv = newRV_noinc((SV*)av); /* create a Math::Complex object */ hv = newHV(); dummy = hv_store(hv, "p_dirty", 7, newSVuv(1), 0); dummy = hv_store(hv, "c_dirty", 7, newSVuv(0), 0); dummy = hv_store(hv, "cartesian", 9, sv, 0); stash = gv_stashpv("Math::Complex", GV_ADD); sv = sv_bless(newRV_noinc((SV*)hv), stash); dreturn("%p", sv); return sv; } /* convert a NULL-terminated char ** into a reference to a list of strings */ static SV *gdp_newRVavpv0(const char **l) { dtrace("%p", l); SV *rv; int i; AV *av = newAV(); for (i = 0; l[i]; ++i) av_store(av, i, newSVpv(l[i], 0)); rv = newRV_noinc((SV*)av); dreturn("%p", rv); return rv; } /* convert a char ** with length into a reference to a list of strings */ static SV *gdp_newRVavpv(const char **l, size_t n) { dtrace("%p, %zi", l, n); SV *rv; int i; AV *av = newAV(); av_extend(av, n - 1); for (i = 0; i < n; ++i) av_store(av, i, newSVpv(l[i], 0)); rv = newRV_noinc((SV*)av); dreturn("%p", rv); return rv; } /* convert a complex double * into a reference to a list of complex data */ static SV *gdp_newRVavcmp(GD_DCOMPLEXV(l), size_t n) { dtrace("%p, %zi", l, n); SV *rv; int i; AV *av = newAV(); av_extend(av, n - 1); for (i = 0; i < n; ++i) av_store(av, i, gdp_newSVcmp(creal(l[i]), cimag(l[i]))); rv = newRV_noinc((SV*)av); dreturn("%p", rv); return rv; } /* store some scalar values in the entry hash on the stack from the gd_entry_t */ static SV **gdp_store_scalars(SV **sp, const gd_entry_t *E, unsigned int mask) { dtrace("%p, %p, %06x", sp, E, mask); int i; if (!mask) { dreturn("%p", sp); return sp; } AV *scalar = newAV(); AV *scalar_ind = newAV(); av_extend(scalar, GD_MAX_POLYORD); av_extend(scalar_ind, GD_MAX_POLYORD); for (i = 0; i <= GD_MAX_POLYORD; ++i) if (mask & (1 << i)) { av_store(scalar, i, newSVpv(E->scalar[i], 0)); if (E->scalar[i] == NULL) av_store(scalar_ind, i, undef); else av_store(scalar_ind, i, newSViv(E->scalar_ind[i])); } GDP_PUSHpvn("scalar"); GDP_PUSHrv(scalar); GDP_PUSHpvn("scalar_ind"); GDP_PUSHrv(scalar_ind); dreturn("%p", sp); return sp; } /* parser callback wrapper */ static int gdp_parser_callback(gd_parser_data_t *pdata, void *extra) { SV *callback_func = ((struct gdp_callback_stuff_t *)extra)->func; SV *callback_data = ((struct gdp_callback_stuff_t *)extra)->data; SV *ret, **dummy; int n, sem = GD_SYNTAX_ABORT; int was_rv = 0; AV *av; int len; /* local stack pointer */ dSP; dtrace("%p, %p", pdata, extra); /* create pseudo-block */ ENTER; SAVETMPS; /* create the parser data hash */ HV *phash = newHV(); dummy = hv_store(phash, "suberror", 8, newSVuv(pdata->suberror), 0); dummy = hv_store(phash, "linenum", 7, newSVuv(pdata->linenum), 0); dummy = hv_store(phash, "line", 4, newSVpv(pdata->line, 0), 0); dummy = hv_store(phash, "filename", 8, newSVpv(pdata->filename, 0), 0); /* create stack frame */ PUSHMARK(SP); XPUSHs(sv_2mortal(newRV_noinc((SV *)phash))); XPUSHs(callback_data); /* finalise stack frame */ PUTBACK; /* call the object */ n = call_sv(callback_func, G_SCALAR); /* refresh local stack pointer */ SPAGAIN; /* delete the hash */ hv_undef(phash); /* Make sure we got a scalar back; otherwise complain and abort */ if (n != 1) { croak("GetData: expected scalar response from parser callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } /* pop our return value */ ret = POPs; /* de-reference as needed */ while (SvROK(ret)) { ret = SvRV(ret); was_rv = 1; } /* ferret out response */ switch (SvTYPE(ret)) { case SVt_IV: sem = SvIV(ret); break; case SVt_PVAV: av = (AV *)ret; len = av_len(av); if (len < 0) { croak("GetData: parser callback returned empty array."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } else if (len > 1) { croak("GetData: too many elements in array returned by parser " "callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } else if (len == 0) { SV **val = av_fetch(av, 0, 0); if (val == NULL || SvROK(*val)) { croak("GetData: bad data type in array returned by parser callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } if (SvTYPE(*val) == SVt_IV) { sem = SvIV(*val); } else if (SvTYPE(*val) == SVt_PV) { pdata->line = strdup(SvPV_nolen(*val)); sem = GD_SYNTAX_RESCAN; } else { croak("GetData: bad data type in array returned by parser callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } } else { /* len == 1 */ SV **val0 = av_fetch(av, 0, 0); SV **val1 = av_fetch(av, 1, 0); if (val0 == NULL || SvROK(*val0) || val1 == NULL || SvROK(*val1)) { croak("GetData: bad data type in array returned by parser callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } if (SvTYPE(*val0) == SVt_IV && SvTYPE(*val1) == SVt_PV) { sem = SvIV(*val0); pdata->line = strdup(SvPV_nolen(*val1)); } else { croak("GetData: bad data type in array returned by parser callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } } break; case SVt_PV: pdata->line = strdup(SvPV_nolen(ret)); sem = GD_SYNTAX_RESCAN; break; default: croak("GetData: bad data type returned by parser callback."); return GD_SYNTAX_ABORT; /* ca'n't get here */ } /* resync global stack pointer */ PUTBACK; /* destroy pseudo-block */ FREETMPS; LEAVE; dreturn("%i", sem); return sem; } #define GDP_UNPACKU(t) \ if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSVuv(((t*)data)[i]))); \ else for (i = 0; i < n; ++i) av_store(av, i, newSVuv(((t*)data)[i])); #define GDP_UNPACKI(t) \ if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSViv(((t*)data)[i]))); \ else for (i = 0; i < n; ++i) av_store(av, i, newSViv(((t*)data)[i])); #define GDP_UNPACKN(t) \ if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSVnv(((t*)data)[i]))); \ else for (i = 0; i < n; ++i) av_store(av, i, newSVnv(((t*)data)[i])); #define GDP_UNPACKC(t) \ if (sp) for (i = 0; i < n; ++i) \ XPUSHs(sv_2mortal(gdp_newSVcmp(((t*)data)[2 * i], \ ((t*)data)[2 * i + 1]))); \ else for (i = 0; i < n; ++i) av_store(av, i, \ gdp_newSVcmp(((t*)data)[2 * i], ((t*)data)[2 * i + 1])); /* unpack data. If sp is NULL, return an AV, otherwise push it onto the perl * stack; returns the updated stack pointer */ static void * gdp_unpack(SV **sp, const void *data, size_t n, gd_type_t type) { dtrace("%p, %p, %zi, %03x", sp, data, n, type); size_t i; AV *av = NULL; if (!sp) { av = newAV(); av_extend(av, n - 1); } if (n == 0) { dreturn("%p", sp); return sp ? (void *)sp : (void *)av; } switch (type) { case GD_UINT8: GDP_UNPACKU(uint8_t); break; case GD_INT8: GDP_UNPACKI(int8_t); break; case GD_UINT16: GDP_UNPACKU(uint16_t); break; case GD_INT16: GDP_UNPACKI(int16_t); break; case GD_UINT32: GDP_UNPACKU(uint32_t); break; case GD_INT32: GDP_UNPACKI(int32_t); break; case GD_UINT64: GDP_UNPACKU(uint64_t); break; case GD_INT64: GDP_UNPACKI(int64_t); break; case GD_FLOAT32: GDP_UNPACKN(float); break; case GD_FLOAT64: GDP_UNPACKN(double); break; case GD_COMPLEX64: GDP_UNPACKC(float); break; case GD_COMPLEX128: GDP_UNPACKC(double); break; case GD_UNKNOWN: case GD_NULL: break; } dreturn("%p", sp ? (void *)sp : (void *)av); return sp ? (void *)sp : (void *)av; } /* Module starts here --------------------------------------------------- */ MODULE = GetData PACKAGE = GetData PROTOTYPES: ENABLE BOOT: gdp_invalid = gd_invalid_dirfile(); void DESTROY(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::DESTROY = 1 CODE: dtrace("%p", dirfile); if (dirfile != gdp_invalid) gd_discard(dirfile); safefree(gdp_dirfile); CLEANUP: dreturnvoid(); int error(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::error = 1 CODE: dtrace("%p", dirfile); RETVAL = gd_error(dirfile); OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); DIRFILE * open(dirfilename, flags, sehandler=undef, extra=undef) const char * dirfilename unsigned long flags SV * sehandler SV * extra PREINIT: struct gdp_dirfile_t *gdp_dirfile = (struct gdp_dirfile_t *)safemalloc(sizeof(struct gdp_dirfile_t)); CODE: dtrace("\"%s\", %lu, %p, %p", dirfilename, flags, sehandler, extra); if (sehandler == undef) { gdp_dirfile->cbdata.func = NULL; gdp_dirfile->cbdata.data = NULL; RETVAL = gd_cbopen(dirfilename, flags, NULL, NULL); } else { gdp_dirfile->cbdata.func = sehandler; gdp_dirfile->cbdata.data = extra; RETVAL = gd_cbopen(dirfilename, flags, gdp_parser_callback, &gdp_dirfile->cbdata); } OUTPUT: RETVAL CLEANUP: dreturn("%p", gdp_dirfile); DIRFILE * invalid_dirfile() PREINIT: struct gdp_dirfile_t *gdp_dirfile = (struct gdp_dirfile_t *)safemalloc(sizeof(struct gdp_dirfile_t)); CODE: dtracevoid(); gdp_dirfile->cbdata.func = NULL; gdp_dirfile->cbdata.data = NULL; RETVAL = gd_invalid_dirfile(); OUTPUT: RETVAL CLEANUP: dreturn("%p", gdp_dirfile); void get_carray(dirfile, field_code, return_type) DIRFILE * dirfile const char * field_code gd_type_t return_type PREINIT: void *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::get_carray = 1 PPCODE: dtrace("%p, \"%s\", %03x; %i", dirfile, field_code, return_type, (int)GIMME_V); size_t len = gd_array_len(dirfile, field_code); data_out = safemalloc(GD_SIZE(return_type) * len); gd_get_carray(dirfile, field_code, return_type, data_out); GDP_UNDEF_ON_ERROR(safefree(data_out)); if (GIMME_V == G_ARRAY) sp = (SV **)gdp_unpack(sp, data_out, len, return_type); else XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); safefree(data_out); dreturnvoid(); void get_carray_slice(dirfile, field_code, start, len, return_type) DIRFILE * dirfile const char * field_code gd_type_t return_type unsigned int start size_t len PREINIT: void *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::get_carray_slice = 1 PPCODE: dtrace("%p, \"%s\", %u, %zi, %03x; %i", dirfile, field_code, start, len, return_type, (int)GIMME_V); data_out = safemalloc(GD_SIZE(return_type) * len); gd_get_carray_slice(dirfile, field_code, start, len, return_type, data_out); GDP_UNDEF_ON_ERROR(safefree(data_out)); if (GIMME_V == G_ARRAY) sp = (SV **)gdp_unpack(sp, data_out, len, return_type); else XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); safefree(data_out); dreturnvoid(); SV * get_constant(dirfile, field_code, return_type) DIRFILE * dirfile const char * field_code gd_type_t return_type PREINIT: void *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::get_constant = 1 CODE: gd_type_t type; dtrace("%p, \"%s\", %03x", dirfile, field_code, return_type); data_out = safemalloc(16); if (return_type & GD_COMPLEX) type = GD_COMPLEX128; else if (return_type & GD_IEEE754) type = GD_FLOAT64; else if (return_type & GD_SIGNED) type = GD_INT64; else type = GD_UINT64; gd_get_constant(dirfile, field_code, type, data_out); GDP_UNDEF_ON_ERROR(safefree(data_out)); if (type == GD_COMPLEX128) RETVAL = gdp_newSVcmp(((double*)data_out)[0], ((double*)data_out)[1]); else if (type == GD_FLOAT64) RETVAL = newSVnv(*(double*)data_out); else if (type == GD_INT64) RETVAL = newSViv(*(int64_t*)data_out); else RETVAL = newSVuv(*(uint64_t*)data_out); OUTPUT: RETVAL CLEANUP: safefree(data_out); dreturn("%p", RETVAL); void constants(dirfile, return_type) DIRFILE * dirfile gd_type_t return_type PREINIT: const void *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::constants = 1 PPCODE: dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V); int len = gd_nfields_by_type(dirfile, GD_CONST_ENTRY); data_out = gd_constants(dirfile, return_type); GDP_UNDEF_ON_ERROR(); if (GIMME_V == G_ARRAY) sp = (SV **)gdp_unpack(sp, data_out, len, return_type); else XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); dreturnvoid(); void carrays(dirfile, return_type) DIRFILE * dirfile gd_type_t return_type PREINIT: const gd_carray_t *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::carrays = 1 PPCODE: dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V); I32 i, len = (I32)gd_nfields_by_type(dirfile, GD_CARRAY_ENTRY); data_out = gd_carrays(dirfile, return_type); GDP_UNDEF_ON_ERROR(); /* in array context, return an array of arrays of unpacked data. * Otherwise, return a reference to an array of packed data. */ if (GIMME_V == G_ARRAY) for (i = 0; i < len; ++i) XPUSHs(sv_2mortal(newRV_noinc((SV *)gdp_unpack(NULL, data_out[i].d, data_out[i].n, return_type)))); else { AV *av = newAV(); for (i = 0; i < len; ++i) av_store(av, i, newSVpvn(data_out[i].d, data_out[i].n * GD_SIZE(return_type))); XPUSHs(sv_2mortal(newRV_noinc((SV*)av))); } dreturnvoid(); void entry(dirfile, field_code) DIRFILE * dirfile const char * field_code PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::entry = 1 PPCODE: dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V); if (GIMME_V == G_ARRAY) { gd_entry_t E; gd_entry(dirfile, field_code, &E); GDP_UNDEF_ON_ERROR(); /* push the hash onto the stack */ GDP_PUSHpvn("field"); GDP_PUSHpvz(E.field); GDP_PUSHpvn("field_type"); GDP_PUSHuv(E.field_type); GDP_PUSHpvn("fragment_index"); GDP_PUSHuv(E.fragment_index); switch (E.field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHpvz(E.in_fields[0]); GDP_PUSHpvn("bitnum"); GDP_PUSHuv(E.EN(bit,bitnum)); GDP_PUSHpvn("numbits"); GDP_PUSHuv(E.EN(bit,numbits)); sp = gdp_store_scalars(sp, &E, 0x3); break; case GD_CARRAY_ENTRY: GDP_PUSHpvn("array_len"); GDP_PUSHuv(E.EN(scalar,array_len)); /* fallthrough */ case GD_CONST_ENTRY: GDP_PUSHpvn("const_type"); GDP_PUSHuv(E.EN(scalar,const_type)); break; case GD_LINCOM_ENTRY: GDP_PUSHpvn("n_fields"); GDP_PUSHiv(E.EN(lincom,n_fields)); GDP_PUSHpvn("in_fields"); GDP_PUSHrvavpv(E.in_fields, E.EN(lincom,n_fields)); GDP_PUSHpvn("m"); GDP_PUSHrvavcmp(E.EN(lincom,cm), E.EN(lincom,n_fields)); GDP_PUSHpvn("b"); GDP_PUSHrvavcmp(E.EN(lincom,cb), E.EN(lincom,n_fields)); sp = gdp_store_scalars(sp, &E, ((1 << E.EN(lincom,n_fields)) - 1) * 9); break; case GD_LINTERP_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHpvz(E.in_fields[0]); GDP_PUSHpvn("table"); GDP_PUSHpvz(E.EN(linterp,table)); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHrvavpv(E.in_fields, 2); break; case GD_PHASE_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHpvz(E.in_fields[0]); GDP_PUSHpvn("shift"); GDP_PUSHiv(E.EN(phase,shift)); sp = gdp_store_scalars(sp, &E, 1); break; case GD_POLYNOM_ENTRY: GDP_PUSHpvn("poly_ord"); GDP_PUSHiv(E.EN(polynom,poly_ord)); GDP_PUSHpvn("in_fields"); GDP_PUSHpvz(E.in_fields[0]); GDP_PUSHpvn("a"); GDP_PUSHrvavcmp(E.EN(polynom,ca), E.EN(polynom,poly_ord) + 1); sp = gdp_store_scalars(sp, &E, (1 << (E.EN(polynom,poly_ord) + 1)) - 1); break; case GD_RECIP_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHpvz(E.in_fields[0]); GDP_PUSHpvn("dividend"); GDP_PUSHcmp(creal(E.EN(recip,cdividend)), cimag(E.EN(recip,cdividend))); sp = gdp_store_scalars(sp, &E, 1); break; case GD_RAW_ENTRY: GDP_PUSHpvn("spf"); GDP_PUSHuv(E.EN(raw,spf)); GDP_PUSHpvn("data_type"); GDP_PUSHuv(E.EN(raw,data_type)); sp = gdp_store_scalars(sp, &E, 1); break; case GD_WINDOW_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHrvavpv(E.in_fields, 2); GDP_PUSHpvn("windop"); GDP_PUSHiv(E.EN(window,windop)); GDP_PUSHpvn("threshold"); switch(E.EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: GDP_PUSHiv(E.EN(window,threshold).i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: GDP_PUSHuv(E.EN(window,threshold).u); break; default: GDP_PUSHnv(E.EN(window,threshold).r); break; } sp = gdp_store_scalars(sp, &E, 1); break; case GD_MPLEX_ENTRY: GDP_PUSHpvn("in_fields"); GDP_PUSHrvavpv(E.in_fields, 2); GDP_PUSHpvn("count_val"); GDP_PUSHuv(E.EN(mplex,count_val)); GDP_PUSHpvn("period"); GDP_PUSHuv(E.EN(mplex,period)); sp = gdp_store_scalars(sp, &E, 0x3); break; case GD_INDEX_ENTRY: case GD_STRING_ENTRY: case GD_NO_ENTRY: break; } gd_free_entry_strings(&E); } else { gd_entype_t t = gd_entry_type(dirfile, field_code); GDP_UNDEF_ON_ERROR(); GDP_PUSHiv(t); } dreturnvoid(); SV * error_string(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::error_string = 1 CODE: dtrace("%p", dirfile); char *s = gd_error_string(dirfile, NULL, 0); RETVAL = newSVpv(s, 0); OUTPUT: RETVAL CLEANUP: free(s); dreturn("%p", RETVAL); AV * mcarrays(dirfile, parent, return_type) DIRFILE * dirfile const char * parent; gd_type_t return_type PREINIT: const gd_carray_t *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::mcarrays = 1 PPCODE: dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V); I32 i, len = (I32)gd_nmfields_by_type(dirfile, parent, GD_CARRAY_ENTRY); data_out = gd_mcarrays(dirfile, parent, return_type); GDP_UNDEF_ON_ERROR(); /* in array context, return an array of arrays of unpacked data. * Otherwise, return a reference to an array of packed data. */ if (GIMME_V == G_ARRAY) for (i = 0; i < len; ++i) XPUSHs(sv_2mortal(newRV_noinc((SV *)gdp_unpack(NULL, data_out[i].d, data_out[i].n, return_type)))); else { AV *av = newAV(); for (i = 0; i < len; ++i) av_store(av, i, newSVpvn(data_out[i].d, data_out[i].n * GD_SIZE(return_type))); XPUSHs(sv_2mortal(newRV_noinc((SV*)av))); } dreturnvoid(); void mconstants(dirfile, parent, return_type) DIRFILE * dirfile const char * parent gd_type_t return_type PREINIT: const void *data_out = NULL; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::mconstants = 1 PPCODE: dtrace("%p, %03x; %i", dirfile, return_type, (int)GIMME_V); int len = gd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY); data_out = gd_mconstants(dirfile, parent, return_type); GDP_UNDEF_ON_ERROR(); if (GIMME_V == G_ARRAY) sp = (SV **)gdp_unpack(sp, data_out, len, return_type); else XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); dreturnvoid(); void parser_callback(dirfile, sehandler, extra=undef) DIRFILE * dirfile SV *sehandler SV *extra PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::parser_callback = 1 CODE: dtrace("%p, %p, %p", dirfile, sehandler, extra); if (sehandler == undef) { gdp_dirfile->cbdata.func = NULL; gdp_dirfile->cbdata.data = NULL; gd_parser_callback(dirfile, NULL, NULL); } else { gdp_dirfile->cbdata.func = sehandler; gdp_dirfile->cbdata.data = extra; gd_parser_callback(dirfile, gdp_parser_callback, &gdp_dirfile->cbdata); } CLEANUP: dreturnvoid(); char * get_string(dirfile, field_code) DIRFILE * dirfile const char * field_code PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::get_string = 1 CODE: dtrace("%p, \"%s\"", dirfile, field_code); /* get string length */ size_t len = gd_get_string(dirfile, field_code, 0, NULL); RETVAL = safemalloc(len); /* get string */ gd_get_string(dirfile, field_code, len, RETVAL); OUTPUT: RETVAL CLEANUP: dreturn("\"%s\"", RETVAL); safefree(RETVAL); int close(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::close = 1 CODE: dtrace("%p", dirfile); if (dirfile != gdp_invalid) { RETVAL = gd_close(dirfile); if (!RETVAL) gdp_dirfile->D = NULL; } else RETVAL = 0; OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); int discard(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::discard = 1 CODE: dtrace("%p", dirfile); if (dirfile != gdp_invalid) { RETVAL = gd_discard(dirfile); if (!RETVAL) gdp_dirfile->D = NULL; } else RETVAL = 0; OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); void getdata(dirfile, field_code, first_frame, first_samp, num_frames, num_samp, return_type=GD_UNKNOWN) DIRFILE * dirfile const char * field_code gd_off64_t first_frame gd_off64_t first_samp size_t num_frames size_t num_samp gd_type_t return_type PREINIT: unsigned int spf = 1; gd_entype_t t; GDP_DIRFILE_ALIAS; size_t i, len; void * data_out; ALIAS: GetData::Dirfile::getdata = 1 PPCODE: dtrace("%p, \"%s\", %lli, %lli, %zi, %zi, %03x; %i", dirfile, field_code, (long long)first_frame, (long long)first_samp, num_frames, num_samp, return_type, (int)GIMME_V); t = gd_entry_type(dirfile, field_code); GDP_UNDEF_ON_ERROR(); if (num_frames) { spf = gd_spf(dirfile, field_code); num_samp += spf * num_frames; GDP_UNDEF_ON_ERROR(); } if (return_type == GD_UNKNOWN) croak("%s::getdata() - No return type specified", gdp_package); data_out = safemalloc(GD_SIZE(return_type) * num_samp); len = gd_getdata64(dirfile, field_code, first_frame, first_samp, 0, num_samp, return_type, data_out); GDP_UNDEF_ON_ERROR(safefree(data_out)); /* In array context, unpack the array and push it onto the stack, * otherwise just return the packed data */ if (GIMME_V == G_ARRAY) sp = (SV **)gdp_unpack(sp, data_out, len, return_type); else XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); safefree(data_out); dreturnvoid(); void field_list(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::field_list = 1 PPCODE: dtrace("%p; %i", dirfile, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_field_list(dirfile); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nfields(dirfile); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void field_list_by_type(dirfile, type) DIRFILE * dirfile gd_entype_t type PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::field_list_by_type = 1 PPCODE: dtrace("%p, %i; %i", dirfile, type, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_field_list_by_type(dirfile, type); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nfields_by_type(dirfile, type); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void entry_list(dirfile, parent, type, flags) DIRFILE * dirfile gdp_char * parent gdp_int type gdp_uint_t flags PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::entry_list = 1 PPCODE: dtrace("%p, \"%s\", %i, %u; %i", dirfile, parent, type, flags, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **el = gd_entry_list(dirfile, parent, type, flags); GDP_UNDEF_ON_ERROR(); for (i = 0; el[i]; ++i) GDP_PUSHpvz(el[i]); } else { unsigned int ne = gd_nentries(dirfile, parent, type, flags); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(ne); } dreturnvoid(); void vector_list(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::vector_list = 1 PPCODE: dtrace("%p; %i", dirfile, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_vector_list(dirfile); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nvectors(dirfile); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void strings(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::strings = 1 PPCODE: dtrace("%p; %i", dirfile, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_strings(dirfile); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nfields_by_type(dirfile, GD_STRING_ENTRY); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void mfield_list(dirfile, field_code) DIRFILE * dirfile const char * field_code PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::mfield_list = 1 PPCODE: dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_mfield_list(dirfile, field_code); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nmfields(dirfile, field_code); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void mfield_list_by_type(dirfile, parent, type) DIRFILE * dirfile const char * parent gd_entype_t type PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::mfield_list_by_type = 1 PPCODE: dtrace("%p, \"%s\", %i; %i", dirfile, parent, type, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_mfield_list_by_type(dirfile, parent, type); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nmfields_by_type(dirfile, parent, type); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void mvector_list(dirfile, parent) DIRFILE * dirfile const char * parent PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::mvector_list = 1 PPCODE: dtrace("%p; %i", dirfile, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_mvector_list(dirfile, parent); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nmvectors(dirfile, parent); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void mstrings(dirfile, field_code) DIRFILE * dirfile const char * field_code PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::mstrings = 1 PPCODE: dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V); /* in array context, return the field list, otherwise return nfields */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_mstrings(dirfile, field_code); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_nmfields_by_type(dirfile, field_code, GD_STRING_ENTRY); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); int put_carray(dirfile, field_code, d, ...) DIRFILE * dirfile const char * field_code SV *d; PREINIT: GDP_DIRFILE_ALIAS; struct gdp_din din; ALIAS: GetData::Dirfile::put_carray = 1 CODE: dtrace("%p, \"%s\", %p, ...[%li]", dirfile, field_code, d, (long)items - 3); din = gdp_convert_data(d, items, ax, 2, gdp_package, "put_carray"); RETVAL = gd_put_carray(dirfile, field_code, din.type, din.data_in); GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in)); OUTPUT: RETVAL CLEANUP: if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in); dreturn("%i", RETVAL); int put_carray_slice(dirfile, field_code, start, d, ...) DIRFILE * dirfile const char * field_code gd_off64_t start SV *d; PREINIT: GDP_DIRFILE_ALIAS; struct gdp_din din; ALIAS: GetData::Dirfile::put_carray_slice = 1 CODE: dtrace("%p, \"%s\", %lli, %p, ...[%li]", dirfile, field_code, (long long)start, d, (long)items - 4); din = gdp_convert_data(d, items, ax, 3, gdp_package, "put_carray_slice"); RETVAL = gd_put_carray_slice(dirfile, field_code, start, din.nsamp, din.type, din.data_in); GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in)); OUTPUT: RETVAL CLEANUP: if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in); dreturn("%i", RETVAL); int add_carray(dirfile, field_code, const_type, fragment_index, d, ...) DIRFILE * dirfile const char * field_code int fragment_index gd_type_t const_type SV *d PREINIT: GDP_DIRFILE_ALIAS; struct gdp_din din; ALIAS: GetData::Dirfile::add_carray = 1 CODE: dtrace("%p, \"%s\", %03x, %i, %p, ...[%li]", dirfile, field_code, const_type, fragment_index, d, (long)items - 5); din = gdp_convert_data(d, items, ax, 4, gdp_package, "add_carray"); RETVAL = gd_add_carray(dirfile, field_code, const_type, din.nsamp, din.type, din.data_in, fragment_index); GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in)); OUTPUT: RETVAL CLEANUP: if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in); dreturn("%i", RETVAL); int madd_carray(dirfile, parent, field_code, const_type, d, ...) DIRFILE * dirfile const char * parent const char * field_code gd_type_t const_type SV *d PREINIT: GDP_DIRFILE_ALIAS; struct gdp_din din; ALIAS: GetData::Dirfile::madd_carray = 1 CODE: dtrace("%p, \"%s\", \"%s\", %03x, %p, ...[%li]", dirfile, parent, field_code, const_type, d, (long)items - 5); din = gdp_convert_data(d, items, ax, 4, gdp_package, "madd_carray"); RETVAL = gd_madd_carray(dirfile, parent, field_code, const_type, din.nsamp, din.type, din.data_in); GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in)); OUTPUT: RETVAL CLEANUP: if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in); dreturn("%i", RETVAL); size_t putdata(dirfile, field_code, first_frame, first_sample, d, ...) DIRFILE * dirfile const char * field_code gd_off64_t first_frame gd_off64_t first_sample SV *d; PREINIT: GDP_DIRFILE_ALIAS; struct gdp_din din; ALIAS: GetData::Dirfile::putdata = 1 CODE: dtrace("%p, \"%s\", %lli, %lli, %p, ...[%li]", dirfile, field_code, (long long)first_frame, (long long)first_sample, d, (long)items - 5); din = gdp_convert_data(d, items, ax, 4, gdp_package, "putdata"); RETVAL = gd_putdata(dirfile, field_code, first_frame, first_sample, 0, din.nsamp, din.type, din.data_in); GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in)); OUTPUT: RETVAL CLEANUP: if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in); dreturn("%zi", RETVAL); int add_const(dirfile, field_code, const_type, value=undef, fragment_index=0) DIRFILE * dirfile const char * field_code gd_type_t const_type SV * value int fragment_index PREINIT: gd_type_t data_type; char data_in[16]; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::add_const = 1 CODE: dtrace("%p, \"%s\", %03x, %p, %i", dirfile, field_code, const_type, value, fragment_index); data_type = gdp_to_voidp(data_in, value, const_type, gdp_package, "add_const"); RETVAL = gd_add_const(dirfile, field_code, const_type, data_type, data_in, fragment_index); GDP_UNDEF_ON_ERROR(); OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); int madd_const(dirfile, parent, field_code, const_type, value=undef) DIRFILE * dirfile const char * parent const char * field_code gd_type_t const_type SV * value PREINIT: gd_type_t data_type; char data_in[16]; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::madd_const = 1 CODE: dtrace("%p, \"%s\", \"%s\", %03x, %p", dirfile, parent, field_code, const_type, value); data_type = gdp_to_voidp(data_in, value, const_type, gdp_package, "madd_const"); RETVAL = gd_madd_const(dirfile, parent, field_code, const_type, data_type, data_in); GDP_UNDEF_ON_ERROR(); OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); int put_constant(dirfile, field_code, value) DIRFILE * dirfile const char * field_code SV * value PREINIT: gd_type_t data_type; char data_in[16]; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::put_constant = 1 CODE: dtrace("%p, \"%s\", %p", dirfile, field_code, value); data_type = gdp_to_voidp(data_in, value, GD_FLOAT64, gdp_package, "put_constant"); RETVAL = gd_put_constant(dirfile, field_code, data_type, data_in); GDP_UNDEF_ON_ERROR(); OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); void fragments(dirfile) DIRFILE * dirfile PREINIT: GDP_DIRFILE_ALIAS; unsigned int nf; ALIAS: GetData::Dirfile::fragments = 1 PPCODE: dtrace("%p; %i", dirfile, (int)GIMME_V); nf = gd_nfragments(dirfile); if (GIMME_V == G_ARRAY) { unsigned int i; for (i = 0; i < nf; ++i) GDP_PUSHpvz(gd_fragmentname(dirfile, i)); } else GDP_PUSHuv(nf); dreturnvoid(); void aliases(dirfile, field_code) DIRFILE * dirfile const char * field_code PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::aliases = 1 PPCODE: dtrace("%p, \"%s\"; %i", dirfile, field_code, (int)GIMME_V); /* in array context, return the field list, otherwise return naliases */ if (GIMME_V == G_ARRAY) { int i; const char **fl = gd_aliases(dirfile, field_code); GDP_UNDEF_ON_ERROR(); for (i = 0; fl[i]; ++i) GDP_PUSHpvz(fl[i]); } else { unsigned int nf = gd_naliases(dirfile, field_code); GDP_UNDEF_ON_ERROR(); GDP_PUSHuv(nf); } dreturnvoid(); void fragment_affixes(dirfile, fragment_index) DIRFILE * dirfile int fragment_index PREINIT: char *prefix; char *suffix; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::fragment_affixes = 1 PPCODE: dtrace("%p, %i", dirfile, fragment_index); gd_fragment_affixes(dirfile, fragment_index, &prefix, &suffix); GDP_UNDEF_ON_ERROR(); GDP_PUSHpvz(prefix); GDP_PUSHpvz(suffix); dreturnvoid(); void strtok(dirfile, string) DIRFILE * dirfile const char * string PREINIT: int i; char *token; GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::strtok = 1 PPCODE: dtrace("%p, \"%s\"", dirfile, string); /* return an array of all the parsed tokens */ for (token = gd_strtok(dirfile, string); token; token = gd_strtok(dirfile, NULL)) { GDP_UNDEF_ON_ERROR(); GDP_PUSHpvz(token); free(token); } dreturnvoid(); int include(dirfile, file, fragment_index, flags, prefix=NULL, suffix=NULL) DIRFILE * dirfile const char * file int fragment_index unsigned long int flags gdp_char * prefix gdp_char * suffix PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::include = 1 CODE: dtrace("%p, \"%s\", %i, %lu, \"%s\", \"%s\"", dirfile, file, fragment_index, flags, prefix, suffix); RETVAL = gd_include_affix(dirfile, file, fragment_index, prefix, suffix, flags); GDP_UNDEF_ON_ERROR(); OUTPUT: RETVAL CLEANUP: dreturn("%i", RETVAL); size_t carray_len(dirfile, field_code) DIRFILE * dirfile const char * field_code PREINIT: GDP_DIRFILE_ALIAS; ALIAS: GetData::Dirfile::carray_len = 1 CODE: dtrace("%p, \"%s\"", dirfile, field_code); warn("carray_len is deprecated. Use array_len instead."); RETVAL = gd_array_len(dirfile, field_code); GDP_UNDEF_ON_ERROR(); OUTPUT: RETVAL CLEANUP: dreturn("%zi", RETVAL); INCLUDE: simple_funcs.xs libgetdata-0.9.0/bindings/perl/funclist.pl0000640000175000017500000000223112614323564020725 0ustar alastairalastair# Copyright (C) 2011 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # use strict; use strict; use warnings; my $preamble = 1; # Generate the list my @funclist; for (<>) { $preamble = 0 if (/^MODULE/); next if $preamble; next unless /^(\w*)\(/; push @funclist, $1; } my $funclist = join(' ', sort @funclist); for () { s/\@FUNCLIST@/$funclist/g; print $_; } libgetdata-0.9.0/bindings/perl/MANIFEST.in0000640000175000017500000000005112614323564020275 0ustar alastairalastairMANIFEST This list of files GetData.pm libgetdata-0.9.0/bindings/perl/GetData.pm.in0000640000175000017500000011051212614323564021017 0ustar alastairalastair# Copyright (C) 2011-2013, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # package GetData; use 5.00800; use strict; use warnings; require Exporter; require XSLoader; require Math::Complex; our @ISA = qw(Exporter); our %EXPORT_TAGS = ('all' => [qw(VERSION @FUNCLIST@ @PARAMLIST@)], 'constants' => [qw(VERSION @PARAMLIST@)], 'functions' => [qw(@FUNCLIST@)]); our @EXPORT_OK = (@{$EXPORT_TAGS{'all'}}); our @EXPORT = qw(); @PARAMETERS@ XSLoader::load('GetData', $VERSION); 1; __END__ =head1 NAME GetData - Perl bindings to the GetData library for Dirfile access =head1 SYNOPSIS use GetData; my $DIRFILE = GetData::open("./dirfile/", $GetData::RDONLY); # the following calls are equivalent my $data = GetData::getdata($DIRFILE, "field", 5, 0, 1, $GetData::UINT8); my $data = $DIRFILE->getdata("field", 5, 0, 1, $GetData::UINT8); =head1 DESCRIPTION This module provides simple, lightweight bindings from Perl to the C GetData library. It provides a simple mapping between public C functions and Perl methods. All C functions and constants are replicated in the GetData package. These methods have the same name as their C counterparts, excluding the C namespace prefix `gd_' (or `GD_', for C preprocessor constants). The dirfile lvalue returned by GetData::open is a simplistic object. Any GetData method which takes a dirfile as a parameter, may instead be called as method of the dirfile object itself. (See the synopsis above for an example.) Dirfile metadata entries (which are C structs of type gd_entry_t) are represented as simple hashes. By default, GetData does not export any symbols. All symbols in the GetData package may be exported with: use GetData "all"; but this is discouraged, as it will overwrite useful things like &CORE::open. Throughout the module, complex data are generally represented as C objects, but may be simplified to ordinary floating point numbers if the imaginary part is zero. =head1 CONSTANTS The module defines a large number of symbolic constants used by the API which mirror the constants defined in the C API. The "constants" tag may be used to export just the constants from the module, if desired. Some genericly useful sets of constants are discussed below. Other constants are discussed in the method descriptions where they are used. =head2 Data Types GetData knows the following data types: =over =item $GetData::NULL the null data type, which returns no data. =item $GetData::UINT8 unsigned 8-bit integer =item $GetData::INT8 signed (two's complement) 8-bit integer =item $GetData::UINT16 unsigned 16-bit integer =item $GetData::INT16 signed (two's complement) 16-bit integer =item $GetData::UINT32 unsigned 32-bit integer =item $GetData::INT32 signed (two's complement) 32-bit integer =item $GetData::UINT64 unsigned 64-bit integer =item $GetData::INT64 signed (two's complement) 64-bit integer =item $GetData::FLOAT32 IEEE-754 standard 32-bit single precision floating point number =item $GetData::FLOAT64 IEEE-754 standard 64-bit double precision floating point number =item $GetData::COMPLEX64 FORTRAN and C99 conformant 64-bit single precision floating point complex number =item $GetData::COMPLEX128 FORTRAN and C99 conformant 128-bit double precision floating point complex number =back =head2 Encoding Types The following encoding types are known by GetData: =over $GetData::BZIP2_ENCODED, $GetData::FLAC_ENCODED, $GetData::GZIP_ENCODED, $GetData::LZMA_ENCODED, $GetData::SIE_ENCODED, $GetData::SLIM_ENCODED, $GetData::TEXT_ENCODED, $GetData::ZZIP_ENCODED, $GetData::ZZSLIM_ENCODED, $GetData::UNENCODED. =back Details of these encoding types are given in the dirfile-format(5) manual page. =head2 Entry Types The following symbols are used to indicate entry types: =over $GetData::NO_ENTRY, $GetData::BIT_ENTRY, $GetData::CARRAY_ENTRY, $GetData::CONST_ENTRY, $GetData::DIVIDE_ENTRY, $GetData::INDEX_ENTRY, $GetData::LINCOM_ENTRY, $GetData::LINTERP_ENTRY, $GetData::MPLEX_ENTRY, $GetData::MULTIPLY_ENTRY, $GetData::PHASE_ENTRY, $GetData::POLYNOM_ENTRY, $GetData::RAW_ENTRY, $GetData::RECIP_ENTRY, $GetData::SBIT_ENTRY, $GetData::STRING_ENTRY, $GetData::WINDOW_ENTRY =back Of these, C<$GetData::NO_ENTRY> is used to flag invalid entry types and C<$GetData::INDEX_ENTRY> is used only for the implicit B field. See gd_entry(3) and dirfile-format(5) for details of the other entry types. =head2 WINDOW Operators The following symbols are used to indicate WINDOW operators: =over $GetData::WINDOP_EQ, $GetData::WINDOP_GE, $GetData::WINDOP_GT, $GetData::WINDOP_LE, $GetData::WINDOP_LT, $GetData::WINDOP_NE, $GetData::WINDOP_CLR, $GetData::WINDOP_SET. =back =head1 INPUT DATA Functions which take sets of data as input (L, L, L, L, and L) accept data in a number of ways. The arguments specifying the data always appear at the end of the argument list. They are represented as C<{DATA...}> in the method descriptions below. Input data arguments are parsed as follows. =over =item 1. If the first data argument is undef, then it is ignored and all subsequent arguments are taken as data: $dirfile->putdata("field_code", $first_frame, $first_sample, undef, @data) or $dirfile->putdata("field_code", $first_frame, $first_sample, undef, $data[0], $data[1], $data[2], ...) =item 2. Otherwise, if the first data argument is a reference to an array, the array is taken as data (and any further arguments are ignored): $dirfile->putdata("field_code", $first_frame, $first_sample, \@data) =item 3. Otherwise, if only two arguments make up the data argument list, and the second is a reference to an array, the first is taken as a type code specifing the conversion type, and the second is taken as the data: $dirfile->putdata("field_code", $first_frame, $first_sample, $GetData::UINT8, \@data) =item 4. Otherwise, if only two arguments make up the data argument list, and the second is not a reference to an array, the first is, again, taken as a type code, and the second is assumed to be a packed string containing the data in a format appropriate for the type code specified: $packed_data = pack("C", @data) $dirfile->putdata("field_code", $first_frame, $first_sample, $GetData::UINT8, $packed_data) =item 5. Otherwise, finally, the data argument list elements are simply taken as data themselves: $dirfile->putdata("field_code", $first_frame, $first_sample, @data) or $dirfile->putdata("field_code", $first_frame, $first_sample, $data[0], $data[1], $data[2], ...) =back GetData internally converts the Perl data into a format readable by the C API. In cases 3 and 4 above, the type the data is converted into is specified explicitly in the call. In the other cases, GetData must guess an appropriate C type into which to convert the data. It does so by looking at the first data value: =over =item * if the value is a C object, the data are converted to double precision complex data (C) =item * if the value is an integer, the data are converted to a 64-bit signed integer (C) =item * otherwise, the data are converted to a double precision float (C). =back Of the above methods, the first is only necessary when the data array has only two elements, and so would be mistaken for method four if specified without the initial undef. Furthermore, the fourth method is typically the most efficient, since the packed data scalar can often be used as the input to the C API without need for type conversion. =head1 ENTRY HASHES The replacement for the C object of the C API is a simple hash. The key names are the same as the names of the C members. (See gd_entry(3) for details). In entry hashes returned by GetData, only those keys appropriate for the entry type specified will be present. Entry hashes passed to GetData from the caller may have other keys than those required by the entry type. They will be ignored. The value associated with the C key will be one of the symbols listed under L above. For entry types which have (potentially) more than one input field (DIVIDE, LINCOM, MPLEX, MULTIPLY, WINDOW), the value associated with the C<"in_fields"> key will be a list of strings, regardless of how many elements it has; other entry types which provide C<"in_fields"> will be a scalar, even though the key name is still plural. Elements of the C array which are undef indicate literal parameters (equivalent to C in the C's C member). Similarly, undef is used in C where the C API uses -1, to indicate CONST fields, instead of CARRAYs. =head1 NON-MEMBER FUNCTIONS =over =item encoding_support ($ENCODING) Returns C<$GetData::RDWR> if the library can both read and write the specified encoding, C<$GetData::RDONLY> if it can only read, or -1 otherwise. C<$ENCODING> should be one of the encoding symbols listed above in the L section. =back =head1 DIRFILE CREATION METHODS =over =item open ($DIRFILENAME, $FLAGS, $SEHANDLER=undef, $EXTRA=undef) Create or open a Dirfile database called C<$DIRFILENAME>. C<$FLAGS> should be either C<$GetData::RDONLY> (for read-only access) or C<$GetData::RDWR> (for read-write access), optionally bitwise or'd with any of the following flags: =over $GetData::ARM_ENDIAN, $GetData::BIG_ENDIAN, $GetData::CREAT, $GetData::EXCL, $GetData::FORCE_ENCODING, $GetData::FORCE_ENDIAN, $GetData::IGNORE_DUPS, $GetData::IGNORE_REFS, $GetData::LITTLE_ENDIAN, $GetData::NOT_ARM_ENDIAN, $GetData::PEDANTIC, $GetData::PERMISSIVE, $GetData::PRETTY_PRINT, $GetData::TRUNC, $GetData::TRUNCSUB, $GetData::VERBOSE, =back and at most one of the encoding symbols listed above in the L section or else C<$GetData::AUTO_ENCODED> indicating that GetData should attempt to automatically determine the encoding. The meaning of the dirfile flags may be found in the gd_cbopen(3) manual page. $SEHANDLER is a Perl callback function which will be executed whenever a syntax error is encountered. It may be undef, if no callback is desired. When called, C<$SEHANDLER> will be passed two arguments. The first is a reference to a hash containing the parser data. The second is the C<$EXTRA> scalar passed to this method. C<$SEHANDLER> is called in scalar context, and should return either: =over =item * an integer, one of the symbolic constants: =over $GetData::SYNTAX_ABORT, $GetData::SYNTAX_CONTINUE, $GetData::SYNTAX_IGNORE, $GetData::SYNTAX_RESCAN; =back (see gd_cbopen(3) for their meaning), or =item * a string containing the corrected line, in which case C<$GetData::SYNTAX_RESCAN> is assumed; or, =item * a reference to a list consisting of an integer, one of the C<$GetData::SYNTAX_...> constants listed above, and then, optionally, a string containing the corrected line. =back This function always returns a Dirfile object, even if the call failed; the caller should use the returned dirfile's L() method to test for success. On error, the returned object will be flagged as invalid. =item invalid_dirfile () This function always returns a newly created, but invalid, Dirfile object. Unlike an invalid dirfile created (either accidentally or purposefully) using L(), the dirfile returned by this function always has a zero error code. See gd_invalid_dirfile(3). =back =head1 DIRFILE OBJECT METHODS The following methods all operate on a dirfile object returned by one of the above methods and can either be called as: $GetData::method($dirfile, ...) or else, as $dirfile->method(...) without change in operation. =head2 List of Methods =over =item $dirfile->add_carray ($FIELD_NAME, $DATA_TYPE, $FRAGMENT_INDEX, {DATA...}) Adds a new CARRAY field called C<$FIELD_NAME> to the metadata fragment indexed by C<$FRAGMENT_INDEX>. The storage type of the CARRAY is given by C<$DATA_TYPE>, which should be one of the symbols listed above under L. The value of the CARRAY is then set to the data given in the C<{DATA...}> argument list, which also determines its length. See the L section above for details on the allowed forms of C<{DATA...}>. See gd_add_carray(3). =item $dirfile->add_const ($FIELD_NAME, $DATA_TYPE, [$VALUE, $FRAGMENT_INDEX]) Adds a new CONST field called C<$FIELD_NAME> to the metadata fragment indexed by C<$FRAGMENT_INDEX>, or to the primary format file if omitted. The C<$DATA_TYPE> argument indicates the storage type, which should be one of the symbols listed above under L. If given, the value of the field is set to C<$VALUE>, otherwise the field will be initialised to zero. See gd_add_const(3). =item $dirfile->aliases ($FIELD_CODE) In scalar context, returns the number of aliases of C<$FIELD_CODE>. In list context, returns an array of alias names for C<$FIELD_CODE>. See gd_naliases(3) and gd_aliases(3). =item $dirfile->carrays ($RETURN_TYPE) Returns the value of all carrays (excluding metafields) in the dirfile after converting them to the return type C<$RETURN_TYPE>, which should be one of the symbols listed under L above. If called in scalar context, returns a reference to an array of packed string data. If called in list context, returns an array of arrays of unpacked data. See gd_carrays(3). =item $dirfile->close () Closes the dirfile, writing changes to disk. Upon successful completion, the dirfile object will be invalidated, prohibiting further operation on it. A dirfile which is destroyed by garbage collection is discarded (see L below). This function should be called if metadata need to be written to disk before the object goes out of scope. See gd_close(3). =item $dirfile->constants ($RETURN_TYPE) Returns the value of all constants (excluding metafields) in the dirfile after converting them to the return type C<$RETURN_TYPE>, which should be one of the symbols listed under L above. If called in scalar context, returns a packed string containing the data. If called in list context, the data will be unpacked and returned as an array. See gd_constants(3). =item $dirfile->discard () Closes the dirfile, ignoring changes to metadata, but writing changed data to disk. Upon successful completion, the dirfile object will be invalidated, prohibiting further operation on it. This function is called automatically by the dirfile destructor, and need not be called explicitly. To save the metadata on close, use L. See gd_discard(3). =item $dirfile->entry ($FIELD_CODE) If called in scalar context, returns the entry type of C<$FIELD_CODE>, one of the symbols listed above under L. In array context, returns a hash describing the indicated field. See gd_entry_type(3) and gd_entry(3). =item $dirfile->entry_list ($PARENT, $TYPE, $FLAGS) In scalar context, returns the number of entries matching the supplied criteria. In list context, returns an array of the names of the entries. If C<$PARENT> is undef, top-level entries are considered, otherwise meta entries under C<$PARENT> are considered. If C<$TYPE> is one of the entry types listed above under L, only entries of that type are considered. Alternatley, C<$TYPE> may be one of: =over $GetData::ALL_ENTRIES, $GetData::SCALAR_ENTRIES, $GetData::VECTOR_ENTRIES. =back Setting C<$TYPE> to undef is equivalent to setting it to C<$GetData::ALL_ENTRIES>. If not undef, which is treated as zero, C<$FLAGS> should be zero or more of the following flags: =over $GetData::ENTRIES_HIDDEN, $GetData::ENTRIES_NOALIAS. =back See gd_nentries(3) and gd_entry_list(3) for the meaning of these symbols. =item $dirfile->error () Returns the error code of the last operation on this dirfile. See gd_error(3). =item $dirfile->error_string () Returns a string describing the error encountered (if any) by the last operation on this dirfile. See gd_error_string(3). =item $dirfile->field_list () Equivalent to: C<$dirfile-Eentry_list(undef, undef, undef)>. =item $dirfile->field_list_by_type ($TYPE) Equivalent to: C<$dirfile-Eentry_list(undef, $TYPE, undef)>. =item $dirfile->fragment_affixes ($FRAGMENT_INDEX) Returns an array containing the prefix (first) and suffix (second) of the fragment indexed by C<$FRAGMENT_INDEX>. See gd_fragment_affixes(3). =item $dirfile->fragments () In scalar context, returns the number of metadata fragments in the dirfile. In list context, returns an array of pathnames to the fragments on disk, in the order that they're indexed. See gd_nfragments(3) and gd_fragmentname(3). =item $dirfile->get_carray ($FIELD_CODE, $RETURN_TYPE) Returns the value of the CARRAY named C<$FIELD_CODE> after converting its elements to the return type C<$RETURN_TYPE>, which should be one of the symbols listed under L above. If called in scalar context, returns a packed string containing the data. If called in list context, the data will be unpacked and returned as an array. See gd_get_carray(3). =item $dirfile->get_carray_slice ($FIELD_CODE, $START, $LEN, $RETURN_TYPE) Returns the value of a portion of the CARRAY named C<$FIELD_CODE> after converting its elements to the return type C<$RETURN_TYPE>, which should be one of the symbols listed under L above. The first element returned is given by C<$START>, and the number of elements by C<$LEN>. If called in scalar context, returns a packed string containing the data. If called in list context, the data will be unpacked and returned as an array. Less data than requested may be returned, if insufficient data exists. See gd_get_carray_slice(3). =item $dirfile->get_constant ($FIELD_CODE, $RETURN_TYPE) Returns the value of the CONST named C<$FIELD_CODE> after converting it to the return type C<$RETURN_TYPE>, which should be one of the symbols listed under L above. See gd_get_constant(3). =item $dirfile->getdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMP, $NUM_FRAMES, $NUM_SAMP, $RETURN_TYPE) Returns data from the field specified by C<$FIELD_CODE> after converting them to the return type C<$RETURN_TYPE>, which should be one of the symbols listed under L above. The first sample returned is C<$FIRST_SAMP> samples after the start of C<$FIRST_FRAME> and the amount of data returned is C<$NUM_FRAMES> frames plus C<$NUM_SAMP> samples. If called in scalar context returns a string of packed data. If called in array context, the data will be unpacked and returned as an array. Complex data are returned as C objects. See gd_getdata(3). =item $dirfile->get_string ($FIELD_CODE) Returns the value of the STRING named C<$FIELD_CODE>. See gd_get_string(3). =item $dirfile->include ($FILE, $PARENT_FRAGMENT, $FLAGS, [$PREFIX, $SUFFIX]) Includes the fragment metadata file C<$FILE> under the fragment indexed by C<$PARENT_FRAGMENT>. C<$FLAGS> should be a bitwise or'd collection of zero or more of the following flags: =over $GetData::BIG_ENDIAN, $GetData::CREAT, $GetData::EXCL, $GetData::FORCE_ENCODING, $GetData::FORCE_ENDIAN, $GetData::IGNORE_DUPS, $GetData::IGNORE_REFS, $GetData::LITTLE_ENDIAN, $GetData::PEDANTIC, $GetData::TRUNC, =back and at most one of the encoding symbols listed above in the L section or else C<$GetData::AUTO_ENCODED> indicating that GetData should attempt to automatically determine the encoding. If C<$PREFIX> or C<$SUFFIX> are omitted or undef, the added fragment will contain no such affix. See gd_include_affix(3). =item $dirfile->madd_carray ($PARENT, $FIELD_NAME, $DATA_TYPE, {DATA...}) Adds a new CARRAY metafield called C<$FIELD_NAME> under the parent field C<$PARENT>. The storage type of the CARRAY is given by C<$DATA_TYPE>, which should be one of the symbols listed above under L. The value of the CARRAY is then set to the data given in the C<{DATA...}> argument list, which also determines its length. See the L section above for details on the allowed forms of C<{DATA...}>. See gd_madd_carray(3). =item $dirfile->madd_const ($PARENT, $FIELD_NAME, $DATA_TYPE, [$VALUE]) Adds a new CONST metafield called C<$FIELD_NAME> under the field C<$PARENT>. The C<$DATA_TYPE> argument indicates the storage type, which should be one of the symbols listed above under L. If given, the value of the field is set to C<$VALUE>, otherwise the field will be initialised to zero. See gd_madd_const(3). =item $dirfile->mcarrays ($PARENT, $RETURN_TYPE) Behaves analogously to L() (I), but returns CARRAYs which are metafields under the parent specified by C<$PARENT>. =item $dirfile->mconstants ($PARENT, $RETURN_TYPE) Behaves analogously to L() (I), but returns CONSTs which are metafields under the parent specified by C<$PARENT>. =item $dirfile->mfield_list ($PARENT) Equivalent to C<$dirfile-Eentry_list($PARENT, undef, undef)>. =item $dirfile->mfield_list_by_type ($PARENT, $TYPE) Equivalent to C<$dirfile-Eentry_list($PARENT, $TYPE, undef)>. =item $dirfile->mstrings ($PARENT) Behaves analogously to L() (I), but returns STRINGs which are metafields under the parent specified by C<$PARENT>. =item $dirfile->mvector_list ($PARENT) Equivalent to: $dirfile-Eentry_list($PARENT, $GetData::VECTOR_ENTRIES, undef). =item $dirfile->parser_callback ($SEHANDLER, $EXTRA=undef) Sets the registered parser callback function for the dirfile to C<$SEHANDLER>, or to nothing if undef, and updates the C<$EXTRA> parameter. See gd_parser_callback(3). =item $dirfile->put_carray ($FIELD_CODE, {DATA...}) Sets the value of the CARRAY named C<$FIELD_CODE> to the values contained in the C<{DATA...}> argument list. See the L section above for details on the allowed forms of C<{DATA...}>. See gd_put_carray(3). =item $dirfile->put_carray_slice ($FIELD_CODE, $START, {DATA...}) Sets a value of the portion of the CARRAY named C<$FIELD_CODE> beginning with element numbered C<$START> to the values contained in the C<{DATA...}> argument list. See the L section above for details on the allowed forms of C<{DATA...}>. See gd_put_carray_slice(3). =item $dirfile->put_constant ($FIELD_CODE, $DATUM) Sets the value of the CONST field C<$FIELD_CODE> to the value C<$DATUM>. See gd_put_constant(3). =item $dirfile->putdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMPLE, {DATA...}) Sets a portion of the vector given by C<$FIELD_CODE> to the values contained in the C<{DATA...}> argument list. The first sample written is C<$FIRST_SAMPLE> samples after the start of C<$FIRST_FRAME>. See the L section above for details on the allowed forms of C<{DATA...}>. See gd_putdata(3). =item $dirfile->strings () In scalar context, returns the number of STRING fields. In list context, returns an array of strings containing the values of all the STRING fields. See gd_strings(3). =item $dirfile->strtok ($STRING) Tokenises C<$STRING>, returning an array of tokens. See gd_strtok(3). =item $dirfile->vector_list () Equivalent to: $dirfile-Eentry_list(undef, $GetData::VECTOR_ENTRIES, undef). =back =head2 Other Methods For the most part, following methods behave identically to their C API counterpart. See the corresponding C API manual page for details. Different behaviour, if any, is indicated. =over =item $dirfile->add ($ENTRY) C<$ENTRY> should be a reference to an entry hash; see L above. =item $dirfile->add_alias ($FIELD_CODE, $TARGET, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_bit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_divide ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_lincom ($FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M, $B, [$FRAGMENT_INDEX]) C<$IN_FIELDS>, C<$M>, and C<$B> should be references to arrays of the appropriate length. The elements of C<$M> and C<$B> may be of any numerical type, including C. C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_linterp ($FIELD_CODE, $IN_FIELD, $TABLE, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_mplex ($FIELD_CODE, $IN_FIELD, $COUNT_FIELD, $COUNT_VAL, $COUNT_MAX, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_multiply ($FIELD_CODE, $IN_FIELD1, $IN_FIELD2, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_phase ($FIELD_CODE, $IN_FIELD, $SHIFT, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_polynom ($FIELD_CODE, $POLY_ORD, $IN_FIELD, $A, [$FRAGMENT_INDEX]) C<$A> should be a reference to an array of numbers (of any numerical type, including C) of the appropriate length. C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_raw ($FIELD_CODE, $DATA_TYPE, $SPF, [$FRAGMENT_INDEX]) C<$DATA_TYPE> should be one of the symbols listed under L above. C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_recip ($FIELD_CODE, $IN_FIELD, $DIVIDEND, [$FRAGMENT_INDEX]) C<$DIVIDEND> may be of any numerical type, including C. C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_sbit ($FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_spec ($LINE, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_string ($FIELD_CODE, $VALUE, [$FRAGMENT_INDEX]) C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->add_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP, $THRESHOLD, [$FRAGMENT_INDEX]) C<$WINDOP> should be one of the symbols listed under L above. C<$FRAGMENT_INDEX> = 0 is assumed if not specified. =item $dirfile->alias_target ($FIELD_CODE) Z<> =item $dirfile->alter_affixes ($FRAGMENT_INDEX, $PREFIX, [$SUFFIX]) If C<$PREFIX> or C<$SUFFIX> are undef, or if C<$SUFFIX> is omitted, that affix is not changed. =item $dirfile->alter_bit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS]) Arguments not given or set to undef are not changed. Additionally, if C<$BITNUM == -1>, or C<$NUMBITS == 0>, that parameter is not changed. =item $dirfile->alter_carray ($FIELD_CODE, $CONST_TYPE, $ARRAY_LEN) C<$CONST_TYPE> should be one of the symbols listed under L above. =item $dirfile->alter_const ($FIELD_CODE, [$CONST_TYPE]) If C<$CONST_TYPE> is omitted, or equal to C<$GetData::NULL>, it is not changed; otherwise, it should be one of the symbols listed under L above. =item $dirfile->alter_divide ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2]) Arguments not given or set to undef are not changed. =item $dirfile->alter_encoding ($ENCODING, [$FRAGMENT_INDEX, $RECODE]) Both C<$FRAGMENT_INDEX> and C<$RECODE> default to 0 if not given. =item $dirfile->alter_endianness ($BYTE_SEX, [$FRAGMENT_INDEX, $RECODE]) Both C<$FRAGMENT_INDEX> and C<$RECODE> default to 0 if not given. =item $dirfile->alter_entry ($FIELD_CODE, $ENTRY, [$RECODE]) C<$ENTRY> should be a reference to an entry hash; see L above. If not given, C<$RECODE> defaults to 0. =item $dirfile->alter_frameoffset ($OFFSET, [$FRAGMENT_INDEX, $RECODE]) Both C<$FRAGMENT_INDEX> and C<$RECODE> default to 0 if not given. =item $dirfile->alter_lincom ($FIELD_CODE, [$N_FIELDS, $IN_FIELDS, $M, $B]) Arguments not given or set to undef are not changed. If given, C<$IN_FIELDS>, C<$M>, and C<$B> should be references to arrays of the appropriate length. =item $dirfile->alter_linterp ($FIELD_CODE, [$IN_FIELD, $TABLE, $RENAME_TABLE]) Arguments not given or set to undef are not changed. If not given, C<$RENAME_TABLE> defaults to 0. =item $dirfile->alter_mplex ($FIELD_CODE, [$IN_FIELD, $COUNT_FIELD, $COUNT_VAL, $COUNT_MAX]) Arguments not given or set to undef are not changed. Additionally, if C<$COUNT_VAL> or C<$COUNT_MAX> are -1, that parameter is not chaged. =item $dirfile->alter_multiply ($FIELD_CODE, [$IN_FIELD1, $IN_FIELD2]) Arguments not given or set to undef are not changed. =item $dirfile->alter_phase ($FIELD_CODE, $IN_FIELD, $SHIFT) If C<$IN_FIELD == undef>, it is not changed. =item $dirfile->alter_polynom ($FIELD_CODE, [$POLY_ORD, $IN_FIELD, $A]) Arguments not given or set to undef are not changed. Additionally, if C<$POLY_ORD == 0>, it is not changed. =item $dirfile->alter_protection ($PROTECTION_LEVEL, $FRAGMENT_INDEX) Z<> =item $dirfile->alter_raw ($FIELD_CODE, [$DATA_TYPE, $SPF, $RECODE]) Arguments not given or set to undef are not changed. Additionally, if C<$DATA_TYPE == $GetData::NULL> or C<$SPF == 0>, that parameter is not changed. If not given, C<$RECODE> defaults to 0. =item $dirfile->alter_recip ($FIELD_CODE, [$IN_FIELD, $DIVIDEND]) Arguments not given or set to undef are not changed. Additionally, if C<$DIVIDEND == 0>, it is not changed. C<$DIVIDEND> may be of any numerical type, including C. =item $dirfile->alter_sbit ($FIELD_CODE, [$IN_FIELD, $BITNUM, $NUMBITS]) Arguments not given or set to undef are not changed. Additionally, if C<$BITNUM == -1>, or C<$NUMBITS == 0>, that parameter is not changed. =item $dirfile->alter_spec ($LINE, [$RECODE]) If not given, C<$RECODE> defaults to 0. =item $dirfile->alter_window ($FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP, $THRESHOLD) If C<$IN_FIELD> or C<$CHECK_FIELD> are undef, or if C<$WINDOP == $GetData::WINDOP_UNK>, that paremeter is not changed. Otherwise, C<$WINDOP> should be one of the symbols listed under L above. =item $dirfile->array_len ($FIELD_CODE) Z<> =item $dirfile->bof ($FIELD_CODE) Z<> =item $dirfile->delete ($FIELD_CODE, [$FLAGS]) If not given, C<$FLAGS> defaults to 0. Otherwise, it should be a bitwise or'd collection of zero or more of the following flags: =over $GetData::DEL_DATA, $GetData::DEL_DEREF, $GetData::DEL_FORCE, $GetData::DEL_META. =back =item $dirfile->desync ([$FLAGS]) If omitted, C<$FLAGS> defaults to zero. Otherwise, it should be zero or more of the following flags bitwise or'd together: =over $GetData::DESYNC_PATHCHECK, $GetData::DESYNC_REOPEN. =back =item $dirfile->dirfilename () Z<> =item $dirfile->dirfile_standards ([$VERSION]) In addition to a simple integer verison number, C<$VERSION> may be one of the symbols =over $GetData::VERSION_CURRENT, $GetData::VERSION_EARLIEST, $GetData::VERSION_LATEST. =back If not given, C<$GetData::VERSION_CURRENT> is assumed. =item $dirfile->encoding ($FRAGMENT_INDEX) Z<> =item $dirfile->endianness ($FRAGMENT_INDEX) Z<> =item $dirfile->eof ($FIELD_CODE) Z<> =item $dirfile->error_count () Z<> =item $dirfile->flags ([$SET, $RESET]) If omitted, C<$SET> and C<$RESET> default to 0. Otherwise, they should be zero or more of the following flags, bitwise or'd together: =over $GetData::PRETTY_PRINT, $GetData::VERBOSE. =back =item $dirfile->flush ($FIELD_CODE) Z<> =item $dirfile->fragment_index ($FIELD_CODE) Z<> =item $dirfile->fragmentname ($FRAGMENT_INDEX) Z<> =item $dirfile->frameoffset ($FRAGMENT_INDEX) Z<> =item $dirfile->framenum ($FIELD_CODE, $VALUE, [$START, $END]) C<$START> and C<$END> default to 0 if not given. =item $dirfile->hidden ($FIELD_CODE) Z<> =item $dirfile->hide ($FIELD_CODE) Z<> =item $dirfile->madd ($ENTRY, $PARENT) C<$ENTRY> should be a reference to an entry hash; see L above. =item $dirfile->madd_alias ($PARENT, $FIELD_CODE, $TARGET) Z<> =item $dirfile->madd_bit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS) Z<> =item $dirfile->madd_divide ($PARENT, $FIELD_CODE, $IN_FIELD1, $IN_FIELD2) Z<> =item $dirfile->madd_lincom ($PARENT, $FIELD_CODE, $N_FIELDS, $IN_FIELDS, $M, $B) C<$IN_FIELDS>, C<$M>, and C<$B> should be references to arrays of the appropriate length. The elements of C<$M> and C<$B> may be of any numerical type, including C. =item $dirfile->madd_linterp ($PARENT, $FIELD_CODE, $IN_FIELD, $TABLE) Z<> =item $dirfile->madd_mplex ($PARENT, $FIELD_CODE, $IN_FIELD, $COUNT_FIELD, $COUNT_VAL, $COUNT_MAX) Z<> =item $dirfile->madd_multiply ($PARENT, $FIELD_CODE, $IN_FIELD1, $IN_FIELD2) Z<> =item $dirfile->madd_phase ($PARENT, $FIELD_CODE, $IN_FIELD, $SHIFT) Z<> =item $dirfile->madd_polynom ($PARENT, $FIELD_CODE, $POLY_ORD, $IN_FIELD, $A) C<$A> should be a reference to an array of numbers (of any numerical type, including C) of the appropriate length. =item $dirfile->madd_recip ($PARENT, $FIELD_CODE, $IN_FIELD, $DIVIDEND) C<$DIVIDEND> may be of any numerical type, including C. =item $dirfile->madd_sbit ($PARENT, $FIELD_CODE, $IN_FIELD, $BITNUM, $NUMBITS) Z<> =item $dirfile->madd_spec ($LINE, $PARENT) Z<> =item $dirfile->madd_string ($PARENT, $FIELD_CODE, $VALUE) Z<> =item $dirfile->madd_window ($PARENT, $FIELD_CODE, $IN_FIELD, $CHECK_FIELD, $WINDOP, $THRESHOLD) C<$WINDOP> should be one of the symbols listed under L above. =item $dirfile->malter_spec ($LINE, $PARENT, [$RECODE]) If not given, C<$RECODE> defaults to 0. =item $dirfile->metaflush () Z<> =item $dirfile->move ($FIELD_CODE, $NEW_FRAGMENT, [$MOVE_DATA]) If not given, C<$FLAGS> defaults to 0. Otherwise, it should be a bitwise or'd collection of zero or more of the following flags: =over $GetData::REN_DANGLE, $GetData::REN_DATA, $GetData::REN_FORCE, $GetData::REN_UPDB. =back =item $dirfile->mplex_lookback ($LOOKBACK) Z<> =item $dirfile->native_type ($FIELD_CODE) The returned value will be one of the symbols listed above under L. =item $dirfile->nframes () Z<> =item $dirfile->parent_fragment ($FRAGMENT_INDEX) Z<> =item $dirfile->protection ($FRAGMENT_INDEX) Z<> =item $dirfile->put_string ($FIELD_CODE, $STRING) Z<> =item $dirfile->raw_close ($FIELD_CODE) Z<> =item $dirfile->raw_filename ($FIELD_CODE) Z<> =item $dirfile->reference ([$FIELD_CODE]) If C<$FIELD_CODE> is not given or undef, this function simply reports the current reference field. =item $dirfile->rename ($OLD_CODE, $NEW_NAME, [$FLAGS]) If not given, C<$FLAGS> defaults to 0. Otherwise, it should be a bitwise or'd collection of zero or more of the following flags: =over $GetData::REN_DANGLE, $GetData::REN_DATA, $GetData::REN_FORCE, $GetData::REN_UPDB. =back =item $dirfile->rewrite_fragment ($FRAGMENT_INDEX) Z<> =item $dirfile->seek ($FIELD_CODE, $FRAME_NUM, $SAMPLE_NUM, [$FLAGS]) If not given, C<$FLAGS> defaults to C<$GetData::SEEK_SET>. Otherwise, it should be one of: =over $GetData::SEEK_CUR, $GetData::SEEK_END, $GetData::SEEK_SET. =back Furthermore, this value should be bitwise or'd with C<$GetData::SEEK_WRITE> if the next operation on the field is a write (via L). =item $dirfile->spf ($FIELD_CODE) Z<> =item $dirfile->sync ($FIELD_CODE) Z<> =item $dirfile->tell ($FIELD_CODE) Z<> =item $dirfile->unhide ($FIELD_CODE) Z<> =item $dirfile->uninclude ($FRAGMENT_INDEX, [$DEL]) If not given, C<$DEL> defaults to 0. =item $dirfile->validate ($FIELD_CODE) Z<> =item $dirfile->verbose_prefix ([$PREFIX]) If C<$PREFIX> is omitted or undef, the prefix is removed. =back =head1 COPYRIGHT Copyright (C) 2012-2015 D. V. Wiebe GetData 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. GetData is distributed in the hope that 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. =head1 SEE ALSO Math::Complex(3), dirfile(5) =cut libgetdata-0.9.0/bindings/perl/t/0000740000175000017500000000000012614323564017004 5ustar alastairalastairlibgetdata-0.9.0/bindings/perl/t/big_test.t0000640000175000017500000016071512614323564021005 0ustar alastairalastair#!/usr/bin/perl -w # Copyright (C) 2011-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA use GetData; use Math::Complex; use strict; use Test::More tests => 1519; my $ne = 0; my ($s, @a, %h); select STDERR; $| = 1; select STDOUT; $| = 1; sub isn { cmp_ok ( (defined $_[0]) ? $_[0] : "undef", (defined $_[0] and defined $_[1]) ? '==' : 'eq', (defined $_[1]) ? $_[1] : "undef", $_[2] . " = " . ((defined $_[0]) ? $_[0] : "undef") . ", expected " . ((defined $_[1]) ? $_[1] : "undef")); } sub CheckError { my $e = $_->error; print "\n"; is ($e, $_[1], "e[$_[0]] = $e, expected $_[1]"); print "#"; } sub CheckError2 { my $e = $_->error; print "\n"; is ($e, $_[2], "e[$_[0],$_[1]] = $e, expected $_[2]"); print "#"; } sub CheckArray { my $i; print "\n"; is ($#{$_[1]}, $#_ - 2, "a[$_[0]]: " . (1 + $#{$_[1]}) . " elements, expected " . ($#_ - 1)); for $i (0 .. $#_ - 2) { isn (${$_[1]}[$i], $_[$i + 2], "a($i)[$_[0]]"); } print "#"; } sub CheckArray2 { my $i; print "\n"; is ($#{$_[2]}, $#_ - 3, "a[$_[0],$_[1]]: " . (1 + $#{$_[2]}) . " elements, expected " . ($#_ - 2)); for $i (0 .. $#_ - 3) { isn (${$_[2]}[$i], $_[$i + 3], "a($i)[$_[0],$_[1]]" ); } print "#"; } sub CheckSArray { my $i; print "\n"; is ($#{$_[1]}, $#_ - 2, "a[$_[0]]: " . (1 + $#{$_[1]}) . " elements, expected " . ($#_ - 1)); for $i (0 .. $#_ - 2) { is (${$_[1]}[$i], $_[$i + 2], "s($i)[$_[0]] = \"${$_[1]}[$i]\", expected \"" . $_[$i + 2] . "\""); } print "#"; } sub CheckSArray2 { my $i; print "\n"; is ($#{$_[2]}, $#_ - 3, "a[$_[0],$_[1]]: " . (1 + $#{$_[2]}) . " elements, expected " . ($#_ - 2)); for $i (0 .. $#_ - 3) { is (${$_[2]}[$i], $_[$i + 3], "s($i)[$_[0],$_[1]] = " . ((defined ${$_[2]}[$i]) ? "\"" . ${$_[2]}[$i] . "\"" : "undef") . ", expected " . ((defined $_[$i + 3]) ? "\"" . $_[$i + 3] . "\"" : "undef")); } print "#"; } sub CheckNum { print "\n"; isn ($_[1], $_[2], "n[$_[0]]"); print "#"; } sub CheckNum2 { print "\n"; isn ($_[2], $_[3], "n[$_[0],$_[1]]"); print "#"; } sub CheckString { print "\n"; is ($_[1], $_[2], "s[$_[0]] = \"" . ((defined $_[1]) ? "\"" . $_[1] . "\"" : "undef") . ", expected " . ((defined $_[2]) ? "\"" . $_[2] . "\"" : "undef")); print "#"; } sub CheckString2 { print "\n"; is ($_[2], $_[3], "s[$_[0],$_[1]] = \"$_[2]\", expected \"$_[3]\""); print "#"; } sub CheckEOString { print "\n"; ok ($_[1] =~ m#$_[2]$#, "s[$_[0]] = \"$_[1]\", expected \"$_[2]\""); print "#"; } sub CheckEOSArray { my $i; print "\n"; is ($#{$_[1]}, $#_ - 2, "a[$_[0]]: " . (1 + $#{$_[1]}) . " elements, expected " . ($#_ - 1)); for $i (0 .. $#_ - 2) { ok (${$_[1]}[$i] =~ m#$_[$i + 2]$#, "s($i)[$_[0]] = \"${$_[1]}[$i]\", expected \"$_[$i + 2]\""); } print "#"; } sub CheckOK { &CheckError($_[0], 0) } sub CheckOK2 { &CheckError2(@_, 0) } my $nfields = 17; my @fields = (qw(INDEX alias bit carray const data div lincom linterp mplex mult phase polynom recip sbit string window)); #create the dirfile system "rm -rf dirfile" if (-e "dirfile"); (mkdir "dirfile" or die) unless -e "dirfile"; open GLOB, ">dirfile/data" or die; print GLOB map chr, 1 .. 81; open GLOB, ">dirfile/format" or die; print GLOB <dirfile/form2" or die; print GLOB "const2 CONST INT8 -19\n" or die; close GLOB; # 1: error check $_ = &GetData::open("x", $GetData::RDONLY); CheckError(1, $GetData::E_IO); # 2: open check $_ = &GetData::open("dirfile", $GetData::RDWR); CheckOK(2); # 3: getdata (INT8) check $s = $_->getdata("data", 5, 0, 1, 0, $GetData::INT8); CheckOK(3); CheckString(3, $s, join "", map chr, 41 .. 48); # 4: getdata (unpacked) check @a = $_->getdata("data", 5, 0, 1, 0, $GetData::INT16); CheckOK(4); CheckArray(4, \@a, 41 .. 48); # 10: getdata (complex unpacked) check @a = $_->getdata("data", 5, 0, 1, 0, $GetData::COMPLEX128); CheckOK(10); CheckArray(10, \@a, 41 .. 48); # 12: constant (INT8) check $s = $_->get_constant("const", $GetData::INT8); CheckOK(12); CheckNum(12, $s, 5); # 19: constant (COMPLEX128) check $s = $_->get_constant("const", $GetData::COMPLEX128); CheckOK(19); CheckNum(19, $s, 5.5); # 23: nfields check $s = $_->field_list; CheckOK(23); CheckNum(23, $s, $nfields); # 25: field_list check @a = $_->field_list; CheckOK(25); CheckSArray(25, \@a, @fields); # 26: nmfields check $s = $_->mfield_list("data"); CheckOK(26); CheckNum(26, $s, 4); # 27: mfield_list check @a = $_->mfield_list("data"); CheckOK(27); CheckSArray(27, \@a, qw(mstr mconst mcarray mlut)); # 28: nframes check $s = $_->nframes; CheckOK(28); CheckNum(28, $s, 10); # 29: spf check $s = $_->spf("data"); CheckOK(29); CheckNum(29, $s, 8); # 30: putdata (packed) check $s = $_->putdata("data", 5, 1, $GetData::UINT8, "\15\16\17\20"); CheckOK2(30,1); CheckNum(30,$s,4); @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8); CheckOK2(30,2); CheckArray(30, \@a, 41, 015, 016, 017, 020, 46, 47, 48); # 31: putdata (typed ref) check $s = $_->putdata("data", 5, 1, $GetData::UINT16, [ 23, 24, 25, 26 ]); CheckOK2(31,1); CheckNum(31,$s,4); @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8); CheckOK2(31,2); CheckArray(31, \@a, 41, 23, 24, 25, 26, 46, 47, 48); # 33: putdata (untyped ref) check $s = $_->putdata("data", 5, 1, [ 33, 34, 35, 36 ]); CheckOK2(33,1); CheckNum(33,$s,4); @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8); CheckOK2(33,2); CheckArray(33, \@a, 41, 33, 34, 35, 36, 46, 47, 48); # 35: putdata (simple list) check $s = $_->putdata("data", 5, 1, 23., 24., 25., 26.); CheckOK2(35,1); CheckNum(35,$s,4); @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8); CheckOK2(35,2); CheckArray(35, \@a, 41, 23, 24, 25, 26, 46, 47, 48); # 37: putdata (undef list) check $s = $_->putdata("data", 5, 1, undef, 13.+0*i, 14.+0*i, 15.+0*i, 16.+0*i); CheckOK2(37,1); CheckNum(37,$s,4); @a = $_->getdata("data", 5, 0, 1, 0, $GetData::UINT8); CheckOK2(37,2); CheckArray(37, \@a, 41, 13, 14, 15, 16, 46, 47, 48); # 38: error_string check $s = $_->getdata("x", 5, 0, 1, 0, $GetData::UINT8); CheckError(38,$GetData::E_BAD_CODE); CheckString(38, $_->error_string, "Field not found: x"); # 39: get_entry check $s = $_->entry("data"); CheckOK(39); CheckNum(39,$s,$GetData::RAW_ENTRY); # 40: get_entry check %h = $_->entry("data"); CheckOK(40); CheckSArray2(40, 0, [ sort keys %h ], qw(data_type field field_type fragment_index scalar scalar_ind spf)); CheckNum2(40, 1, $h{'data_type'}, $GetData::INT8); CheckString2(40, 2, $h{'field'}, "data"); CheckNum2(40, 3, $h{'field_type'}, $GetData::RAW_ENTRY); CheckNum2(40, 4, $h{'fragment_index'}, 0); CheckSArray2(40, 6, $h{'scalar'}, undef); CheckArray2(40, 7, $h{'scalar_ind'}, undef); CheckNum2(40, 8, $h{'spf'}, 8); # 42: get_entry check %h = $_->entry("lincom"); CheckOK(42); CheckSArray2(42, 1, [ sort keys %h ], qw(b field field_type), qw(fragment_index in_fields m n_fields scalar scalar_ind)); CheckArray2(42, 2, $h{'b'}, 2.2, 3.3+4.4*i, 5.5); CheckString2(42, 5, $h{'field'}, "lincom"); CheckNum2(42, 6, $h{'field_type'}, $GetData::LINCOM_ENTRY); CheckNum2(42, 7, $h{'fragment_index'}, 0); CheckSArray2(42, 8, $h{'in_fields'}, qw(data INDEX linterp)); CheckArray2(42, 3, $h{'m'}, 1.1, 2.2, 5.5); CheckNum2(42, 10, $h{'n_fields'}, 3); CheckSArray2(42, 11, $h{'scalar'}, undef, undef, "const", undef, undef, "const"); CheckArray2(42, 12, $h{'scalar_ind'}, undef, undef, -1, undef, undef, -1); # 44: get_entry check %h = $_->entry("polynom"); CheckOK(44); CheckSArray2(44, 1, [ sort keys %h ], qw(a field field_type), qw(fragment_index in_fields poly_ord scalar scalar_ind)); CheckArray2(44, 2, $h{'a'}, 1.1, 2.2, 2.2, 3.3+4.4*i, 5.5, 5.5); CheckString2(44, 4, $h{'field'}, "polynom"); CheckNum2(44, 5, $h{'field_type'}, $GetData::POLYNOM_ENTRY); CheckNum2(44, 6, $h{'fragment_index'}, 0); CheckString2(44, 7, $h{'in_fields'}, "data"); CheckNum2(44, 8, $h{'poly_ord'}, 5); CheckSArray2(44, 9, $h{'scalar'}, undef, undef, undef, undef, "const", "const"); CheckArray2(44, 10, $h{'scalar_ind'}, undef, undef, undef, undef, -1, -1); # 45: get_entry check %h = $_->entry("linterp"); CheckOK(45); CheckSArray2(45, 0, [ sort keys %h ], qw(field field_type fragment_index), qw(in_fields table)); CheckString2(45, 1, $h{'field'}, "linterp"); CheckNum2(45, 2, $h{'field_type'}, $GetData::LINTERP_ENTRY); CheckNum2(45, 3, $h{'fragment_index'}, 0); CheckString2(45, 4, $h{'in_fields'}, "data"); CheckString2(45, 5, $h{'table'}, "./lut"); # 46: get_entry check %h = $_->entry("bit"); CheckOK(46); CheckSArray2(46, 0, [ sort keys %h ], qw(bitnum field field_type), qw(fragment_index in_fields numbits scalar scalar_ind)); CheckNum2(46, 1, $h{'bitnum'}, 3); CheckString2(46, 2, $h{'field'}, "bit"); CheckNum2(46, 3, $h{'field_type'}, $GetData::BIT_ENTRY); CheckNum2(46, 4, $h{'fragment_index'}, 0); CheckString2(46, 5, $h{'in_fields'}, "data"); CheckNum2(46, 6, $h{'numbits'}, 4); CheckSArray2(46, 7, $h{'scalar'}, undef, undef); CheckArray2(46, 8, $h{'scalar_ind'}, undef, undef); # 47: get_entry check %h = $_->entry("sbit"); CheckOK(47); CheckSArray2(47, 0, [ sort keys %h ], qw(bitnum field field_type), qw(fragment_index in_fields numbits scalar scalar_ind)); CheckNum2(47, 1, $h{'bitnum'}, 5); CheckString2(47, 2, $h{'field'}, "sbit"); CheckNum2(47, 3, $h{'field_type'}, $GetData::SBIT_ENTRY); CheckNum2(47, 4, $h{'fragment_index'}, 0); CheckString2(47, 5, $h{'in_fields'}, "data"); CheckNum2(47, 6, $h{'numbits'}, 6); CheckSArray2(47, 7, $h{'scalar'}, undef, undef); CheckArray2(47, 8, $h{'scalar_ind'}, undef, undef); # 48: get_entry check %h = $_->entry("mult"); CheckOK(48); CheckSArray2(48, 0, [ sort keys %h ], qw(field field_type fragment_index), "in_fields"); CheckString2(48, 1, $h{'field'}, "mult"); CheckNum2(48, 2, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(48, 3, $h{'fragment_index'}, 0); CheckSArray2(48, 4, $h{'in_fields'}, qw(data sbit)); # 49: get_entry check %h = $_->entry("phase"); CheckOK(49); CheckSArray2(49, 0, [ sort keys %h ], qw(field field_type fragment_index), qw(in_fields scalar scalar_ind shift)); CheckString2(49, 1, $h{'field'}, "phase"); CheckNum2(49, 2, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(49, 3, $h{'fragment_index'}, 0); CheckString2(49, 4, $h{'in_fields'}, "data"); CheckSArray2(49, 5, $h{'scalar'}, undef); CheckArray2(49, 6, $h{'scalar_ind'}, undef); CheckNum2(49, 7, $h{'shift'}, 11); # 50: get_entry check %h = $_->entry("const"); CheckOK(50); CheckSArray2(50, 0, [ sort keys %h ], qw(const_type field field_type), "fragment_index"); CheckNum2(50, 1, $h{'const_type'}, $GetData::FLOAT64); CheckString2(50, 2, $h{'field'}, "const"); CheckNum2(50, 3, $h{'field_type'}, $GetData::CONST_ENTRY); CheckNum2(50, 4, $h{'fragment_index'}, 0); # 51: get_entry check %h = $_->entry("string"); CheckOK(51); CheckSArray2(51, 0, [ sort keys %h ], qw(field field_type fragment_index)); CheckString2(51, 1, $h{'field'}, "string"); CheckNum2(51, 2, $h{'field_type'}, $GetData::STRING_ENTRY); CheckNum2(51, 3, $h{'fragment_index'}, 0); # 52: fragment_index check $s = $_->fragment_index("data"); CheckOK(52); CheckNum(52, $s, 0); # 53: add_raw check $s = $_->add_raw("new1", $GetData::FLOAT64, 3); CheckOK2(53, 1); CheckNum2(53, 2, $s, 0); %h = $_->entry("new1"); CheckOK2(53, 3); CheckNum2(53, 4, $h{'data_type'}, $GetData::FLOAT64); CheckString2(53, 5, $h{'field'}, "new1"); CheckNum2(53, 6, $h{'field_type'}, $GetData::RAW_ENTRY); CheckNum2(53, 7, $h{'fragment_index'}, 0); CheckSArray2(53, 8, $h{'scalar'}, undef); CheckArray2(53, 9, $h{'scalar_ind'}, undef); CheckNum2(53, 10, $h{'spf'}, 3); #55: add_lincom check $s = $_->add_lincom("new3", 2, [ qw(in1 in2) ], [ 1.1+1.2*i, 1.4+1.5*i ], [ 1.3+1.4*i, 1.6+1.7*i ], 0); CheckOK2(55, 1); CheckNum2(55, 2, $s, 0); %h = $_->entry("new3"); CheckOK2(55, 3); CheckArray2(55, 4, $h{'b'}, 1.3+1.4*i, 1.6+1.7*i); CheckString2(55, 6, $h{'field'}, "new3"); CheckNum2(55, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY); CheckNum2(55, 8, $h{'fragment_index'}, 0); CheckSArray2(55, 9, $h{'in_fields'}, qw(in1 in2)); CheckArray2(55, 10, $h{'m'}, 1.1+1.2*i, 1.4+1.5*i); CheckNum2(55, 11, $h{'n_fields'}, 2); CheckSArray2(55, 12, $h{'scalar'}, undef, undef, undef, undef, undef); CheckArray2(55, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef); # 56: add_polynom $s = $_->add_polynom("new4", 3, "in1", [ 3.9, 4.8, 5.7, 6.6 ], 0); CheckOK2(56, 1); CheckNum2(56, 2, $s, 0); %h = $_->entry("new4"); CheckOK2(56, 3); CheckArray2(56, 4, $h{'a'}, 3.9, 4.8, 5.7, 6.6); CheckString2(56, 7, $h{'field'}, "new4"); CheckNum2(56, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY); CheckNum2(56, 9, $h{'fragment_index'}, 0); CheckString2(56, 10, $h{'in_fields'}, "in1"); CheckNum2(56, 11, $h{'poly_ord'}, 3); CheckSArray2(56, 12, $h{'scalar'}, undef, undef, undef, undef); CheckArray2(56, 13, $h{'scalar_ind'}, undef, undef, undef, undef); # 58: add_linterp $s = $_->add_linterp("new6", "in", "./some/table"); CheckOK2(58, 1); CheckNum2(58, 2, $s, 0); %h = $_->entry("new6"); CheckOK2(58, 2); CheckString2(58, 3, $h{'field'}, "new6"); CheckNum2(58, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY); CheckNum2(58, 5, $h{'fragment_index'}, 0); CheckString2(58, 6, $h{'in_fields'}, "in"); CheckString2(58, 7, $h{'table'}, "./some/table"); # 59: add_bit $s = $_->add_bit("new7", "in1", 11, 22); CheckOK2(59, 1); CheckNum2(59, 2, $s, 0); %h = $_->entry("new7"); CheckOK(59, 2); CheckNum2(59, 3, $h{'bitnum'}, 11); CheckString2(59, 4, $h{'field'}, "new7"); CheckNum2(59, 5, $h{'field_type'}, $GetData::BIT_ENTRY); CheckNum2(59, 6, $h{'fragment_index'}, 0); CheckString2(59, 7, $h{'in_fields'}, "in1"); CheckNum2(59, 8, $h{'numbits'}, 22); CheckSArray2(59, 9, $h{'scalar'}, undef, undef); CheckArray2(59, 10, $h{'scalar_ind'}, undef, undef); # 60: add_sbit $s = $_->add_sbit("new8", "in2", 5, 10); CheckOK2(60, 1); CheckNum2(60, 2, $s, 0); %h = $_->entry("new8"); CheckOK(60, 2); CheckNum2(60, 3, $h{'bitnum'}, 5); CheckString2(60, 4, $h{'field'}, "new8"); CheckNum2(60, 5, $h{'field_type'}, $GetData::SBIT_ENTRY); CheckNum2(60, 6, $h{'fragment_index'}, 0); CheckString2(60, 7, $h{'in_fields'}, "in2"); CheckNum2(60, 8, $h{'numbits'}, 10); CheckSArray2(60, 9, $h{'scalar'}, undef, undef); CheckArray2(60, 10, $h{'scalar_ind'}, undef, undef); # 61: add_mutiply $s = $_->add_multiply("new9", "in2", "in3"); CheckOK2(61, 1); CheckNum2(61, 2, $s, 0); %h = $_->entry("new9"); CheckOK2(61, 3); CheckString2(61, 4, $h{'field'}, "new9"); CheckNum2(61, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(61, 6, $h{'fragment_index'}, 0); CheckSArray2(61, 7, $h{'in_fields'}, qw(in2 in3)); # 62: add_phase $s = $_->add_phase("new10", "in6", 42); CheckOK2(62, 1); CheckNum2(62, 2, $s, 0); %h = $_->entry("new10"); CheckOK2(62, 2); CheckString2(62, 3, $h{'field'}, "new10"); CheckNum2(62, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(62, 5, $h{'fragment_index'}, 0); CheckString2(62, 6, $h{'in_fields'}, "in6"); CheckSArray2(62, 7, $h{'scalar'}, undef); CheckArray2(62, 8, $h{'scalar_ind'}, undef); CheckNum2(62, 9, $h{'shift'}, 42); # 63: add_const $s = $_->add_const("new11", $GetData::FLOAT64, "33.3"); CheckOK2(63, 1); CheckNum2(63, 2, $s, 0); %h = $_->entry("new11"); CheckOK2(63, 3); CheckNum2(63, 4, $h{'const_type'}, $GetData::FLOAT64); CheckString2(63, 5, $h{'field'}, "new11"); CheckNum2(63, 6, $h{'field_type'}, $GetData::CONST_ENTRY); CheckNum2(63, 7, $h{'fragment_index'}, 0); $s = $_->get_constant("new11", $GetData::FLOAT64); CheckOK2(63, 8); CheckNum2(63, 9, $s, 33.3); # 64: fragment_name $s = $_->fragmentname(0); CheckOK(64); CheckEOString(64, $s, "dirfile/format"); # 65: nfragments $s = $_->fragments; CheckOK(65); CheckNum(65, $s, 1); # 66: include $s = $_->include("form2", 0, 0); CheckOK2(66, 1); CheckNum2(66, 2, $s, 1); $s = $_->get_constant("const2", $GetData::INT32); CheckOK2(66, 3); CheckNum2(66, 4, $s, -19); # 67: nfields_by_type $s = $_->field_list_by_type($GetData::LINCOM_ENTRY); CheckOK(67); CheckNum(67, $s, 2); # 68: field_list_by_type @a = $_->field_list_by_type($GetData::LINCOM_ENTRY); CheckOK(68); CheckSArray(68, \@a, qw(lincom new3)); # 69: nvectors $s = $_->vector_list; CheckOK(69); CheckNum(69, $s, 22); # 70: vector_list @a = $_->vector_list; CheckOK(70); CheckSArray(70, \@a, qw(INDEX alias bit data div lincom linterp mplex mult new1 new10 new3 new4 new6 new7 new8 new9 phase polynom recip sbit window)); #72: madd_lincom check $s = $_->madd_lincom("data", "mnew2", 2, [ qw(in1 in2) ], [ 9.9+8.8*i, 7.7 ], [ 6.6, 5.5 ]); CheckOK2(72, 1); CheckNum2(72, 2, $s, 0); %h = $_->entry("data/mnew2"); CheckOK2(72, 3); CheckArray2(72, 4, $h{'b'}, 6.6, 5.5); CheckArray2(72, 5, $h{'m'}, 9.9+8.8*i, 7.7); CheckString2(72, 7, $h{'field'}, "data/mnew2"); CheckNum2(72, 8, $h{'field_type'}, $GetData::LINCOM_ENTRY); CheckNum2(72, 9, $h{'fragment_index'}, 0); CheckSArray2(72, 10, $h{'in_fields'}, qw(in1 in2)); CheckNum2(72, 11, $h{'n_fields'}, 2); CheckSArray2(72, 12, $h{'scalar'}, undef, undef, undef, undef, undef); CheckArray2(72, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef); # 73: madd_polynom $s = $_->madd_polynom("data", "mnew3", 3, "in1", [ 3.9, 4.8, 5.7, 6.6 ]); CheckOK2(73, 1); CheckNum2(73, 2, $s, 0); %h = $_->entry("data/mnew3"); CheckOK2(73, 3); CheckArray2(73, 4, $h{'a'}, 3.9, 4.8, 5.7, 6.6); CheckString2(73, 7, $h{'field'}, "data/mnew3"); CheckNum2(73, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY); CheckNum2(73, 9, $h{'fragment_index'}, 0); CheckString2(73, 10, $h{'in_fields'}, "in1"); CheckNum2(73, 11, $h{'poly_ord'}, 3); CheckSArray2(73, 12, $h{'scalar'}, undef, undef, undef, undef); CheckArray2(73, 13, $h{'scalar_ind'}, undef, undef, undef, undef); # 75: madd_linterp $s = $_->madd_linterp("data", "mnew6", "in", "./more/table"); CheckOK2(75, 1); CheckNum2(75, 2, $s, 0); %h = $_->entry("data/mnew6"); CheckOK2(75, 2); CheckString2(75, 3, $h{'field'}, "data/mnew6"); CheckNum2(75, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY); CheckNum2(75, 5, $h{'fragment_index'}, 0); CheckString2(75, 6, $h{'in_fields'}, "in"); CheckString2(75, 7, $h{'table'}, "./more/table"); # 76: madd_bit $s = $_->madd_bit("data", "mnew7", "in1", 3, 2); CheckOK2(76, 1); CheckNum2(76, 2, $s, 0); %h = $_->entry("data/mnew7"); CheckOK(76, 2); CheckNum2(76, 3, $h{'bitnum'}, 3); CheckString2(76, 4, $h{'field'}, "data/mnew7"); CheckNum2(76, 5, $h{'field_type'}, $GetData::BIT_ENTRY); CheckNum2(76, 6, $h{'fragment_index'}, 0); CheckString2(76, 7, $h{'in_fields'}, "in1"); CheckNum2(76, 8, $h{'numbits'}, 2); CheckSArray2(76, 9, $h{'scalar'}, undef, undef); CheckArray2(76, 10, $h{'scalar_ind'}, undef, undef); # 77: madd_sbit $s = $_->madd_sbit("data", "mnew8", "in2", 4, 5); CheckOK2(77, 1); CheckNum2(77, 2, $s, 0); %h = $_->entry("data/mnew8"); CheckOK(77, 2); CheckNum2(77, 3, $h{'bitnum'}, 4); CheckString2(77, 4, $h{'field'}, "data/mnew8"); CheckNum2(77, 5, $h{'field_type'}, $GetData::SBIT_ENTRY); CheckNum2(77, 6, $h{'fragment_index'}, 0); CheckString2(77, 7, $h{'in_fields'}, "in2"); CheckNum2(77, 8, $h{'numbits'}, 5); CheckSArray2(77, 9, $h{'scalar'}, undef, undef); CheckArray2(77, 10, $h{'scalar_ind'}, undef, undef); # 78: madd_mutiply $s = $_->madd_multiply("data", "mnew9", "in3", "in2"); CheckOK2(78, 1); CheckNum2(78, 2, $s, 0); %h = $_->entry("data/mnew9"); CheckOK2(78, 3); CheckString2(78, 4, $h{'field'}, "data/mnew9"); CheckNum2(78, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(78, 6, $h{'fragment_index'}, 0); CheckSArray2(78, 7, $h{'in_fields'}, qw(in3 in2)); # 79: madd_phase $s = $_->madd_phase("data", "mnew10", "in6", 44); CheckOK2(79, 1); CheckNum2(79, 2, $s, 0); %h = $_->entry("data/mnew10"); CheckOK2(79, 2); CheckString2(79, 3, $h{'field'}, "data/mnew10"); CheckNum2(79, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(79, 5, $h{'fragment_index'}, 0); CheckString2(79, 6, $h{'in_fields'}, "in6"); CheckSArray2(79, 7, $h{'scalar'}, undef); CheckArray2(79, 8, $h{'scalar_ind'}, undef); CheckNum2(79, 9, $h{'shift'}, 44); # 80: madd_const $s = $_->madd_const("data", "mnew11", $GetData::FLOAT64, 9.2); CheckOK2(80, 1); CheckNum2(80, 2, $s, 0); %h = $_->entry("data/mnew11"); CheckOK2(80, 3); CheckNum2(80, 4, $h{'const_type'}, $GetData::FLOAT64); CheckString2(80, 5, $h{'field'}, "data/mnew11"); CheckNum2(80, 6, $h{'field_type'}, $GetData::CONST_ENTRY); CheckNum2(80, 7, $h{'fragment_index'}, 0); $s = $_->get_constant("data/mnew11", $GetData::FLOAT64); CheckOK2(80, 8); CheckNum2(80, 9, $s, 9.2); # 81: get_string $s = $_->get_string("string"); CheckOK(81); CheckString(81, $s, "Zaphod Beeblebrox"); # 82: add_string $s = $_->add_string("new12", "a string"); CheckOK2(82, 1); CheckNum2(82, 2, $s, 0); %h = $_->entry("new12"); CheckOK2(82, 3); CheckString2(82, 4, $h{'field'}, "new12"); CheckNum2(82, 5, $h{'field_type'}, $GetData::STRING_ENTRY); CheckNum2(82, 6, $h{'fragment_index'}, 0); $s = $_->get_string("new12"); CheckOK2(82, 7); CheckString2(82, 8, $s, "a string"); # 83: madd_string $s = $_->madd_string("data", "mnew12", "another string"); CheckOK2(83, 1); CheckNum2(83, 2, $s, 0); %h = $_->entry("data/mnew12"); CheckOK2(83, 3); CheckString2(83, 4, $h{'field'}, "data/mnew12"); CheckNum2(83, 5, $h{'field_type'}, $GetData::STRING_ENTRY); CheckNum2(83, 6, $h{'fragment_index'}, 0); $s = $_->get_string("data/mnew12"); CheckOK2(83, 7); CheckString2(83, 8, $s, "another string"); # 84: add_spec $s = $_->add_spec("lorem STRING \"Lorem ipsum\"", 0); CheckOK2(84, 1); CheckNum2(84, 2, $s, 0); %h = $_->entry("lorem"); CheckOK2(84, 3); CheckString2(84, 4, $h{'field'}, "lorem"); CheckNum2(84, 5, $h{'field_type'}, $GetData::STRING_ENTRY); CheckNum2(84, 6, $h{'fragment_index'}, 0); $s = $_->get_string("lorem"); CheckOK2(84, 7); CheckString2(84, 8, $s, "Lorem ipsum"); # 85: add_spec $s = $_->madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem"); CheckOK2(85, 1); CheckNum2(85, 2, $s, 0); %h = $_->entry("lorem/ipsum"); CheckOK2(85, 3); CheckString2(85, 4, $h{'field'}, "lorem/ipsum"); CheckNum2(85, 5, $h{'field_type'}, $GetData::STRING_ENTRY); CheckNum2(85, 6, $h{'fragment_index'}, 0); $s = $_->get_string("lorem/ipsum"); CheckOK2(85, 7); CheckString2(85, 8, $s, "dolor sit amet."); # 86: put_constant $s = $_->put_constant("const", 86); CheckOK2(86, 1); CheckNum2(86, 2, $s, 0); $s = $_->get_constant("const", $GetData::FLOAT64); CheckOK2(86, 3); CheckNum2(86, 4, $s, 86.); # 94: put_string $s = $_->put_string("string", "Arthur Dent"); CheckOK2(94, 1); CheckNum2(94, 2, $s, 12); $s = $_->get_string("string"); CheckOK2(94, 3); CheckString2(94, 4, $s, "Arthur Dent"); # 95: nmfields_by_type $s = $_->mfield_list_by_type("data", $GetData::LINCOM_ENTRY); CheckOK(95); CheckNum(95, $s, 1); # 96: mfield_list_by_type @a = $_->mfield_list_by_type("data", $GetData::LINCOM_ENTRY); CheckOK(96); CheckSArray(96, \@a, qw(mnew2)); # 97: nmvectors $s = $_->mvector_list("data"); CheckOK(97); CheckNum(97, $s, 8); # 98: mvector_list @a = $_->mvector_list("data"); CheckOK(98); CheckSArray(98, \@a, qw(mlut mnew2 mnew3 mnew6 mnew7 mnew8 mnew9 mnew10)); # 99: alter raw $s = $_->alter_raw("new1", $GetData::INT32, undef); CheckOK2(99, 1); CheckNum2(99, 2, $s, 0); %h = $_->entry("new1"); CheckOK2(99, 3); CheckNum2(99, 4, $h{'data_type'}, $GetData::INT32); CheckString2(99, 5, $h{'field'}, "new1"); CheckNum2(99, 6, $h{'field_type'}, $GetData::RAW_ENTRY); CheckNum2(99, 7, $h{'fragment_index'}, 0); CheckSArray2(99, 8, $h{'scalar'}, undef); CheckArray2(99, 9, $h{'scalar_ind'}, undef); CheckNum2(99, 10, $h{'spf'}, 3); # 100: alter_lincom check $s = $_->alter_lincom("new3", undef, [ qw(in3 in4) ], [ 3., 4. ]); CheckOK2(100, 1); CheckNum2(100, 2, $s, 0); %h = $_->entry("new3"); CheckOK2(100, 3); CheckArray2(100, 4, $h{'b'}, 1.3+1.4*i, 1.6+1.7*i); CheckArray2(100, 5, $h{'m'}, 3, 4); CheckString2(100, 7, $h{'field'}, "new3"); CheckNum2(100, 8, $h{'field_type'}, $GetData::LINCOM_ENTRY); CheckNum2(100, 9, $h{'fragment_index'}, 0); CheckSArray2(100, 10, $h{'in_fields'}, qw(in3 in4)); CheckNum2(100, 11, $h{'n_fields'}, 2); CheckSArray2(100, 12, $h{'scalar'}, undef, undef, undef, undef, undef); CheckArray2(100, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef); # 102: alter_polynom $s = $_->alter_polynom("new4", 4, undef, [ 1*i, 2*i, 3*i, 4*i, 5*i ]); CheckOK2(102, 1); CheckNum2(102, 2, $s, 0); %h = $_->entry("new4"); CheckOK2(102, 3); CheckArray2(102, 4, $h{'a'}, 1*i, 2*i, 3*i, 4*i, 5*i); CheckString2(102, 7, $h{'field'}, "new4"); CheckNum2(102, 8, $h{'field_type'}, $GetData::POLYNOM_ENTRY); CheckNum2(102, 9, $h{'fragment_index'}, 0); CheckString2(102, 10, $h{'in_fields'}, "in1"); CheckNum2(102, 11, $h{'poly_ord'}, 4); CheckSArray2(102, 12, $h{'scalar'}, undef, undef, undef, undef, undef); CheckArray2(102, 13, $h{'scalar_ind'}, undef, undef, undef, undef, undef); # 104: alter_linterp $s = $_->alter_linterp("new6", undef, "./other/table"); CheckOK2(104, 1); CheckNum2(104, 2, $s, 0); %h = $_->entry("new6"); CheckOK2(104, 2); CheckString2(104, 3, $h{'field'}, "new6"); CheckNum2(104, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY); CheckNum2(104, 5, $h{'fragment_index'}, 0); CheckString2(104, 6, $h{'in_fields'}, "in"); CheckString2(104, 7, $h{'table'}, "./other/table"); # 105: alter_bit $s = $_->alter_bit("new7", "in3", undef, 8); CheckOK2(105, 1); CheckNum2(105, 2, $s, 0); %h = $_->entry("new7"); CheckOK(105, 2); CheckNum2(105, 3, $h{'bitnum'}, 11); CheckString2(105, 4, $h{'field'}, "new7"); CheckNum2(105, 5, $h{'field_type'}, $GetData::BIT_ENTRY); CheckNum2(105, 6, $h{'fragment_index'}, 0); CheckString2(105, 7, $h{'in_fields'}, "in3"); CheckNum2(105, 8, $h{'numbits'}, 8); CheckSArray2(105, 9, $h{'scalar'}, undef, undef); CheckArray2(105, 10, $h{'scalar_ind'}, undef, undef); # 106: alter_sbit $s = $_->alter_sbit("new8", "in1"); CheckOK2(106, 1); CheckNum2(106, 2, $s, 0); %h = $_->entry("new8"); CheckOK(106, 2); CheckNum2(106, 3, $h{'bitnum'}, 5); CheckString2(106, 4, $h{'field'}, "new8"); CheckNum2(106, 5, $h{'field_type'}, $GetData::SBIT_ENTRY); CheckNum2(106, 6, $h{'fragment_index'}, 0); CheckString2(106, 7, $h{'in_fields'}, "in1"); CheckNum2(106, 8, $h{'numbits'}, 10); CheckSArray2(106, 9, $h{'scalar'}, undef, undef); CheckArray2(106, 10, $h{'scalar_ind'}, undef, undef); # 107: alter_mutiply $s = $_->alter_multiply("new9", "in1"); CheckOK2(107, 1); CheckNum2(107, 2, $s, 0); %h = $_->entry("new9"); CheckOK2(107, 3); CheckString2(107, 4, $h{'field'}, "new9"); CheckNum2(107, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(107, 6, $h{'fragment_index'}, 0); CheckSArray2(107, 7, $h{'in_fields'}, qw(in1 in3)); # 108: alter_phase $s = $_->alter_phase("new10", undef, -3); CheckOK2(108, 1); CheckNum2(108, 2, $s, 0); %h = $_->entry("new10"); CheckOK2(108, 2); CheckString2(108, 3, $h{'field'}, "new10"); CheckNum2(108, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(108, 5, $h{'fragment_index'}, 0); CheckString2(108, 6, $h{'in_fields'}, "in6"); CheckSArray2(108, 7, $h{'scalar'}, undef); CheckArray2(108, 8, $h{'scalar_ind'}, undef); CheckNum2(108, 9, $h{'shift'}, -3); # 109: alter_const $s = $_->alter_const("new11", $GetData::FLOAT32); CheckOK2(109, 1); CheckNum2(109, 2, $s, 0); %h = $_->entry("new11"); CheckOK2(109, 3); CheckNum2(109, 4, $h{'const_type'}, $GetData::FLOAT32); CheckString2(109, 5, $h{'field'}, "new11"); CheckNum2(109, 6, $h{'field_type'}, $GetData::CONST_ENTRY); CheckNum2(109, 7, $h{'fragment_index'}, 0); # 110: encoding check $s = $_->encoding(0); CheckOK(110); CheckNum(110, $s, $GetData::UNENCODED); # 111: endianness check $s = $_->endianness(0); CheckOK(111); CheckNum(111, $s, $GetData::LITTLE_ENDIAN | $GetData::NOT_ARM_ENDIAN); # 112: dirfilename $s = $_->dirfilename; CheckOK(112); CheckEOString(112, $s, "dirfile"); # 113: parent_fragment $s = $_->parent_fragment(1); CheckOK(113); CheckNum(113, $s, 0); # 114: alter_protection $s = $_->alter_protection($GetData::PROTECT_DATA, 1); CheckOK(114); CheckNum(114, $s, 0); # 115: protection $s = $_->protection(1); CheckOK(115); CheckNum(115, $s, $GetData::PROTECT_DATA); # 116: raw_filename $s = $_->raw_filename("data"); CheckOK(116); CheckEOString(116, $s, "dirfile/data"); # 117: reference $s = $_->reference("new1"); CheckOK(117); CheckString(117, $s, "new1"); # 118: gd_eof $s = $_->eof("lincom"); CheckOK(118); CheckNum(118, $s, 81); # 119: alter_encoding $s = $_->alter_encoding($GetData::SLIM_ENCODED, 1); CheckOK2(119, 1); CheckNum2(119, 2, $s, 0); $s = $_->encoding(1); CheckOK2(119, 3); CheckNum2(119, 4, $s, $GetData::SLIM_ENCODED); # 120: alter_endianness $s = $_->alter_endianness($GetData::BIG_ENDIAN, 1); CheckOK2(120, 1); CheckNum2(120, 2, $s, 0); $s = $_->endianness(1); CheckOK2(120, 3); CheckNum2(120, 4, $s, $GetData::BIG_ENDIAN); # 121: alter_spec $s = $_->alter_spec("new10 PHASE in const"); CheckOK2(121, 1); CheckNum2(121, 2, $s, 0); %h = $_->entry("new10"); CheckOK2(121, 2); CheckString2(121, 3, $h{'field'}, "new10"); CheckNum2(121, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(121, 5, $h{'fragment_index'}, 0); CheckString2(121, 6, $h{'in_fields'}, "in"); CheckSArray2(121, 7, $h{'scalar'}, "const"); CheckArray2(121, 8, $h{'scalar_ind'}, -1); CheckNum2(121, 9, $h{'shift'}, 86); # 122: delete $s = $_->delete("new10"); CheckOK2(122, 0); CheckNum2(122, 1, $s, 0); $s = $_->entry("new10"); CheckError2(122, 2, $GetData::E_BAD_CODE); CheckNum2(122, 3, $s, undef); # 123: malter_spec $s = $_->malter_spec("mnew10 PHASE in4 11", "data"); CheckOK2(123, 0); CheckNum2(123, 1, $s, 0); %h = $_->entry("data/mnew10"); CheckOK2(123, 2); CheckString2(123, 3, $h{'field'}, "data/mnew10"); CheckNum2(123, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(123, 5, $h{'fragment_index'}, 0); CheckString2(123, 6, $h{'in_fields'}, "in4"); CheckSArray2(123, 7, $h{'scalar'}, undef); CheckArray2(123, 8, $h{'scalar_ind'}, undef); CheckNum2(123, 9, $h{'shift'}, 11); # 124: move $s = $_->move("new9", 1); CheckOK2(124, 0); CheckNum2(124, 1, $s, 0); %h = $_->entry("new9"); CheckOK2(124, 3); CheckString2(124, 4, $h{'field'}, "new9"); CheckNum2(124, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(124, 6, $h{'fragment_index'}, 1); CheckSArray2(124, 7, $h{'in_fields'}, qw(in1 in3)); # 125: rename $s = $_->rename(qw(new9 newer)); CheckOK2(125, 0); CheckNum2(125, 1, $s, 0); $s = $_->entry("new9"); CheckError2(125, 2, $GetData::E_BAD_CODE); %h = $_->entry("newer"); CheckOK2(125, 3); CheckString2(125, 4, $h{'field'}, "newer"); CheckNum2(125, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(125, 6, $h{'fragment_index'}, 1); CheckSArray2(125, 7, $h{'in_fields'}, qw(in1 in3)); # 126: uninclude $s = $_->uninclude(1); CheckOK2(126, 0); CheckNum2(126, 1, $s, 0); $s = $_->entry("newer"); CheckError2(126, 2, $GetData::E_BAD_CODE); # 127: frameoffset $s = $_->frameoffset(0); CheckOK(127); CheckNum(127, $s, 0); # 128: alter_frameoffset $s = $_->alter_frameoffset(33, 0); CheckOK2(128, 0); CheckNum2(128, 1, $s, 0); $s = $_->frameoffset(0); CheckOK2(128, 2); CheckNum2(128, 3, $s, 33); # 129: native_type $s = $_->native_type("data"); CheckOK(129); CheckNum(129, $s, $GetData::INT8); # 131: validate $s = $_->validate("new7"); CheckError(131, $GetData::E_BAD_CODE); CheckNum(131, $s, undef); # 133: framenum $s = $_->framenum("data", 33.3, 6); CheckOK(133); CheckNum(133, $s, 37.0375); # 135: add check $s = $_->add({ field => "new135", field_type => $GetData::RAW_ENTRY, fragment_index => 0, data_type => $GetData::FLOAT32, spf => 5 }); CheckOK2(135,1); CheckNum2(135, 2, $s, 0); %h = $_->entry("new135"); CheckOK2(135, 2); CheckString2(135, 3, $h{'field'}, "new135"); CheckNum2(135, 4, $h{'field_type'}, $GetData::RAW_ENTRY); CheckNum2(135, 5, $h{'fragment_index'}, 0); CheckNum2(135, 6, $h{'data_type'}, $GetData::FLOAT32); CheckNum2(135, 7, $h{'spf'}, 5); CheckSArray2(135, 8, $h{'scalar'}, undef); CheckArray2(135, 9, $h{'scalar_ind'}, undef); # 136: madd check $s = $_->madd({ field => "mnew136", field_type => $GetData::PHASE_ENTRY, fragment_index => 0, in_fields => "data", shift => 2 }, "data"); CheckOK2(136,1); CheckNum2(136, 2, $s, 0); %h = $_->entry("data/mnew136"); CheckOK2(136, 2); CheckString2(136, 3, $h{'field'}, "data/mnew136"); CheckNum2(136, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(136, 5, $h{'fragment_index'}, 0); CheckString2(136, 6, $h{'in_fields'}, "data"); CheckSArray2(136, 7, $h{'scalar'}, undef); CheckArray2(136, 8, $h{'scalar_ind'}, undef); CheckNum2(136, 9, $h{'shift'}, 2); # 141: alter check $s = $_->alter_entry("new135", { field_type => $GetData::RAW_ENTRY, data_type => $GetData::FLOAT64, spf => 141 }); CheckOK2(141,1); CheckNum2(141, 2, $s, 0); %h = $_->entry("new135"); CheckOK2(141, 2); CheckString2(141, 3, $h{'field'}, "new135"); CheckNum2(141, 4, $h{'field_type'}, $GetData::RAW_ENTRY); CheckNum2(141, 5, $h{'fragment_index'}, 0); CheckString2(141, 6, $h{'data_type'}, $GetData::FLOAT64); CheckNum2(141, 9, $h{'spf'}, 141); CheckSArray2(141, 7, $h{'scalar'}, undef); CheckArray2(141, 8, $h{'scalar_ind'}, undef); # 142: gd_bof $s = $_->bof("lincom"); CheckOK(142); CheckNum(142, $s, 264); # 143: divide entry %h = $_->entry("div"); CheckOK(143); CheckSArray2(143, 0, [ sort keys %h ], qw(field field_type fragment_index), "in_fields"); CheckString2(143, 1, $h{'field'}, "div"); CheckNum2(143, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY); CheckNum2(143, 3, $h{'fragment_index'}, 0); CheckSArray2(143, 4, $h{'in_fields'}, qw(mult bit)); # 145: recip entry %h = $_->entry("recip"); CheckOK(145); CheckSArray2(145, 1, [ sort keys %h ], qw(dividend field field_type), qw(fragment_index in_fields scalar scalar_ind)); CheckNum2(145, 2, $h{'dividend'}, 6.5 + 4.3 * i); CheckString2(145, 3, $h{'field'}, "recip"); CheckNum2(145, 4, $h{'field_type'}, $GetData::RECIP_ENTRY); CheckNum2(145, 5, $h{'fragment_index'}, 0); CheckString2(145, 6, $h{'in_fields'}, "div"); CheckSArray2(145, 7, $h{'scalar'}, undef); CheckArray2(145, 8, $h{'scalar_ind'}, undef); # 146: add divide $s = $_->add_divide(qw(new14 in2 in3)); CheckOK2(146, 0); CheckNum2(146, 1, $s, 0); %h = $_->entry("new14"); CheckOK(146); CheckString2(146, 1, $h{'field'}, "new14"); CheckNum2(146, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY); CheckNum2(146, 3, $h{'fragment_index'}, 0); CheckSArray2(146, 4, $h{'in_fields'}, qw(in2 in3)); # 148: add recip $s = $_->add_recip(qw(new16 in2), 33.3 + 44.4 * i); CheckOK2(148, 0); CheckNum2(148, 1, $s, 0); %h = $_->entry("new16"); CheckOK(148); CheckNum2(148, 2, $h{'dividend'}, 33.3 + 44.4 * i); CheckString2(148, 3, $h{'field'}, "new16"); CheckNum2(148, 4, $h{'field_type'}, $GetData::RECIP_ENTRY); CheckNum2(148, 5, $h{'fragment_index'}, 0); CheckString2(148, 6, $h{'in_fields'}, "in2"); CheckSArray2(148, 7, $h{'scalar'}, undef); CheckArray2(148, 8, $h{'scalar_ind'}, undef); # 149: madd divide $s = $_->madd_divide(qw(data mnew14 in1 in8)); CheckOK2(149, 0); CheckNum2(149, 1, $s, 0); %h = $_->entry("data/mnew14"); CheckOK(149); CheckString2(149, 1, $h{'field'}, "data/mnew14"); CheckNum2(149, 2, $h{'field_type'}, $GetData::DIVIDE_ENTRY); CheckNum2(149, 3, $h{'fragment_index'}, 0); CheckSArray2(149, 4, $h{'in_fields'}, qw(in1 in8)); # 151: madd recip $s = $_->madd_recip(qw(data mnew16 in2), 1.0); CheckOK2(151, 0); CheckNum2(151, 1, $s, 0); %h = $_->entry("data/mnew16"); CheckOK(151); CheckNum2(151, 2, $h{'dividend'}, 1); CheckString2(151, 3, $h{'field'}, "data/mnew16"); CheckNum2(151, 4, $h{'field_type'}, $GetData::RECIP_ENTRY); CheckNum2(151, 5, $h{'fragment_index'}, 0); CheckString2(151, 6, $h{'in_fields'}, "in2"); CheckSArray2(151, 7, $h{'scalar'}, undef); CheckArray2(151, 8, $h{'scalar_ind'}, undef); # 152: alter_divide $s = $_->alter_divide("new14", "in5"); CheckOK2(152, 1); CheckNum2(152, 2, $s, 0); %h = $_->entry("new14"); CheckOK2(152, 3); CheckString2(152, 4, $h{'field'}, "new14"); CheckNum2(152, 5, $h{'field_type'}, $GetData::DIVIDE_ENTRY); CheckNum2(152, 6, $h{'fragment_index'}, 0); CheckSArray2(152, 7, $h{'in_fields'}, qw(in5 in3)); # 153: alter recip $s = $_->alter_recip("new16", "in6", undef); CheckOK2(153, 1); CheckNum2(153, 2, $s, 0); %h = $_->entry("new16"); CheckOK(151); CheckNum2(151, 2, $h{'dividend'}, 33.3 + 44.4 * i); CheckString2(151, 3, $h{'field'}, "new16"); CheckNum2(151, 4, $h{'field_type'}, $GetData::RECIP_ENTRY); CheckNum2(151, 5, $h{'fragment_index'}, 0); CheckString2(151, 6, $h{'in_fields'}, "in6"); CheckSArray2(151, 7, $h{'scalar'}, undef); CheckArray2(151, 8, $h{'scalar_ind'}, undef); # 155: rewrite fragment $s = $_->rewrite_fragment(0); CheckOK(155, 0); CheckNum(155, $s, 0); # 156: invalid dirfile my $d = $_; $_ = &GetData::invalid_dirfile; CheckOK2(156, 0); $s = $_->fragments; CheckError2(156, 1, $GetData::E_BAD_DIRFILE); CheckNum2(156, 2, $s, 0); $_->close; $_ = $d; # 157: dirfile standards $s = $_->dirfile_standards; CheckOK2(157, 1); CheckNum2(157, 2, $s, $GetData::DIRFILE_STANDARDS_VERSION); $s = $_->dirfile_standards(0); CheckError2(157, 3, $GetData::E_ARGUMENT); CheckNum2(157, 4, $s, undef); # 158: get_carray $s = $_->get_carray("carray", $GetData::INT8); CheckOK(158); CheckString(158, $s, "\1\2\3\4\5\6"); # 164: get_carray_slice @a = $_->get_carray_slice("carray", 2, 2, $GetData::FLOAT64); CheckOK(164); CheckArray(164, \@a, 3.3, 4.4); # 167: carrays $s = $_->carrays($GetData::INT8); CheckOK2(167, 1); CheckNum2(167, 2, $#$s, 0); CheckSArray2(167, 3, $s, "\1\2\3\4\5\6"); @a = $_->carrays($GetData::FLOAT64); CheckOK2(167, 4); CheckNum2(167, 5, $#a, 0); CheckArray2(167, 6, $a[0], 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 ); # 168: put carray $s = $_->put_carray("carray", 9, 8, 7, 6, 5, 4); CheckOK2(168, 1); CheckNum2(168, 2, $s, 0); @a = $_->get_carray("carray", $GetData::INT8); CheckOK2(168, 3); CheckArray2(168, 4, \@a, 9, 8, 7, 6, 5, 4); # 169: put carray slice $s = $_->put_carray_slice("carray", 2, [ 169, 169 ]); CheckOK2(169, 1); CheckNum2(169, 2, $s, 0); @a = $_->get_carray("carray", $GetData::UINT8); CheckOK2(169, 3); CheckArray2(169, 4, \@a, 9, 8, 169, 169, 5, 4); # 177: array len $s = $_->array_len("carray"); CheckOK(177); CheckNum(177, $s, 6); # 178: carray entry %h = $_->entry("carray"); CheckOK2(178, 1); CheckSArray2(178, 2, [ sort keys %h ], qw(array_len const_type field field_type fragment_index)); CheckNum2(178, 3, $h{'array_len'}, 6); CheckNum2(178, 4, $h{'const_type'}, $GetData::FLOAT64); CheckString2(178, 5, $h{'field'}, "carray"); CheckNum2(178, 6, $h{'field_type'}, $GetData::CARRAY_ENTRY); CheckNum2(178, 7, $h{'fragment_index'}, 0); # 179: add carray $s = $_->add_carray("new17", $GetData::FLOAT64, 0, undef, 1.79, 17.9); CheckOK2(179, 1); CheckNum2(179, 2, $s, 0); %h = $_->entry("new17"); CheckOK2(179, 3); CheckNum2(179, 4, $h{'array_len'}, 2); CheckNum2(179, 5, $h{'const_type'}, $GetData::FLOAT64); CheckString2(179, 6, $h{'field'}, "new17"); CheckNum2(179, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY); CheckNum2(179, 8, $h{'fragment_index'}, 0); @a = $_->get_carray("new17", $GetData::FLOAT64); CheckOK2(179, 9); CheckArray2(179, 10, \@a, 1.79, 17.9); # 180: madd carray $s = $_->madd_carray("data", "mnew17", $GetData::FLOAT64, undef, 1.80, 18.0); CheckOK2(180, 1); CheckNum2(180, 2, $s, 0); %h = $_->entry("data/mnew17"); CheckOK2(180, 3); CheckNum2(180, 4, $h{'array_len'}, 2); CheckNum2(180, 5, $h{'const_type'}, $GetData::FLOAT64); CheckString2(180, 6, $h{'field'}, "data/mnew17"); CheckNum2(180, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY); CheckNum2(180, 8, $h{'fragment_index'}, 0); @a = $_->get_carray("data/mnew17", $GetData::FLOAT64); CheckOK2(180, 9); CheckArray2(180, 10, \@a, 1.80, 18.0); # 181: alter carray $s = $_->alter_carray("new17", $GetData::FLOAT32, 3); CheckOK2(181, 0); CheckNum2(181, 1, $s, 0); %h = $_->entry("new17"); CheckOK2(181, 3); CheckNum2(181, 4, $h{'array_len'}, 3); CheckNum2(181, 5, $h{'const_type'}, $GetData::FLOAT32); CheckString2(181, 6, $h{'field'}, "new17"); CheckNum2(181, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY); CheckNum2(181, 8, $h{'fragment_index'}, 0); @a = $_->get_carray("new17", $GetData::FLOAT64); CheckOK2(181, 9); CheckArray2(181, 10, \@a, 1.79, 17.9, 0); # 182: fragment list @a = $_->fragments; CheckOK(182); CheckEOSArray(182, \@a, "dirfile/format"); # 183: constants $s = $_->constants($GetData::UINT8); CheckOK2(183, 0); CheckString2(183, 1, $s, "V!"); @a = $_->constants($GetData::FLOAT64); CheckOK2(183, 2); CheckArray2(183, 3, \@a, 86, 33.3); # 191: mconstants $s = $_->mconstants("data", $GetData::UINT8); CheckOK2(191, 0); CheckString2(191, 1, $s, "\3\011"); @a = $_->mconstants("data", $GetData::FLOAT64); CheckOK2(191, 2); CheckArray2(191, 3, \@a, 3.3, 9.2); # 199: strings $s = $_->strings; CheckOK2(199, 1); CheckNum2(199, 2, $s, 3); @a = $_->strings; CheckOK2(199, 3); CheckSArray2(199, 4, \@a, "Lorem ipsum", "a string", "Arthur Dent"); # 200: mstrings $s = $_->mstrings("data"); CheckOK2(200, 1); CheckNum2(200, 2, $s, 2); @a = $_->mstrings("data"); CheckOK2(200, 3); CheckSArray2(200, 4, \@a, "This is a string constant.", "another string"); # 203: seek $s = $_->seek("data", 35, 0, $GetData::SEEK_SET); CheckOK2(203, 0); CheckNum2(203, 0, $s, 280); $s = $_->getdata("data", $GetData::HERE, 0, 1, 0, $GetData::INT8); CheckOK2(203, 1); CheckNum2(203, 1, length($s), 8); CheckString2(203, 2, $s, join "", map chr, 17 .. 24); # 204: tell $s = $_->tell("data"); CheckOK(204); CheckNum(204,$s,288); # 205: gd_hide check $s = $_->hide('data'); CheckOK(205); # 206: gd_hidden check $s = $_->hidden('data'); CheckOK2(206, 1); CheckNum2(206, 1, $s, 1); $s = $_->hidden('lincom'); CheckOK2(206, 2); CheckNum2(206, 2, $s, 0); # 207: gd_unhide check $s = $_->unhide('data'); CheckOK2(206, 1); $s = $_->hidden('data'); CheckOK2(206, 2); CheckNum(206, $s, 0); # 208: gd_sync check $s = $_->sync('data'); CheckOK(208); # 209: gd_flush check $s = $_->flush('data'); CheckOK(209); # 210: gd_metaflush check $s = $_->metaflush(); CheckOK(210); # 211: gd_entry (WINDOW) check %h = $_->entry('window'); CheckOK(211); CheckNum2(211, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY); CheckNum2(211, 2, $h{"fragment_index"}, 0); CheckNum2(211, 3, $h{"windop"}, $GetData::WINDOP_LT); CheckSArray2(211, 4, $h{"in_fields"}, 'linterp', 'mult'); CheckNum2(211, 5, $h{"threshold"}, 4.1); # 212: gd_add_window check $s = $_->add_window('new18', 'in1', 'in2', $GetData::WINDOP_NE, 32, 0); CheckOK2(212, 1); %h = $_->entry('new18'); CheckOK2(212, 2); CheckNum2(212, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY); CheckNum2(212, 2, $h{"fragment_index"}, 0); CheckNum2(212, 3, $h{"windop"}, $GetData::WINDOP_NE); CheckSArray2(212, 4, $h{"in_fields"}, 'in1', 'in2'); CheckNum2(212, 5, $h{"threshold"}, 32); # 214: gd_madd_window check $s = $_->madd_window('data', 'mnew18', 'in2', 'in3', $GetData::WINDOP_SET, 128); CheckOK2(214, 1); %h = $_->entry('data/mnew18'); CheckOK2(214, 2); CheckNum2(214, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY); CheckNum2(214, 2, $h{"fragment_index"}, 0); CheckNum2(214, 3, $h{"windop"}, $GetData::WINDOP_SET); CheckSArray2(214, 4, $h{"in_fields"}, 'in2', 'in3'); CheckNum2(214, 5, $h{"threshold"}, 128); # 217: gd_alter_window check $s = $_->alter_window('new18', 'in3', 'in4', $GetData::WINDOP_GE, 32e3); CheckOK2(217, 1); %h = $_->entry('new18'); CheckOK2(217, 2); CheckNum2(217, 1, $h{"field_type"}, $GetData::WINDOW_ENTRY); CheckNum2(217, 2, $h{"fragment_index"}, 0); CheckNum2(217, 3, $h{"windop"}, $GetData::WINDOP_GE); CheckSArray2(217, 4, $h{"in_fields"}, 'in3', 'in4'); CheckNum2(217, 5, $h{"threshold"}, 32e3); # 218: gd_alias_target check $s = $_->alias_target('alias'); CheckOK(218); CheckString(218, $s, 'data'); # 219: gd_add_alias check $s = $_->add_alias('new20', 'data', 0); CheckOK2(219, 1); $s = $_->alias_target('new20'); CheckOK2(219, 2); CheckString(219, $s, 'data'); # 220: gd_madd_alias check $s = $_->madd_alias('data', 'mnew20', 'data'); CheckOK2(220, 1); $s = $_->alias_target('data/mnew20'); CheckOK2(220, 2); CheckString(220, $s, 'data'); # 221: gd_naliases check $s = $_->aliases('data'); CheckOK(221); CheckNum(221, $s, 4); # 222: gd_aliases check @a = $_->aliases('data'); CheckOK(222); CheckSArray(222, \@a, "data", "alias", "data/mnew20", "new20"); # 223: gd_include_affix check $s = $_->include('format1', 0, $GetData::CREAT | $GetData::EXCL, 'A', 'Z'); CheckOK(223); # 226: gd_fragment_affixes check @a = $_->fragment_affixes(1); CheckOK(226); CheckSArray(226, \@a, "A", "Z"); # 227: gd_alter_affixes check $s = $_->alter_affixes(1, 'B', ''); CheckOK2(227, 1); @a = $_->fragment_affixes(1); CheckOK2(227, 2); CheckSArray(227, \@a, "B", ""); # 228: gd_entry (MPLEX) check %h = $_->entry('mplex'); CheckOK(228); CheckNum2(228, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY); CheckNum2(228, 2, $h{"fragment_index"}, 0); CheckNum2(228, 3, $h{"count_val"}, 1); CheckSArray2(228, 4, $h{"in_fields"}, 'data', 'sbit'); CheckNum2(228, 5, $h{"period"}, 10); # 229: gd_add_mplex check $s = $_->add_mplex('new21', 'in1', 'in2', 5, 6, 0); CheckOK2(229, 1); %h = $_->entry('new21'); CheckOK2(229, 2); CheckNum2(229, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY); CheckNum2(229, 2, $h{"fragment_index"}, 0); CheckNum2(229, 3, $h{"count_val"}, 5); CheckSArray2(229, 4, $h{"in_fields"}, 'in1', 'in2'); CheckNum2(229, 5, $h{"period"}, 6); # 230: gd_madd_mplex check $s = $_->madd_mplex('data', 'mnew21', 'in2', 'in3', 0, 12); CheckOK2(230, 1); %h = $_->entry('data/mnew21'); CheckOK2(230, 2); CheckNum2(230, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY); CheckNum2(230, 2, $h{"fragment_index"}, 0); CheckNum2(230, 3, $h{"count_val"}, 0); CheckSArray2(230, 4, $h{"in_fields"}, 'in2', 'in3'); CheckNum2(230, 5, $h{"period"}, 12); # 231: gd_alter_mplex check $s = $_->alter_mplex('new21', 'in3', 'in4', 7, -1); CheckOK2(231, 1); %h = $_->entry('new21'); CheckOK2(231, 2); CheckNum2(231, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY); CheckNum2(231, 2, $h{"fragment_index"}, 0); CheckNum2(231, 3, $h{"count_val"}, 7); CheckSArray2(231, 4, $h{"in_fields"}, 'in3', 'in4'); CheckNum2(231, 5, $h{"period"}, 6); # 232: gd_strtok check @a = $_->strtok('"test1 test2" test3\ test4 test5'); CheckOK(232); CheckSArray(232, \@a, "test1 test2", "test3 test4", "test5"); # 233: gd_raw_close check $s = $_->raw_close('data'); CheckOK(233); # 234: gd_desync $s = $_->desync(0); CheckOK(234); CheckNum(234, $s, 0); # 235: gd_flags $s = $_->flags($GetData::PRETTY_PRINT, 0); CheckOK(235); CheckNum(235, $s, $GetData::PRETTY_PRINT); # 236: gd_verbose_prefix $s = $_->verbose_prefix("big_test: "); CheckOK(236); CheckNum(236, $s, 0); # 237: gd_nentries $s = $_->entry_list("data", $GetData::SCALAR_ENTRIES, $GetData::ENTRIES_HIDDEN | $GetData::ENTRIES_NOALIAS); CheckOK2(237, 1); CheckNum2(237, 1, $s, 6); $s = $_->entry_list(undef, $GetData::VECTOR_ENTRIES, $GetData::ENTRIES_HIDDEN | $GetData::ENTRIES_NOALIAS); CheckOK2(237, 2); CheckNum2(237, 2, $s, 24); # 239: gd_entry_list @a = $_->entry_list(undef, $GetData::VECTOR_ENTRIES, $GetData::ENTRIES_HIDDEN | $GetData::ENTRIES_NOALIAS); CheckOK(239); CheckSArray(239, \@a, qw(INDEX bit data div lincom linterp mplex mult new1 new135 new14 new16 new18 new21 new3 new4 new6 new7 new8 phase polynom recip sbit window)); # 240: gd_mplex_lookback $_->mplex_lookback($GetData::LOOKBACK_ALL); CheckOK(240); # 241: linterp_tablename $s = $_->linterp_tablename("linterp"); CheckOK(241); CheckEOString(241, $s, "dirfile/lut"); # 242: mcarrays @a = $_->mcarrays("data", $GetData::FLOAT64); CheckOK2(242, 1); CheckNum2(242, 2, $#a, 1); CheckArray2(242, 3, $a[0], 1.9, 2.8, 3.7, 4.6, 5.5 ); CheckArray2(242, 4, $a[1], 1.8, 18 ); # 243: add lincom $s = $_->add({ field => 'new243', field_type => $GetData::LINCOM_ENTRY, fragment_index => 0, in_fields => [qw(in1 in2 in3)], m => [1.1, undef, 1.4], scalar => [undef, 'const', undef, 'carray', 'carray', 'carray'], scalar_ind => [undef, undef, undef, 3, 4, 5] }); CheckOK2(243, 1); CheckNum2(243, 2, $s, 0); %h = $_->entry("new243"); CheckOK2(243, 3); CheckArray2(243, 4, $h{'b'}, 169, 5, 4); CheckString2(243, 6, $h{'field'}, "new243"); CheckNum2(243, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY); CheckNum2(243, 8, $h{'fragment_index'}, 0); CheckSArray2(243, 9, $h{'in_fields'}, qw(in1 in2 in3)); CheckArray2(243, 10, $h{'m'}, 1.1, 86, 1.4); CheckNum2(243, 11, $h{'n_fields'}, 3); CheckSArray2(243, 12, $h{'scalar'}, undef, 'const', undef, 'carray', 'carray', 'carray'); CheckArray2(243, 13, $h{'scalar_ind'}, undef, -1, undef, 3, 4, 5); # 244: add polynom $s = $_->add({ field => 'new244', field_type => $GetData::POLYNOM_ENTRY, fragment_index => 0, in_fields => 'in2', a => [33, 44+i*55, 66], scalar => [undef, undef, undef, 'carray'], scalar_ind => [undef, undef, undef, 3 ] }); CheckOK2(244, 1); CheckNum2(244, 2, $s, 0); %h = $_->entry("new244"); CheckOK2(244, 3); CheckArray2(244, 2, $h{'a'}, 33, 44+i*55, 66, 169); CheckString2(244, 4, $h{'field'}, "new244"); CheckNum2(244, 5, $h{'field_type'}, $GetData::POLYNOM_ENTRY); CheckNum2(244, 6, $h{'fragment_index'}, 0); CheckString2(244, 7, $h{'in_fields'}, "in2"); CheckNum2(244, 8, $h{'poly_ord'}, 3); CheckSArray2(244, 9, $h{'scalar'}, undef, undef, undef, "carray"); CheckArray2(244, 10, $h{'scalar_ind'}, undef, undef, undef, 3); # 245: add linterp $s = $_->add({ field => 'new245', field_type => $GetData::LINTERP_ENTRY, fragment_index => 0, in_fields => 'in', table => './some/table' }); CheckOK2(245, 1); CheckNum2(245, 2, $s, 0); %h = $_->entry("new245"); CheckOK2(245, 2); CheckString2(245, 3, $h{'field'}, "new245"); CheckNum2(245, 4, $h{'field_type'}, $GetData::LINTERP_ENTRY); CheckNum2(245, 5, $h{'fragment_index'}, 0); CheckString2(245, 6, $h{'in_fields'}, "in"); CheckString2(245, 7, $h{'table'}, "./some/table"); # 246: add bit $s = $_->add({ field => 'new246', field_type => $GetData::BIT_ENTRY, fragment_index => 0, in_fields => 'in1', bitnum => 11 }); CheckOK2(246, 1); CheckNum2(246, 2, $s, 0); %h = $_->entry("new246"); CheckOK(246, 2); CheckNum2(246, 3, $h{'bitnum'}, 11); CheckString2(246, 4, $h{'field'}, "new246"); CheckNum2(246, 5, $h{'field_type'}, $GetData::BIT_ENTRY); CheckNum2(246, 6, $h{'fragment_index'}, 0); CheckString2(246, 7, $h{'in_fields'}, "in1"); CheckNum2(246, 8, $h{'numbits'}, 1); CheckSArray2(246, 9, $h{'scalar'}, undef, undef); CheckArray2(246, 10, $h{'scalar_ind'}, undef, undef); # 247: add multiply $s = $_->add({ field => 'new247', field_type => $GetData::MULTIPLY_ENTRY, fragment_index => 0, in_fields => [qw(in1 in2)] }); CheckOK2(247, 1); CheckNum2(247, 2, $s, 0); %h = $_->entry("new247"); CheckOK2(247, 3); CheckString2(247, 4, $h{'field'}, "new247"); CheckNum2(247, 5, $h{'field_type'}, $GetData::MULTIPLY_ENTRY); CheckNum2(247, 6, $h{'fragment_index'}, 0); CheckSArray2(247, 7, $h{'in_fields'}, qw(in1 in2)); # 248: add phase $s = $_->add({ field => "new248", field_type => $GetData::PHASE_ENTRY, fragment_index => 0, in_fields => "new9", shift => -88 }); CheckOK2(248,1); CheckNum2(248, 2, $s, 0); %h = $_->entry("new248"); CheckOK2(248, 2); CheckString2(248, 3, $h{'field'}, "new248"); CheckNum2(248, 4, $h{'field_type'}, $GetData::PHASE_ENTRY); CheckNum2(248, 5, $h{'fragment_index'}, 0); CheckString2(248, 6, $h{'in_fields'}, "new9"); CheckSArray2(248, 7, $h{'scalar'}, undef); CheckArray2(248, 8, $h{'scalar_ind'}, undef); CheckNum2(248, 9, $h{'shift'}, -88); # 249: add const $s = $_->add({ field => 'new249', field_type => $GetData::CONST_ENTRY, fragment_index => 0, const_type => $GetData::UINT8 }); CheckOK2(249, 1); CheckNum2(249, 2, $s, 0); %h = $_->entry("new249"); CheckOK2(249, 3); CheckNum2(249, 4, $h{'const_type'}, $GetData::UINT8); CheckString2(249, 5, $h{'field'}, "new249"); CheckNum2(249, 6, $h{'field_type'}, $GetData::CONST_ENTRY); CheckNum2(249, 7, $h{'fragment_index'}, 0); $s = $_->get_constant("new249", $GetData::FLOAT64); CheckOK2(249, 8); CheckNum2(249, 9, $s, 0); # 250: add string $s = $_->add({ field => 'new250', field_type => $GetData::STRING_ENTRY, fragment_index => 0, }); CheckOK2(250, 1); CheckNum2(250, 2, $s, 0); %h = $_->entry("new250"); CheckOK2(250, 3); CheckString2(250, 4, $h{'field'}, "new250"); CheckNum2(250, 5, $h{'field_type'}, $GetData::STRING_ENTRY); CheckNum2(250, 6, $h{'fragment_index'}, 0); $s = $_->get_string("new250"); CheckOK2(250, 7); CheckString2(250, 8, $s, ""); # 251: add recip $s = $_->add({ field => 'Bnew251', field_type => $GetData::RECIP_ENTRY, fragment_index => 1, in_fields => 'Bin2', dividend => 33.3+i*44.4, scalar => undef }); CheckOK2(251, 0); CheckNum2(251, 1, $s, 0); %h = $_->entry("Bnew251"); CheckOK(251); CheckNum2(251, 2, $h{'dividend'}, 33.3 + 44.4 * i); CheckString2(251, 3, $h{'field'}, "Bnew251"); CheckNum2(251, 4, $h{'field_type'}, $GetData::RECIP_ENTRY); CheckNum2(251, 5, $h{'fragment_index'}, 1); CheckString2(251, 6, $h{'in_fields'}, "Bin2"); # 252: add const $s = $_->add({ field => 'new252', field_type => $GetData::CARRAY_ENTRY, fragment_index => 0, array_len => 5, const_type => $GetData::UINT8 }); CheckOK2(252, 1); CheckNum2(252, 2, $s, 0); %h = $_->entry("new252"); CheckOK2(252, 3); CheckNum2(252, 4, $h{'const_type'}, $GetData::UINT8); CheckNum2(252, 5, $h{'array_len'}, 5); CheckString2(252, 6, $h{'field'}, "new252"); CheckNum2(252, 7, $h{'field_type'}, $GetData::CARRAY_ENTRY); CheckNum2(252, 8, $h{'fragment_index'}, 0); @a = $_->get_carray("new252", $GetData::FLOAT64); CheckOK2(252, 9); CheckArray2(252, 10, \@a, 0, 0, 0, 0, 0); # 253: add window $s = $_->add({ field => 'new253', field_type => $GetData::WINDOW_ENTRY, fragment_index => 0, in_fields => [qw(in1 in2)], windop => $GetData::WINDOP_NE, threshold => 32 }); CheckOK2(253, 1); CheckNum2(253, 2, $s, 0); %h = $_->entry('new253'); CheckOK2(253, 3); CheckString2(253, 4, $h{'field'}, "new253"); CheckNum2(253, 5, $h{"field_type"}, $GetData::WINDOW_ENTRY); CheckNum2(253, 6, $h{"fragment_index"}, 0); CheckNum2(253, 7, $h{"windop"}, $GetData::WINDOP_NE); CheckNum2(253, 8, $h{"threshold"}, 32); CheckSArray2(253, 9, $h{"in_fields"}, 'in1', 'in2'); # 254: add mplex $s = $_->add({ field => 'new254', field_type => $GetData::MPLEX_ENTRY, fragment_index => 0, in_fields => [qw(in1 in3)], count_val => 254 }); CheckOK2(254, 1); %h = $_->entry('new254'); CheckOK2(254, 2); CheckNum2(254, 1, $h{"field_type"}, $GetData::MPLEX_ENTRY); CheckNum2(254, 2, $h{"fragment_index"}, 0); CheckNum2(254, 3, $h{"count_val"}, 254); CheckSArray2(254, 4, $h{"in_fields"}, 'in1', 'in3'); CheckNum2(254, 5, $h{"period"}, 0); # 259: alter_entry with scalar $s = $_->alter_entry('new243', { field_type => $GetData::LINCOM_ENTRY, scalar => [ undef, "", "const", "carray", undef, "const" ], scalar_ind => [ undef, undef, undef, 4, undef, -1 ] }); CheckOK2(259, 1); CheckNum2(259, 2, $s, 0); %h = $_->entry("new243"); CheckOK2(259, 3); CheckArray2(259, 4, $h{'b'}, 5, 5, 86); CheckString2(259, 6, $h{'field'}, "new243"); CheckNum2(259, 7, $h{'field_type'}, $GetData::LINCOM_ENTRY); CheckNum2(259, 8, $h{'fragment_index'}, 0); CheckSArray2(259, 9, $h{'in_fields'}, qw(in1 in2 in3)); CheckArray2(259, 10, $h{'m'}, 1.1, 86, 86); CheckNum2(259, 11, $h{'n_fields'}, 3); CheckSArray2(259, 12, $h{'scalar'}, undef, 'const', 'const', 'carray', undef, 'const'); CheckArray2(259, 13, $h{'scalar_ind'}, undef, -1, -1, 4, undef, -1); # 272: NULL return from gd_reference { local $_ = &GetData::open("dirfile/empty", $GetData::RDWR | $GetData::CREAT | $GetData::EXCL); CheckOK2(272, 1); $s = $_->reference(); CheckOK2(272, 2); CheckString(272, $s, undef); } $d = $_ = undef; system "rm -rf dirfile"; libgetdata-0.9.0/bindings/perl/t/callback.t0000640000175000017500000000340312614323564020727 0ustar alastairalastair#!/usr/bin/perl -w # Copyright (C) 2011 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., use GetData; use strict; use Test::More tests => 8; # callback sub callback { my ($pdata, $extra) = @_; print "\n"; is ($extra, "extra stuff", "\$extra parameter good"); is ($$pdata{'suberror'}, $GetData::E_FORMAT_BAD_LINE, "suberror good"); is ($$pdata{'linenum'}, 2, "linenum good"); ok ($$pdata{'filename'} =~ m"dirfile/format$", "filename good"); $GetData::SYNTAX_IGNORE } # create the dirfile system "rm -rf dirfile" if (-e "dirfile" and not -d "dirfile"); print "\n"; ok(-e "dirfile" or mkdir "dirfile"); open GLOB, ">dirfile/format" or die; print GLOB "data RAW UINT16 8\nbad line\n" or die; close GLOB or die; my $d = &GetData::open("dirfile", $GetData::RDONLY, \&callback, "extra stuff"); print "\n"; ok (defined $d, "open created an object"); my $e = &GetData::error($d); print "\n"; is ($e, $GetData::E_OK, "no error from open"); my $close_ret = $d->close(); print "\n"; is ($close_ret, 0, "close succeeded"); system "rm -rf dirfile"; libgetdata-0.9.0/bindings/perl/Build.PL.in0000640000175000017500000000361512614323564020451 0ustar alastairalastair# Copyright (C) 2011-2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # # @configure_input@ use Module::Build; # divert up_to_date to allow consideration of various other dependencies my $class = Module::Build->subclass( class => "GetData::Build", code => <<'SUBCLASS' ); sub up_to_date { my ($self, $source, $derived) = @_; if ($source eq "lib/GetData.xs") { return 0 if (not $self->up_to_date("lib/typemap", $derived)); return 0 if (not $self->up_to_date("lib/simple_funcs.xs", $derived)); return 0 if (not $self->up_to_date("@top_builddir@/src/getdata.h", $derived)); return 0 if (not $self->up_to_date("@top_builddir@/src/internal.h", $derived)); } return $self->SUPER::up_to_date($source, $derived); } SUBCLASS my $build = $class->new( dist_abstract => "Perl bindings to the GetData library", dist_author => 'The GetData Project <@PACKAGE_BUGREPORT@>', dist_version_from => "GetData.pm", extra_compiler_flags => ['@DEFS@', '-I@top_builddir@/src'], extra_linker_flags => ['-L@top_builddir@/src/.libs/', '-lgetdata'], include_dirs => ['@top_srcdir@/src'], license => 'lgpl', module_name => "GetData", pm_files => { 'GetData.pm' => 'lib/GetData.pm' }, release_status => "testing", requires => { perl => '5.6.0', 'Math::Complex' => '1.34' }, test_files => '@srcdir@/t/*.t', xs_files => { 'lib/GetData.xs' => 'lib/GetData.xs' } ); $build->create_build_script; libgetdata-0.9.0/bindings/make_parameters.c0000640000175000017500000005515312614323564021116 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "gd_config.h" #endif #include #include #include #define GD_NO_LEGACY_API #include "getdata.h" /* parameter types (used by Fortran, IDL, and PHP) */ #define GDMP_ERR 0x00000001 /* error code */ #define GDMP_DEPERR 0x00000002 /* deprecated error codes not in PHP */ #define GDMP_OFLAG 0x00000004 /* open flags not in IDL */ #define GDMP_OFLAG_L 0x00000008 /* open flags represented as LONG in IDL */ #define GDMP_ENTYPE 0x00000010 /* entry types */ #define GDMP_DTYPE 0x00000020 /* data types */ #define GDMP_RFLAG 0x00000040 /* delete and rename flags (not in IDL) */ #define GDMP_PROT 0x00000080 /* protection levels */ #define GDMP_CALLBAK 0x00000100 /* callback actions (not in IDL) */ #define GDMP_FORMAT 0x00000200 /* GD_E_FORMAT suberrors (not in IDL) */ #define GDMP_VERS 0x00000400 /* special version codes */ #define GDMP_WHENCE 0x00000800 /* gd_seek whence values */ #define GDMP_SEEK 0x00001000 /* gd_seek flags (not in IDL) */ #define GDMP_WINDOP 0x00002000 /* window operations */ #define GDMP_DESYNC 0x00004000 /* desync flags (not in IDL) */ #define GDMP_ENLIST 0x00008000 /* entry_list constants (not in IDL) */ #define GDMP_EFLAG 0x00010000 /* entry flags */ #define GDMP_MISC_I 0x00020000 /* miscellaneous constants not in IDL */ #define GDMP_MISC 0x00040000 /* miscellaneous constants */ #define CONSTANT(s,f,t) { "GD_" #s, #s, f, GD_ ## s, t } static struct { const char* lname; /* Long name */ const char* sname; /* Short name */ const char* fname; /* F77 name */ long int value; unsigned type; } constant_list[] = { CONSTANT(E_OK, "GD_EOK", GDMP_ERR), CONSTANT(E_FORMAT, "GD_EFO", GDMP_ERR), CONSTANT(E_CREAT, "GD_ECR", GDMP_ERR), CONSTANT(E_BAD_CODE, "GD_EBC", GDMP_ERR), CONSTANT(E_BAD_TYPE, "GD_EBT", GDMP_ERR), CONSTANT(E_IO, "GD_EIO", GDMP_ERR), CONSTANT(E_INTERNAL_ERROR, "GD_EIE", GDMP_ERR), CONSTANT(E_ALLOC, "GD_EAL", GDMP_ERR), CONSTANT(E_RANGE, "GD_ERA", GDMP_ERR), CONSTANT(E_LUT, "GD_ELT", GDMP_ERR), CONSTANT(E_RECURSE_LEVEL, "GD_ERL", GDMP_ERR), CONSTANT(E_BAD_DIRFILE, "GD_EBD", GDMP_ERR), CONSTANT(E_BAD_FIELD_TYPE, "GD_EBF", GDMP_ERR), CONSTANT(E_ACCMODE, "GD_EAC", GDMP_ERR), CONSTANT(E_UNSUPPORTED, "GD_UNS", GDMP_ERR), CONSTANT(E_UNKNOWN_ENCODING,"GD_EUE",GDMP_ERR), CONSTANT(E_BAD_ENTRY, "GD_EBE", GDMP_ERR), CONSTANT(E_DUPLICATE, "GD_EDU", GDMP_ERR), CONSTANT(E_DIMENSION, "GD_EDM", GDMP_ERR), CONSTANT(E_BAD_INDEX, "GD_EBI", GDMP_ERR), CONSTANT(E_BAD_SCALAR, "GD_EBS", GDMP_ERR), CONSTANT(E_BAD_REFERENCE, "GD_EBR", GDMP_ERR), CONSTANT(E_PROTECTED, "GD_EPT", GDMP_ERR), CONSTANT(E_DELETE, "GD_EDL", GDMP_ERR), CONSTANT(E_ARGUMENT, "GD_EAR", GDMP_ERR), CONSTANT(E_CALLBACK, "GD_ECB", GDMP_ERR), CONSTANT(E_EXISTS, "GD_EEX", GDMP_ERR), CONSTANT(E_UNCLEAN_DB, "GD_UCL", GDMP_ERR), CONSTANT(E_DOMAIN, "GD_EDO", GDMP_ERR), CONSTANT(E_BAD_REPR, "GD_ERP", GDMP_ERR), CONSTANT(E_BOUNDS, "GD_EBO", GDMP_ERR), CONSTANT(E_LINE_TOO_LONG, "GD_ETL", GDMP_ERR), CONSTANT(E_BAD_ENDIANNESS, "GD_EEN", GDMP_DEPERR), CONSTANT(E_BAD_PROTECTION, "GD_EBP", GDMP_DEPERR), CONSTANT(E_BAD_VERSION, "GD_EVR", GDMP_DEPERR), CONSTANT(E_OPEN_LINFILE, "GD_EOL", GDMP_DEPERR), CONSTANT(E_FLUSH, "GD_EFL", GDMP_DEPERR), CONSTANT(E_OPEN, "GD_EOP", GDMP_DEPERR), CONSTANT(E_OPEN_FRAGMENT, "GD_EOF", GDMP_DEPERR), CONSTANT(E_OPEN_INCLUDE, "GD_EOI", GDMP_DEPERR), CONSTANT(E_RAW_IO, "GD_ERW", GDMP_DEPERR), CONSTANT(E_TRUNC, "GD_ETR", GDMP_DEPERR), CONSTANT(RDONLY, "GD_RO", GDMP_OFLAG_L), CONSTANT(RDWR, "GD_RW", GDMP_OFLAG_L), CONSTANT(FORCE_ENDIAN, "GD_FE", GDMP_OFLAG), CONSTANT(BIG_ENDIAN, "GD_BE", GDMP_OFLAG_L), CONSTANT(LITTLE_ENDIAN, "GD_LE", GDMP_OFLAG_L), CONSTANT(CREAT, "GD_CR", GDMP_OFLAG), CONSTANT(EXCL, "GD_EX", GDMP_OFLAG), CONSTANT(TRUNC, "GD_TR", GDMP_OFLAG), CONSTANT(PEDANTIC, "GD_PE", GDMP_OFLAG), CONSTANT(FORCE_ENCODING, "GD_FC", GDMP_OFLAG), CONSTANT(VERBOSE, "GD_VB", GDMP_OFLAG_L), CONSTANT(IGNORE_DUPS, "GD_ID", GDMP_OFLAG), CONSTANT(IGNORE_REFS, "GD_IR", GDMP_OFLAG), CONSTANT(PRETTY_PRINT, "GD_PP", GDMP_OFLAG_L), CONSTANT(ARM_ENDIAN, "GD_AE", GDMP_OFLAG_L), CONSTANT(NOT_ARM_ENDIAN, "GD_NA", GDMP_OFLAG_L), CONSTANT(PERMISSIVE, "GD_PM", GDMP_OFLAG), CONSTANT(TRUNCSUB, "GD_TS", GDMP_OFLAG), CONSTANT(AUTO_ENCODED, "GDE_AU", GDMP_OFLAG), CONSTANT(BZIP2_ENCODED, "GDE_BZ", GDMP_OFLAG_L), CONSTANT(FLAC_ENCODED, "GDE_FL", GDMP_OFLAG_L), CONSTANT(GZIP_ENCODED, "GDE_GZ", GDMP_OFLAG_L), CONSTANT(LZMA_ENCODED, "GDE_LZ", GDMP_OFLAG_L), CONSTANT(SIE_ENCODED, "GDE_SI", GDMP_OFLAG_L), CONSTANT(SLIM_ENCODED, "GDE_SL", GDMP_OFLAG_L), CONSTANT(TEXT_ENCODED, "GDE_TX", GDMP_OFLAG_L), CONSTANT(UNENCODED, "GDE_UN", GDMP_OFLAG_L), CONSTANT(ZZSLIM_ENCODED, "GDE_ZS", GDMP_OFLAG_L), CONSTANT(ZZIP_ENCODED, "GDE_ZZ", GDMP_OFLAG_L), CONSTANT(NO_ENTRY, "GD_NOE", GDMP_ENTYPE), CONSTANT(RAW_ENTRY, "GD_RWE", GDMP_ENTYPE), CONSTANT(LINCOM_ENTRY, "GD_LCE", GDMP_ENTYPE), CONSTANT(LINTERP_ENTRY, "GD_LTE", GDMP_ENTYPE), CONSTANT(BIT_ENTRY, "GD_BTE", GDMP_ENTYPE), CONSTANT(MULTIPLY_ENTRY, "GD_MTE", GDMP_ENTYPE), CONSTANT(PHASE_ENTRY, "GD_PHE", GDMP_ENTYPE), CONSTANT(INDEX_ENTRY, "GD_IXE", GDMP_ENTYPE), CONSTANT(POLYNOM_ENTRY, "GD_PNE", GDMP_ENTYPE), CONSTANT(SBIT_ENTRY, "GD_SBE", GDMP_ENTYPE), CONSTANT(DIVIDE_ENTRY, "GD_DVE", GDMP_ENTYPE), CONSTANT(RECIP_ENTRY, "GD_RCE", GDMP_ENTYPE), CONSTANT(WINDOW_ENTRY, "GD_WDE", GDMP_ENTYPE), CONSTANT(MPLEX_ENTRY, "GD_MXE", GDMP_ENTYPE), CONSTANT(CONST_ENTRY, "GD_COE", GDMP_ENTYPE), CONSTANT(CARRAY_ENTRY, "GD_CAE", GDMP_ENTYPE), CONSTANT(STRING_ENTRY, "GD_STE", GDMP_ENTYPE), CONSTANT(NULL, "GD_NUL", GDMP_DTYPE), CONSTANT(UINT8, "GD_U8", GDMP_DTYPE), CONSTANT(INT8, "GD_I8", GDMP_DTYPE), CONSTANT(UINT16, "GD_U16", GDMP_DTYPE), CONSTANT(INT16, "GD_I16", GDMP_DTYPE), CONSTANT(UINT32, "GD_U32", GDMP_DTYPE), CONSTANT(INT32, "GD_I32", GDMP_DTYPE), CONSTANT(UINT64, "GD_U64", GDMP_DTYPE), CONSTANT(INT64, "GD_I64", GDMP_DTYPE), CONSTANT(FLOAT32, "GD_F32", GDMP_DTYPE), CONSTANT(FLOAT64, "GD_F64", GDMP_DTYPE), CONSTANT(COMPLEX64, "GD_C64", GDMP_DTYPE), CONSTANT(COMPLEX128, "GDC128", GDMP_DTYPE), CONSTANT(DEL_META, "GDD_MT", GDMP_RFLAG), CONSTANT(DEL_DATA, "GDD_DT", GDMP_RFLAG), CONSTANT(DEL_DEREF, "GDD_DR", GDMP_RFLAG), CONSTANT(DEL_FORCE, "GDD_FO", GDMP_RFLAG), CONSTANT(REN_DATA, "GDR_DT", GDMP_RFLAG), CONSTANT(REN_UPDB, "GDR_UP", GDMP_RFLAG), CONSTANT(REN_DANGLE, "GDR_DL", GDMP_RFLAG), CONSTANT(REN_FORCE, "GDR_FO", GDMP_RFLAG), CONSTANT(PROTECT_NONE, "GDPR_N", GDMP_PROT), CONSTANT(PROTECT_FORMAT, "GDPR_F", GDMP_PROT), CONSTANT(PROTECT_DATA, "GDPR_D", GDMP_PROT), CONSTANT(PROTECT_ALL, "GDPR_A", GDMP_PROT), CONSTANT(SYNTAX_ABORT, "GDSX_A", GDMP_CALLBAK), CONSTANT(SYNTAX_RESCAN, "GDSX_S", GDMP_CALLBAK), CONSTANT(SYNTAX_IGNORE, "GDSX_I", GDMP_CALLBAK), CONSTANT(SYNTAX_CONTINUE, "GDSX_C", GDMP_CALLBAK), CONSTANT(E_FORMAT_BAD_SPF, "GDF_SF", GDMP_FORMAT), CONSTANT(E_FORMAT_N_FIELDS, "GDF_NF", GDMP_FORMAT), CONSTANT(E_FORMAT_N_TOK, "GDF_NT", GDMP_FORMAT), CONSTANT(E_FORMAT_NUMBITS, "GDF_NB", GDMP_FORMAT), CONSTANT(E_FORMAT_BITNUM, "GDF_BN", GDMP_FORMAT), CONSTANT(E_FORMAT_BITSIZE, "GDF_SZ", GDMP_FORMAT), CONSTANT(E_FORMAT_CHARACTER,"GDF_CH", GDMP_FORMAT), CONSTANT(E_FORMAT_BAD_LINE, "GDF_LI", GDMP_FORMAT), CONSTANT(E_FORMAT_RES_NAME, "GDF_RN", GDMP_FORMAT), CONSTANT(E_FORMAT_ENDIAN, "GDF_EN", GDMP_FORMAT), CONSTANT(E_FORMAT_BAD_TYPE, "GDF_TY", GDMP_FORMAT), CONSTANT(E_FORMAT_BAD_NAME, "GDF_NA", GDMP_FORMAT), CONSTANT(E_FORMAT_UNTERM, "GDF_UM", GDMP_FORMAT), CONSTANT(E_FORMAT_METARAW, "GDF_MR", GDMP_FORMAT), CONSTANT(E_FORMAT_NO_PARENT,"GDF_PA", GDMP_FORMAT), CONSTANT(E_FORMAT_DUPLICATE,"GDF_DU", GDMP_FORMAT), CONSTANT(E_FORMAT_LOCATION, "GDF_LO", GDMP_FORMAT), CONSTANT(E_FORMAT_PROTECT, "GDF_PR", GDMP_FORMAT), CONSTANT(E_FORMAT_LITERAL, "GDF_LT", GDMP_FORMAT), CONSTANT(E_FORMAT_WINDOP, "GDF_WO", GDMP_FORMAT), CONSTANT(E_FORMAT_META_META,"GDF_MM", GDMP_FORMAT), CONSTANT(E_FORMAT_ALIAS, "GDF_AL", GDMP_FORMAT), CONSTANT(E_FORMAT_MPLEXVAL, "GDF_MV", GDMP_FORMAT), CONSTANT(VERSION_CURRENT, "GDSV_C", GDMP_VERS), CONSTANT(VERSION_LATEST, "GDSV_L", GDMP_VERS), CONSTANT(VERSION_EARLIEST, "GDSV_E", GDMP_VERS), CONSTANT(SEEK_SET, "GDSK_S", GDMP_WHENCE), CONSTANT(SEEK_CUR, "GDSK_C", GDMP_WHENCE), CONSTANT(SEEK_END, "GDSK_E", GDMP_WHENCE), CONSTANT(SEEK_WRITE, "GDSK_W", GDMP_SEEK), CONSTANT(WINDOP_UNK, "GDW_UN", GDMP_WINDOP), CONSTANT(WINDOP_EQ, "GDW_EQ", GDMP_WINDOP), CONSTANT(WINDOP_GE, "GDW_GE", GDMP_WINDOP), CONSTANT(WINDOP_GT, "GDW_GT", GDMP_WINDOP), CONSTANT(WINDOP_LE, "GDW_LE", GDMP_WINDOP), CONSTANT(WINDOP_LT, "GDW_LT", GDMP_WINDOP), CONSTANT(WINDOP_NE, "GDW_NE", GDMP_WINDOP), CONSTANT(WINDOP_SET, "GDW_ST", GDMP_WINDOP), CONSTANT(WINDOP_CLR, "GDW_CL", GDMP_WINDOP), CONSTANT(DESYNC_PATHCHECK, "GDDS_P", GDMP_DESYNC), CONSTANT(DESYNC_REOPEN, "GDDS_O", GDMP_DESYNC), CONSTANT(ALL_ENTRIES, "GDEN_X", GDMP_ENLIST), CONSTANT(VECTOR_ENTRIES, "GDEN_V", GDMP_ENLIST), CONSTANT(SCALAR_ENTRIES, "GDEN_S", GDMP_ENLIST), CONSTANT(ALIAS_ENTRIES, "GDEN_A", GDMP_ENLIST), CONSTANT(ENTRIES_HIDDEN, "GDEN_H", GDMP_ENLIST), CONSTANT(ENTRIES_NOALIAS, "GDEN_N", GDMP_ENLIST), CONSTANT(EN_CALC, "GDE_CA", GDMP_EFLAG), CONSTANT(EN_HIDDEN, "GDE_HI", GDMP_EFLAG), CONSTANT(EN_COMPSCAL, "GDE_CS", GDMP_EFLAG), CONSTANT(ALL_FRAGMENTS, "GD_ALL", GDMP_MISC), CONSTANT(DEFAULT_LOOKBACK, "GDLB_D", GDMP_MISC), CONSTANT(DIRFILE_STANDARDS_VERSION, "GD_DSV", GDMP_MISC), CONSTANT(HERE, "GD_HER", GDMP_MISC_I), CONSTANT(LOOKBACK_ALL, "GDLB_A", GDMP_MISC_I), CONSTANT(MAX_LINE_LENGTH, "GD_MLL", GDMP_MISC), { NULL } }; static void parameter(const char* cname, const char* name, int value, int free_form) { if (free_form) printf("integer, parameter :: %s=%i\\\n", cname, value); else printf( "C Corresponding to %s\\\n" " INTEGER %s\\\n" " PARAMETER (%s=%i)\\\n", cname, name, name, value); } void Fortran(void) { int i, j; char c; for (i = 0; i < 2; ++i) { c = (i == 0) ? 'C' : '!'; if (i == 0) printf("s/@PARAMETERS@/\\\nC Error codes\\\n"); else printf("s/@PARAMETERS95@/\\\n! Error codes\\\n"); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_ERR) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Deprecated error codes\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_DEPERR) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Open flags\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type & (GDMP_OFLAG | GDMP_OFLAG_L)) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Entry types\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_ENTYPE) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf( "\\\n%c Data types -- the unsigned types won't work when passed as\\\n" "%c a return type; they are defined because they\\\n" "%c may be returned by %s or %s\\\n", c, c, c, (i == 0) ? "GDGERW" : "fget_entry", (i == 0) ? "GDNTYP" : "fget_native_type"); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_DTYPE) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Delete and Rename flags\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_RFLAG) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Protection levels\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_PROT) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Callback actions\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_CALLBAK) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Syntax suberrors\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_FORMAT) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Special version codes\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_VERS) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Seek flags\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type & (GDMP_WHENCE | GDMP_SEEK)) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Window operations\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_WINDOP) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Desync flags\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_DESYNC) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Entry List codes and flags\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_ENLIST) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Entry object flags\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type == GDMP_EFLAG) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("\\\n%c Miscellaneous parameters\\\n", c); for (j = 0; constant_list[j].lname != NULL; ++j) if (constant_list[j].type & (GDMP_MISC | GDMP_MISC_I)) parameter(constant_list[j].lname, constant_list[j].fname, constant_list[j].value, i); printf("/\n"); } printf("s/@GD_MAX_LINE_LENGTH@/%i/\n", GD_MAX_LINE_LENGTH); } void Python(void) { int i; printf( "/* This code is automatically generated. " "Changes made here will be lost. */\n#define NO_IMPORT_ARRAY\n" "#include \"pygetdata.h\"\n" "const struct gdpy_constant_t gdpy_constant_list[] = {\n"); for (i = 0; constant_list[i].lname != NULL; ++i) printf("{\"%s\", %s}, ", constant_list[i].sname, constant_list[i].lname); /* Python numerical type aliases */ printf( "{\"INT\", GD_INT32}, " "{\"LONG\", GD_INT64}, " "{\"ULONG\", GD_UINT64}, " "{\"FLOAT\", GD_FLOAT64}, " "{\"COMPLEX\", GD_COMPLEX128}, " "{NULL, 0}};\n" ); } void IDL(void) { int i, n; /* The structure */ printf( "/* This code is automatically generated. " "Changes made here will be lost. */\n#define _LARGEFILE64_SOURCE 1\n" "#include \n#include \n" "IDL_STRUCT_TAG_DEF gdidl_constants[] = {\n" ); for (i = 0; constant_list[i].lname != NULL; ++i) if (constant_list[i].type & (GDMP_ERR | GDMP_DEPERR | GDMP_OFLAG_L | GDMP_ENTYPE | GDMP_DTYPE | GDMP_PROT | GDMP_VERS | GDMP_WHENCE | GDMP_WINDOP | GDMP_EFLAG | GDMP_MISC)) { printf("{ \"%s\", 0, (void*)IDL_TYP_%s }, ", constant_list[i].sname, (constant_list[i].type == GDMP_OFLAG_L) ? "LONG" : "INT"); } printf("{ NULL }};\n"); /* The initialisation function */ printf( "extern IDL_StructDefPtr gdidl_const_def;" "IDL_VPTR gdidl_generate_constants(int argc, IDL_VPTR argv[], char *argk)" "{" "IDL_VPTR r;" "IDL_MEMINT dims[] = { 1 };" "void* data = IDL_MakeTempStruct(gdidl_const_def, 1,dims, &r, IDL_TRUE);" "\n"); for (n = i = 0; constant_list[i].lname != NULL; ++i) if (constant_list[i].type & (GDMP_ERR | GDMP_DEPERR | GDMP_OFLAG_L | GDMP_ENTYPE | GDMP_DTYPE | GDMP_PROT | GDMP_VERS | GDMP_WHENCE | GDMP_WINDOP | GDMP_EFLAG | GDMP_MISC)) { printf("*(IDL_%s*)(data + IDL_StructTagInfoByIndex(gdidl_const_def, %i, " "IDL_MSG_LONGJMP, NULL)) = %li;\n", (constant_list[i].type == GDMP_OFLAG_L) ? "LONG" : "INT", n++, constant_list[i].value); } printf("return r; }\n"); } void Perl(void) { int i; printf("s/@PARAMETERS@/"); printf("our $VERSION = %i.%04i;\\\n", GETDATA_MAJOR, GETDATA_MINOR * 100 + GETDATA_REVISION); for (i = 0; constant_list[i].lname != NULL; ++i) printf("our $%s = %li;\\\n", constant_list[i].sname, constant_list[i].value); printf("/\n"); printf("s/@PARAMLIST@/"); for (i = 0; constant_list[i].lname != NULL; ++i) printf("%s ", constant_list[i].sname); printf("/\n"); } /* Since this file gets installed, we're a little more chatty here than usual */ void MatLab(void) { int i; fputs("function GD = getdata_constants()\n", stdout); fputs("% GETDATA_CONSTANTS Define GetData symbolic constants\n" "%\n" "% GETDATA_CONSTANTS produces a structure containing the symbolic " "constants\n" "% used by the GetData bindings. Member names of the structure " "correspond to\n" "% names of symbolic constants used in the GetData C API.\n" "%\n" "% Although it can be used in immediate context by doing something " "like\n" "%\n" "% >> GETDATA_CONSTANTS.FLOAT64\n" "%\n" "% ans =\n" "%\n" "% 136\n" "%\n" "% it is usually assigned to a variable, which prevents having to " "evaluate this\n" "% function more than once. We recommend calling this variable GD:\n" "%\n" "% >> GD = GETDATA_CONSTANTS;\n" "% >> GD.FLOAT64\n" "%\n" "% ans =\n" "%\n" "% 136\n" "%\n" "% providing more succinct symbol names which closely resemble the " "cor-\n" "% respondng C API symbol names (e.g. GD_FLOAT64). In the " "documentation for\n" "% these bindings, we assume such a GD variable has been defined, and " "refer to\n" "% symbolic constants as GD.<...> when necessary.\n" "%\n" "% See also GETDATA\n\n", stdout); fputs(" GD = struct(...\n" " 'VERSION', '" VERSION "'", stdout); for (i = 0; constant_list[i].lname != NULL; ++i) printf(", ...\n '%s', int32(%li)", constant_list[i].sname, constant_list[i].value); printf(" ...\n );\nend\n"); fputs("\n% Copyright (C) 2013 D. V. Wiebe\n%\n%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%" "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n%\n" "% This file is part of the GetData project.\n%\n" "% GetData is free software; you can redistribute it and/or modify it " "under\n" "% the terms of the GNU Lesser General Public License as published by " "the\n" "% Free Software Foundation; either version 2.1 of the License, or (at " "your\n" "% option) any later version.\n%\n" "% GetData is distributed in the hope that it will be useful, but " "WITHOUT\n" "% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY " "or\n" "% FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public\n" "% License for more details.\n%\n" "% You should have received a copy of the GNU Lesser General Public " "License\n" "% along with GetData; if not, write to the Free Software Foundation, " "Inc.,\n" "% 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n", stdout); } void PHP(void) { int i; puts( "/* This code is automatically generated. " "Changes made here will be lost. */\n" "#include \"php_getdata.h\"\n" "void gdphp_register_constants(int module_number) {" "dtrace(\"%i\", module_number); TSRMLS_FETCH();" ); for (i = 0; constant_list[i].lname != NULL; ++i) if (constant_list[i].type != GDMP_DEPERR) printf("zend_register_long_constant(ZEND_STRS(\"%s\"), %li, CONST_CS, " "module_number TSRMLS_CC);", constant_list[i].lname, constant_list[i].value); puts("dreturnvoid();}"); } int main(int argc, char* argv[]) { if (argv[1][0] == 'f') Fortran(); else if (argv[1][0] == 'p') Python(); else if (argv[1][0] == 'i') IDL(); else if (argv[1][0] == 'P') Perl(); else if (argv[1][0] == 'm') MatLab(); else if (argv[1][0] == 'h') PHP(); else return 1; return 0; } libgetdata-0.9.0/bindings/python/0000740000175000017500000000000012614323564017120 5ustar alastairalastairlibgetdata-0.9.0/bindings/python/Makefile.in0000640000175000017500000006330412614323564021175 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/python DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/setup.py.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = setup.py 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)$(pythondir)" SCRIPTS = $(nodist_python_SCRIPTS) 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 cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2009, 2013, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SUBDIRS = test nodist_python_SCRIPTS = pygetdata.so BUILT_SOURCES = pyconstants.c EXTRA_DIST = pydirfile.c pygetdata.c pyentry.c pygetdata.h pyfragment.c distutils_path = build/lib.${PYTHON_PLATFORM}-${PYTHON_VERSION} all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: $(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 bindings/python/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/python/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): setup.py: $(top_builddir)/config.status $(srcdir)/setup.py.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-nodist_pythonSCRIPTS: $(nodist_python_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nodist_python_SCRIPTS)'; test -n "$(pythondir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pythondir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pythondir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(pythondir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pythondir)$$dir" || exit $$?; \ } \ ; done uninstall-nodist_pythonSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nodist_python_SCRIPTS)'; test -n "$(pythondir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(pythondir)'; $(am__uninstall_files_from_dir) 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(SCRIPTS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pythondir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-local 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-nodist_pythonSCRIPTS 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-nodist_pythonSCRIPTS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am 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-nodist_pythonSCRIPTS \ 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-am uninstall uninstall-am \ uninstall-nodist_pythonSCRIPTS pygetdata.so: ${distutils_path}/pygetdata.so cp $< $@ ${distutils_path}/pygetdata.so: setup.py ${BUILT_SOURCES} ${EXTRA_DIST} ${PYTHON} setup.py build pyconstants.c: ../make_parameters ../make_parameters p > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters clean-local: @MAKE_PYBINDINGS_TRUE@ if [ -e setup.py ]; then ${PYTHON} setup.py clean; fi rm -rf build pygetdata.so ${BUILT_SOURCES} debug.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: libgetdata-0.9.0/bindings/python/pyfragment.c0000640000175000017500000003660212614323564021451 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define NO_IMPORT_ARRAY #include "pygetdata.h" /* Fragment */ static void gdpy_fragment_delete(struct gdpy_fragment_t *self) { dtrace("%p", self); Py_XDECREF(self->dirfile); PyObject_Del(self); dreturnvoid(); } static PyObject *gdpy_fragment_create(PyTypeObject *type, PyObject *args, PyObject *keys) { struct gdpy_fragment_t *self; dtrace("%p, %p, %p", type, args, keys); self = (struct gdpy_fragment_t*)type->tp_alloc(type, 0); if (self) self->dirfile = NULL; dreturn("%p", self); return (PyObject*)self; } static int gdpy_fragment_init(struct gdpy_fragment_t *self, PyObject *args, PyObject *keys) { char *keywords[] = {"dirfile", "index", NULL}; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "O!i:pygetdata.fragment.__init__", keywords, &gdpy_dirfile, &self->dirfile, self->n)) { dreturn("%i", -1); return -1; } Py_INCREF(self->dirfile); dreturn("%i", 0); return 0; } static PyObject *gdpy_fragment_getindex(struct gdpy_fragment_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); pyobj = PyInt_FromLong(self->n); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_fragment_getname(struct gdpy_fragment_t *self, void *closure) { const char *name; PyObject *pyobj; dtrace("%p, %p", self, closure); name = gd_fragmentname(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); pyobj = PyString_FromString(name); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_fragment_getencoding(struct gdpy_fragment_t *self, void *closure) { unsigned long enc; PyObject *pyobj; dtrace("%p, %p", self, closure); enc = gd_encoding(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); pyobj = PyLong_FromUnsignedLong(enc); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_fragment_setencoding(struct gdpy_fragment_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "encoding", "recode", NULL }; unsigned long enc; int recode = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "k|i:pygetdata.fragment.alter_encoding", keywords, &enc, &recode)) { dreturn("%p", NULL); return NULL; } gd_alter_encoding(self->dirfile->D, enc, self->n, recode); PYGD_CHECK_ERROR(self->dirfile->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_fragment_getendianness(struct gdpy_fragment_t *self, void *closure) { unsigned long end; PyObject *pyobj; dtrace("%p, %p", self, closure); end = gd_endianness(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); pyobj = PyLong_FromUnsignedLong(end); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_fragment_setendianness(struct gdpy_fragment_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "endianness", "recode", NULL }; unsigned long end; int recode = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "k|i:pygetdata.fragment.alter_endianness", keywords, &end, &recode)) { dreturn("%p", NULL); return NULL; } gd_alter_endianness(self->dirfile->D, end, self->n, recode); PYGD_CHECK_ERROR(self->dirfile->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_fragment_rewrite(struct gdpy_fragment_t *self) { dtrace("%p", self); gd_rewrite_fragment(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_fragment_getoffset(struct gdpy_fragment_t *self, void *closure) { gd_off64_t offset; PyObject *pyobj; dtrace("%p, %p", self, closure); offset = gd_frameoffset64(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); pyobj = PyLong_FromLongLong((long long)offset); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_fragment_setoffset(struct gdpy_fragment_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "frameoffset", "recode", NULL }; long long offset; int recode = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "L|i:pygetdata.fragment.alter_frameoffset", keywords, &offset, &recode)) { dreturn("%p", NULL); return NULL; } gd_alter_frameoffset64(self->dirfile->D, (gd_off64_t)offset, self->n, recode); PYGD_CHECK_ERROR(self->dirfile->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_fragment_getparent(struct gdpy_fragment_t *self, void *closure) { int parent; PyObject *pyobj; dtrace("%p, %p", self, closure); parent = gd_parent_fragment(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); pyobj = PyInt_FromLong(parent); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_fragment_getprotection(struct gdpy_fragment_t *self, void *closure) { int prot; PyObject *pyobj; dtrace("%p, %p", self, closure); prot = gd_protection(self->dirfile->D, self->n); PYGD_CHECK_ERROR(self->dirfile->D, NULL); pyobj = PyInt_FromLong(prot); dreturn("%p", pyobj); return pyobj; } static int gdpy_fragment_setprotection(struct gdpy_fragment_t *self, PyObject *value, void *closure) { int p; dtrace("%p, %p, %p", self, value, closure); p = PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } gd_alter_protection(self->dirfile->D, p, self->n); PYGD_CHECK_ERROR(self->dirfile->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_fragment_getprefix(struct gdpy_fragment_t *self, void *closure) { char *prefix, *suffix; PyObject *pyobj; dtrace("%p, %p", self, closure); gd_fragment_affixes(self->dirfile->D, self->n, &prefix, &suffix); PYGD_CHECK_ERROR(self->dirfile->D, NULL); free(suffix); if (prefix == NULL) { Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } pyobj = PyString_FromString(prefix); free(prefix); dreturn("%p", pyobj); return pyobj; } static int gdpy_fragment_setprefix(struct gdpy_fragment_t *self, PyObject *value, void *closure) { const char *prefix; dtrace("%p, %p, %p", self, value, closure); prefix = PyString_AsString(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } gd_alter_affixes(self->dirfile->D, self->n, prefix, NULL); PYGD_CHECK_ERROR(self->dirfile->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_fragment_getsuffix(struct gdpy_fragment_t *self, void *closure) { char *prefix, *suffix; PyObject *pyobj; dtrace("%p, %p", self, closure); gd_fragment_affixes(self->dirfile->D, self->n, &prefix, &suffix); PYGD_CHECK_ERROR(self->dirfile->D, NULL); free(prefix); if (suffix == NULL) { Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } pyobj = PyString_FromString(suffix); free(suffix); dreturn("%p", pyobj); return pyobj; } static int gdpy_fragment_setsuffix(struct gdpy_fragment_t *self, PyObject *value, void *closure) { const char *suffix; dtrace("%p, %p, %p", self, value, closure); suffix = PyString_AsString(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } gd_alter_affixes(self->dirfile->D, self->n, NULL, suffix); PYGD_CHECK_ERROR(self->dirfile->D, -1); dreturn("%i", 0); return 0; } static PyGetSetDef gdpy_fragment_getset[] = { { "encoding", (getter)gdpy_fragment_getencoding, NULL, "The encoding scheme of this fragment. This will be one of the\n" "pygetdata.*_ENCODED symbols. To change this value, use the\n" "alter_encoding method.", NULL }, { "endianness", (getter)gdpy_fragment_getendianness, NULL, "The byte sex of this fragment. This will be either\n" "pygetdata.BIG_ENDIAN or pygetdata.LITTLE_ENDIAN, bitwise or'd with\n" "pygetdata.ARM_ENDIAN or pygetdata.NOT_ARM_ENDIAN. To change this\n" "value, use the alter_endianness method.", NULL }, { "frameoffset", (getter)gdpy_fragment_getoffset, NULL, "The frame offset of this fragment. To change this value, use the\n" "alter_frameoffset method.", NULL }, { "index", (getter)gdpy_fragment_getindex, NULL, "The index number of this fragment. This is simply the index value\n" "passed to the constructor.", NULL }, { "name", (getter)gdpy_fragment_getname, NULL, "The pathname of this fragment. This attribute cannot be changed.\n" "See gd_fragmentname(3).", NULL }, { "parent", (getter)gdpy_fragment_getparent, NULL, "The fragment index of this fragment's parent. Since the primary\n" "format file has no parent, an error will occur if an attempt is made\n" "to read this attribute for the primary format file. This value\n" "cannot be changed. To move a format file fragment to a different\n" "parent fragment, use dirfile.uninclude() and dirfile.include().", NULL }, { "prefix", (getter)gdpy_fragment_getprefix, (setter)gdpy_fragment_setprefix, "The prefix applied to all fields defined in this fragment and\n" "subfragments. See gd_fragment_affixes(3).", NULL }, { "protection", (getter)gdpy_fragment_getprotection, (setter)gdpy_fragment_setprotection, "The (advisory) protection level of this fragment. This will be one\n" "the pygetdata.PROTECT_* symbols. The protection level of this\n" "fragment can be changed by assigning to this attribute. See\n" "gd_protection(3) and gd_alter_protection(3).", NULL }, { "suffix", (getter)gdpy_fragment_getsuffix, (setter)gdpy_fragment_setsuffix, "The suffix applied to all fields defined in this fragment and\n" "subfragments. See gd_fragment_affixes(3).", NULL }, { NULL } }; static PyMethodDef gdpy_fragment_methods[] = { {"alter_encoding", (PyCFunction)gdpy_fragment_setencoding, METH_VARARGS | METH_KEYWORDS, "alter_encoding(encoding [, recode])\n\n" "Change the encoding scheme of this fragment. The 'encoding'\n" "parameter should be one of the pygetdata.*_ENCODED symbols\n" "(excluding pygetdata.AUTO_ENCODED). If 'recode' is given, and is\n" "non-zero, the RAW files affected by this change will be converted\n" "to the new encoding. See gd_alter_encoding(3)." }, {"alter_endianness", (PyCFunction)gdpy_fragment_setendianness, METH_VARARGS | METH_KEYWORDS, "alter_endianness(endianness [, recode])\n\n" "Change the byte sex of this fragment. The 'endianness' parameter\n" "should be pygetdata.LITTLE_ENDIAN, pygetdata.BIG_ENDIAN, or some\n" "combination of these two as described in the gd_alter_endianness\n" /* -----------------------------------------------------------------| */ "manual page, and possibly bitwise or'd with pygetdata.ARM_ENDIAN or\n" "pygetdata.NOT_ARM_ENDIAN. If 'recode' is given, and is non-zero,\n" "the RAW files affected by this change will be converted to the byte\n" "sex. See gd_alter_endianness(3)." }, {"alter_frameoffset", (PyCFunction)gdpy_fragment_setoffset, METH_VARARGS | METH_KEYWORDS, "alter_frameoffset(frameoffset [, recode])\n\n" "Change the frame offset of this fragment. The 'frameoffset'\n" "parameter should specify the new frame offset. If 'recode' is\n" "given, and is non-zero, the RAW files affected bt this change will\n" "be shifted appropriately for the new frame offset. See\n" "gd_alter_frameoffset(3)." }, {"rewrite", (PyCFunction)gdpy_fragment_rewrite, METH_NOARGS, "rewrite()\n\n" "Force re-writing of this fragment on disc, regardless of whether\n" "it has been modified or not. See gd_rewrite_fragment(3)." }, { NULL, NULL, 0, NULL } }; #define FRAGMENT_DOC \ "fragment(dirfile, index)\n\n"\ "Returns a fragment object which describes the fragment-specific metadata\n"\ "of one format file fragment in a dirfile. The 'dirfile' parameter\n"\ "should be a dirfile object. Index is the fragment index of the desired\n"\ "format file fragment. This constructor is equivalent to calling\n\n"\ " dirfile.fragment(index)\n\n"\ "The fragment object remains connected to its dirfile, and changes made\n"\ "to the fragment object are propagated back to the dirfile. This object\n"\ /* ---------------------------------------------------------------------| */\ "creates a new reference to the supplied dirfile. Calling\n"\ "close() or discard() on the dirfile and then attempting to access a\n"\ "fragment object previously derived from that dirfile will result in an\n"\ "error." PyTypeObject gdpy_fragment = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "pygetdata.fragment", /* tp_name */ sizeof(struct gdpy_fragment_t),/* tp_basicsize */ 0, /* tp_itemsize */ (destructor)gdpy_fragment_delete, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ FRAGMENT_DOC, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ gdpy_fragment_methods, /* tp_methods */ 0, /* tp_members */ gdpy_fragment_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)gdpy_fragment_init, /* tp_init */ 0, /* tp_alloc */ gdpy_fragment_create, /* tp_new */ }; libgetdata-0.9.0/bindings/python/pyentry.c0000640000175000017500000022474412614323564021015 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define NO_IMPORT_ARRAY #include "pygetdata.h" static const char *gdpy_entry_type_names[] = { "NO_ENTRY", /* 0x00 */ "RAW_ENTRY", /* 0x01 */ "LINCOM_ENTRY", /* 0x02 */ "LINTERP_ENTRY", /* 0x03 */ "BIT_ENTRY", /* 0x04 */ "MULTIPLY_ENTRY", /* 0x05 */ "PHASE_ENTRY", /* 0x06 */ "INDEX_ENTRY", /* 0x07 */ "POLYNOM_ENTRY", /* 0x08 */ "SBIT_ENTRY", /* 0x09 */ "DIVIDE_ENTRY", /* 0x0A */ "RECIP_ENTRY", /* 0x0B */ "WINDOW_ENTRY", /* 0x0C */ "MPLEX_ENTRY", /* 0x0D */ NULL, /* 0x0E */ NULL, /* 0x0F */ "CONST_ENTRY", /* 0x10 */ "STRING_ENTRY", /* 0x11 */ "CARRAY_ENTRY", /* 0x12 */ }; static char *gdpy_dup_pystring(PyObject *obj) { char *s; dtrace("%p", obj); s = PyString_AsString(obj); if (s != NULL) { s = strdup(s); if (s == NULL) PyErr_NoMemory(); } dreturn("%p", s); return s; } static void gdpy_entry_delete(struct gdpy_entry_t *self) { dtrace("%p", self); gd_free_entry_strings(self->E); free(self->E); PyObject_Del(self); dreturnvoid(); } static PyObject *gdpy_entry_create(PyTypeObject *type, PyObject *args, PyObject *keys) { struct gdpy_entry_t *self; dtrace("%p, %p, %p", type, args, keys); self = (struct gdpy_entry_t*)type->tp_alloc(type, 0); if (self) { self->E = NULL; } dreturn("%p", self); return (PyObject*)self; } static void gdpy_set_scalar_from_pyobj(PyObject *pyobj, gd_type_t type, char **scalar, void *data) { dtrace("%p, %x, %p, %p", pyobj, type, scalar, data); /* FIXME */ if (PyString_Check(pyobj)) *scalar = gdpy_dup_pystring(pyobj); else { *scalar = NULL; switch (type) { case GD_UINT8: *(uint8_t*)data = (uint8_t)PyInt_AsUnsignedLongMask(pyobj); break; case GD_INT8: *(int8_t*)data = (int8_t)PyInt_AsLong(pyobj); break; case GD_UINT16: *(uint16_t*)data = (uint16_t)PyInt_AsUnsignedLongMask(pyobj); break; case GD_INT16: *(int16_t*)data = (int16_t)PyInt_AsLong(pyobj); break; case GD_UINT32: *(uint32_t*)data = (uint32_t)PyLong_AsUnsignedLong(pyobj); break; case GD_INT32: *(int32_t*)data = (int32_t)PyLong_AsLong(pyobj); break; case GD_UINT64: if (PyLong_Check(pyobj)) *(uint64_t*)data = PyLong_AsUnsignedLongLong(pyobj); else *(uint64_t*)data = PyInt_AsUnsignedLongLongMask(pyobj); break; case GD_INT64: *(int64_t*)data = (int64_t)PyLong_AsLongLong(pyobj); break; case GD_FLOAT32: *(float*)data = (float)PyFloat_AsDouble(pyobj); break; case GD_FLOAT64: *(double*)data = PyFloat_AsDouble(pyobj); break; case GD_COMPLEX64: gdpy_as_complex((float*)data, pyobj); break; case GD_COMPLEX128: gdpy_as_complex((double*)data, pyobj); break; default: PyErr_Format(PyExc_RuntimeError, "unexpected field type (%x) inside %s", type, __func__); } } dreturnvoid(); } static void gdpy_set_entry_from_tuple(gd_entry_t *E, PyObject *tuple, const char *name) { PyObject *parm1; PyObject *parm2; PyObject *parm3; PyObject *obj; int i, count, size, min; dtrace("%p, %p, \"%s\"", E, tuple, name); switch (E->field_type) { case GD_INDEX_ENTRY: case GD_STRING_ENTRY: min = 0; break; case GD_CONST_ENTRY: min = 1; break; case GD_RAW_ENTRY: case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_SBIT_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_RECIP_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_CARRAY_ENTRY: min = 2; break; case GD_LINCOM_ENTRY: min = 3; break; case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: min = 4; break; default: PyErr_Format(PyExc_TypeError, "%s: unrecognised field type", name); dreturnvoid(); return; } if (min == 0) { /* nothing to do */ dreturnvoid(); return; } size = PyTuple_Size(tuple); if (size < min) { PyErr_Format(PyExc_TypeError, "'pygetdata.entry' " "%s: needed %d entry parameters, but got only %d", name, min, size); dreturnvoid(); return; } switch (E->field_type) { case GD_RAW_ENTRY: E->EN(raw,data_type) = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0)); if (GDPY_INVALID_TYPE(E->EN(raw,data_type))) PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid data type"); gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_UINT_TYPE, &E->scalar[0], &E->EN(raw,spf)); break; case GD_LINCOM_ENTRY: parm1 = PyTuple_GetItem(tuple, 0); parm2 = PyTuple_GetItem(tuple, 1); parm3 = PyTuple_GetItem(tuple, 2); if (!PyTuple_Check(parm1) || !PyTuple_Check(parm2) || !PyTuple_Check(parm3)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "LINCOM parameters must be tuples"); dreturnvoid(); return; } count = E->EN(lincom,n_fields) = PyTuple_Size(parm1); if (count > GD_MAX_LINCOM) count = GD_MAX_LINCOM; if (PyTuple_Size(parm2) < count || PyTuple_Size(parm3) < count) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "Missing data in LINCOM parameters"); dreturnvoid(); return; } for (i = 0; i < count; ++i) { E->in_fields[i] = gdpy_dup_pystring(PyTuple_GetItem(parm1, i)); if (PyErr_Occurred()) { dreturnvoid(); return; } obj = PyTuple_GetItem(parm2, i); if (PyComplex_Check(obj)) { E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(lincom,cm)[i]), obj); } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i], &E->EN(lincom,cm)[i]); else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i], &E->EN(lincom,m)[i]); gd_rs2cs_(E->EN(lincom,cm)[i], E->EN(lincom,m)[i]); } if (PyErr_Occurred()) { dreturnvoid(); return; } obj = PyTuple_GetItem(parm3, i); if (PyComplex_Check(obj)) { E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(lincom,cb)[i]), obj); } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i + GD_MAX_LINCOM], &E->EN(lincom,cb)[i]); else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i + GD_MAX_LINCOM], &E->EN(lincom,b)[i]); gd_rs2cs_(E->EN(lincom,cb)[i], E->EN(lincom,b)[i]); } if (PyErr_Occurred()) { dreturnvoid(); return; } } break; case GD_LINTERP_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } E->EN(linterp,table) = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1)); if (PyErr_Occurred()) { dreturnvoid(); return; } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_INT_TYPE, &E->scalar[0], &E->EN(bit,bitnum)); if (size > 2) gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 2), GD_INT_TYPE, &E->scalar[1], &E->EN(bit,numbits)); else { E->EN(bit,numbits) = 1; E->scalar[1] = NULL; } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } E->in_fields[1] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1)); if (PyErr_Occurred()) { dreturnvoid(); return; } break; case GD_RECIP_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } obj = PyTuple_GetItem(tuple, 1); if (PyComplex_Check(obj)) { E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(recip,cdividend)), obj); } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[0], &E->EN(recip,cdividend)); else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[0], &E->EN(recip,dividend)); gd_rs2cs_(E->EN(recip,cdividend), E->EN(recip,dividend)); } if (PyErr_Occurred()) { dreturnvoid(); return; } break; case GD_PHASE_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 1), GD_INT64, &E->scalar[0], &E->EN(phase,shift)); break; case GD_POLYNOM_ENTRY: parm2 = PyTuple_GetItem(tuple, 1); if (!PyTuple_Check(parm2)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "POLYNOM requires a tuple of co-efficients"); dreturnvoid(); return; } E->EN(polynom,poly_ord) = count = PyTuple_Size(parm2) - 1; if (count > GD_MAX_POLYORD) count = GD_MAX_POLYORD; E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } for (i = 0; i <= count; ++i) { obj = PyTuple_GetItem(parm2, i); if (PyComplex_Check(obj)) { E->flags |= GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(E->EN(polynom,ca)[i]), obj); E->scalar[i] = NULL; } else if (E->flags & GD_EN_COMPSCAL) gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, &E->scalar[i], &E->EN(polynom,ca)[i]); else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[i], &E->EN(polynom,a)[i]); gd_rs2cs_(E->EN(polynom,ca)[i], E->EN(polynom,a)[i]); } if (PyErr_Occurred()) { dreturnvoid(); return; } } break; case GD_WINDOW_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } E->in_fields[1] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1)); if (PyErr_Occurred()) { dreturnvoid(); return; } E->EN(window,windop) = (gd_windop_t)PyInt_AsLong(PyTuple_GetItem(tuple, 2)); if (GDPY_INVALID_OP(E->EN(window,windop))) PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid window operation"); obj = PyTuple_GetItem(tuple, 3); switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: gdpy_set_scalar_from_pyobj(obj, GD_INT64, &E->scalar[0], &E->EN(window,threshold).i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: gdpy_set_scalar_from_pyobj(obj, GD_UINT64, &E->scalar[0], &E->EN(window,threshold).u); break; default: gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, &E->scalar[0], &E->EN(window,threshold).r); break; } if (PyErr_Occurred()) { dreturnvoid(); return; } break; case GD_MPLEX_ENTRY: E->in_fields[0] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 0)); if (PyErr_Occurred()) { dreturnvoid(); return; } E->in_fields[1] = gdpy_dup_pystring(PyTuple_GetItem(tuple, 1)); if (PyErr_Occurred()) { dreturnvoid(); return; } gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 2), GD_INT_TYPE, &E->scalar[0], &E->EN(mplex,count_val)); gdpy_set_scalar_from_pyobj(PyTuple_GetItem(tuple, 3), GD_INT_TYPE, &E->scalar[1], &E->EN(mplex,period)); break; case GD_CARRAY_ENTRY: E->EN(scalar,array_len) = (size_t)PyLong_AsUnsignedLong(PyTuple_GetItem(tuple, 1)); /* fallthrough */ case GD_CONST_ENTRY: E->EN(scalar,const_type) = (gd_type_t)PyInt_AsLong(PyTuple_GetItem(tuple, 0)); if (GDPY_INVALID_TYPE(E->EN(scalar,const_type))) PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid data type"); case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_STRING_ENTRY: case GD_INDEX_ENTRY: break; } dreturnvoid(); } static void gdpy_set_entry_from_dict(gd_entry_t *E, PyObject *parms, const char *name) { PyObject *tuple = Py_None; const char *key[4]; int i, size = 0; dtrace("%p, %p, \"%s\"", E, parms, name); /* convert the dictionary to a tuple */ /* variadic objects for entry types: * RAW: type, spf = 2 * LINCOM: in_fields, m, b = 3 * LINTERP: in_field, table = 2 * (S)BIT: in_field, bitnum, (numbits) = 2/3 * PHASE: in_field, shift = 2 * MULTIPLY: in_field1, in_field2 = 2 * DIVIDE: in_field1, in_field2 = 2 * RECIP: in_field, dividend = 2 * POLYNOM: in_field, a = 2 * WINDOW: in_field1, in_field2, op, thresh = 4 * MPLEX: in_field1, in_field2, val, max = 4 * CONST: type = 1 * CARRAY: type, array_len = 2 * STRING: (none) = 0 * INDEX: (none) = 0 */ switch(E->field_type) { case GD_RAW_ENTRY: key[0] = "type"; key[1] = "spf"; size = 2; break; case GD_LINCOM_ENTRY: key[0] = "in_fields"; key[1] = "m"; key[2] = "b"; size = 3; break; case GD_LINTERP_ENTRY: key[0] = "in_field"; key[1] = "table"; size = 2; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: key[0] = "in_field"; key[1] = "bitnum"; if (PyDict_GetItemString(parms, "numbits")) { key[2] = "numbits"; size = 3; } else size = 2; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: key[0] = "in_field1"; key[1] = "in_field2"; size = 2; break; case GD_RECIP_ENTRY: key[0] = "in_field"; key[1] = "dividend"; size = 2; break; case GD_PHASE_ENTRY: key[0] = "in_field"; key[1] = "shift"; size = 2; break; case GD_POLYNOM_ENTRY: key[0] = "in_field"; key[1] = "a"; size = 2; break; case GD_WINDOW_ENTRY: key[0] = "in_field1"; key[1] = "in_field2"; key[2] = "windop"; key[3] = "threshold"; size = 4; break; case GD_MPLEX_ENTRY: key[0] = "in_field1"; key[1] = "in_field2"; key[2] = "count_val"; key[3] = "period"; size = 4; break; case GD_CARRAY_ENTRY: key[0] = "type"; key[1] = "array_len"; size = 2; break; case GD_CONST_ENTRY: key[0] = "type"; size = 1; break; case GD_STRING_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_INDEX_ENTRY: break; } if (size > 0) { tuple = PyTuple_New(size); for (i = 0; i < size; ++i) { PyObject *o = PyDict_GetItemString(parms, key[i]); if (o == NULL) { PyErr_Format(PyExc_KeyError, "%s: missing required parameter key %s", name, key[i]); dreturnvoid(); return; } Py_INCREF(o); PyTuple_SET_ITEM(tuple, i, o); } } gdpy_set_entry_from_tuple(E, tuple, name); dreturnvoid(); } static int gdpy_entry_init(struct gdpy_entry_t *self, PyObject *args, PyObject *keys) { gd_entry_t E; char *keywords[] = {"type", "name", "fragment_index", "parameters", NULL}; PyObject *parms = NULL; const char *field_name; dtrace("%p, %p, %p", self, args, keys); memset(&E, 0, sizeof(gd_entry_t)); if (!PyArg_ParseTupleAndKeywords(args, keys, "isi|O:pygetdata.entry.__init__", keywords, &E.field_type, &field_name, &E.fragment_index, &parms)) { dreturn("%i", -1); return -1; } E.field = strdup(field_name); if (E.field == NULL) { PyErr_NoMemory(); dreturn("%i", -1); return -1; } /* check for valid field type */ if (E.field_type > 0x13 || E.field_type <= 0 || gdpy_entry_type_names[E.field_type] == NULL) { PyErr_SetString(PyExc_ValueError, "'pygetdata.entry.__init__' invalid entry type"); dreturn("%i", -1); return -1; } if (E.field_type == GD_STRING_ENTRY) ; /* no parameters required */ else if (parms == NULL) PyErr_Format(PyExc_TypeError, "pygetdata.entry.__init__() initialisation " "of %s require parameter tuple or dictionary", gdpy_entry_type_names[E.field_type]); else if (PyDict_Check(parms)) gdpy_set_entry_from_dict(&E, parms, "pygetdata.entry.__init__"); else if (PyTuple_Check(parms)) gdpy_set_entry_from_tuple(&E, parms, "pygetdata.entry.__init__"); else PyErr_SetString(PyExc_TypeError, "pygetdata.dirfile.__init__() argument 3 " "must be a tuple or dictionary"); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } if (self->E == NULL) { self->E = malloc(sizeof(gd_entry_t)); if (self->E == NULL) { dreturn("%i", -1); return -1; } } else gd_free_entry_strings(self->E); memcpy(self->E, &E, sizeof(gd_entry_t)); dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getname(struct gdpy_entry_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); pyobj = PyString_FromString(self->E->field); dreturn("%p", pyobj); return pyobj; } static int gdpy_entry_setname(struct gdpy_entry_t *self, PyObject *value, void *closure) { char *s; dtrace("%p, %p, %p", self, value, closure); s = gdpy_dup_pystring(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } free(self->E->field); self->E->field = s; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getfragment(struct gdpy_entry_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); pyobj = PyInt_FromLong(self->E->fragment_index); dreturn("%p", pyobj); return pyobj; } static int gdpy_entry_setfragment(struct gdpy_entry_t *self, PyObject *value, void *closure) { int t; dtrace("%p, %p, %p", self, value, closure); t = (int)PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->fragment_index = t; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_gettypename(struct gdpy_entry_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); pyobj = PyString_FromString(gdpy_entry_type_names[self->E->field_type]); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_entry_gettype(struct gdpy_entry_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); pyobj = PyInt_FromLong(self->E->field_type); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_entry_getinfields(struct gdpy_entry_t *self, void *closure) { int i; PyObject *tuple = NULL; dtrace("%p, %p", self, closure); switch (self->E->field_type) { case GD_LINCOM_ENTRY: tuple = PyTuple_New(self->E->EN(lincom,n_fields)); for (i = 0; i < self->E->EN(lincom,n_fields); ++i) PyTuple_SetItem(tuple, i, PyString_FromString(self->E->in_fields[i])); break; case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: tuple = Py_BuildValue("(s)", self->E->in_fields[0]); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: tuple = Py_BuildValue("(ss)", self->E->in_fields[0], self->E->in_fields[1]); break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_RAW_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'in_fields' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); break; } dreturn("%p", tuple); return tuple; } static int gdpy_entry_setinfields(struct gdpy_entry_t *self, PyObject *value, void *closure) { int i; char *s[GD_MAX_LINCOM]; dtrace("%p, %p, %p", self, value, closure); switch (self->E->field_type) { case GD_LINCOM_ENTRY: if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "attribute 'in_fields' must be a tuple"); dreturn("%i", -1); return -1; } if (PyTuple_Size(value) < self->E->EN(lincom,n_fields)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "not enough items in tuple for in_fields"); dreturn("%i", -1); return -1; } for (i = 0; i < self->E->EN(lincom,n_fields); ++i) s[i] = gdpy_dup_pystring(PyTuple_GetItem(value, i)); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } for (i = 0; i < self->E->EN(lincom,n_fields); ++i) { free(self->E->in_fields[i]); self->E->in_fields[i] = s[i]; } break; case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: if (!PyTuple_Check(value)) s[0] = gdpy_dup_pystring(value); else { if (PyTuple_Size(value) < 1) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "not enough items in tuple for in_fields"); dreturn("%i", -1); } s[0] = gdpy_dup_pystring(PyTuple_GetItem(value, 0)); } if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } free(self->E->in_fields[0]); self->E->in_fields[0] = s[0]; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "attribute 'in_fields' must be a tuple"); dreturn("%i", -1); return -1; } if (PyTuple_Size(value) < 2) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "not enough items in tuple for in_fields"); dreturn("%i", -1); return -1; } for (i = 0; i < 2; ++i) s[i] = gdpy_dup_pystring(PyTuple_GetItem(value, i)); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } for (i = 0; i < 2; ++i) { free(self->E->in_fields[i]); self->E->in_fields[i] = s[i]; } break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_RAW_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'in_fields' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); break; } dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getdatatypename(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; int t = -1; char buffer[11]; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_RAW_ENTRY) t = self->E->EN(raw,data_type); else if (self->E->field_type == GD_CONST_ENTRY || self->E->field_type == GD_CARRAY_ENTRY) t = self->E->EN(scalar,const_type); else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'data_type_name' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); if (t != -1) { sprintf(buffer, "%s%i", (t & GD_COMPLEX) ? "COMPLEX" : (t & GD_IEEE754) ? "FLOAT" : (t & GD_SIGNED) ? "INT" : "UINT", 8 * GD_SIZE(t)); obj = PyString_FromString(buffer); } dreturn("%p", obj); return obj; } static PyObject *gdpy_entry_getdatatype(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_RAW_ENTRY) obj = PyInt_FromLong(self->E->EN(raw,data_type)); else if (self->E->field_type == GD_CONST_ENTRY || self->E->field_type == GD_CARRAY_ENTRY) obj = PyInt_FromLong(self->E->EN(scalar,const_type)); else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'data_type' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setdatatype(struct gdpy_entry_t *self, PyObject *value, void *closure) { int t; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_RAW_ENTRY && self->E->field_type != GD_CONST_ENTRY && self->E->field_type != GD_CARRAY_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'data_type' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } t = PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } /* The C library is significantly more lax about this. (It just checks a few * key bits) */ if (GDPY_INVALID_TYPE(t)) { PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid data type"); dreturn("%i", -1); return -1; } if (self->E->field_type == GD_RAW_ENTRY) self->E->EN(raw,data_type) = (gd_type_t)t; else self->E->EN(scalar,const_type) = (gd_type_t)t; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getspf(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_RAW_ENTRY) { if (self->E->scalar[0] == NULL) obj = PyInt_FromLong(self->E->EN(raw,spf)); else obj = PyString_FromString(self->E->scalar[0]); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'spf' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setspf(struct gdpy_entry_t *self, PyObject *value, void *closure) { unsigned int spf = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_RAW_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'spf' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } gdpy_set_scalar_from_pyobj(value, GD_UINT_TYPE, &scalar, &spf); if (PyErr_Occurred()) { free(scalar); dreturn("%i", -1); return -1; } free(self->E->scalar[0]); self->E->scalar[0] = scalar; self->E->EN(raw,spf) = spf; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getarraylen(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_CARRAY_ENTRY) { obj = PyLong_FromUnsignedLong(self->E->EN(scalar,array_len)); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'array_len' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setarraylen(struct gdpy_entry_t *self, PyObject *value, void *closure) { size_t array_len; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_CARRAY_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'array_len' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } array_len = PyLong_AsUnsignedLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->EN(scalar,array_len) = array_len; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getnfields(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_LINCOM_ENTRY) { obj = PyInt_FromLong(self->E->EN(lincom,n_fields)); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'n_fields' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setnfields(struct gdpy_entry_t *self, PyObject *value, void *closure) { int i, n; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_LINCOM_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'n_fields' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } n = (int)PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } else if (n < 0 || n > GD_MAX_LINCOM) { PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' " "attribute 'n_fields' out of range"); dreturn("%i", -1); return -1; } /* free extra terms */ for (i = n; i < self->E->EN(lincom,n_fields); ++i) free(self->E->in_fields[i]); /* initialise new terms */ for (i = self->E->EN(lincom,n_fields); i < n; ++i) { self->E->in_fields[i] = strdup(""); self->E->EN(lincom,m)[i] = self->E->EN(lincom,b)[i] = 0; } self->E->EN(lincom,n_fields) = n; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getm(struct gdpy_entry_t *self, void *closure) { int i; PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_LINCOM_ENTRY) { obj = PyTuple_New(self->E->EN(lincom,n_fields)); for (i = 0; i < self->E->EN(lincom,n_fields); ++i) PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ? (self->E->flags & GD_EN_COMPSCAL) ? gdpy_from_complex(self->E->EN(lincom,cm)[i]) : PyFloat_FromDouble(self->E->EN(lincom,m)[i]) : PyString_FromString(self->E->scalar[i])); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'm' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setm(struct gdpy_entry_t *self, PyObject *value, void *closure) { int i; int comp_scal = 0; double m[GD_MAX_LINCOM]; GD_DCOMPLEXM(cm[GD_MAX_LINCOM]); char *scalar[GD_MAX_LINCOM]; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_LINCOM_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'm' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "attribute 'm' must be a tuple"); dreturn("%i", -1); return -1; } if (PyTuple_Size(value) < self->E->EN(lincom,n_fields)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "not enough items in tuple for attribute 'm'"); dreturn("%i", -1); return -1; } for (i = 0; i < self->E->EN(lincom,n_fields); ++i) { PyObject *obj = PyTuple_GetItem(value, i); if (PyComplex_Check(obj)) { comp_scal = GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(cm[i]), obj); m[i] = creal(cm[i]); scalar[i] = NULL; } else if (comp_scal) { gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, cm + i); m[i] = creal(cm[i]); } else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, m + i); gd_rs2cs_(cm[i], m[i]); } } if (PyErr_Occurred()) { for (i = 0; i < GD_MAX_LINCOM; ++i) free(scalar[i]); dreturn("%i", -1); return -1; } for (i = 0; i < self->E->EN(lincom,n_fields); ++i) { /* check whether the corresponding cb is complex */ if (!comp_scal && cimag(self->E->EN(lincom,cb)[i])) comp_scal = GD_EN_COMPSCAL; gd_cs2cs_(self->E->EN(lincom,cm)[i], cm[i]); self->E->EN(lincom,m)[i] = m[i]; free(self->E->scalar[i]); self->E->scalar[i] = scalar[i]; } self->E->flags |= comp_scal; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getb(struct gdpy_entry_t *self, void *closure) { int i; PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_LINCOM_ENTRY) { obj = PyTuple_New(self->E->EN(lincom,n_fields)); for (i = 0; i < self->E->EN(lincom,n_fields); ++i) PyTuple_SetItem(obj, i, (self->E->scalar[i + GD_MAX_LINCOM] == NULL) ? (self->E->flags & GD_EN_COMPSCAL) ? gdpy_from_complex(self->E->EN(lincom,cb)[i]) : PyFloat_FromDouble(self->E->EN(lincom,b)[i]) : PyString_FromString(self->E->scalar[i + GD_MAX_LINCOM])); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'b' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setb(struct gdpy_entry_t *self, PyObject *value, void *closure) { int i; int comp_scal = 0; double b[GD_MAX_LINCOM]; GD_DCOMPLEXM(cb[GD_MAX_LINCOM]); char *scalar[GD_MAX_LINCOM]; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_LINCOM_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'b' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "attribute 'b' must be a tuple"); dreturn("%i", -1); return -1; } if (PyTuple_Size(value) < self->E->EN(lincom,n_fields)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "not enough items in tuple for attribute 'b'"); dreturn("%i", -1); return -1; } for (i = 0; i < self->E->EN(lincom,n_fields); ++i) { PyObject *obj = PyTuple_GetItem(value, i); if (PyComplex_Check(obj)) { comp_scal = GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(cb[i]), obj); b[i] = creal(cb[i]); scalar[i] = NULL; } else if (comp_scal) { gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, cb + i); b[i] = creal(cb[i]); } else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, b + i); gd_rs2cs_(cb[i], b[i]); } } if (PyErr_Occurred()) { for (i = 0; i < GD_MAX_LINCOM; ++i) free(scalar[i]); dreturn("%i", -1); return -1; } for (i = 0; i < self->E->EN(lincom,n_fields); ++i) { /* check whether the corresponding cm is complex */ if (!comp_scal && cimag(self->E->EN(lincom,cm)[i])) comp_scal = GD_EN_COMPSCAL; gd_cs2cs_(self->E->EN(lincom,cb)[i], cb[i]); self->E->EN(lincom,b)[i] = b[i]; free(self->E->scalar[i + GD_MAX_LINCOM]); self->E->scalar[i + GD_MAX_LINCOM] = scalar[i]; } self->E->flags |= comp_scal; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_gettable(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_LINTERP_ENTRY) obj = PyString_FromString(self->E->EN(linterp,table)); else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'table' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_settable(struct gdpy_entry_t *self, PyObject *value, void *closure) { dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type == GD_LINTERP_ENTRY) { char *s = gdpy_dup_pystring(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } free(self->E->EN(linterp,table)); self->E->EN(linterp,table) = s; } else { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'table' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getbitnum(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_BIT_ENTRY || self->E->field_type == GD_SBIT_ENTRY) { if (self->E->scalar[0] == NULL) obj = PyInt_FromLong(self->E->EN(bit,bitnum)); else obj = PyString_FromString(self->E->scalar[0]); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'bitnum' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setbitnum(struct gdpy_entry_t *self, PyObject *value, void *closure) { int bitnum = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_BIT_ENTRY && self->E->field_type != GD_SBIT_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'bitnum' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &bitnum); if (PyErr_Occurred()) { free(scalar); dreturn("%i", -1); return -1; } self->E->EN(bit,bitnum) = bitnum; free(self->E->scalar[0]); self->E->scalar[0] = scalar; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getnumbits(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_BIT_ENTRY || self->E->field_type == GD_SBIT_ENTRY) { if (self->E->scalar[1] == NULL) obj = PyInt_FromLong(self->E->EN(bit,numbits)); else obj = PyString_FromString(self->E->scalar[1]); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'numbits' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setnumbits(struct gdpy_entry_t *self, PyObject *value, void *closure) { int numbits = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_BIT_ENTRY && self->E->field_type != GD_SBIT_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'numbits' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &numbits); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->EN(bit,numbits) = numbits; free(self->E->scalar[1]); self->E->scalar[1] = scalar; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getdividend(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_RECIP_ENTRY) { if (self->E->scalar[0]) obj = PyString_FromString(self->E->scalar[0]); else if (self->E->flags & GD_EN_COMPSCAL) obj = gdpy_from_complex(self->E->EN(recip,cdividend)); else obj = PyFloat_FromDouble(self->E->EN(recip,dividend)); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'dividend' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setdividend(struct gdpy_entry_t *self, PyObject *value, void *closure) { int comp_scal = 0; char *scalar; GD_DCOMPLEXA(cdividend); double dividend = 0; dtrace("%p, %p, %p", self, value, closure); gd_li2cs_(cdividend, 0, 0); if (self->E->field_type != GD_RECIP_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'dividend' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } if (PyComplex_Check(value) || PyString_Check(value)) comp_scal = GD_EN_COMPSCAL; if (comp_scal) { gdpy_set_scalar_from_pyobj(value, GD_COMPLEX128, &scalar, &cdividend); dividend = creal(cdividend); } else { gdpy_set_scalar_from_pyobj(value, GD_FLOAT64, &scalar, ÷nd); gd_rs2cs_(cdividend, dividend); } if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->flags |= comp_scal; gd_cs2cs_(self->E->EN(recip,cdividend), cdividend); self->E->EN(recip,dividend) = dividend; free(self->E->scalar[0]); self->E->scalar[0] = scalar; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getshift(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_PHASE_ENTRY) { if (self->E->scalar[0] == NULL) obj = PyLong_FromLongLong((PY_LONG_LONG)self->E->EN(phase,shift)); else obj = PyString_FromString(self->E->scalar[0]); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'shift' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setshift(struct gdpy_entry_t *self, PyObject *value, void *closure) { int64_t shift = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_PHASE_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'shift' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } gdpy_set_scalar_from_pyobj(value, GD_INT64, &scalar, &shift); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->EN(phase,shift) = shift; free(self->E->scalar[0]); self->E->scalar[0] = scalar; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getcountval(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_MPLEX_ENTRY) { if (self->E->scalar[0] == NULL) obj = PyInt_FromLong(self->E->EN(mplex,count_val)); else obj = PyString_FromString(self->E->scalar[0]); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'count_val' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setcountval(struct gdpy_entry_t *self, PyObject *value, void *closure) { int count_val = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_MPLEX_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'count_val' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &count_val); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->EN(mplex,count_val) = count_val; free(self->E->scalar[0]); self->E->scalar[0] = scalar; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getperiod(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_MPLEX_ENTRY) { if (self->E->scalar[0] == NULL) obj = PyInt_FromLong(self->E->EN(mplex,period)); else obj = PyString_FromString(self->E->scalar[0]); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'period' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setperiod(struct gdpy_entry_t *self, PyObject *value, void *closure) { int period = 0; char *scalar; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_MPLEX_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'period' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } gdpy_set_scalar_from_pyobj(value, GD_INT_TYPE, &scalar, &period); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->EN(mplex,period) = period; free(self->E->scalar[1]); self->E->scalar[1] = scalar; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_geta(struct gdpy_entry_t *self, void *closure) { int i; PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_POLYNOM_ENTRY) { obj = PyTuple_New(self->E->EN(polynom,poly_ord) + 1); for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) PyTuple_SetItem(obj, i, (self->E->scalar[i] == NULL) ? (self->E->flags & GD_EN_COMPSCAL) ? gdpy_from_complex(self->E->EN(polynom,ca)[i]) : PyFloat_FromDouble(self->E->EN(polynom,a)[i]) : PyString_FromString(self->E->scalar[i])); } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'a' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_seta(struct gdpy_entry_t *self, PyObject *value, void *closure) { int i; int comp_scal = 0; double a[GD_MAX_POLYORD + 1]; GD_DCOMPLEXM(ca[GD_MAX_POLYORD + 1]); char *scalar[GD_MAX_POLYORD + 1]; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_POLYNOM_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'a' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } if (!PyTuple_Check(value)) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "attribute 'a' must be a tuple"); dreturn("%i", -1); return -1; } if (PyTuple_Size(value) < self->E->EN(polynom,poly_ord) + 1) { PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "not enough items in tuple for attribute 'a'"); dreturn("%i", -1); return -1; } for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) { PyObject *obj = PyTuple_GetItem(value, i); if (PyComplex_Check(obj)) { comp_scal = GD_EN_COMPSCAL; gdpy_as_complex(gd_csp_(ca[i]), obj); a[i] = creal(ca[i]); scalar[i] = NULL; } else if (comp_scal) { gdpy_set_scalar_from_pyobj(obj, GD_COMPLEX128, scalar + i, ca + i); a[i] = creal(ca[i]); } else { gdpy_set_scalar_from_pyobj(obj, GD_FLOAT64, scalar + i, a + i); gd_rs2cs_(ca[i], a[i]); } } if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) { self->E->EN(polynom,a)[i] = a[i]; gd_cs2cs_(self->E->EN(polynom,ca)[i], ca[i]); free(self->E->scalar[i]); self->E->scalar[i] = scalar[i]; } self->E->flags |= comp_scal; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getpolyord(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_POLYNOM_ENTRY) obj = PyInt_FromLong(self->E->EN(polynom,poly_ord)); else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'poly_ord' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setpolyord(struct gdpy_entry_t *self, PyObject *value, void *closure) { int n; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_POLYNOM_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'poly_ord' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } n = (int)PyLong_AsUnsignedLongLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } else if (n < 1 || n > GD_MAX_POLYORD) { PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' " "attribute 'poly_ord' out of range"); dreturn("%i", -1); return -1; } self->E->EN(polynom,poly_ord) = n; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getparms(struct gdpy_entry_t *self, void *closure) { int i; PyObject *a, *tuple = NULL; dtrace("%p, %p", self, closure); switch (self->E->field_type) { case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_INDEX_ENTRY: case GD_STRING_ENTRY: tuple = Py_BuildValue("()"); break; case GD_CONST_ENTRY: tuple = Py_BuildValue("(i)", self->E->EN(scalar,const_type)); break; case GD_CARRAY_ENTRY: tuple = Py_BuildValue("(iI)", self->E->EN(scalar,const_type), self->E->EN(scalar,array_len)); break; case GD_RAW_ENTRY: tuple = Py_BuildValue("(iI)", self->E->EN(raw,data_type), self->E->EN(raw,spf)); break; case GD_LINTERP_ENTRY: tuple = Py_BuildValue("(ss)", self->E->in_fields[0], self->E->EN(linterp,table)); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: tuple = Py_BuildValue("(ss)", self->E->in_fields[0], self->E->in_fields[1]); break; case GD_RECIP_ENTRY: if (self->E->flags & GD_EN_COMPSCAL) tuple = Py_BuildValue("(sO)", self->E->in_fields[0], gdpy_from_complex(self->E->EN(recip,cdividend))); else tuple = Py_BuildValue("(sd)", self->E->in_fields[0], self->E->EN(recip,dividend)); break; case GD_PHASE_ENTRY: tuple = Py_BuildValue("(si)", self->E->in_fields[0], self->E->EN(phase,shift)); break; case GD_POLYNOM_ENTRY: a = PyTuple_New(self->E->EN(polynom,poly_ord) + 1); if (self->E->flags & GD_EN_COMPSCAL) for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) PyTuple_SetItem(a, i, gdpy_from_complex(self->E->EN(polynom,ca)[i])); else for (i = 0; i <= self->E->EN(polynom,poly_ord); ++i) PyTuple_SetItem(a, i, PyFloat_FromDouble(self->E->EN(polynom,a)[i])); tuple = Py_BuildValue("(sO)", self->E->in_fields[0], a); break; case GD_LINCOM_ENTRY: switch (self->E->EN(lincom,n_fields)) { case 1: if (self->E->flags & GD_EN_COMPSCAL) tuple = Py_BuildValue("((s)(O)(O))", self->E->in_fields[0], gdpy_from_complex(self->E->EN(lincom,cm)[0]), gdpy_from_complex(self->E->EN(lincom,cb)[0])); else tuple = Py_BuildValue("((s)(d)(d))", self->E->in_fields[0], self->E->EN(lincom,m)[0], self->E->EN(lincom,b)[0]); break; case 2: if (self->E->flags & GD_EN_COMPSCAL) tuple = Py_BuildValue("((ss)(OO)(OO))", self->E->in_fields[0], self->E->in_fields[1], gdpy_from_complex(self->E->EN(lincom,cm)[0]), gdpy_from_complex(self->E->EN(lincom,cm)[1]), gdpy_from_complex(self->E->EN(lincom,cb)[0]), gdpy_from_complex(self->E->EN(lincom,cb)[1])); else tuple = Py_BuildValue("((ss)(dd)(dd))", self->E->in_fields[0], self->E->in_fields[1], self->E->EN(lincom,m)[0], self->E->EN(lincom,m)[1], self->E->EN(lincom,b)[0], self->E->EN(lincom,b)[1]); break; case 3: if (self->E->flags & GD_EN_COMPSCAL) tuple = Py_BuildValue("((sss)(OOO)(OOO))", self->E->in_fields[0], self->E->in_fields[1], self->E->in_fields[2], gdpy_from_complex(self->E->EN(lincom,cm)[0]), gdpy_from_complex(self->E->EN(lincom,cm)[1]), gdpy_from_complex(self->E->EN(lincom,cm)[2]), gdpy_from_complex(self->E->EN(lincom,cb)[0]), gdpy_from_complex(self->E->EN(lincom,cb)[1]), gdpy_from_complex(self->E->EN(lincom,cb)[2])); else tuple = Py_BuildValue("((sss)(ddd)(ddd))", self->E->in_fields[0], self->E->in_fields[1], self->E->in_fields[2], self->E->EN(lincom,m)[0], self->E->EN(lincom,m)[1], self->E->EN(lincom,m)[2], self->E->EN(lincom,b)[0], self->E->EN(lincom,b)[1], self->E->EN(lincom,b)[2]); break; } break; case GD_WINDOW_ENTRY: switch (self->E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: tuple = Py_BuildValue("(ssiL)", self->E->in_fields[0], self->E->in_fields[1], self->E->EN(window,windop), (long long)self->E->EN(window,threshold).i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: tuple = Py_BuildValue("(ssiK)", self->E->in_fields[0], self->E->in_fields[1], self->E->EN(window,windop), (unsigned long long)self->E->EN(window,threshold).u); break; default: tuple = Py_BuildValue("(ssid)", self->E->in_fields[0], self->E->in_fields[1], self->E->EN(window,windop), self->E->EN(window,threshold).r); break; } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: tuple = Py_BuildValue("(sii)", self->E->in_fields[0], self->E->EN(bit,bitnum), self->E->EN(bit,numbits)); break; case GD_MPLEX_ENTRY: tuple = Py_BuildValue("(ssII)", self->E->in_fields[0], self->E->in_fields[1], (unsigned int)self->E->EN(mplex,count_val), (unsigned int)self->E->EN(mplex,period)); break; } dreturn("%p", tuple); return tuple; } static int gdpy_entry_setparms(struct gdpy_entry_t *self, PyObject *value, void *closure) { gd_entry_t E; dtrace("%p, %p, %p", self, value, closure); memset(&E, 0, sizeof(gd_entry_t)); E.field = self->E->field; E.field_type = self->E->field_type; E.fragment_index = self->E->fragment_index; if (PyDict_Check(value)) gdpy_set_entry_from_dict(&E, value, "pygetdata.entry"); else if (PyTuple_Check(value)) gdpy_set_entry_from_tuple(&E, value, "pygetdata.entry"); else PyErr_SetString(PyExc_TypeError, "'pygetdata.entry' " "attribute 'parameters' must be a tuple or dictionary"); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->field = NULL; gd_free_entry_strings(self->E); memcpy(self->E, &E, sizeof(gd_entry_t)); dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getwindop(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_WINDOW_ENTRY) obj = PyInt_FromLong(self->E->EN(window,windop)); else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'windop' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setwindop(struct gdpy_entry_t *self, PyObject *value, void *closure) { int t; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_WINDOW_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'windop' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } t = PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } if (GDPY_INVALID_OP(t)) { PyErr_SetString(PyExc_ValueError, "'pygetdata.entry' invalid data type"); dreturn("%i", -1); return -1; } self->E->EN(window,windop) = (gd_windop_t)t; dreturn("%i", 0); return 0; } static PyObject *gdpy_entry_getthreshold(struct gdpy_entry_t *self, void *closure) { PyObject *obj = NULL; dtrace("%p, %p", self, closure); if (self->E->field_type == GD_WINDOW_ENTRY) { switch (self->E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: obj = PyLong_FromLongLong((long long)self->E->EN(window,threshold).i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: obj = PyLong_FromUnsignedLongLong( (unsigned long long)self->E->EN(window,threshold).u); break; default: obj = PyFloat_FromDouble(self->E->EN(window,threshold).r); break; } } else PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'threshold' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%p", obj); return obj; } static int gdpy_entry_setthreshold(struct gdpy_entry_t *self, PyObject *value, void *closure) { gd_triplet_t t; dtrace("%p, %p, %p", self, value, closure); if (self->E->field_type != GD_WINDOW_ENTRY) { PyErr_Format(PyExc_AttributeError, "'pygetdata.entry' " "attribute 'threshold' not available for entry type %s", gdpy_entry_type_names[self->E->field_type]); dreturn("%i", -1); return -1; } switch (self->E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: t.i = PyLong_AsLongLong(value); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: t.u = PyLong_AsUnsignedLongLong(value); break; default: t.r = PyFloat_AsDouble(value); break; } if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->E->EN(window,threshold) = t; dreturn("%i", 0); return 0; } static PyGetSetDef gdpy_entry_getset[] = { { "a", (getter)gdpy_entry_geta, (setter)gdpy_entry_seta, "The POLYNOM co-efficients. A tuple of numerical and/or string data.\n" "If a CONST scalar is used as a co-efficient, the corresponding\n" "element of the tuple will be the field code of this scalar field.\n" "Otherwise, the elements will be numerical data. When assigning to\n" "this attribute, the tuple (which may similarly mix numerical and\n" "string data) must have as many elements as the current polynomial\n" "order dictates: assigning a tuple of different size to this\n" "attribute will not result in a change in the polynomial order. To\n" "do that, modify the poly_ord attribute directly.\n", NULL }, { "array_len", (getter)gdpy_entry_getarraylen, (setter)gdpy_entry_setarraylen, "The length of a CARRAY scalar field.\n", NULL }, { "b", (getter)gdpy_entry_getb, (setter)gdpy_entry_setb, "The LINCOM offset terms. A tuple of numerical and/or string data.\n" "If a CONST scalar is used as an offset, the corresponding element of\n" "the tuple will be the field code of this scalar field. Otherwise,\n" "the elements will be numerical data. When assigning to this\n" "attribute, the tuple (which may similarly mix numerical and string\n" "data) must have as many elements as the current number of fields in\n" "the LINCOM: assigning a tuple of different size to this attribute\n" "will not result in a change in the number of fields used. To do\n" "that, modify the n_fields attribute directly.\n", NULL }, { "bitnum", (getter)gdpy_entry_getbitnum, (setter)gdpy_entry_setbitnum, "The starting bit for a BIT field. If this is specified using a\n" "CONST scalar field, this will be the field code of that field,\n" "otherwise, it will be the number itself.", NULL }, { "const_type", (getter)gdpy_entry_getdatatype, (setter)gdpy_entry_setdatatype, "An alias for the data_type attribute.", NULL }, { "count_val", (getter)gdpy_entry_getcountval, (setter)gdpy_entry_setcountval, "The target value of the counter of a MPLEX field. If this is\n" "specified using a CONST scalar field, this will be the field code of\n" "that field, otherwise, it will be the number itself.", NULL }, { "data_type", (getter)gdpy_entry_getdatatype, (setter)gdpy_entry_setdatatype, "A numeric code indicating the underlying data type of a CONST or RAW\n" "field. It should be one of the data type symbols: pygetdata.UINT8,\n" "pygetdata.INT8, &c. The data_type_name attribute provides a human-\n" "readable version of this data.\n", NULL }, { "data_type_name", (getter)gdpy_entry_getdatatypename, NULL, "A human-readable string indicating the underlying data type of a\n" "CONST or RAW field. This attribute is read-only. To change the\n" "data type modify the data_type attribute.\n", NULL }, { "dividend", (getter)gdpy_entry_getdividend, (setter)gdpy_entry_setdividend, "The dividend of a RECIP field. If this is specified using a CONST\n" "scalar field, this will be the field code of that field, otherwise,\n" "it will be the number itself.", NULL }, { "field_type", (getter)gdpy_entry_gettype, NULL, "A numeric code indicating the field type. This will be one of the\n" "pygetdata.*_ENTRY symbols. This attribute is read-only. An entry's\n" "field type may not be changed after creation. See also the\n" "field_type_name attribute for a human-readable version of this data.\n", NULL }, { "field_type_name", (getter)gdpy_entry_gettypename, NULL, "A human-readable string indicating the field type. This attribute\n" "is read-only. An entry's field type may not be changed after\n" "creation. See also the field_type attribute for a numeric version\n" "of this data.\n", NULL }, { "fragment", (getter)gdpy_entry_getfragment, (setter)gdpy_entry_setfragment, "If this entry object was created by a call to dirfile.entry,\n" "this is index number of the format file fragment which defines the\n" "field described by this entry object. Otherwise, it is the index of\n" "the fragment to which this entry will be added, if this entry is\n" "passed to dirfile.add(). It may be freely modified, but is ignored\n" "by dirfile.alter(). To change the fragment index of an existing\n" "field in a dirfile, use dirfile.move().\n", NULL }, { "in_fields", (getter)gdpy_entry_getinfields, (setter)gdpy_entry_setinfields, "A tuple containing the input vector field codes for a derived field.\n" "Except in the case of a LINCOM, this will be a tuple of length one.\n" "When modifying this attribute, the new tuple must contain the same\n" "number of elements as it did previously: assigning a tuple of a\n" "different size will not cause the number of fields used in a LINCOM\n" "to change. To do that, modify the n_fields attribute directly.", NULL }, { "m", (getter)gdpy_entry_getm, (setter)gdpy_entry_setm, "The LINCOM scale factors. A tuple of numerical and/or string data.\n" "If a CONST scalar is used as a scale factor, the corresponding\n" "element of the tuple will be the field code of this scalar field.\n" "Otherwise, the elements will be numerical data. When assigning to\n" "this attribute, the tuple (which may similarly mix numerical and\n" "string data) must have as many elements as the current number of\n" "fields in the LINCOM: assigning a tuple of different size to this\n" "attribute will not result in a change in the number of fields used.\n" "To do that, modify the n_fields attribute directly.\n", NULL }, { "n_fields", (getter)gdpy_entry_getnfields, (setter)gdpy_entry_setnfields, "The number of fields in a LINCOM. Modifying this will change the\n" "number of fields used. If this number is increased, the added\n" "elements in the in_fields, m, and b attributes will contain\n" "nonsensical data, and should be initialised (by assignment) before\n" "the entry object is otherwise used.", NULL }, { "name", (getter)gdpy_entry_getname, (setter)gdpy_entry_setname, "The name of this field. This may be freely modified, but is ignored\n" "by dirfile.alter(). To change the name of an existing field in a\n" "dirfile, use dirfile.rename().", NULL }, { "numbits", (getter)gdpy_entry_getnumbits, (setter)gdpy_entry_setnumbits, "The length of a BIT field. If this is specified using a CONST\n" "scalar field, this will be the field code of that field, otherwise,\n" "it will be the number itself.", NULL }, { "parameters", (getter)gdpy_entry_getparms, (setter)gdpy_entry_setparms, "A tuple containing the field specific parameters for this entry.\n" "The format is identical to the 'parameters' tuple passed to the\n" "entry constructor (q.v.). If modified, this will update all\n" "parameters of the entry. This attribute may be assigned a\n" "dictionary, in which case it will be converted internally to the\n" "corresponding parameters tuple.", NULL }, { "period", (getter)gdpy_entry_getperiod, (setter)gdpy_entry_setperiod, "The number of samples between successive occurrences of the MPLEX\n" "value in the index vector (or zero, if unknown or not constant). If\n" /* ------ handy ruler ----------------------------------------------| */ "this is specified using a CONST scalar field, this will be the field\n" "code of that field, otherwise, it will be the number itself.", NULL }, { "poly_ord", (getter)gdpy_entry_getpolyord, (setter)gdpy_entry_setpolyord, "The polynomial order of a POLYNOM field. Modifying this will change\n" "the number of terms in the polynomial. If this number is increased,\n" "higher order co-efficients in the 'a' attribute will contain\n" "nonsensical data, and should be initialised (by assignment) before\n" "the entry object is otherwise used.", NULL }, { "shift", (getter)gdpy_entry_getshift, (setter)gdpy_entry_setshift, "The shift of a PHASE field. If this is specified using a CONST\n" "scalar field, this will be the field code of that field, otherwise,\n" "it will be the number itself.", NULL }, { "spf", (getter)gdpy_entry_getspf, (setter)gdpy_entry_setspf, "The number of samples per frame of the data on disk for a RAW field.\n" "If this is specified using a CONST scalar field, this will be the\n" "field code of that field, otherwise, it will be the number itself.", NULL }, { "table", (getter)gdpy_entry_gettable, (setter)gdpy_entry_settable, "The pathname of the look-up table of a LINTERP field.", NULL }, { "windop", (getter)gdpy_entry_getwindop, (setter)gdpy_entry_setwindop, "The operation of a WINDOW field.", NULL }, { "threshold", (getter)gdpy_entry_getthreshold, (setter)gdpy_entry_setthreshold, "The threshold of a WINDOW field. The numerical type depends on the\n" "operation of the field.\n", NULL }, { NULL } }; #define ENTRY_DOC \ "entry(type, name, fragment_index [, parameters])\n\n"\ "Returns an entry object containing the metadata for one dirfile field.\n"\ "The field type is specified by 'type', which should be one of the\n"\ "pygetdata.*_ENTRY symbols. The field name is specified by 'name', and\n"\ "'fragment_index' indicates the format file fragment which will contain\n"\ "the specification line of this field, once the entry is added to a\n"\ "dirfile. To add this field to the primary format file, set\n"\ "'fragment_index' to zero.\n\n"\ "The 'parameters' parameter is a tuple or dictionary containing field-\n"\ "specific metadata parameters, and must be present for all field types\n"\ "except STRING, which has no parameters. If a tuple, 'parameters' should\n"\ "contain the following members, based on field type:\n\n"\ " BIT or SBIT: (in_field, bitnum [, numbits])\n"\ " 'in_field': a string containing the input field code.\n"\ " 'bitnum': a number or CONST field code specifying the first bit\n"\ " to extract.\n"\ " 'numbits': an optional number or CONST field code specifying the\n"\ " number of bits to extract. If not specified, it\n"\ " defaults to 1.\n\n"\ " CONST: (type,)\n"\ " 'type': the storage type of the CONST data. Should be one of\n"\ " the data type symbols: pygetdata.UINT8,\n"\ " pygetdata.INT8 &.c.\n\n"\ " LINCOM: (in_fields, m, b)\n"\ " 'in_fields': a tuple of input vector fields for the LINCOM. The\n"\ " number of elements of the tuple determines the\n"\ " number of input fields for the LINCOM. If there are\n"\ " more than three elements, the remainder will be\n"\ " ignored.\n"\ " 'm', 'b': the scale factors and offset terms of the LINCOM.\n"\ " These are also tuples and should have the same\n"\ " number of elements as 'in_fields'. Data can be any\n"\ " mix of numeric types and, to specify CONST scalars,\n"\ " string field code.\n\n"\ " LINTERP: (in_field, table)\n"\ " 'in_field': a string containing the input field code.\n"\ " 'table': the pathname to the look-up table on disk.\n\n"\ " MULTIPLY or DIVIDE:\n"\ " (in_field1, in_field2)\n"\ " 'in_field1': a string containing the first input field code.\n"\ " 'in_field2': a string containing the second input field code.\n\n"\ " PHASE: (in_field, shift)\n"\ " 'in_field': a string containing the input field code.\n"\ " 'shift: a number or CONST field code specifying the number of\n"\ " samples to shift the data.\n\n"\ " POLYNOM: (in_field, a)\n"\ " 'in_field': a string containing the input field code.\n"\ " 'a': a tuple of the co-efficients of the polynomial. The\n"\ " order of the polynomial will be determined from the\n"\ " length of the tuple. If there are more than six\n"\ " elements, the remainder will be ignored. Data can\n"\ " be any mix of numeric types and, to specify CONST\n"\ " scalars, string field codes.\n\n"\ " RAW: (type, spf)\n"\ " 'type': the storage type of the data on disk. Should be one\n"\ " of the data type symbols: pygetdata.UINT8,\n"\ " pygetdata.INT8 &.c\n"\ " 'spf': the number of samples per frame of the data on disk,\n"\ " or a CONST field code specifying the same.\n\n"\ " RECIP: (in_field, dividend)\n"\ " 'in_field': a string containing the input field code.\n"\ " 'dividend': a number or CONST field code specifying the dividend\n"\ " of the RECIP.\n"\ " WINDOW: (in_field1, in_fields2, windop, threshold)\n"\ " 'in_field1': a string containing the input field code.\n"\ " 'in_field2': a string containing the check field code.\n"\ " 'windop': the window operation. Should be one of the windop\n"\ " symbols: pygetdata.WINDOP_EQ, pygetdata.WINDOP_NE,\n"\ " &c.\n"\ " 'threshold': a scalar containing the threshold value. The type of\n"\ " this value depends on the window operation used.\n"\ "\n"\ /* ---------------------------------------------------------------------| */\ "If a dictionary, the keys of 'parameters' should be the names of the\n"\ "tuple parameters listed above (e.g. 'type' and 'spf' for a RAW field),\n"\ "and the values the same as their tuple counterparts.\n\n"\ "An entry object provides all these parameters as attributes, which may\n"\ "be modified by assignment. Attempting to access an attribute which is\n"\ "not available for the specified field type will result in AttributeError\n"\ "being thrown.\n\n"\ "To add a newly created entry object to a dirfile, use dirfile.add() or\n"\ "dirfile.madd() as appropriate. To propagate changes made to an entry\n"\ "object back to the dirfile, dirfile.alter() is typically used, unless\n"\ "the name or fragment index is to be changed, in which case\n"\ "dirfile.rename() or dirfile.move() should be used.\n" PyTypeObject gdpy_entry = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "pygetdata.entry", /* tp_name */ sizeof(struct gdpy_entry_t), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)gdpy_entry_delete, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ ENTRY_DOC, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ gdpy_entry_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)gdpy_entry_init, /* tp_init */ 0, /* tp_alloc */ gdpy_entry_create, /* tp_new */ }; libgetdata-0.9.0/bindings/python/pygetdata.h0000640000175000017500000001044312614323564021257 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include #undef _BSD_SOURCE #undef _POSIX_SOURCE #undef _SVID_SOURCE #undef _POSIX_C_SOURCE #undef SIZEOF_OFF_T #include "../../src/internal.h" #ifdef HAVE_NUMPY_ARRAYOBJECT_H # define PY_ARRAY_UNIQUE_SYMBOL gdpy_array_api # include #endif #define GDPY_UNSIGNED 0x00 #define GDPY_SIGNED 0x01 #define GDPY_IEEE754 0x02 #define GDPY_COMPLEX 0x03 #define GDPY_INT 0x00 #define GDPY_LONG 0x10 #define GDPY_FLOAT 0x20 #define GDPY_PYCOMPLEX 0x40 #define GDPY_INT_AS_LONG (GDPY_INT | GDPY_SIGNED) #define GDPY_LONG_AS_ULL (GDPY_LONG | GDPY_UNSIGNED) #define GDPY_LONG_AS_SLL (GDPY_LONG | GDPY_SIGNED) #define GDPY_LONG_AS_DOUBLE (GDPY_LONG | GDPY_IEEE754) #define GDPY_FLOAT_AS_DOUBLE (GDPY_FLOAT | GDPY_IEEE754) #define GDPY_COMPLEX_AS_COMPLEX (GDPY_PYCOMPLEX | GDPY_COMPLEX) #define GDPY_INVALID_OP(t) ( \ t != GD_WINDOP_EQ && t != GD_WINDOP_NE && \ t != GD_WINDOP_GE && t != GD_WINDOP_GT && \ t != GD_WINDOP_LE && t != GD_WINDOP_LT && \ t != GD_WINDOP_SET && t != GD_WINDOP_CLR ) #define GDPY_INVALID_TYPE(t) ( \ t != GD_UINT8 && t != GD_INT8 && \ t != GD_UINT16 && t != GD_INT16 && \ t != GD_UINT32 && t != GD_INT32 && \ t != GD_UINT64 && t != GD_INT64 && \ t != GD_FLOAT32 && t != GD_FLOAT64 && \ t != GD_COMPLEX64 && t != GD_COMPLEX128 ) #define PYGD_CHECK_ERROR(D,R) PYGD_CHECK_ERROR2(D,R,) #define PYGD_CHECK_ERROR2(D,R,E) \ do { \ int e; \ if ((e = gd_error(D))) { \ PYGD_REPORT_ERROR(D,e); \ E; \ dreturnvoid(); \ return (R); \ } \ } while(0) #define PYGD_REPORT_ERROR(D,e) \ do { \ char *buffer = gd_error_string((D), NULL, 0); \ if (buffer) { \ PyErr_SetString(gdpy_exceptions[e], buffer); \ free(buffer); \ } else \ PyErr_SetString(gdpy_exceptions[e], "Unspecified error"); \ } while (0) extern PyObject *gdpy_exceptions[GD_N_ERROR_CODES]; extern PyTypeObject gdpy_dirfile; extern PyTypeObject gdpy_entry; extern PyTypeObject gdpy_fragment; extern const struct gdpy_constant_t { char *name; long value; } gdpy_constant_list[]; struct gdpy_dirfile_t { PyObject_HEAD DIRFILE *D; int mplex_lookback; char *verbose_prefix; PyObject *callback_data; PyObject *callback; int callback_exception; }; struct gdpy_entry_t { PyObject_HEAD gd_entry_t *E; }; struct gdpy_fragment_t { PyObject_HEAD int n; struct gdpy_dirfile_t *dirfile; }; union gdpy_quadruple_value { uint64_t u; int64_t s; double f; GD_DCOMPLEXA(c); }; #define gdpy_as_complex(v,o) do { \ Py_complex c = PyComplex_AsCComplex(o); \ gd_li2cp_((v), c.real, c.imag); \ } while(0) #define gdpy_from_complexp(c) PyComplex_FromDoubles((c)[0], (c)[1]) #define gdpy_from_complex(c) PyComplex_FromDoubles(creal(c), cimag(c)) extern int gdpylist_append(PyObject *, PyObject *); extern int gdpy_convert_from_pyobj(PyObject*, union gdpy_quadruple_value*, gd_type_t); extern gd_type_t gdpy_convert_from_pylist(PyObject*, void*, gd_type_t, size_t); extern PyObject *gdpy_convert_to_pyobj(const void*, gd_type_t); extern PyObject *gdpy_convert_to_pylist(const void*, gd_type_t, size_t); extern PyObject *gdpy_to_pystringlist(const char **list); extern int gdpy_npytype_from_type(gd_type_t type); extern gd_type_t gdpy_type_from_npytype(int npytype); PyMODINIT_FUNC initpygetdata(void); libgetdata-0.9.0/bindings/python/test/0000740000175000017500000000000012614323564020077 5ustar alastairalastairlibgetdata-0.9.0/bindings/python/test/Makefile.in0000640000175000017500000004666312614323564022165 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/python/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2009, 2010, 2012, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests @TEST_PYTHON_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=..:${PYTHONPATH} ${PYTHON} @TEST_PYTHON_TRUE@pyTESTS = callback.py big_test.py @TEST_PYTHON_TRUE@TESTS = $(addprefix ${srcdir}/,$(pyTESTS)) EXTRA_DIST = ${pyTESTS} all: all-am .SUFFIXES: $(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 bindings/python/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/python/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: $(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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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-TESTS check-local 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 clean-local 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: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am check-local clean \ clean-generic clean-libtool clean-local cscopelist-am ctags-am \ 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 tags-am uninstall \ uninstall-am # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ # 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: libgetdata-0.9.0/bindings/python/test/callback.py0000640000175000017500000000366012614323564022214 0ustar alastairalastair# Copyright (C) 2009, 2011 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os import re import array import pygetdata #callback def parser_callback(pdata, extra): if (extra != "extra stuff"): print "extra =", extra; sys.exit(1) if (pdata["suberror"] != 8): print "suberror =", pdata["suberror"] sys.exit(1); if (pdata["line"] != "bad line\n"): print "line =", pdata["line"] sys.exit(1); if (pdata["linenum"] != 2): print "linenum =", pdata["linenum"] sys.exit(1); if (re.search("dirfile/format$", pdata["filename"]) == None): print "filename =", pdata["filename"] sys.exit(1); return pygetdata.SYNTAX_IGNORE; # create the dirfile first data=array.array("H",range(3,7000,7)) os.system("rm -rf dirfile") os.mkdir("dirfile") file=open("dirfile/data", 'w') data.tofile(file) file.close() file=open("dirfile/format", "w") file.write("data RAW UINT16 8\nbad line\n") file.close() d=pygetdata.dirfile("dirfile", pygetdata.RDONLY, callback=parser_callback, extra="extra stuff"); error=d.error; os.system("rm -rf dirfile") if (error != pygetdata.E_OK): print "error = ", error sys.exit(1) libgetdata-0.9.0/bindings/python/test/big_test.py0000640000175000017500000013022612614323564022257 0ustar alastairalastair# Copyright (C) 2009-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import sys import os import re import array import pygetdata if (pygetdata.__numpy_supported__): import numpy def CheckOK(t): global ne ne+=1 print "e[", t, "] =", sys.exc_type, sys.exc_value def CheckOK2(t,m): global ne ne+=1 print "e[", t, ",", m, "] =", sys.exc_type, sys.exc_value def CheckException(t,g): global ne if (sys.exc_type != g): ne+=1 print "e[", t, "] =", sys.exc_type, "expected", g def CheckException2(t,m,g): global ne if (sys.exc_type != g): ne+=1 print "e[", t, ",", m, "] =", sys.exc_type, "expected", g def CheckNumpy(t,v,g): global ne if (numpy.any(v - g)): ne+=1 print "a[", t, "] =", v, "expected", g def CheckNumpy2(t,m,v,g): global ne if (numpy.any(v - g)): ne+=1 print "a[", t, ",", m, "] =", v, "expected", g def CheckSimple(t,v,g): global ne if (v != g): ne+=1 print "n[", t, "] =", v, "expected", g def CheckSimple2(t,m,v,g): global ne if (v != g): ne+=1 print "n[", t, ",", m, "] =", v, "expected", g def CheckEOS(t,v,g): global ne if (re.search(g + "$", v) == None): ne+=1 print "n[", t, "] =", v, "expected", g # create the dirfile first data=array.array("B",range(1,81)) os.system("rm -rf dirfile") os.mkdir("dirfile") file=open("dirfile/data", 'w') data.tofile(file) file.close() ne = 0 fields = ["INDEX", "alias", "bit", "carray", "const", "data", "div", "lincom", "linterp", "mplex", "mult", "phase", "polynom", "recip", "sbit", "string", "window"] nfields = 17 file=open("dirfile/format", 'w') file.write( "/ENDIAN little\n" "data RAW INT8 8\n" "lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const\n" "/META data mstr STRING \"This is a string constant.\"\n" "/META data mconst CONST COMPLEX128 3.3;4.4\n" "/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n" "/META data mlut LINTERP DATA ./lut\n" "const CONST FLOAT64 5.5\n" "carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n" "linterp LINTERP data ./lut\n" "polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n" "bit BIT data 3 4\n" "sbit SBIT data 5 6\n" "mplex MPLEX data sbit 1 10\n" "mult MULTIPLY data sbit\n" "div DIVIDE mult bit\n" "recip RECIP div 6.5;4.3\n" "phase PHASE data 11\n" "window WINDOW linterp mult LT 4.1\n" "/ALIAS alias data\n" "string STRING \"Zaphod Beeblebrox\"\n" ) file.close() file=open("dirfile/form2", 'w') file.write("const2 CONST INT8 -19\n") file.close() # 1: error check try: d = pygetdata.dirfile("x", pygetdata.RDONLY) except: CheckException(1, pygetdata.IOError) # 2: dirfile check try: d = pygetdata.dirfile("dirfile", pygetdata.RDWR) except: CheckOK(2) # 3: getdata (int) check try: n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1) except: CheckOK(3) CheckSimple(3,len(n),8) if (pygetdata.__numpy_supported__): CheckNumpy(3,n,numpy.arange(41,49)) else: CheckSimple(3,n,range(41,49)) # 6: getdata (long) check try: n = d.getdata("data", pygetdata.LONG, first_frame=5, num_frames=1) except: CheckOK(6) CheckSimple(6,len(n),8) if (pygetdata.__numpy_supported__): CheckNumpy(6,n,numpy.arange(41L,49L)) else: CheckSimple(6,n,range(41L,49L)) # 8: getdata (float) check try: n = d.getdata("data", pygetdata.FLOAT, first_frame=5, num_frames=1) except: CheckOK(8) CheckSimple(8,len(n),8) if (pygetdata.__numpy_supported__): CheckNumpy(8,n,numpy.arange(41.,49.)) else: CheckSimple(8,n,[41.,42.,43.,44.,45.,46.,47.,48.]) # 10: getdata (complex) check try: n = d.getdata("data", pygetdata.COMPLEX, first_frame=5, num_frames=1) except: CheckOK(10) CheckSimple(10,len(n),8) if (pygetdata.__numpy_supported__): CheckNumpy(10,n,numpy.arange(41,49,dtype=numpy.complex128)) else: CheckSimple(10,n,[41.+0j,42.+0j,43.+0j,44.+0j,45.+0j,46.+0j,47.+0j,48.+0j]) # 12: constant (int) check try: n = d.get_constant("const", pygetdata.INT) except: CheckOK(12) CheckSimple(12,n,5) # 15: constant (long) check try: n = d.get_constant("const", pygetdata.LONG) except: CheckOK(15) CheckSimple(15,n,5L) # 17: constant (float) check try: n = d.get_constant("const", pygetdata.FLOAT) except: CheckOK(17) CheckSimple(17,n,5.5) # 19: constant (float) check try: n = d.get_constant("const", pygetdata.COMPLEX) except: CheckOK(19) CheckSimple(19,n,5.5+0j) # 23: nfields check try: n = d.nfields() except: CheckOK(23) CheckSimple(23,n,nfields) # 25: field_list check try: n = d.field_list() except: CheckOK(25) CheckSimple(25,n,fields) # 26: nmfields check try: n = d.nmfields("data") except: CheckOK(26) CheckSimple(26,n,4) # 27: mfield_list check try: n = d.mfield_list("data") except: CheckOK(27) CheckSimple(27,n,["mstr", "mconst", "mcarray", "mlut"]) # 28: nframes check try: n = d.nframes except: CheckOK(28) CheckSimple(28,n,10) # 29: spf check try: n = d.spf("data") except: CheckOK(29) CheckSimple(29,n,8) # 30: putdata (int) check p = [ 13, 14, 15, 16 ] try: n = d.putdata("data", p, pygetdata.INT, first_frame=5, first_sample=1) except: CheckOK2(30,1) CheckSimple2(30,1,n,4) try: n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1) except: CheckOK(30,2) CheckSimple2(30,2,n,[41, 13, 14, 15, 16, 46, 47, 48]) # 32: putdata (numpy) check if (pygetdata.__numpy_supported__): p = numpy.array([ 73, 74, 75, 76 ]) try: n = d.putdata("data", p, first_frame=5, first_sample=1) except: CheckOK2(32,1) CheckSimple2(32,1,n,4) try: n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1) except: CheckOK(32,2) CheckNumpy2(32,2,n,numpy.array([41, 73, 74, 75, 76, 46, 47, 48])) # 33: putdata (long) check p = [ 23L, 24L, 25L, 26L ] try: n = d.putdata("data", p, pygetdata.LONG, first_frame=5, first_sample=1) except: CheckOK2(33,1) CheckSimple2(33,1,n,4) try: n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1) except: CheckOK(33,2) CheckSimple2(33,2,n,[41, 23, 24, 25, 26, 46, 47, 48]) # 35: putdata (float) check p = [ 33., 34., 35., 36. ] try: n = d.putdata("data", p, pygetdata.FLOAT, first_frame=5, first_sample=1) except: CheckOK2(35,1) CheckSimple2(35,1,n,4) try: n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1) except: CheckOK(35,2) CheckSimple2(35,2,n,[41, 33, 34, 35, 36, 46, 47, 48]) # 37: putdata (complex) check p = [ 124.+1j, 125.+2j, 126.+3j, 127.+4j ] try: n = d.putdata("data", p, pygetdata.COMPLEX, first_frame=5, first_sample=1) except: CheckOK2(37,1) CheckSimple2(37,1,n,4) try: n = d.getdata("data", pygetdata.INT, first_frame=5, num_frames=1, as_list=1) except: CheckOK2(37,2) CheckSimple2(37,2,n,[41, 124, 125, 126, 127, 46, 47, 48]) # 38: error_string check try: n = d.getdata("x", pygetdata.INT, first_frame=5, num_frames=1) except: CheckException(38,pygetdata.BadCodeError) CheckSimple(38,d.error_string,"Field not found: x") # 40: entry (raw) check try: ent = d.entry("data") except: CheckOK(40) CheckSimple2(40,1,ent.field_type,pygetdata.RAW_ENTRY) CheckSimple2(40,2,ent.field_type_name,"RAW_ENTRY") CheckSimple2(40,3,ent.fragment,0) CheckSimple2(40,4,ent.data_type,pygetdata.INT8) CheckSimple2(40,5,ent.data_type_name,"INT8") CheckSimple2(40,6,ent.spf,8) # 42: entry (lincom) check try: ent = d.entry("lincom") except: CheckOK(42) CheckSimple2(42,1,ent.field_type,pygetdata.LINCOM_ENTRY) CheckSimple2(42,2,ent.field_type_name,"LINCOM_ENTRY") CheckSimple2(42,3,ent.fragment,0) CheckSimple2(42,4,ent.n_fields,3) CheckSimple2(42,5,ent.in_fields,( "data", "INDEX", "linterp" )) CheckSimple2(42,6,ent.m,(1.1, 2.2, "const")) CheckSimple2(42,7,ent.b,(2.2, 3.3 + 4.4j, "const")) # 44: entry (polynom) check try: ent = d.entry("polynom") except: CheckOK(44) CheckSimple2(44,1,ent.field_type,pygetdata.POLYNOM_ENTRY) CheckSimple2(44,2,ent.field_type_name,"POLYNOM_ENTRY") CheckSimple2(44,3,ent.fragment,0) CheckSimple2(44,4,ent.poly_ord,5) CheckSimple2(44,5,ent.in_fields,( "data", )) CheckSimple2(44,6,ent.a,(1.1, 2.2, 2.2, 3.3 + 4.4j, "const", "const")) # 45: entry (linterp) check try: ent = d.entry("linterp") except: CheckOK(45) CheckSimple2(45,1,ent.field_type,pygetdata.LINTERP_ENTRY) CheckSimple2(45,2,ent.field_type_name,"LINTERP_ENTRY") CheckSimple2(45,3,ent.fragment,0) CheckSimple2(45,4,ent.in_fields,( "data", )) CheckSimple2(45,5,ent.table,"./lut") # 46: entry (bit) check try: ent = d.entry("bit") except: CheckOK(46) CheckSimple2(46,1,ent.field_type,pygetdata.BIT_ENTRY) CheckSimple2(46,2,ent.field_type_name,"BIT_ENTRY") CheckSimple2(46,3,ent.fragment,0) CheckSimple2(46,4,ent.in_fields,( "data", )) CheckSimple2(46,5,ent.numbits,4) CheckSimple2(46,6,ent.bitnum,3) # 47: entry (sbit) check try: ent = d.entry("sbit") except: CheckOK(47) CheckSimple2(47,1,ent.field_type,pygetdata.SBIT_ENTRY) CheckSimple2(47,2,ent.field_type_name,"SBIT_ENTRY") CheckSimple2(47,3,ent.fragment,0) CheckSimple2(47,4,ent.in_fields,( "data", )) CheckSimple2(47,5,ent.numbits,6) CheckSimple2(47,6,ent.bitnum,5) # 48: entry (mult) check try: ent = d.entry("mult") except: CheckOK(48) CheckSimple2(48,1,ent.field_type,pygetdata.MULTIPLY_ENTRY) CheckSimple2(48,2,ent.field_type_name,"MULTIPLY_ENTRY") CheckSimple2(48,3,ent.fragment,0) CheckSimple2(48,4,ent.in_fields,( "data", "sbit")) # 49: entry (phase) check try: ent = d.entry("phase") except: CheckOK(49) CheckSimple2(49,1,ent.field_type,pygetdata.PHASE_ENTRY) CheckSimple2(49,2,ent.field_type_name,"PHASE_ENTRY") CheckSimple2(49,3,ent.fragment,0) CheckSimple2(49,4,ent.in_fields,( "data", )) CheckSimple2(49,5,ent.shift,11) # 50: entry (const) check try: ent = d.entry("const") except: CheckOK(50) CheckSimple2(50,1,ent.field_type,pygetdata.CONST_ENTRY) CheckSimple2(50,2,ent.field_type_name,"CONST_ENTRY") CheckSimple2(50,3,ent.fragment,0) CheckSimple2(50,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(50,5,ent.data_type_name,"FLOAT64") # 51: entry (string) check try: ent = d.entry("string") except: CheckOK(51) CheckSimple2(51,1,ent.field_type,pygetdata.STRING_ENTRY) CheckSimple2(51,2,ent.field_type_name,"STRING_ENTRY") CheckSimple2(51,3,ent.fragment,0) # 52: fragment_index check try: n = d.fragment_index("data") except: CheckOK(52) CheckSimple(52,n,0) # 53: add / entry (raw) check ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0, (pygetdata.FLOAT64, 3)) try: d.add(ent) except: CheckOK2(53,1) try: ent = d.entry("new1") except: CheckOK(53,2) CheckSimple2(53,1,ent.field_type,pygetdata.RAW_ENTRY) CheckSimple2(53,2,ent.field_type_name,"RAW_ENTRY") CheckSimple2(53,3,ent.fragment,0) CheckSimple2(53,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(53,5,ent.data_type_name,"FLOAT64") CheckSimple2(53,6,ent.spf,3) # 54: add / entry (lincom) check ent = pygetdata.entry(pygetdata.LINCOM_ENTRY, "new2", 0, (("in1", "in2"), (9.9, 7.7), (8.8, 6.6))) try: d.add(ent) except: CheckOK2(54,1) try: ent = d.entry("new2") except: CheckOK(54,2) CheckSimple2(54,1,ent.field_type,pygetdata.LINCOM_ENTRY) CheckSimple2(54,2,ent.field_type_name,"LINCOM_ENTRY") CheckSimple2(54,3,ent.fragment,0) CheckSimple2(54,4,ent.n_fields,2) CheckSimple2(54,5,ent.in_fields,( "in1", "in2" )) CheckSimple2(54,6,ent.m,(9.9, 7.7)) CheckSimple2(54,7,ent.b,(8.8, 6.6)) # 56: add / entry (polynom) check ent = pygetdata.entry(pygetdata.POLYNOM_ENTRY, "new4", 0, ("in1", (3.9, 4.8, 5.7, 6.6))) try: d.add(ent) except: CheckOK2(56,1) try: ent = d.entry("new4") except: CheckOK2(56,2) CheckSimple2(56,1,ent.field_type,pygetdata.POLYNOM_ENTRY) CheckSimple2(56,2,ent.field_type_name,"POLYNOM_ENTRY") CheckSimple2(56,3,ent.fragment,0) CheckSimple2(56,4,ent.poly_ord,3) CheckSimple2(56,5,ent.in_fields,( "in1", )) CheckSimple2(56,6,ent.a,(3.9, 4.8, 5.7, 6.6)) # 58: add / entry (linterp) check ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "new6", 0, ("in", "./some/table")) try: d.add(ent) except: CheckOK2(58,1) try: ent = d.entry("new6") except: CheckOK2(58,2) CheckSimple2(58,1,ent.field_type,pygetdata.LINTERP_ENTRY) CheckSimple2(58,2,ent.field_type_name,"LINTERP_ENTRY") CheckSimple2(58,3,ent.fragment,0) CheckSimple2(58,4,ent.in_fields,( "in", )) CheckSimple2(58,5,ent.table,"./some/table") # 59: add / entry (bit) check ent = pygetdata.entry(pygetdata.BIT_ENTRY, "new7", 0, ("in", 13, 12)) try: d.add(ent) except: CheckOK2(59,1) try: ent = d.entry("new7") except: CheckOK2(59,1) CheckSimple2(59,1,ent.field_type,pygetdata.BIT_ENTRY) CheckSimple2(59,2,ent.field_type_name,"BIT_ENTRY") CheckSimple2(59,3,ent.fragment,0) CheckSimple2(59,4,ent.in_fields,( "in", )) CheckSimple2(59,5,ent.numbits,12) CheckSimple2(59,6,ent.bitnum,13) # 60: add / entry (sbit) check ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "new8", 0, ("in2", 14, 15)) try: d.add(ent) except: CheckOK2(60,1) try: ent = d.entry("new8") except: CheckOK2(60,2) CheckSimple2(60,1,ent.field_type,pygetdata.SBIT_ENTRY) CheckSimple2(60,2,ent.field_type_name,"SBIT_ENTRY") CheckSimple2(60,3,ent.fragment,0) CheckSimple2(60,4,ent.in_fields,( "in2", )) CheckSimple2(60,5,ent.bitnum,14) CheckSimple2(60,6,ent.numbits,15) # 61: add / entry (mult) check ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "new9", 0, ("in1", "in2")) try: d.add(ent) except: CheckOK2(61,1) try: ent = d.entry("new9") except: CheckOK2(61,2) CheckSimple2(61,1,ent.field_type,pygetdata.MULTIPLY_ENTRY) CheckSimple2(61,2,ent.field_type_name,"MULTIPLY_ENTRY") CheckSimple2(61,3,ent.fragment,0) CheckSimple2(61,4,ent.in_fields,( "in1", "in2")) # 62: add / entry (phase) check ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "new10", 0, ("in1", 22)) try: d.add(ent) except: CheckOK2(62,1) try: ent = d.entry("new10") except: CheckOK2(62,2) CheckSimple2(62,1,ent.field_type,pygetdata.PHASE_ENTRY) CheckSimple2(62,2,ent.field_type_name,"PHASE_ENTRY") CheckSimple2(62,3,ent.fragment,0) CheckSimple2(62,4,ent.in_fields,( "in1", )) CheckSimple2(62,5,ent.shift,22) # 63: add / entry (const) check ent = pygetdata.entry(pygetdata.CONST_ENTRY, "new11", 0, (pygetdata.FLOAT64,)) try: d.add(ent) except: CheckOK2(63,1) try: ent = d.entry("new11") except: CheckOK2(63,2) CheckSimple2(63,1,ent.field_type,pygetdata.CONST_ENTRY) CheckSimple2(63,2,ent.field_type_name,"CONST_ENTRY") CheckSimple2(63,3,ent.fragment,0) CheckSimple2(63,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(63,5,ent.data_type_name,"FLOAT64") # 64: fragment check try: f = d.fragment(0) except: CheckOK(64) CheckEOS(64,f.name,"dirfile/format") # 65: nfragments check try: n = d.nfragments except: CheckOK(65) CheckSimple(65,n,1) # 66: include check try: n = d.include("form2") except: CheckOK2(66,1) CheckSimple2(66,1,n,1) try: n = d.get_constant("const2", pygetdata.INT) except: CheckOK2(66,2) CheckSimple2(66,2,n,-19) # 67: nfields_by_type check try: n = d.nfields(pygetdata.LINCOM_ENTRY) except: CheckOK(67) CheckSimple(67,n,2) # 68: field_list_by_type check try: n = d.field_list(pygetdata.LINCOM_ENTRY) except: CheckOK(68) CheckSimple(68,n,["lincom", "new2"]) # 69: nvectors check try: n = d.nvectors() except: CheckOK(69) CheckSimple(69,n,22) # 70: field_list check try: n = d.vector_list() except: CheckOK(70) CheckSimple(70,n,['INDEX', 'alias', 'bit', 'data', 'div', 'lincom', 'linterp', 'mplex', 'mult', 'new1', 'new10', 'new2', 'new4', 'new6', 'new7', 'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit', 'window']) # 71: add / entry (lincom) check ent = pygetdata.entry(pygetdata.LINCOM_ENTRY, "mnew1", 0, {"in_fields": ("in1", "in2"), "m": (9.9, 7.7), "b": (8.8, 6.6)}) try: d.madd(ent, "data") except: CheckOK2(71,1) try: ent = d.entry("data/mnew1") except: CheckOK(71,2) CheckSimple2(71,1,ent.field_type,pygetdata.LINCOM_ENTRY) CheckSimple2(71,2,ent.field_type_name,"LINCOM_ENTRY") CheckSimple2(71,3,ent.fragment,0) CheckSimple2(71,4,ent.n_fields,2) CheckSimple2(71,5,ent.in_fields,( "in1", "in2" )) CheckSimple2(71,6,ent.m,(9.9, 7.7)) CheckSimple2(71,7,ent.b,(8.8, 6.6)) # 73: add / entry (polynom) check ent = pygetdata.entry(pygetdata.POLYNOM_ENTRY, "mnew3", 0, {"in_field": "in1", "a": (3.9, 4.8, 5.7, 6.6)}) try: d.madd(ent, "data") except: CheckOK2(73,1) try: ent = d.entry("data/mnew3") except: CheckOK2(73,2) CheckSimple2(73,1,ent.field_type,pygetdata.POLYNOM_ENTRY) CheckSimple2(73,2,ent.field_type_name,"POLYNOM_ENTRY") CheckSimple2(73,3,ent.fragment,0) CheckSimple2(73,4,ent.poly_ord,3) CheckSimple2(73,5,ent.in_fields,( "in1", )) CheckSimple2(73,6,ent.a,(3.9, 4.8, 5.7, 6.6)) # 75: add / entry (linterp) check ent = pygetdata.entry(pygetdata.LINTERP_ENTRY, "mnew6", 0, {"in_field": "in", "table": "./more/table"}) try: d.madd(ent, "data") except: CheckOK2(75,1) try: ent = d.entry("data/mnew6") except: CheckOK2(75,2) CheckSimple2(75,1,ent.field_type,pygetdata.LINTERP_ENTRY) CheckSimple2(75,2,ent.field_type_name,"LINTERP_ENTRY") CheckSimple2(75,3,ent.fragment,0) CheckSimple2(75,4,ent.in_fields,( "in", )) CheckSimple2(75,5,ent.table,"./more/table") # 76: add / entry (bit) check ent = pygetdata.entry(pygetdata.BIT_ENTRY, "mnew7", 0, {"in_field": "in1", "bitnum": 3, "numbits": 2}) try: d.madd(ent,"data") except: CheckOK2(76,1) try: ent = d.entry("data/mnew7") except: CheckOK2(76,1) CheckSimple2(76,1,ent.field_type,pygetdata.BIT_ENTRY) CheckSimple2(76,2,ent.field_type_name,"BIT_ENTRY") CheckSimple2(76,3,ent.fragment,0) CheckSimple2(76,4,ent.in_fields,( "in1", )) CheckSimple2(76,5,ent.numbits,2) CheckSimple2(76,6,ent.bitnum,3) # 77: add / entry (sbit) check ent = pygetdata.entry(pygetdata.SBIT_ENTRY, "mnew8", 0, {"in_field": "in2", "bitnum": 4, "numbits": 5}) try: d.madd(ent,"data") except: CheckOK2(77,1) try: ent = d.entry("data/mnew8") except: CheckOK2(77,2) CheckSimple2(77,1,ent.field_type,pygetdata.SBIT_ENTRY) CheckSimple2(77,2,ent.field_type_name,"SBIT_ENTRY") CheckSimple2(77,3,ent.fragment,0) CheckSimple2(77,4,ent.in_fields,( "in2", )) CheckSimple2(77,5,ent.numbits,5) CheckSimple2(77,6,ent.bitnum,4) # 78: add / entry (mult) check ent = pygetdata.entry(pygetdata.MULTIPLY_ENTRY, "mnew9", 0, {"in_field1": "in3", "in_field2": "in2"}) try: d.madd(ent,"data") except: CheckOK2(78,1) try: ent = d.entry("data/mnew9") except: CheckOK2(78,2) CheckSimple2(78,1,ent.field_type,pygetdata.MULTIPLY_ENTRY) CheckSimple2(78,2,ent.field_type_name,"MULTIPLY_ENTRY") CheckSimple2(78,3,ent.fragment,0) CheckSimple2(78,4,ent.in_fields,( "in3", "in2")) # 79: add / entry (phase) check ent = pygetdata.entry(pygetdata.PHASE_ENTRY, "mnew10", 0, {"in_field": "in3", "shift": 44}) try: d.madd(ent,"data") except: CheckOK2(79,1) try: ent = d.entry("data/mnew10") except: CheckOK2(79,2) CheckSimple2(79,1,ent.field_type,pygetdata.PHASE_ENTRY) CheckSimple2(79,2,ent.field_type_name,"PHASE_ENTRY") CheckSimple2(79,3,ent.fragment,0) CheckSimple2(79,4,ent.in_fields,( "in3", )) CheckSimple2(79,5,ent.shift,44) # 80: add / entry (const) check ent = pygetdata.entry(pygetdata.CONST_ENTRY, "mnew11", 0, {"type": pygetdata.FLOAT64}) try: d.madd(ent,"data") except: CheckOK2(80,1) try: ent = d.entry("data/mnew11") except: CheckOK2(80,2) CheckSimple2(80,1,ent.field_type,pygetdata.CONST_ENTRY) CheckSimple2(80,2,ent.field_type_name,"CONST_ENTRY") CheckSimple2(80,3,ent.fragment,0) CheckSimple2(80,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(80,5,ent.data_type_name,"FLOAT64") #81: string check try: n = d.get_string("string") except: CheckOK(81) CheckSimple(81,n,"Zaphod Beeblebrox") # 82: entry (string) check ent = pygetdata.entry(pygetdata.STRING_ENTRY, "new12", 0) try: d.add(ent) except: CheckOK2(82,1) try: ent = d.entry("new12") except: CheckOK(82) CheckSimple2(82,1,ent.field_type,pygetdata.STRING_ENTRY) CheckSimple2(82,2,ent.field_type_name,"STRING_ENTRY") CheckSimple2(82,3,ent.fragment,0) # 84: add_spec check try: d.add_spec("lorem STRING \"Lorem ipsum\"", 0) except: CheckOK2(84,1) try: n = d.get_string("lorem") except: CheckOK2(84,2) CheckSimple(84,n,"Lorem ipsum") # 85: madd_spec check try: d.madd_spec("ipsum STRING \"dolor sit amet.\"", "lorem") except: CheckOK2(85,1) try: n = d.get_string("lorem/ipsum") except: CheckOK2(85,2) CheckSimple(85,n,"dolor sit amet.") # 86: put_constant / int check try: d.put_constant("const", 86) except: CheckOK2(86,1) try: n = d.get_constant("const",pygetdata.INT) except: CheckOK2(86,2) CheckSimple(86,n,86) # 88: put_constant / int check try: d.put_constant("const", 128L) except: CheckOK2(88,1) try: n = d.get_constant("const",pygetdata.ULONG) except: CheckOK2(88,2) CheckSimple(88,n,128L) # 89: put_constant / int check try: d.put_constant("const", 89L) except: CheckOK2(89,1) try: n = d.get_constant("const",pygetdata.LONG) except: CheckOK2(89,2) CheckSimple(89,n,89L) # 91: put_constant / float check try: d.put_constant("const", 91.) except: CheckOK2(91,1) try: n = d.get_constant("const",pygetdata.FLOAT) except: CheckOK2(91,2) CheckSimple(91,n,91.) # 93: put_constant / complex check try: d.put_constant("const", 93.+0j) except: CheckOK2(93,1) try: n = d.get_constant("const",pygetdata.COMPLEX) except: CheckOK2(93,2) CheckSimple(93,n,93.+0j) # 94: put_string try: d.put_string("string", "Arthur Dent") except: CheckOK2(94,1) try: n = d.get_string("string") except: CheckOK2(94,2) CheckSimple(94,n,"Arthur Dent") # 95: nmfields_by_type check try: n = d.nmfields("data",pygetdata.LINCOM_ENTRY) except: CheckOK(95) CheckSimple(95,n,1) # 96: mfield_list_by_type check try: n = d.mfield_list("data",pygetdata.LINCOM_ENTRY) except: CheckOK(96) CheckSimple(96,n,["mnew1"]) # 97: nmvectors check try: n = d.nmvectors("data") except: CheckOK(97) CheckSimple(97,n,8) # 98: mvector_list check try: n = d.mvector_list("data") except: CheckOK(98) CheckSimple(98,n,['mlut', 'mnew1', 'mnew3', 'mnew6', 'mnew7', 'mnew8', 'mnew9', 'mnew10']) # 99: alter / raw check ent = pygetdata.entry(pygetdata.RAW_ENTRY, "new1", 0, {"type": pygetdata.FLOAT32, "spf": 4}) try: n = d.alter("new1", ent) except: CheckOK2(99,1) try: ent = d.entry("new1") except: CheckOK(99,2) CheckSimple2(99,1,ent.field_type,pygetdata.RAW_ENTRY) CheckSimple2(99,2,ent.field_type_name,"RAW_ENTRY") CheckSimple2(99,3,ent.fragment,0) CheckSimple2(99,4,ent.data_type,pygetdata.FLOAT32) CheckSimple2(99,5,ent.data_type_name,"FLOAT32") CheckSimple2(99,6,ent.spf,4) # 110: encoding check try: f = d.fragment(0) CheckSimple(110,f.encoding,pygetdata.UNENCODED) except: CheckOK(110) # 111: endianness check try: CheckSimple(111,f.endianness,pygetdata.LITTLE_ENDIAN | pygetdata.NOT_ARM_ENDIAN) except: CheckOK(111) # 112: dirfilename check try: CheckEOS(112,d.name,"dirfile") except: CheckOK(112) # 113: parent_fragment check try: f = d.fragment(1) CheckSimple(113,f.parent,0) except: CheckOK(113) # 114: dirfile_protect check try: f.protection = pygetdata.PROTECT_DATA except: CheckOK(114) # 115: protection check try: f = d.fragment(1) CheckSimple(115,f.protection,pygetdata.PROTECT_DATA) except: CheckOK(115) # 116: raw_filename check try: n = d.raw_filename("data") except: CheckOK(116) CheckEOS(116,n,"dirfile/data") # 117: reference check try: d.reference = "new1" except: CheckOK2(117,1) try: CheckSimple(117,d.reference,"new1") except: CheckOK2(117,2) # 118: eof check try: n = d.eof("lincom") except: CheckOK(118) CheckSimple(118,n,80) # 119: alter_encoding check try: f = d.fragment(1) f.alter_encoding(pygetdata.SLIM_ENCODED,0) except: CheckOK(119) # 120: alter_endianness check try: f.alter_endianness(pygetdata.BIG_ENDIAN,0) except: CheckOK(120) # 121: alter_spec check try: d.alter_spec("new10 PHASE in5 3", 0) except: CheckOK2(121,1) try: ent = d.entry("new10") except: CheckOK2(121,2) CheckSimple2(121,1,ent.field_type,pygetdata.PHASE_ENTRY) CheckSimple2(121,2,ent.field_type_name,"PHASE_ENTRY") CheckSimple2(121,3,ent.fragment,0) CheckSimple2(121,4,ent.in_fields,( "in5", )) CheckSimple2(121,5,ent.shift,3) # 122: delete check try: d.delete("new10",0) except: CheckOK2(122,1) try: ent = d.entry("new10") except: CheckException2(122,2,pygetdata.BadCodeError) # 123: malter_spec check try: d.malter_spec("mnew10 PHASE in4 11", "data", 0) except: CheckOK2(123,1) try: ent = d.entry("data/mnew10") except: CheckOK2(123,2) CheckSimple2(123,1,ent.field_type,pygetdata.PHASE_ENTRY) CheckSimple2(123,2,ent.field_type_name,"PHASE_ENTRY") CheckSimple2(123,3,ent.fragment,0) CheckSimple2(123,4,ent.in_fields,( "in4", )) CheckSimple2(123,5,ent.shift,11) # 124: move check try: d.move("new9", 1, 0) except: CheckOK2(124,1) try: ent = d.entry("new9") except: CheckOK2(124,2) CheckSimple2(124,1,ent.field_type,pygetdata.MULTIPLY_ENTRY) CheckSimple2(124,2,ent.field_type_name,"MULTIPLY_ENTRY") CheckSimple2(124,3,ent.fragment,1) CheckSimple2(124,4,ent.in_fields,( "in1", "in2")) # 125: rename check try: d.rename("new9", "newer", 0) except: CheckOK2(125,1) try: ent = d.entry("new9") except: CheckException2(125,2,pygetdata.BadCodeError) try: ent = d.entry("newer") except: CheckOK2(125,3) CheckSimple2(125,1,ent.field_type,pygetdata.MULTIPLY_ENTRY) CheckSimple2(125,2,ent.field_type_name,"MULTIPLY_ENTRY") CheckSimple2(125,3,ent.fragment,1) CheckSimple2(125,4,ent.in_fields,( "in1", "in2")) # 126: uninclude check try: d.uninclude(1,0) except: CheckOK2(126,1) try: ent = d.entry("newer") except: CheckException2(126,2,pygetdata.BadCodeError) # 127: frameoffset check try: f = d.fragment(0) CheckSimple(127,f.frameoffset,0) except: CheckOK(127) # 128: alter_frameoffset check try: f.alter_frameoffset(33, 0) CheckSimple(128,f.frameoffset,33) except: CheckOK(128) # 129: native_type check try: n = d.native_type("data") except: CheckOK(129) CheckSimple(129,n,pygetdata.INT8) # 131: validate check try: d.validate("new7") except: CheckException(131,pygetdata.BadCodeError) # 133: framenum check try: n = d.framenum("data", 33.3, start=6) except: CheckOK(133) CheckSimple(133,n,37.0375) # 138: putdata (auto) check p = [ 53.+0j, 54.+0j, 55.+0j, 56.+0j ] try: n = d.putdata("data", p, first_frame=38, first_sample=1) except: CheckOK2(138,1) CheckSimple2(138,1,n,4) try: n = d.getdata("data", pygetdata.INT, first_frame=38, num_frames=1, as_list=1) except: CheckOK2(138,2) CheckSimple2(138,2,n,[41, 53, 54, 55, 56, 46, 47, 48]) # 139: native_type_name check try: n = d.native_type_name("data") except: CheckOK(139) CheckSimple(139,n,"INT8") # 142: bof check try: n = d.bof("lincom") except: CheckOK(142) CheckSimple(142,n,264) # 143: entry (div) check try: ent = d.entry("div") except: CheckOK(143) CheckSimple2(143,1,ent.field_type,pygetdata.DIVIDE_ENTRY) CheckSimple2(143,2,ent.field_type_name,"DIVIDE_ENTRY") CheckSimple2(143,3,ent.fragment,0) CheckSimple2(143,4,ent.in_fields,( "mult", "bit")) # 145: entry (recip) check try: ent = d.entry("recip") except: CheckOK(145) CheckSimple2(145,1,ent.field_type,pygetdata.RECIP_ENTRY) CheckSimple2(145,2,ent.field_type_name,"RECIP_ENTRY") CheckSimple2(145,3,ent.fragment,0) CheckSimple2(145,4,ent.in_fields,( "div",)) CheckSimple2(145,6,ent.dividend,6.5+4.3j) # 146: add / entry (divide) check ent = pygetdata.entry(pygetdata.DIVIDE_ENTRY, "new14", 0, ("in1", "in2")) try: d.add(ent) except: CheckOK2(146,1) try: ent = d.entry("new14") except: CheckOK2(146,2) CheckSimple2(146,1,ent.field_type,pygetdata.DIVIDE_ENTRY) CheckSimple2(146,2,ent.fragment,0) CheckSimple2(146,3,ent.in_fields,( "in1", "in2")) # 148: add / entry (recip) check ent = pygetdata.entry(pygetdata.RECIP_ENTRY, "new16", 0, ("in3", 33.3)) try: d.add(ent) except: CheckOK2(148,1) try: ent = d.entry("new16") except: CheckOK2(148,2) CheckSimple2(148,1,ent.field_type,pygetdata.RECIP_ENTRY) CheckSimple2(148,2,ent.fragment,0) CheckSimple2(148,3,ent.in_fields,( "in3",)) CheckSimple2(148,4,ent.dividend,33.3) # 149: madd / entry (div) check ent = pygetdata.entry(pygetdata.DIVIDE_ENTRY, "mnew14", 0, {"in_field1": "in3", "in_field2": "in2"}) try: d.madd(ent,"data") except: CheckOK2(149,1) try: ent = d.entry("data/mnew14") except: CheckOK2(149,2) CheckSimple2(149,1,ent.field_type,pygetdata.DIVIDE_ENTRY) CheckSimple2(149,2,ent.fragment,0) CheckSimple2(149,3,ent.in_fields,( "in3", "in2")) # 151: madd / entry (recip) check ent = pygetdata.entry(pygetdata.RECIP_ENTRY, "mnew16", 0, {"in_field": "in3", "dividend": "const"}) try: d.madd(ent,"data") except: CheckOK2(151,1) try: ent = d.entry("data/mnew16") except: CheckOK2(151,2) CheckSimple2(151,1,ent.field_type,pygetdata.RECIP_ENTRY) CheckSimple2(151,2,ent.fragment,0) CheckSimple2(151,3,ent.in_fields,( "in3",)) CheckSimple2(151,4,ent.dividend,"const") # 155: fragment.rewrite check try: f.rewrite() except: CheckOK(155) # 156: invalid dirfile check try: m = pygetdata.dirfile(None) except: CheckOK2(156,1) try: n = m.nfragments() except: CheckException2(156,2,pygetdata.BadDirfileError) try: m.discard() except: pass # 157: standards version try: n = d.standards except: CheckOK2(157,1) CheckSimple(157,n,pygetdata.DIRFILE_STANDARDS_VERSION) try: d.standards = 0 except: CheckException2(157,2,pygetdata.ArgumentError) # 158: gd_get_carray try: n = d.get_carray("carray", pygetdata.INT) except: CheckOK(158) if (pygetdata.__numpy_supported__): CheckNumpy(158,n,numpy.arange(1,7)) else: CheckSimple(158,n,[1, 2, 3, 4, 5, 6]) # 159: gd_get_carray_slice (INT8) try: n = d.get_carray("carray", pygetdata.INT, start=2, len=2) except: CheckOK(159) if (pygetdata.__numpy_supported__): CheckNumpy(159,n,numpy.arange(3,5)) else: CheckSimple(159,n,[3, 4]) # 162: gd_get_carray_slice (INT64) try: n = d.get_carray("carray", pygetdata.LONG, start=2, len=2) except: CheckOK(162) if (pygetdata.__numpy_supported__): CheckNumpy(162,n,numpy.arange(3L,5L)) else: CheckSimple(162,n,[3L, 4L]) # 164: gd_get_carray_slice (FLOAT64) try: n = d.get_carray("carray", pygetdata.FLOAT, start=2, len=2) except: CheckOK(164) if (pygetdata.__numpy_supported__): CheckNumpy(164,n,numpy.array([3.3, 4.4])) else: CheckSimple(164,n,[3.3, 4.4]) # 166: gd_get_carray_slice (COMPLEX128) try: n = d.get_carray("carray", pygetdata.COMPLEX, start=2, len=2) except: CheckOK(166) if (pygetdata.__numpy_supported__): CheckNumpy(166,n,numpy.array([3.3+0j, 4.4+0j])) else: CheckSimple(166,n,[3.3+0j, 4.4+0j]) # 167: gd_carrays try: n = d.carrays(pygetdata.INT) except: CheckOK(167) CheckSimple2(167,1,len(n),1) if (pygetdata.__numpy_supported__): CheckSimple2(167,2,n[0][0],"carray") CheckNumpy2(167,3,n[0][1],numpy.arange(1,7)) else: CheckSimple(167,n,[("carray", [1,2,3,4,5,6])]) # 168: gd_put_carray try: d.put_carray("carray", [9,8,7,6,5,4]) except: CheckOK2(168,1) try: n = d.get_carray("carray", pygetdata.INT) except: CheckOK2(168,2) if (pygetdata.__numpy_supported__): CheckNumpy(168,n,numpy.arange(9,3,-1)) else: CheckSimple(168,n,[9,8,7,6,5,4]) # 169: gd_put_carray_slice (INT8) try: d.put_carray("carray", [169,169], start=2) except: CheckOK2(169,1) try: n = d.get_carray("carray", pygetdata.INT) except: CheckOK2(169,2) if (pygetdata.__numpy_supported__): CheckNumpy(169,n,numpy.array([9,8,169,169,5,4])) else: CheckSimple(169,n,[9,8,169,169,5,4]) # 172: gd_put_carray_slice (INT64) try: d.put_carray("carray", [172L,172L], start=2) except: CheckOK2(172,1) try: n = d.get_carray("carray", pygetdata.INT) except: CheckOK2(172,2) if (pygetdata.__numpy_supported__): CheckNumpy(172,n,numpy.array([9,8,172,172,5,4])) else: CheckSimple(172,n,[9,8,172,172,5,4]) # 174: gd_put_carray_slice (FLOAT64) try: d.put_carray("carray", [174.,174.], start=2) except: CheckOK2(174,1) try: n = d.get_carray("carray", pygetdata.INT) except: CheckOK2(174,2) if (pygetdata.__numpy_supported__): CheckNumpy(174,n,numpy.array([9,8,174,174,5,4])) else: CheckSimple(174,n,[9,8,174,174,5,4]) # 176: gd_put_carray_slice (COMPLEX128) try: d.put_carray("carray", [176.+0j,176.+0j], start=2) except: CheckOK2(176,1) try: n = d.get_carray("carray", pygetdata.INT) except: CheckOK2(176,2) if (pygetdata.__numpy_supported__): CheckNumpy(176,n,numpy.array([9,8,176,176,5,4])) else: CheckSimple(176,n,[9,8,176,176,5,4]) # 177: gd_carray_len try: n = d.carray_len("carray") except: CheckOK(177) CheckSimple(177,n,6) # 178: gd_entry (CARRAY) try: ent = d.entry("carray") except: CheckOK(178) CheckSimple2(178,1,ent.field_type,pygetdata.CARRAY_ENTRY) CheckSimple2(178,2,ent.field_type_name,"CARRAY_ENTRY") CheckSimple2(178,3,ent.fragment,0) CheckSimple2(178,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(178,5,ent.data_type_name,"FLOAT64") CheckSimple2(178,6,ent.array_len,6) # 179: gd_add_carray ent = pygetdata.entry(pygetdata.CARRAY_ENTRY, "new17", 0, (pygetdata.FLOAT64,2)) try: d.add(ent) except: CheckOK2(179,1) try: ent = d.entry("new17") except: CheckOK2(179,2) CheckSimple2(179,1,ent.field_type,pygetdata.CARRAY_ENTRY) CheckSimple2(179,2,ent.field_type_name,"CARRAY_ENTRY") CheckSimple2(179,3,ent.fragment,0) CheckSimple2(179,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(179,5,ent.data_type_name,"FLOAT64") CheckSimple2(179,6,ent.array_len,2) # 180: gd_madd_carray ent = pygetdata.entry(pygetdata.CARRAY_ENTRY, "mnew17", 0, {"type": pygetdata.FLOAT64, "array_len": 2}) try: d.madd(ent,"data") except: CheckOK2(180,1) try: ent = d.entry("data/mnew17") except: CheckOK2(180,2) CheckSimple2(180,1,ent.field_type,pygetdata.CARRAY_ENTRY) CheckSimple2(180,2,ent.field_type_name,"CARRAY_ENTRY") CheckSimple2(180,3,ent.fragment,0) CheckSimple2(180,4,ent.data_type,pygetdata.FLOAT64) CheckSimple2(180,5,ent.data_type_name,"FLOAT64") CheckSimple2(180,6,ent.array_len,2) # 183: gd_constants (int) try: n = d.constants(pygetdata.INT) except: CheckOK(183) CheckSimple(183,n,[('const', 93), ('new11', 0)]) # 186: gd_constants (long) try: n = d.constants(pygetdata.LONG) except: CheckOK(186) CheckSimple(186,n,[('const', 93L), ('new11', 0L)]) # 188: gd_constants (float) try: n = d.constants(pygetdata.FLOAT) except: CheckOK(188) CheckSimple(188,n,[('const', 93.0), ('new11', 0.0)]) # 190: gd_constants (complex) try: n = d.constants(pygetdata.COMPLEX) except: CheckOK(190) CheckSimple(190,n,[('const', 93.0), ('new11', 0.0)]) # 191: gd_constants (int) try: n = d.mconstants("data", pygetdata.INT) except: CheckOK(191) CheckSimple(191,n,[('mconst', 3), ('mnew11', 0)]) # 194: gd_constants (long) try: n = d.mconstants("data", pygetdata.LONG) except: CheckOK(194) CheckSimple(194,n,[('mconst', 3L), ('mnew11', 0L)]) # 196: gd_constants (float) try: n = d.mconstants("data", pygetdata.FLOAT) except: CheckOK(196) CheckSimple(196,n,[('mconst', 3.3), ('mnew11', 0.)]) # 198: gd_constants (complex) try: n = d.mconstants("data", pygetdata.COMPLEX) except: CheckOK(198) CheckSimple(198,n,[('mconst', 3.3+4.4j), ('mnew11', 0j)]) # 199: gd_strings try: n = d.strings() except: CheckOK(199) CheckSimple(199,n,[('lorem', 'Lorem ipsum'), ('new12', ''), ('string', 'Arthur Dent')]) # 200: gd_strings try: n = d.mstrings("data") except: CheckOK(200) CheckSimple(200,n,[('mstr', 'This is a string constant.')]) # 203: gd_seek try: n = d.seek("data", pygetdata.SEEK_SET, frame_num=35) except: CheckOK2(203,0) try: m = d.getdata("data", pygetdata.INT, first_frame=pygetdata.HERE, num_frames=1) except: CheckOK2(203,1) CheckSimple2(203,0,n,280) CheckSimple2(203,1,len(m),8) if (pygetdata.__numpy_supported__): CheckNumpy2(203,2,m,numpy.arange(17,25)) else: CheckSimple2(203,2,m,range(17,25)) # 204: gd_tell try: n = d.tell("data") except: CheckOK(204) CheckSimple(204,n,288) # 205: gd_hide check try: d.hide('data') except: CheckOK(205) # 206: gd_hidden check try: n = d.hidden('data') except: CheckOK2(206, 1) CheckSimple2(206, 1, n, 1) try: n = d.hidden('lincom') except: CheckOK2(206, 2) CheckSimple2(206, 2, n, 0) # 207: gd_unhide check try: d.unhide('data') except: CheckOK2(206, 1) try: n = d.hidden('data') except: CheckOK2(206, 2) CheckSimple(206, n, 0) # 208: gd_sync check try: d.sync('data') except: CheckOK(208) # 209: gd_flush check try: d.flush('data') except: CheckOK(209) # 210: gd_metaflush check try: d.metaflush() except: CheckOK(210) # 211: gd_entry (WINDOW) check try: ent = d.entry('window') except: CheckOK(211) CheckSimple2(211, 1, ent.field_type, pygetdata.WINDOW_ENTRY) CheckSimple2(211, 2, ent.fragment, 0) CheckSimple2(211, 3, ent.windop, pygetdata.WINDOP_LT) CheckSimple2(211, 4, ent.in_fields, ( 'linterp', 'mult' )) CheckSimple2(211, 5, ent.threshold, 4.1) # 212: gd_add_window check ent = pygetdata.entry(pygetdata.WINDOW_ENTRY, "new18", 0, ("in1", "in2", pygetdata.WINDOP_NE, 32)) try: d.add(ent) except: CheckOK2(212, 1) try: ent = d.entry('new18') except: CheckOK2(212, 2) CheckSimple2(212, 1, ent.field_type, pygetdata.WINDOW_ENTRY) CheckSimple2(212, 2, ent.fragment, 0) CheckSimple2(212, 3, ent.windop, pygetdata.WINDOP_NE) CheckSimple2(212, 4, ent.in_fields, ( 'in1', 'in2' )) CheckSimple2(212, 5, ent.threshold, 32) # 214: gd_madd_window check ent = pygetdata.entry(pygetdata.WINDOW_ENTRY, "mnew18", 0, ("in2", "in3", pygetdata.WINDOP_SET, 128)) try: d.madd(ent, "data") except: CheckOK2(214, 1) try: ent = d.entry('data/mnew18') except: CheckOK2(214, 2) CheckSimple2(214, 1, ent.field_type, pygetdata.WINDOW_ENTRY) CheckSimple2(214, 2, ent.fragment, 0) CheckSimple2(214, 3, ent.windop, pygetdata.WINDOP_SET) CheckSimple2(214, 4, ent.in_fields, ( 'in2', 'in3' )) CheckSimple2(214, 5, ent.threshold, 128) # 217: gd_alter_window check ent = pygetdata.entry(pygetdata.WINDOW_ENTRY, "new18", 0, { "threshold": 32e3, "in_field1": "in3", "in_field2": "in4", "windop": pygetdata.WINDOP_GE }) try: d.alter('new18', ent) except: CheckOK2(217, 1) try: ent = d.entry('new18') except: CheckOK2(217, 2) CheckSimple2(217, 1, ent.field_type, pygetdata.WINDOW_ENTRY) CheckSimple2(217, 2, ent.fragment, 0) CheckSimple2(217, 3, ent.windop, pygetdata.WINDOP_GE) CheckSimple2(217, 4, ent.in_fields, ( 'in3', 'in4' )) CheckSimple2(217, 5, ent.threshold, 32e3) # 218: gd_alias_target check try: str = d.alias_target('alias') except: CheckOK(218) CheckSimple(218, str, 'data') # 219: gd_add_alias check try: d.add_alias('new20', 'data', 0) except: CheckOK2(219, 1) try: str = d.alias_target('new20') except: CheckOK2(219, 2) CheckSimple(219, str, 'data') # 220: gd_madd_alias check try: d.madd_alias('data', 'mnew20', 'data') except: CheckOK2(220, 1) try: str = d.alias_target('data/mnew20') except: CheckOK2(220, 2) CheckSimple(220, str, 'data') # 221: gd_naliases check try: n = d.naliases('data') except: CheckOK(221) CheckSimple(221, n, 4) # 222: gd_aliases check try: n = d.aliases('data') except: CheckOK(222) CheckSimple(222, n, [ 'data', 'alias', 'data/mnew20', 'new20' ]) # 223: gd_include_affix check try: d.include('format1', 0, prefix='A', suffix='Z', flags=pygetdata.CREAT | pygetdata.EXCL) except: CheckOK(223) # 226: gd_fragment_affixes check try: n = d.fragment(1).prefix m = d.fragment(1).suffix except: CheckOK(226) CheckSimple2(226, 1, n, "A") CheckSimple2(226, 2, m, "Z") # 227: gd_alter_affixes check try: d.fragment(1).prefix = "B" d.fragment(1).suffix = "" except: CheckOK2(227, 1) try: n = d.fragment(1).prefix m = d.fragment(1).suffix except: CheckOK2(227, 2) CheckSimple2(227, 1, n, "B") CheckSimple2(227, 2, m, "") # 228: gd_entry (MPLEX) check try: ent = d.entry('mplex') except: CheckOK(228) CheckSimple2(228, 1, ent.field_type, pygetdata.MPLEX_ENTRY) CheckSimple2(228, 2, ent.fragment, 0) CheckSimple2(228, 3, ent.count_val, 1) CheckSimple2(228, 4, ent.in_fields, ( 'data', 'sbit' )) CheckSimple2(228, 5, ent.period, 10) # 229: gd_add_mplex check ent = pygetdata.entry(pygetdata.MPLEX_ENTRY, "new21", 0, ("in1", "in2", 5, 6)) try: d.add(ent) except: CheckOK2(229, 1) try: ent = d.entry('new21') except: CheckOK2(229, 2) CheckSimple2(229, 1, ent.field_type, pygetdata.MPLEX_ENTRY) CheckSimple2(229, 2, ent.fragment, 0) CheckSimple2(229, 3, ent.count_val, 5) CheckSimple2(229, 4, ent.in_fields, ( 'in1', 'in2' )) CheckSimple2(229, 5, ent.period, 6) # 230: gd_madd_mplex check ent = pygetdata.entry(pygetdata.MPLEX_ENTRY, "mnew21", 0, ("in2", "in3", 0, 12)) try: d.madd(ent, "data") except: CheckOK2(230, 1) try: ent = d.entry('data/mnew21') except: CheckOK2(230, 2) CheckSimple2(230, 1, ent.field_type, pygetdata.MPLEX_ENTRY) CheckSimple2(230, 2, ent.fragment, 0) CheckSimple2(230, 3, ent.count_val, 0) CheckSimple2(230, 4, ent.in_fields, ( 'in2', 'in3' )) CheckSimple2(230, 5, ent.period, 12) # 231: gd_alter_mplex check ent = pygetdata.entry(pygetdata.MPLEX_ENTRY, "new21", 0, { "count_val": 3, "in_field1": "in3", "in_field2": "in4", "period": 7 }) try: d.alter('new21', ent) except: CheckOK2(231, 1) try: ent = d.entry('new21') except: CheckOK2(231, 2) CheckSimple2(231, 1, ent.field_type, pygetdata.MPLEX_ENTRY) CheckSimple2(231, 2, ent.fragment, 0) CheckSimple2(231, 3, ent.count_val, 3) CheckSimple2(231, 4, ent.in_fields, ( 'in3', 'in4' )) CheckSimple2(231, 5, ent.period, 7) # 232: gd_strtok check try: str = d.strtok("\"test1 test2\" test3\ test4") except: CheckOK2(232, 1) CheckSimple2(232, 2, str, "test1 test2") try: str = d.strtok() except: CheckOK2(232, 3) CheckSimple2(232, 4, str, "test3 test4") # 233: gd_raw_close check try: d.raw_close('data') except: CheckOK(233) # 234: gd_desync check try: n = d.desync() except: CheckOK(234) CheckSimple(234, n, 0) # 235: gd_flags check try: d.flags = pygetdata.PRETTY_PRINT except: CheckOK2(235,1) try: CheckSimple(235, d.flags, pygetdata.PRETTY_PRINT) except: CheckOK2(235,2) # 236: gd_verbose_prefix check try: CheckSimple(236, d.verbose_prefix, None) except: CheckOK2(236, 1) try: d.verbose_prefix = "big_test: " except: CheckOK2(236, 2) CheckSimple(236, d.verbose_prefix, "big_test: ") # 237: gd_nentries check try: n = d.nentries("data", pygetdata.SCALAR_ENTRIES, pygetdata.ENTRIES_HIDDEN | pygetdata.ENTRIES_NOALIAS) except: CheckOK2(237, 1) CheckSimple2(237, 1, n, 5) try: n = d.nentries(type = pygetdata.VECTOR_ENTRIES, flags = pygetdata.ENTRIES_HIDDEN | pygetdata.ENTRIES_NOALIAS) except: CheckOK2(237, 2) CheckSimple2(237, 2, n, 23) # 239: gd_entry_list check try: n = d.entry_list(type = pygetdata.VECTOR_ENTRIES, flags = pygetdata.ENTRIES_HIDDEN | pygetdata.ENTRIES_NOALIAS) except: CheckOK(239) CheckSimple(239,n, ['INDEX', 'bit', 'data', 'div', 'lincom', 'linterp', 'mplex', 'mult', 'new1', 'new14', 'new16', 'new18', 'new2', 'new21', 'new4', 'new6', 'new7', 'new8', 'phase', 'polynom', 'recip', 'sbit', 'window']) # 240: gd_mplex_lookback check try: d.mplex_lookback = pygetdata.LOOKBACK_ALL except: CheckOK(240, 1) try: n = d.mplex_lookback except: CheckOK2(240, 2) CheckSimple(240, n, pygetdata.LOOKBACK_ALL) # 241: linterp_tablename check try: n = d.linterp_tablename("linterp") except: CheckOK(241) CheckEOS(241,n,"dirfile/lut") # 242: mcarrays try: n = d.mcarrays("data", pygetdata.FLOAT) except: CheckOK(242) CheckSimple2(242,1,len(n),2) if (pygetdata.__numpy_supported__): CheckSimple2(242,2,n[0][0],"mcarray") CheckNumpy2(242,3,n[0][1],1.9 + 0.9 * numpy.arange(0,5)) CheckSimple2(242,4,n[1][0],"mnew17") CheckNumpy2(242,5,n[1][1],[0,0]) else: CheckSimple(242,n,[("mcarray", [1.9, 2.8, 3.7, 4.6, 5.5]), ("mnew17", [0,0])]) # 271: encoding_support n = pygetdata.encoding_support(pygetdata.SIE_ENCODED) CheckSimple(271,n,pygetdata.RDWR) # 272: check NULL return from gd_reference try: m = pygetdata.dirfile("dirfile/empty", pygetdata.RDWR | pygetdata.CREAT | pygetdata.EXCL) except: CheckOK2(272, 1) try: n = m.reference; CheckSimple(272, n, None); except: CheckOK2(272, 2) # ========================================================================== d.discard() del d os.system("rm -rf dirfile") if (ne > 0): print "ne =", ne print "__numpy_supported__ =", pygetdata.__numpy_supported__ sys.exit(1) libgetdata-0.9.0/bindings/python/test/Makefile.am0000640000175000017500000000247312614323564022143 0ustar alastairalastair# Copyright (C) 2009, 2010, 2012, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests if TEST_PYTHON TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} PYTHONPATH=..:${PYTHONPATH} ${PYTHON} pyTESTS=callback.py big_test.py TESTS=$(addprefix ${srcdir}/,$(pyTESTS)) endif EXTRA_DIST=${pyTESTS} # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ libgetdata-0.9.0/bindings/python/Makefile.am0000640000175000017500000000304212614323564021155 0ustar alastairalastair# Copyright (C) 2009, 2013, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SUBDIRS=test nodist_python_SCRIPTS = pygetdata.so BUILT_SOURCES = pyconstants.c EXTRA_DIST = pydirfile.c pygetdata.c pyentry.c pygetdata.h pyfragment.c distutils_path=build/lib.${PYTHON_PLATFORM}-${PYTHON_VERSION} pygetdata.so: ${distutils_path}/pygetdata.so cp $< $@ ${distutils_path}/pygetdata.so: setup.py ${BUILT_SOURCES} ${EXTRA_DIST} ${PYTHON} setup.py build pyconstants.c: ../make_parameters ../make_parameters p > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters clean-local: if MAKE_PYBINDINGS if [ -e setup.py ]; then ${PYTHON} setup.py clean; fi endif rm -rf build pygetdata.so ${BUILT_SOURCES} debug.c *~ libgetdata-0.9.0/bindings/python/pygetdata.c0000640000175000017500000004750712614323564021265 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "pygetdata.h" static PyObject *GdPy_DirfileError; static const char *gdpy_exception_list[GD_N_ERROR_CODES] = { NULL, NULL, /* 1 */ "Format", NULL, /* 3 */ "Creation", "BadCode", "BadType", "IO", NULL, /* 8 */ "Internal", "Alloc", "Range", "LUT", "RecurseLevel", "BadDirfile", "BadFieldType", "AccessMode", "Unsupported", "UnknownEncoding", "BadEntry", "Duplicate", "Dimension", "BadIndex", "BadScalar", "BadReference", "Protected", "Deletion", "Argument", "Callback", "Exists", "UncleanDatabase", "Domain", "BadRepr", NULL, /* 33 */ NULL, /* 34 */ "Bounds", "LineTooLong" }; PyObject *gdpy_exceptions[GD_N_ERROR_CODES]; /* These are unused but for backwards compatibility are defined as aliases of * current exceptions */ static struct { const char *name; int e; } gdpy_dead_exceptions[] = { { "BadEndianness", GD_E_ARGUMENT }, { "BadProtection", GD_E_ARGUMENT }, { "BadVersion", GD_E_ARGUMENT }, { "OpenLinfile", GD_E_LUT }, { "Flush", GD_E_IO }, { "Open", GD_E_IO }, { "OpenFragment", GD_E_IO }, { "OpenFragment", GD_E_IO }, { "OpenInclude", GD_E_IO }, { "RawIO", GD_E_IO }, { "Trunc", GD_E_IO }, { NULL, 0} }; /* Like PyList_Append, but steal the object's reference */ int gdpylist_append(PyObject *list, PyObject *item) { dtrace("%p, %p", list, item); int ret; ret = PyList_Append(list, item); Py_DECREF(item); dreturn("%i", ret); return ret; } /* Create an array of strings from a NULL-terminated string list */ PyObject *gdpy_to_pystringlist(const char **list) { PyObject *pyobj; size_t i; dtrace("%p", list); pyobj = PyList_New(0); if (pyobj) for (i = 0; list[i] != NULL; ++i) if (gdpylist_append(pyobj, PyString_FromString(list[i]))) { Py_DECREF(pyobj); pyobj = NULL; break; } dreturn("%p", pyobj); return pyobj; } int gdpy_convert_from_pyobj(PyObject *value, union gdpy_quadruple_value *data, gd_type_t type) { int data_type; dtrace("%p, %p, %02x", value, data, type); /* check value type, and figure out autotype, if needed */ if (PyInt_Check(value)) { data->s = PyInt_AsLong(value); data_type = GDPY_INT_AS_LONG; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else if (PyLong_Check(value)) { if (type == GD_UNKNOWN) { /* try unsigned long long first */ data->u = PyLong_AsUnsignedLongLong(value); data_type = GDPY_LONG_AS_ULL; if (PyErr_Occurred()) { if (PyErr_ExceptionMatches(PyExc_OverflowError)) { /* too big */ data->f = PyLong_AsDouble(value); data_type = GDPY_LONG_AS_DOUBLE; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else if (PyErr_ExceptionMatches(PyExc_TypeError)) { /* too small */ data->f = PyLong_AsDouble(value); data_type = GDPY_LONG_AS_DOUBLE; if (PyErr_Occurred()) { if (PyErr_ExceptionMatches(PyExc_TypeError)) { /* still too small */ data->s = PyLong_AsLongLong(value); data_type = GDPY_LONG_AS_SLL; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else { /* some other error */ dreturn("%i", -1); return -1; } } } else { /* some other error */ dreturn("%i", -1); return -1; } } } else if (type & GD_SIGNED) { data->s = PyLong_AsLongLong(value); data_type = GDPY_LONG_AS_SLL; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else if (type & GD_IEEE754) { data->f = PyLong_AsDouble(value); data_type = GDPY_LONG_AS_DOUBLE; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else { data->u = PyLong_AsLongLong(value); data_type = GDPY_LONG_AS_ULL; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } } else if (PyFloat_Check(value)) { data->f = PyFloat_AsDouble(value); data_type = GDPY_FLOAT_AS_DOUBLE; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else if (PyComplex_Check(value)) { gdpy_as_complex(gd_csp_(data->c), value); data_type = GDPY_COMPLEX_AS_COMPLEX; if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } } else { /* a non-numeric type */ PyErr_SetString(PyExc_TypeError, "a numeric type was expected"); dreturn("%i", -1); return -1; } dreturn("%02x", data_type); return data_type; } gd_type_t gdpy_convert_from_pylist(PyObject *value, void *data, gd_type_t type, size_t ns) { size_t i; int data_type; union gdpy_quadruple_value tmp; dtrace("%p, %p, %02x, %zi", value, data, type, ns); /* use the first element to determine the data type */ data_type = gdpy_convert_from_pyobj(PyList_GetItem(value, 0), &tmp, type); if (data_type == -1) { dreturn("%02x", GD_UNKNOWN); return GD_UNKNOWN; } switch(data_type) { case GDPY_INT_AS_LONG: type = GD_INT32; *(int32_t*)data = tmp.s; for (i = 1; i < ns; ++i) ((int32_t*)data)[i] = PyInt_AsLong(PyList_GetItem(value, i)); break; case GDPY_LONG_AS_ULL: type = GD_UINT64; *(uint64_t*)data = tmp.u; for (i = 1; i < ns; ++i) ((uint64_t*)data)[i] = PyLong_AsUnsignedLongLong(PyList_GetItem(value, i)); break; case GDPY_LONG_AS_SLL: type = GD_INT64; *(int64_t*)data = tmp.s; for (i = 1; i < ns; ++i) ((int64_t*)data)[i] = PyLong_AsLongLong(PyList_GetItem(value, i)); break; case GDPY_LONG_AS_DOUBLE: type = GD_FLOAT64; *(double*)data = tmp.f; for (i = 1; i < ns; ++i) ((double*)data)[i] = PyLong_AsDouble(PyList_GetItem(value, i)); break; case GDPY_FLOAT_AS_DOUBLE: type = GD_FLOAT64; *(double*)data = tmp.f; for (i = 1; i < ns; ++i) ((double*)data)[i] = PyFloat_AsDouble(PyList_GetItem(value, i)); break; case GDPY_COMPLEX_AS_COMPLEX: type = GD_COMPLEX128; gd_cs2ca_(data, 0, tmp.c, double); for (i = 1; i < ns; ++i) gdpy_as_complex(((double*)data) + 2 * i, PyList_GetItem(value, i)); break; } dreturn("%02x", type); return type; } /* generic utitily functions */ gd_type_t gdpy_type_from_npytype(int npytype) { gd_type_t type; dtrace("%i", npytype); switch(npytype) { case NPY_UBYTE: type = GD_UINT8; break; case NPY_BYTE: type = GD_INT8; break; #if NPY_SIZEOF_SHORT <= 8 case NPY_SHORT: type = (gd_type_t)(NPY_SIZEOF_SHORT | GD_SIGNED); break; case NPY_USHORT: type = (gd_type_t)NPY_SIZEOF_SHORT; break; #endif #if NPY_SIZEOF_INT <= 8 case NPY_INT: type = (gd_type_t)(NPY_SIZEOF_INT | GD_SIGNED); break; case NPY_UINT: type = (gd_type_t)NPY_SIZEOF_INT; break; #endif #if NPY_SIZEOF_LONG <= 8 case NPY_LONG: type = (gd_type_t)(NPY_SIZEOF_LONG | GD_SIGNED); break; case NPY_ULONG: type = (gd_type_t)NPY_SIZEOF_LONG; break; #endif #if NPY_SIZEOF_LONGLONG <= 8 case NPY_LONGLONG: type = (gd_type_t)(NPY_SIZEOF_LONGLONG | GD_SIGNED); break; case NPY_ULONGLONG: type = (gd_type_t)NPY_SIZEOF_LONGLONG; break; #endif #if NPY_SIZEOF_FLOAT <= 8 case NPY_FLOAT: type = (gd_type_t)NPY_SIZEOF_FLOAT | GD_IEEE754; break; case NPY_CFLOAT: type = (gd_type_t)((2 * NPY_SIZEOF_FLOAT) | GD_COMPLEX); break; #endif #if NPY_SIZEOF_DOUBLE <= 8 case NPY_DOUBLE: type = (gd_type_t)(NPY_SIZEOF_DOUBLE | GD_IEEE754); break; case NPY_CDOUBLE: type = (gd_type_t)((2 * NPY_SIZEOF_DOUBLE) | GD_COMPLEX); break; #endif default: type = GD_UNKNOWN; break; } dreturn("0x%03x\n", type); return type; } int gdpy_npytype_from_type(gd_type_t type) { int npytype; dtrace("0x%03x", type); switch(type) { case GD_UINT8: npytype = PyArray_UINT8; break; case GD_INT8: npytype = PyArray_INT8; break; case GD_UINT16: npytype = PyArray_UINT16; break; case GD_INT16: npytype = PyArray_INT16; break; case GD_UINT32: npytype = PyArray_UINT32; break; case GD_INT32: npytype = PyArray_INT32; break; case GD_UINT64: npytype = PyArray_UINT64; break; case GD_INT64: npytype = PyArray_INT64; break; case GD_FLOAT32: npytype = PyArray_FLOAT32; break; case GD_FLOAT64: npytype = PyArray_FLOAT64; break; case GD_COMPLEX64: npytype = PyArray_COMPLEX64; break; case GD_COMPLEX128: npytype = PyArray_COMPLEX128; break; default: npytype = NPY_NOTYPE; break; } dreturn("%i", npytype); return npytype; } PyObject *gdpy_convert_to_pylist(const void *data, gd_type_t type, size_t ns) { size_t i; PyObject *pyobj; dtrace("%p, %02x, %zi", data, type, ns); if (type == GD_NULL) { Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } pyobj = PyList_New(0); switch(type) { case GD_UINT8: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyInt_FromLong((long)((uint8_t*)data)[i]))) return NULL; break; case GD_INT8: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyInt_FromLong((long)((int8_t*)data)[i]))) return NULL; break; case GD_UINT16: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyInt_FromLong((long)((uint16_t*)data)[i]))) return NULL; break; case GD_INT16: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyInt_FromLong((long)((int16_t*)data)[i]))) return NULL; break; case GD_UINT32: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyLong_FromUnsignedLong((unsigned long)((uint32_t*)data)[i]))) return NULL; break; case GD_INT32: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyInt_FromLong((long)((int32_t*)data)[i]))) return NULL; break; case GD_UINT64: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyLong_FromUnsignedLongLong( (unsigned long long)((uint64_t*)data)[i]))) return NULL; break; case GD_INT64: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyLong_FromLongLong((long long)((int64_t*)data)[i]))) return NULL; break; case GD_FLOAT32: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyFloat_FromDouble((double)((float*)data)[i]))) return NULL; break; case GD_FLOAT64: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, PyFloat_FromDouble(((double*)data)[i]))) return NULL; break; case GD_COMPLEX64: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, gdpy_from_complexp(((float*)data) + 2 * i))) return NULL; break; case GD_COMPLEX128: for (i = 0; i < ns; ++i) if (gdpylist_append(pyobj, gdpy_from_complexp(((double*)data) + 2 * i))) return NULL; break; case GD_NULL: case GD_UNKNOWN: /* prevent compiler warning */ break; } dreturn("%p", pyobj); return pyobj; } PyObject *gdpy_convert_to_pyobj(const void *data, gd_type_t type) { PyObject *pyobj = NULL; dtrace("%p, %02x", data, type); switch(type) { case GD_NULL: Py_INCREF(Py_None); pyobj = Py_None; break; case GD_UINT8: pyobj = PyInt_FromLong((long)*(uint8_t*)data); break; case GD_INT8: pyobj = PyInt_FromLong((long)*(int8_t*)data); break; case GD_UINT16: pyobj = PyInt_FromLong((long)*(uint16_t*)data); break; case GD_INT16: pyobj = PyInt_FromLong((long)*(int16_t*)data); break; case GD_UINT32: pyobj = PyLong_FromUnsignedLong((unsigned long)*(uint32_t*)data); break; case GD_INT32: pyobj = PyInt_FromLong((long)*(int32_t*)data); break; case GD_UINT64: pyobj = PyLong_FromUnsignedLongLong((unsigned long long)*(uint64_t*)data); break; case GD_INT64: pyobj = PyLong_FromLongLong((long long)*(int64_t*)data); break; case GD_FLOAT32: pyobj = PyFloat_FromDouble((double)*(float*)data); break; case GD_FLOAT64: pyobj = PyFloat_FromDouble(*(double*)data); break; case GD_COMPLEX64: pyobj = gdpy_from_complexp((float*)data); break; case GD_COMPLEX128: pyobj = gdpy_from_complexp((double*)data); break; case GD_UNKNOWN: /* prevent compiler warning */ break; } dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_encoding_support(struct gdpy_fragment_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "encoding", NULL }; unsigned long enc; PyObject *pyobj; int n; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "k:pygetdata.encoding_support", keywords, &enc)) { dreturn("%p", NULL); return NULL; } n = gd_encoding_support(enc); if (n == 0) { Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } pyobj = PyInt_FromLong(n); dreturn("%p", pyobj); return pyobj; } /* GetData */ static PyMethodDef GetDataMethods[] = { { "encoding_support", (PyCFunction)gdpy_encoding_support, METH_VARARGS | METH_KEYWORDS, "encoding_support(encoding)\n\n" "The 'encoding' parameter should be one of the pygetdata.*_ENCODED\n" "symbols. This method will return pygetdata.RDWR if the library can\n" "read and write the encoding, pygetdata.RDONLY if the library can\n" /* ------- handy ruler ---------------------------------------------| */ "only read the encodin, or None otherwise. See\n" "gd_encoding_support(3)." }, { NULL, NULL, 0, NULL } }; PyMODINIT_FUNC initpygetdata(void) { int i; PyObject *mod; PyObject *mdict; dtracevoid(); if (PyType_Ready(&gdpy_dirfile) < 0) return; if (PyType_Ready(&gdpy_entry) < 0) return; if (PyType_Ready(&gdpy_fragment) < 0) return; /* The following macro will cause this function to return if importing numpy * fails */ import_array() mod = Py_InitModule3("pygetdata", GetDataMethods, "Bindings to the GetData library for Dirfile access\n\n" "This module provides interfaces to the C GetData library. It defines " "three\nmain classes:\n\n" " o dirfile, encapsulating the C API's DIRFILE object,\n" " o entry, encapsulating the C API's gd_entry_t object, and\n" " o fragment, containing fragment metadata.\n\n" "Second, it defines various symbolic constants defined by the C API. " "These\nsymbols are identical to the C API's symbols, except lacking the " "GD_ prefix.\nSo, for example, the C API's GD_INT8 is available in these " "bindings as\npygetdata.INT8.\n\n" "Finally, it defines a number of exceptions corresponding to C API " "dirfile\nerror codes. These exceptions have similar names to the C " "API's error\nnames, so, for example, pygetdata.BadCodeError corresponds " "to the C API's\nGD_E_BAD_CODE error code. All these exceptions are " "derived from a common\npygetdata.DirfileError exception class, itself " "derived from RuntimeError.\nExceptions are thrown by the bindings in " "lieu of returning a dirfile error\nvalue.\n\n" "Where possible, pygetdata will, by default, return vector data as " "NumPy\narrays. If " "pygetdata has been built with NumPy support,\n" "pygetdata.__numpy_supported__ will be non-zero. If NumPy support is " "not\npresent, vector data will be returned as Python lists. Vector " "data passed\nto pygetdata may either be a Python list or a NumPy array." "\n\n" "The input data type argument to bindings for functions such as\n" "gd_putdata(3), which is required in the C API, are typically optional,\n" "as pygetdata can determine the input data type by itself, and convert " "it to\nan appropriate type for the C API. If the data type is supplied," " pygetdata\nwill coerce the input data to the specified C type as best " "it can. For\ngd_getdata(3) and similar, the C API types are converted " "to Python types as\nfollows:\n\n" " o int -- UINT8, INT8, UINT16, INT16, INT32\n" " o long -- UINT32, UINT64, INT64\n" " o float -- FLOAT32, FLOAT64\n" " o complex -- COMPLEX64, COMPLEX128\n\n" "or to NumPy data types, as appropriate. " "For convenience, the following type\ncode aliases are defined:\n\n" " o pygetdata.INT = pygetdata.INT32\n" " o pygetdata.LONG = pygetdata.INT64\n" " o pygetdata.ULONG = pygetdata.UINT64\n" " o pygetdata.FLOAT = pygetdata.FLOAT64\n" " o pygetdata.COMPLEX = pygetdata.COMPLEX128\n\n" "Note that pygetdata.FLOAT is different than the C API's GD_FLOAT " "alias.\n\n" "All pygetdata functions may be given positional or keyword parameters." ); if (mod == NULL) return; Py_INCREF(&gdpy_dirfile); PyModule_AddObject(mod, "dirfile", (PyObject *)&gdpy_dirfile); Py_INCREF(&gdpy_entry); PyModule_AddObject(mod, "entry", (PyObject *)&gdpy_entry); Py_INCREF(&gdpy_fragment); PyModule_AddObject(mod, "fragment", (PyObject *)&gdpy_fragment); /* version */ PyModule_AddObject(mod, "__version__", Py_BuildValue("(iiis)", GETDATA_MAJOR, GETDATA_MINOR, GETDATA_REVISION, GETDATA_VERSION_SUFFIX)); /* author */ PyModule_AddStringConstant(mod, "__author__", "The GetData Project "); /* add constants */ for (i = 0; gdpy_constant_list[i].name != NULL; ++i) PyModule_AddIntConstant(mod, gdpy_constant_list[i].name, gdpy_constant_list[i].value); PyModule_AddIntConstant(mod, "__numpy_supported__", 1); /* add exceptions */ GdPy_DirfileError = PyErr_NewException("pygetdata.DirfileError", PyExc_RuntimeError, NULL); Py_INCREF(GdPy_DirfileError); PyModule_AddObject(mod, "DirfileError", GdPy_DirfileError); for (i = 1; i < GD_N_ERROR_CODES; ++i) { if (gdpy_exception_list[i]) { char name[40]; sprintf(name, "pygetdata.%sError", gdpy_exception_list[i]); gdpy_exceptions[i] = PyErr_NewException(name, GdPy_DirfileError, NULL); Py_INCREF(gdpy_exceptions[i]); PyModule_AddObject(mod, name + 10, gdpy_exceptions[i]); } else gdpy_exceptions[i] = GdPy_DirfileError; } /* add dead exceptions -- we do this through manual dictionary editing */ mdict = PyModule_GetDict(mod); if (mdict) for (i = 0; gdpy_dead_exceptions[i].name; ++i) { char name[40]; sprintf(name, "%sError", gdpy_dead_exceptions[i].name); Py_INCREF(gdpy_exceptions[gdpy_dead_exceptions[i].e]); PyDict_SetItemString(mdict, name, gdpy_exceptions[gdpy_dead_exceptions[i].e]); } dreturnvoid(); } libgetdata-0.9.0/bindings/python/setup.py.in0000640000175000017500000000571512614323564021251 0ustar alastairalastair# Copyright (C) 2012, 2015 D. V. Wiebe # # @configure_input@ # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # from distutils.core import setup from distutils.extension import Extension from distutils.command.clean import clean as clean from distutils.command.build import build as build from os.path import join from os.path import exists from os import unlink from shutil import copy libsrc_dir = '@top_srcdir@/src' libbuild_dir = '../../src' srcdir = '@srcdir@' #include paths includes = [ libbuild_dir, libsrc_dir ] import numpy includes.append(numpy.get_include()) sources = [ 'pydirfile.c', 'pyentry.c', 'pyfragment.c', 'pygetdata.c' ] # clean copied source files in out-of-place builds; see below cmdclass = {} class gd_clean(clean): def run(self): if srcdir != '.': for x in sources: unlink(x) clean.run(self) class gd_build(build): def run(self): # if we don't do this, the object files will end up in # @top_builddir@/bindings/bindings/python, # instead of # @builddir@/build/temp. # like they're supposed to. It seems to work, but it's a little crazier # than we're willing to deal with. for x in sources: if not exists(x): copy(join(srcdir, x), x) build.run(self) # deal with out-of-place (VPATH) builds if srcdir != '.': includes.append(srcdir) # to find pygetdata.h # handle set up and clean up cmdclass['build'] = gd_build cmdclass['clean'] = gd_clean # now add this built source; it always ends up where distutils wants it to be sources.append('pyconstants.c') # add debug sources if @GETDATA_DEBUG@: copy(join(libsrc_dir, 'debug.c'), 'debug.c') # see comment above sources.append('debug.c') setup( name = 'pygetdata', version = '@VERSION@', cmdclass = cmdclass, ext_modules = [ Extension('pygetdata', sources = sources, depends = [ join(srcdir, 'pygetdata.h'), join(libbuild_dir, 'gd_config.h'), join(libbuild_dir, 'getdata.h') ], include_dirs = includes, library_dirs = [ join(libbuild_dir, '.libs') ], libraries = [ 'getdata' ], define_macros = [ ('HAVE_CONFIG_H','1') ] ) ] ) libgetdata-0.9.0/bindings/python/pydirfile.c0000640000175000017500000030671712614323564021273 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define NO_IMPORT_ARRAY #include "pygetdata.h" /* Dirfile */ static int gdpy_callback_func(gd_parser_data_t *pdata, void *extra) { int r = GD_SYNTAX_ABORT; struct gdpy_dirfile_t *self = extra; dtrace("%p, %p", pdata, extra); if (self->callback != NULL) { char *new_string; PyObject *result, *arglist; char *estring; estring = gd_error_string(pdata->dirfile, NULL, 0); arglist = Py_BuildValue("({sssisssiss}O)", "error_string", estring, "suberror", pdata->suberror, "line", pdata->line, "linenum", pdata->linenum, "filename", pdata->filename, self->callback_data); free(estring); /* an exception results in an abort */ if (arglist == NULL) { self->callback_exception = 1; dreturn("%i", GD_SYNTAX_ABORT); return GD_SYNTAX_ABORT; } result = PyEval_CallObject(self->callback, arglist); Py_DECREF(arglist); /* result may be: * - an Int -- the return code; line not changed * - a String - the new line -- GD_SYNTAX_RESCAN is assumed * - a Tuple containing an Int and then, optionally, a String */ if (result == NULL) self->callback_exception = 1; else if (PyTuple_Check(result)) { switch (PyTuple_Size(result)) { case 0: PyErr_SetString(PyExc_TypeError, "callback must return at least one object"); self->callback_exception = 1; break; case 1: r = (int)PyInt_AsLong(PyTuple_GetItem(result, 0)); if (PyErr_Occurred()) { self->callback_exception = 1; r = GD_SYNTAX_ABORT; } break; default: r = (int)PyInt_AsLong(PyTuple_GetItem(result, 0)); if (PyErr_Occurred()) { self->callback_exception = 1; r = GD_SYNTAX_ABORT; } new_string = PyString_AsString(PyTuple_GetItem(result, 1)); if (new_string == NULL) { self->callback_exception = 1; r = GD_SYNTAX_ABORT; } pdata->line = new_string; } if (PyTuple_Size(result) == 1) { } } else if (PyString_Check(result)) { new_string = PyString_AsString(result); if (new_string == NULL) { self->callback_exception = 1; r = GD_SYNTAX_ABORT; } r = GD_SYNTAX_RESCAN; pdata->line = new_string; } else if (PyInt_Check(result)) r = (int)PyInt_AsLong(result); else { PyErr_SetString(PyExc_TypeError, "bad return type from callback function"); self->callback_exception = 1; } } dreturn("%i", r); return r; } static void gdpy_dirfile_delete(struct gdpy_dirfile_t *self) { dtrace("%p", self); gd_close(self->D); free(self->verbose_prefix); Py_XDECREF(self->callback); Py_XDECREF(self->callback_data); PyObject_Del(self); dreturnvoid(); } static PyObject *gdpy_dirfile_create(PyTypeObject *type, PyObject *args, PyObject *keys) { struct gdpy_dirfile_t *self; dtrace("%p, %p, %p", type, args, keys); self = (struct gdpy_dirfile_t*)type->tp_alloc(type, 0); if (self) { self->D = NULL; self->mplex_lookback = GD_DEFAULT_LOOKBACK; self->verbose_prefix = NULL; self->callback = NULL; self->callback_data = NULL; } dreturn("%p", self); return (PyObject*)self; } static int gdpy_dirfile_init(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { PyObject *pycallback = NULL; PyObject *pycallback_data = Py_None; char *keywords[] = {"name", "flags", "callback", "extra", NULL}; PyObject *name = NULL; unsigned long flags = GD_RDONLY; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|OkOO:pygetdata.dirfile.__init__", keywords, &name, &flags, &pycallback, &pycallback_data)) { dreturn("%i", -1); return -1; } /* An invalid dirfile was requested */ if (name == NULL || name == Py_None) { self->D = gd_invalid_dirfile(); PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } if (!PyString_Check(name)) { PyErr_SetString(PyExc_TypeError, "name must be a string or None"); dreturn("%i", -1); return -1; } if (pycallback && pycallback != Py_None && !PyCallable_Check(pycallback)) { PyErr_SetString(PyExc_TypeError, "callback function must be callable"); dreturn("%i", -1); return -1; } Py_XINCREF(pycallback); Py_XINCREF(pycallback_data); Py_XDECREF(self->callback); Py_XDECREF(self->callback_data); self->callback = pycallback; self->callback_data = pycallback_data; self->callback_exception = 0; self->D = gd_cbopen(PyString_AsString(name), (unsigned int)flags, (pycallback == NULL) ? NULL : gdpy_callback_func, self); if (self->callback_exception) { dreturn("%i", -1); return -1; } PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_dirfile_add(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "entry", NULL }; struct gdpy_entry_t *entry = NULL; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "O!:pygetdata.dirfile.add", keywords, &gdpy_entry, &entry)) { dreturn("%p", NULL); return NULL; } gd_add(self->D, entry->E); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_addspec(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "spec", "fragment_index", NULL }; const char *spec; int fragment = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.add_spec", keywords, &spec, &fragment)) { dreturn("%p", NULL); return NULL; } gd_add_spec(self->D, spec, fragment); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_alter(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "entry", "recode", NULL }; struct gdpy_entry_t *entry = NULL; int recode = 0; char *field_code; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "sO!|i:pygetdata.dirfile.alter", keywords, &field_code, &gdpy_entry, &entry, &recode)) { dreturn("%p", NULL); return NULL; } gd_alter_entry(self->D, field_code, entry->E, recode); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_alterspec(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "spec", "recode", NULL }; const char *spec; int recode = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.alter_spec", keywords, &spec, &recode)) { dreturn("%p", NULL); return NULL; } gd_alter_spec(self->D, spec, recode); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_close(struct gdpy_dirfile_t *self) { dtrace("%p", self); if (gd_close(self->D)) PYGD_CHECK_ERROR(self->D, NULL); self->D = gd_invalid_dirfile(); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_delentry(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"field_code", "flags", NULL}; const char *field_code; int flags = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.delete", keywords, &field_code, &flags)) { dreturn("%p", NULL); return NULL; } gd_delete(self->D, field_code, flags); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_discard(struct gdpy_dirfile_t *self) { dtrace("%p", self); if (gd_discard(self->D)) { PYGD_CHECK_ERROR(self->D, NULL); } /* Here we replace D with an empty, invalid dirfile object. */ self->D = gd_invalid_dirfile(); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_getcarray(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"field_code", "return_type", "start", "len", "as_list", NULL}; const char *field_code; unsigned int start = 0, len = 0; int as_list = 0; gd_type_t return_type; PyObject *pyobj = NULL; npy_intp dims[] = { 0 }; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "si|IIi:pygetdata.dirfile.get_carray", keywords, &field_code, &return_type, &start, &len, &as_list)) { dreturn("%p", NULL); return NULL; } if (len == 0) { len = gd_array_len(self->D, field_code); if (len > start) len -= start; else len = 0; } if (len == 0) { if (!as_list) pyobj = PyArray_ZEROS(1, dims, NPY_INT, 0); else pyobj = Py_BuildValue("[]"); } else { void *data; if (!as_list) { dims[0] = (npy_intp)len; pyobj = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type)); data = PyArray_DATA(pyobj); } else data = malloc(len * GD_SIZE(return_type)); gd_get_carray_slice(self->D, field_code, start, (size_t)len, return_type, data); if (!as_list) PYGD_CHECK_ERROR(self->D, NULL); else { PYGD_CHECK_ERROR2(self->D, NULL, free(data)); pyobj = gdpy_convert_to_pylist(data, return_type, len); free(data); } } dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getconstant(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"field_code", "return_type", NULL}; const char *field_code; gd_type_t return_type; char data[16]; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "si:pygetdata.dirfile.get_constant", keywords, &field_code, &return_type)) { dreturn("%p", NULL); return NULL; } gd_get_constant(self->D, field_code, return_type, data); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_convert_to_pyobj(data, return_type); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_arraylen(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; size_t len; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.array_len", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } len = gd_array_len(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)len); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_carraylen(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); PyErr_WarnEx(PyExc_DeprecationWarning, "pygetdata.dirfile.carray_len is " "deprecated; use pygetdata.dirfile.array_len instead.", 1); pyobj = gdpy_dirfile_arraylen(self, args, keys); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_carrays(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"return_type", "as_list", NULL}; const char **fields; int as_list = 0, i; gd_type_t return_type; const gd_carray_t *carrays; PyObject *pyobj; npy_intp dims[] = { 0 }; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "i|i:pygetdata.dirfile.carrays", keywords, &return_type, &as_list)) { dreturn("%p", NULL); return NULL; } fields = gd_field_list_by_type(self->D, GD_CARRAY_ENTRY); PYGD_CHECK_ERROR(self->D, NULL); carrays = gd_carrays(self->D, return_type); pyobj = PyList_New(0); for (i = 0; carrays[i].n != 0; ++i) { PyObject *pydata; if (!as_list) { dims[0] = (npy_intp)carrays[i].n; pydata = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type)); memcpy(PyArray_DATA(pydata), carrays[i].d, GD_SIZE(return_type) * carrays[i].n); } else pydata = gdpy_convert_to_pylist(carrays[i].d, return_type, carrays[i].n); gdpylist_append(pyobj, Py_BuildValue("sN", fields[i], pydata)); } dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getconstants(struct gdpy_dirfile_t *self, void *args, void *keys) { int i; char *keywords[] = {"return_type", NULL}; const char **fields; const char *values; gd_type_t return_type; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "i:pygetdata.dirfile.constants", keywords, &return_type)) { dreturn("%p", NULL); return NULL; } fields = gd_field_list_by_type(self->D, GD_CONST_ENTRY); PYGD_CHECK_ERROR(self->D, NULL); values = gd_constants(self->D, return_type); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyList_New(0); for (i = 0; fields[i] != NULL; ++i) gdpylist_append(pyobj, Py_BuildValue("sN", fields[i], gdpy_convert_to_pyobj(values + i * GD_SIZE(return_type), return_type))); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getdata(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "return_type", "first_frame", "first_sample", "num_frames", "num_samples", "as_list", NULL }; const char *field_code; PY_LONG_LONG first_frame = 0, first_sample = 0; PyObject *num_frames_obj = NULL, *num_samples_obj = NULL; PyObject *return_type_obj = NULL; long int num_frames = 0, num_samples = 0; size_t ns; int as_list = 0, read_to_end = 0; gd_type_t return_type = GD_NULL; unsigned int spf = 1; PyObject *pyobj = NULL; npy_intp dims[] = { 0 }; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|OLLOOi:pygetdata.dirfile.getdata", keywords, &field_code, &return_type_obj, &first_frame, &first_sample, &num_frames_obj, &num_samples_obj, &as_list)) { dreturn("%p", NULL); return NULL; } PYGD_CHECK_ERROR(self->D, NULL); /* get return type */ if (return_type_obj) { return_type = (gd_type_t)PyInt_AsLong(return_type_obj); if (PyErr_Occurred()) { dreturn("%p", NULL); return NULL; } } else { return_type = gd_native_type(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); } if (num_frames_obj) { num_frames = PyInt_AsLong(num_frames_obj); if (num_frames == -1 && PyErr_Occurred()) { dreturn("%p", NULL); return NULL; } else if (num_frames < 0) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.gd_getdata(): " "num_frames must be non-negative"); dreturn("%p", NULL); return NULL; } } if (num_samples_obj) { num_samples = PyInt_AsLong(num_samples_obj); if (num_samples == -1 && PyErr_Occurred()) { dreturn("%p", NULL); return NULL; } else if (num_samples < 0) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.gd_getdata(): " "num_samples must be non-negative"); dreturn("%p", NULL); return NULL; } } /* read to end mode */ if (num_frames_obj == NULL && num_samples_obj == NULL) read_to_end = 1; /* we need the SPF to know how many samples we have to allocate */ if (read_to_end || num_frames) { spf = gd_spf(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); if (read_to_end) { num_samples = gd_nframes64(self->D) * spf; PYGD_CHECK_ERROR(self->D, NULL); /* don't read past the frame indicated by nframes */ num_samples -= first_frame * spf - first_sample; if (num_samples < 0) num_samples = 0; } else num_samples += num_frames * spf; } if (num_samples == 0) { if (!as_list) pyobj = PyArray_ZEROS(1, dims, gdpy_npytype_from_type(return_type), 0); else pyobj = Py_BuildValue("[]"); } else { void *data; if (!as_list) { dims[0] = (npy_intp)num_samples; pyobj = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type)); data = PyArray_DATA(pyobj); } else data = malloc(num_samples * GD_SIZE(return_type)); ns = gd_getdata64(self->D, field_code, first_frame, first_sample, 0, (size_t)num_samples, return_type, data); if (!as_list) { PYGD_CHECK_ERROR(self->D, NULL); /* resize, if necessary */ if (ns < num_samples) { PyObject *check; PyArray_Dims new_dims; new_dims.ptr = dims; new_dims.len = 1; dims[0] = (npy_intp)ns; check = PyArray_Resize((PyArrayObject*)pyobj, &new_dims, 0, NPY_ANYORDER); if (check == NULL) /* error -- exception already raised */ return NULL; Py_DECREF(check); /* Despite the docs, PyArray_Resize returns an INCREF'd Py_None on success */ } } else { PYGD_CHECK_ERROR2(self->D, NULL, free(data)); pyobj = gdpy_convert_to_pylist(data, return_type, ns); free(data); } } dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getentry(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"field_code", NULL}; const char *field_code; struct gdpy_entry_t *obj; gd_entry_t *E; int e; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.entry", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } E = malloc(sizeof(gd_entry_t)); if (E == NULL) { PyErr_NoMemory(); dreturn("%p", NULL); return NULL; } gd_entry(self->D, field_code, E); if ((e = gd_error(self->D))) { PYGD_REPORT_ERROR(self->D,e); free(E); dreturn("%p", NULL); return NULL; } obj = (struct gdpy_entry_t*)gdpy_entry.tp_alloc(&gdpy_entry, 0); if (obj == NULL) { PyErr_NoMemory(); gd_free_entry_strings(E); free(E); dreturn("%p", NULL); return NULL; } obj->E = E; Py_INCREF(obj); dreturn("%p", obj); return (PyObject*)obj; } static PyObject *gdpy_dirfile_geterror(struct gdpy_dirfile_t *self, void *closure) { PyObject *error; dtrace("%p, %p", self, closure); error = PyInt_FromLong(gd_error(self->D)); dreturn("%p", error); return error; } static PyObject *gdpy_dirfile_geterrorcount(struct gdpy_dirfile_t *self, void *closure) { PyObject *count; dtrace("%p, %p", self, closure); count = PyInt_FromLong(gd_error_count(self->D)); dreturn("%p", count); return count; } static PyObject *gdpy_dirfile_getfragment(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"fragment_index", NULL}; int fragment_index; struct gdpy_fragment_t *obj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "i:pygetdata.dirfile.fragment", keywords, &fragment_index)) { dreturn("%p", NULL); return NULL; } obj = (struct gdpy_fragment_t*)gdpy_fragment.tp_alloc(&gdpy_fragment, 0); if (obj == NULL) { PyErr_NoMemory(); dreturn("%p", NULL); return NULL; } obj->n = fragment_index; obj->dirfile = self; Py_INCREF(obj); dreturn("%p", obj); return (PyObject*)obj; } static PyObject *gdpy_dirfile_getfragmentindex(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"field_code", NULL}; const char *field_code; PyObject *pyobj; int index; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.fragment_index", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } index = gd_fragment_index(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong(index); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_geterrorstring(struct gdpy_dirfile_t *self, void *closure) { char *estring; PyObject *pyobj; dtrace("%p, %p", self, closure); estring = gd_error_string(self->D, NULL, 0); pyobj = PyString_FromString(estring); free(estring); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getvectorlist(struct gdpy_dirfile_t *self) { const char **vectors; PyObject *pyobj; dtrace("%p", self); vectors = gd_vector_list(self->D); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_to_pystringlist(vectors); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getfieldlist(struct gdpy_dirfile_t *self, void *args, void *keys) { const char **fields; char *keywords[] = { "type", NULL }; int type = (int)GD_NO_ENTRY; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|i:pygetdata.dirfile.field_list", keywords, &type)) { dreturn("%p", NULL); return NULL; } if (type == GD_NO_ENTRY) fields = gd_field_list(self->D); else fields = gd_field_list_by_type(self->D, (gd_entype_t)type); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_to_pystringlist(fields); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_flush(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code = NULL; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.flush", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } gd_flush(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_sync(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code = NULL; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.sync", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } gd_sync(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_raw_close(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code = NULL; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.raw_close", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } gd_raw_close(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_include(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "file", "fragment_index", "flags", "prefix", "suffix", NULL }; const char *file = NULL; int fragment_index = 0; unsigned int flags = 0; char *prefix = NULL, *suffix = NULL; long index; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|iiss:pygetdata.dirfile.include", keywords, &file, &fragment_index, &flags, &prefix, &suffix)) { dreturn("%p", NULL); return NULL; } self->callback_exception = 0; index = gd_include_affix(self->D, file, fragment_index, prefix, suffix, flags); if (self->callback_exception) { dreturn("%p", NULL); return NULL; } PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong(index); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_madd(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "entry", "parent", NULL }; struct gdpy_entry_t *entry = NULL; const char *parent; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "O!s:pygetdata.dirfile.madd", keywords, &gdpy_entry, &entry, &parent)) { dreturn("%p", NULL); return NULL; } gd_madd(self->D, entry->E, parent); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_maddspec(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "spec", "parent", NULL }; const char *spec; const char *parent; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "ss:pygetdata.dirfile.madd_spec", keywords, &spec, &parent)) { dreturn("%p", NULL); return NULL; } gd_madd_spec(self->D, spec, parent); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_malterspec(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "spec", "parent", "recode", NULL }; const char *spec, *parent; int recode = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "ss|i:pygetdata.dirfile.malter_spec", keywords, &spec, &parent, &recode)) { dreturn("%p", NULL); return NULL; } gd_malter_spec(self->D, spec, parent, recode); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_mcarrays(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"parent", "return_type", "as_list", NULL}; const char **fields; const char *parent; int as_list = 0, i; gd_type_t return_type; const gd_carray_t *carrays; PyObject *pyobj; npy_intp dims[] = { 0 }; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "si|i:pygetdata.dirfile.mcarrays", keywords, &parent, &return_type, &as_list)) { dreturn("%p", NULL); return NULL; } fields = gd_mfield_list_by_type(self->D, parent, GD_CARRAY_ENTRY); PYGD_CHECK_ERROR(self->D, NULL); carrays = gd_mcarrays(self->D, parent, return_type); pyobj = PyList_New(0); for (i = 0; carrays[i].n != 0; ++i) { PyObject *pydata; if (!as_list) { dims[0] = (npy_intp)carrays[i].n; pydata = PyArray_SimpleNew(1, dims, gdpy_npytype_from_type(return_type)); memcpy(PyArray_DATA(pydata), carrays[i].d, GD_SIZE(return_type) * carrays[i].n); } else pydata = gdpy_convert_to_pylist(carrays[i].d, return_type, carrays[i].n); gdpylist_append(pyobj, Py_BuildValue("sN", fields[i], pydata)); } dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getmconstants(struct gdpy_dirfile_t *self, void *args, void *keys) { int i; char *keywords[] = {"parent", "return_type", NULL}; const char **fields; const char *values; const char *parent = NULL; gd_type_t return_type; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "si:pygetdata.dirfile.mconstants", keywords, &parent, &return_type)) { dreturn("%p", NULL); return NULL; } fields = gd_mfield_list_by_type(self->D, parent, GD_CONST_ENTRY); PYGD_CHECK_ERROR(self->D, NULL); values = gd_mconstants(self->D, parent, return_type); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyList_New(0); for (i = 0; fields[i] != NULL; ++i) gdpylist_append(pyobj, Py_BuildValue("sN", fields[i], gdpy_convert_to_pyobj(values + i * GD_SIZE(return_type), return_type))); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_metaflush(struct gdpy_dirfile_t *self) { dtrace("%p", self); gd_metaflush(self->D); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_getmfieldlist(struct gdpy_dirfile_t *self, void *args, void *keys) { const char **fields; char *keywords[] = { "parent", "type", NULL }; const char *parent = NULL; gd_entype_t type = GD_NO_ENTRY; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.field_list_by_type", keywords, &parent, &type)) { dreturn("%p", NULL); return NULL; } if (type == GD_NO_ENTRY) fields = gd_mfield_list(self->D, parent); else fields = gd_mfield_list_by_type(self->D, parent, (gd_entype_t)type); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_to_pystringlist(fields); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getname(struct gdpy_dirfile_t *self, void *closure) { const char *name; PyObject *pyobj; dtrace("%p, %p", self, closure); name = gd_dirfilename(self->D); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyString_FromString(name); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getmstrings(struct gdpy_dirfile_t *self, void *args, void *keys) { int i; char *keywords[] = {"parent", NULL}; const char **fields; const char **values; const char *parent = NULL; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.mstrings", keywords, &parent)) { dreturn("%p", NULL); return NULL; } fields = gd_mfield_list_by_type(self->D, parent, GD_STRING_ENTRY); PYGD_CHECK_ERROR(self->D, NULL); values = gd_mstrings(self->D, parent); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyList_New(0); for (i = 0; fields[i] != NULL; ++i) gdpylist_append(pyobj, Py_BuildValue("ss", fields[i], values[i])); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getmvectorlist(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"parent", NULL}; const char *parent = NULL; const char **fields; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.mvector_list", keywords, &parent)) { dreturn("%p", NULL); return NULL; } fields = gd_mvector_list(self->D, parent); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_to_pystringlist(fields); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getrawfilename(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; char *filename; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.raw_filename", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } filename = gd_raw_filename(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyString_FromString(filename); free(filename); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnativetype(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; gd_type_t ntype; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.native_type", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } ntype = gd_native_type(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)ntype); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnativetypename(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; char tbuffer[11]; PyObject *pyobj; gd_type_t t; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.native_type_name", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } t = gd_native_type(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); sprintf(tbuffer, "%s%i", ((t & GD_COMPLEX) ? "COMPLEX" : (t & GD_IEEE754) ? "FLOAT" : (t & GD_SIGNED) ? "INT" : "UINT"), (int)(8 * GD_SIZE(t))); pyobj = PyString_FromString(tbuffer); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnfields(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { unsigned int nfields; char *keywords[] = { "type", NULL }; int type = GD_NO_ENTRY; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|i:pygetdata.dirfile.nfields", keywords, &type)) { dreturn("%p", NULL); return NULL; } if (type == GD_NO_ENTRY) nfields = gd_nfields(self->D); else nfields = gd_nfields_by_type(self->D, (gd_entype_t)type); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)nfields); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnfragments(struct gdpy_dirfile_t *self, void *closure) { long nfragments; PyObject *pyobj; dtrace("%p, %p", self, closure); nfragments = gd_nfragments(self->D); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong(nfragments); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnframes(struct gdpy_dirfile_t *self, void *closure) { gd_off64_t nframes; PyObject *pyobj; dtrace("%p, %p", self, closure); nframes = gd_nframes64(self->D); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyLong_FromLongLong(nframes); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnmfields(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "parent", "type", NULL }; const char *parent = NULL; int type = GD_NO_ENTRY; unsigned int nmfields; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s|i:pygetdata.dirfile.nmfields", keywords, &parent, &type)) { dreturn("%p", NULL); return NULL; } if (type == GD_NO_ENTRY) nmfields = gd_nmfields(self->D, parent); else nmfields = gd_nmfields_by_type(self->D, parent, (gd_entype_t)type); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)nmfields); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnmvectors(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "parent", NULL }; const char *parent = NULL; PyObject *pyobj; unsigned int nmvectors; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.nmvectors", keywords, &parent)) { dreturn("%p", NULL); return NULL; } nmvectors = gd_nmvectors(self->D, parent); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)nmvectors); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getbof(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; gd_off64_t bof; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.bof", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } bof = gd_bof64(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyLong_FromLongLong(bof); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_geteof(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; gd_off64_t eof; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.eof", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } eof = gd_eof64(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyLong_FromLongLong(eof); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getnvectors(struct gdpy_dirfile_t *self) { unsigned int nvectors; PyObject *pyobj; dtrace("%p", self); nvectors = gd_nvectors(self->D); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)nvectors); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getreference(struct gdpy_dirfile_t *self, void *closure) { const char *ref; PyObject *pyobj; dtrace("%p, %p", self, closure); ref = gd_reference(self->D, NULL); PYGD_CHECK_ERROR(self->D, NULL); /* Empty dirfile */ if (ref == NULL) { Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } pyobj = PyString_FromString(ref); dreturn("%p", pyobj); return pyobj; } static int gdpy_dirfile_setreference(struct gdpy_dirfile_t *self, PyObject *value, void *closure) { const char *ref; dtrace("%p, %p, %p", self, value, closure); ref = PyString_AsString(value); /* TypeError already raised on error */ if (ref == NULL) { dreturn("%i", -1); return -1; } gd_reference(self->D, ref); PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_dirfile_getstring(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; size_t len; char *data; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.get_string", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } len = gd_get_string(self->D, field_code, 0, NULL); PYGD_CHECK_ERROR(self->D, NULL); data = malloc(len); if (data == NULL) { PyErr_NoMemory(); dreturn("%p", NULL); return NULL; } gd_get_string(self->D, field_code, len, data); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyString_FromString(data); free(data); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getstrings(struct gdpy_dirfile_t *self) { int i; const char **fields; const char **values; PyObject *pyobj; dtrace("%p", self); fields = gd_field_list_by_type(self->D, GD_STRING_ENTRY); PYGD_CHECK_ERROR(self->D, NULL); values = gd_strings(self->D); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyList_New(0); for (i = 0; fields[i] != NULL; ++i) gdpylist_append(pyobj, Py_BuildValue("ss", fields[i], values[i])); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_putconstant(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = {"field_code", "value", "type", NULL}; const char *field_code; PyObject *value; gd_type_t type = GD_UNKNOWN; union gdpy_quadruple_value data; int data_type; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "sO|i:pygetdata.dirfile.put_constant", keywords, &field_code, &value, &type)) { dreturn("%p", NULL); return NULL; } data_type = gdpy_convert_from_pyobj(value, &data, type); if (data_type == -1) { dreturn("%p", NULL); return NULL; } if ((data_type & 0xf) == GDPY_SIGNED) gd_put_constant(self->D, field_code, GD_INT64, &data.s); else if ((data_type & 0xf) == GDPY_IEEE754) gd_put_constant(self->D, field_code, GD_FLOAT64, &data.f); else if ((data_type & 0xf) == GDPY_COMPLEX) gd_put_constant(self->D, field_code, GD_COMPLEX128, &data.c); else gd_put_constant(self->D, field_code, GD_UINT64, &data.u); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_putcarray(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "data", "type", "start", NULL }; const char *field_code; unsigned int start = 0, len; gd_type_t type = GD_UNKNOWN; PyObject *pyobj; int have_ndarray = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "sO|iI:pygetdata.dirfile.put_carray", keywords, &field_code, &pyobj, &type, &start)) { dreturn ("%p", NULL); return NULL; } /* we only handle list or ndarray data */ if (PyArray_Check(pyobj)) { if (PyArray_NDIM(pyobj) != 1) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.put_carray() argument 2 must be one dimensional"); dreturn("%p", NULL); return NULL; } have_ndarray = 1; len = PyArray_DIM(pyobj, 0); } else { if (!PyList_Check(pyobj)) { PyErr_SetString(PyExc_TypeError, "pygetdata.dirfile.put_carray() argument 2 must be list or NumPy " "array."); dreturn("%p", NULL); return NULL; } len = PyList_Size(pyobj); } if (len > 0) { void *data; if (have_ndarray) { type = gdpy_type_from_npytype(PyArray_TYPE(pyobj)); if (type == GD_UNKNOWN) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.put_carray() unknown data type for argument 2."); dreturn ("%p", NULL); return NULL; } if (!(PyArray_FLAGS(pyobj) & NPY_ALIGNED)) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.put_carray() argument 2 must be aligned."); dreturn ("%p", NULL); return NULL; } if (!(PyArray_FLAGS(pyobj) & NPY_C_CONTIGUOUS)) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.put_carray()" " argument 2 must be C-style contiguous."); dreturn ("%p", NULL); return NULL; } data = PyArray_DATA(pyobj); } else { data = malloc(len * 16); type = gdpy_convert_from_pylist(pyobj, data, type, len); if (type == GD_UNKNOWN) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.put_carray() unknown data type for argument 2."); free(data); dreturn ("%p", NULL); return NULL; } } gd_put_carray_slice(self->D, field_code, start, len, type, data); if (have_ndarray) PYGD_CHECK_ERROR(self->D, NULL); else { PYGD_CHECK_ERROR2(self->D, NULL, free(data)); free(data); } } Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_putdata(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "data", "type", "first_frame", "first_sample", NULL }; const char *field_code; PY_LONG_LONG first_frame = 0, first_sample = 0; gd_type_t type = GD_UNKNOWN; PyObject *pyobj; size_t ns; int have_ndarray = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "sO|iLL:pygetdata.dirfile.putdata", keywords, &field_code, &pyobj, &type, &first_frame, &first_sample)) { dreturn ("%p", NULL); return NULL; } /* we only handle list or ndarray data */ if (PyArray_Check(pyobj)) { if (PyArray_NDIM(pyobj) != 1) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.putdata() argument 2 must be one dimensional"); dreturn("%p", NULL); return NULL; } have_ndarray = 1; ns = PyArray_DIM(pyobj, 0); } else { if (!PyList_Check(pyobj)) { PyErr_SetString(PyExc_TypeError, "pygetdata.dirfile.putdata() argument 2 must be list or NumPy " "array."); dreturn("%p", NULL); return NULL; } ns = PyList_Size(pyobj); } if (ns > 0) { void *data; if (have_ndarray) { type = gdpy_type_from_npytype(PyArray_TYPE(pyobj)); if (type == GD_UNKNOWN) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.putdata() unknown data type for argument 2."); dreturn ("%p", NULL); return NULL; } if (!(PyArray_FLAGS(pyobj) & NPY_ALIGNED)) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.putdata() argument 2 must be aligned."); dreturn ("%p", NULL); return NULL; } if (!(PyArray_FLAGS(pyobj) & NPY_C_CONTIGUOUS)) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.putdata()" " argument 2 must be C-style contiguous."); dreturn ("%p", NULL); return NULL; } data = PyArray_DATA(pyobj); } else { data = malloc(ns * 16); type = gdpy_convert_from_pylist(pyobj, data, type, ns); if (type == GD_UNKNOWN) { PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.putdata() unknown data type for argument 2."); free(data); dreturn ("%p", NULL); return NULL; } } ns = gd_putdata64(self->D, field_code, first_frame, first_sample, 0, ns, type, data); if (have_ndarray) PYGD_CHECK_ERROR(self->D, NULL); else { PYGD_CHECK_ERROR2(self->D, NULL, free(data)); free(data); } } pyobj = PyLong_FromLongLong(ns); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_putstring(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "data", NULL }; const char *field_code; const char *data; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "ss:pygetdata.dirfile.put_string", keywords, &field_code, &data)) { dreturn ("%p", NULL); return NULL; } gd_put_string(self->D, field_code, data); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_getspf(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; unsigned int spf; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.spf", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } spf = gd_spf(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)spf); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_validate(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.validate", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } gd_validate(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_getframenum(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "value", "start", "end", NULL }; const char *field_code; double value, frame; PY_LONG_LONG frame_start = 0; PY_LONG_LONG frame_end = 0; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "sd|LL:pygetdata.dirfile.framenum", keywords, &field_code, &value, &frame_start, &frame_end)) { dreturn ("%p", NULL); return NULL; } frame = gd_framenum_subset64(self->D, field_code, value, frame_start, frame_end); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyFloat_FromDouble(frame); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_callback(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { PyObject *pycallback = NULL; PyObject *pycallback_data = Py_None; char *keywords[] = {"callback", "extra", NULL}; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "OO:pygetdata.dirfile.set_callback", keywords, &pycallback, &pycallback_data)) { dreturn("%p", NULL); return NULL; } if (pycallback && pycallback != Py_None && !PyCallable_Check(pycallback)) { PyErr_SetString(PyExc_TypeError, "callback function must be callable"); dreturn("%p", NULL); return NULL; } Py_XINCREF(pycallback); Py_XINCREF(pycallback_data); Py_XDECREF(self->callback); Py_XDECREF(self->callback_data); self->callback = pycallback; self->callback_data = pycallback_data; gd_parser_callback(self->D, (pycallback == NULL) ? NULL : gdpy_callback_func, self); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_uninclude(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = {"fragment_index", "del", NULL}; int fragment_index; int del = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "i|i:pygetdata.dirfile.uninclude", keywords, &fragment_index, &del)) { dreturn("%p", NULL); return NULL; } gd_uninclude(self->D, fragment_index, del); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_move(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "new_fragment", "flags", NULL }; const char *field_code; int new_fragment; unsigned flags = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "si|I:pygetdata.dirfile.move", keywords, &field_code, &new_fragment, &flags)) { dreturn ("%p", NULL); return NULL; } gd_move(self->D, field_code, new_fragment, flags); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_rename(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "old_code", "new_name", "flags", NULL }; const char *old_code; const char *new_name; unsigned flags = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "ss|I:pygetdata.dirfile.rename", keywords, &old_code, &new_name, &flags)) { dreturn ("%p", NULL); return NULL; } gd_rename(self->D, old_code, new_name, flags); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_getstandards(struct gdpy_dirfile_t *self, void *closure) { int vers; PyObject *pyobj; dtrace("%p, %p", self, closure); vers = gd_dirfile_standards(self->D, GD_VERSION_CURRENT); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong(vers); dreturn("%p", pyobj); return pyobj; } static int gdpy_dirfile_setstandards(struct gdpy_dirfile_t *self, PyObject *value, void *closure) { int vers; dtrace("%p, %p, %p", self, value, closure); vers = (int)PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } gd_dirfile_standards(self->D, vers); PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_dirfile_seek(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", "flags", "frame_num", "sample_num", NULL }; const char *field_code; PY_LONG_LONG frame_num = 0, sample_num = 0; int flags; gd_off64_t pos; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "si|LL:pygetdata.dirfile.seek", keywords, &field_code, &flags, &frame_num, &sample_num)) { dreturn("%p", NULL); return NULL; } pos = gd_seek64(self->D, field_code, frame_num, sample_num, flags); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyLong_FromLongLong((long long)pos); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_tell(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; gd_off64_t pos; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.tell", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } pos = gd_tell64(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyLong_FromLongLong((long long)pos); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_hide(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.hide", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } gd_hide(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_unhide(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.unhide", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } gd_unhide(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_naliases(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; long naliases; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.naliases", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } naliases = gd_naliases(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong(naliases); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_aliastarget(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code, *target; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.alias_target", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } target = gd_alias_target(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyString_FromString(target); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_hidden(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; long hidden; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.hidden", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } hidden = gd_hidden(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong(hidden); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_aliaslist(struct gdpy_dirfile_t *self, void *args, void *keys) { const char **fields; char *keywords[] = { "field_code", NULL }; const char *field_code; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.alias_list", keywords, &field_code)) { dreturn("%p", NULL); return NULL; } fields = gd_aliases(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_to_pystringlist(fields); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_addalias(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = { "field_code", "target", "fragment_index", NULL }; const char *field_code, *target; int fragment_index = 0; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "ss|i:pygetdata.dirfile.add_alias", keywords, &field_code, &target, &fragment_index)) { dreturn("%p", NULL); return NULL; } gd_add_alias(self->D, field_code, target, fragment_index); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_maddalias(struct gdpy_dirfile_t *self, void *args, void *keys) { char *keywords[] = { "parent", "field_code", "target", NULL }; const char *field_code, *target, *parent; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "sss:pygetdata.dirfile.madd_alias", keywords, &parent, &field_code, &target)) { dreturn("%p", NULL); return NULL; } gd_madd_alias(self->D, parent, field_code, target); PYGD_CHECK_ERROR(self->D, NULL); Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } static PyObject *gdpy_dirfile_strtok(struct gdpy_dirfile_t *self, void *args, void *keys) { char *token; char *keywords[] = { "string", NULL }; const char *string = NULL; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.strtok", keywords, &string)) { dreturn("%p", NULL); return NULL; } token = gd_strtok(self->D, string); pyobj = PyString_FromString(token); free(token); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_desync(struct gdpy_dirfile_t *self, void *args, void *keys) { int ret; char *keywords[] = { "flags", NULL }; unsigned int flags = 0; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|I:pygetdata.dirfile.desync", keywords, &flags)) { dreturn("%p", NULL); return NULL; } ret = gd_desync(self->D, flags); pyobj = PyInt_FromLong((long)ret); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_getflags(struct gdpy_dirfile_t *self, void *closure) { PyObject *pyobj; unsigned long flags; dtrace("%p, %p", self, closure); flags = gd_flags(self->D, 0, 0); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyLong_FromUnsignedLong(flags); dreturn("%p", pyobj); return pyobj; } static int gdpy_dirfile_setflags(struct gdpy_dirfile_t *self, PyObject *value, void *closure) { unsigned long new_flags; dtrace("%p, %p, %p", self, value, closure); new_flags = PyLong_AsUnsignedLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } gd_flags(self->D, new_flags, ~new_flags); PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_dirfile_getverboseprefix(struct gdpy_dirfile_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); if (self->verbose_prefix == NULL) { Py_INCREF(Py_None); dreturn("%p", Py_None); return Py_None; } pyobj = PyString_FromString(self->verbose_prefix); dreturn("%p", pyobj); return pyobj; } static int gdpy_dirfile_setverboseprefix(struct gdpy_dirfile_t *self, PyObject *value, void *closure) { dtrace("%p, %p, %p", self, value, closure); free(self->verbose_prefix); if (value == Py_None) self->verbose_prefix = NULL; else { char *string = PyString_AsString(value); if (string == NULL) { dreturn("%i", -1); return -1; } self->verbose_prefix = strdup(string); } gd_verbose_prefix(self->D, self->verbose_prefix); PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_dirfile_getmplexlookback(struct gdpy_dirfile_t *self, void *closure) { PyObject *pyobj; dtrace("%p, %p", self, closure); pyobj = PyInt_FromLong(self->mplex_lookback); dreturn("%p", pyobj); return pyobj; } static int gdpy_dirfile_setmplexlookback(struct gdpy_dirfile_t *self, PyObject *value, void *closure) { int lookback; dtrace("%p, %p, %p", self, value, closure); lookback = (int)PyInt_AsLong(value); if (PyErr_Occurred()) { dreturn("%i", -1); return -1; } self->mplex_lookback = lookback; gd_mplex_lookback(self->D, lookback); PYGD_CHECK_ERROR(self->D, -1); dreturn("%i", 0); return 0; } static PyObject *gdpy_dirfile_nentries(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "parent", "type", "flags", NULL }; unsigned int nentries, flags = 0; int type = 0; const char *parent = NULL; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|siI:pygetdata.dirfile.nentries", keywords, &parent, &type, &flags)) { dreturn("%p", NULL); return NULL; } nentries = gd_nentries(self->D, parent, type, flags); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyInt_FromLong((long)nentries); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_entrylist(struct gdpy_dirfile_t *self, void *args, void *keys) { const char **entries; char *keywords[] = { "parent", "type", "flags", NULL }; int type = 0; unsigned int flags = 0; const char *parent = NULL; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "|siI:pygetdata.dirfile.entry_list", keywords, &parent, &type, &flags)) { dreturn("%p", NULL); return NULL; } entries = gd_entry_list(self->D, parent, type, flags); PYGD_CHECK_ERROR(self->D, NULL); pyobj = gdpy_to_pystringlist(entries); dreturn("%p", pyobj); return pyobj; } static PyObject *gdpy_dirfile_linterptablename(struct gdpy_dirfile_t *self, PyObject *args, PyObject *keys) { char *keywords[] = { "field_code", NULL }; const char *field_code; char *filename; PyObject *pyobj; dtrace("%p, %p, %p", self, args, keys); if (!PyArg_ParseTupleAndKeywords(args, keys, "s:pygetdata.dirfile.linterp_tablename", keywords, &field_code)) { dreturn ("%p", NULL); return NULL; } filename = gd_linterp_tablename(self->D, field_code); PYGD_CHECK_ERROR(self->D, NULL); pyobj = PyString_FromString(filename); free(filename); dreturn("%p", pyobj); return pyobj; } static PyGetSetDef gdpy_dirfile_getset[] = { { "error", (getter)gdpy_dirfile_geterror, NULL, "The numerical error code encountered by the last call to the GetData\n" "library for this dirfile. If the last call was successful, this\n" "will be zero. Because pygetdata throws exceptions on GetData\n" "errors, it is typically not necessary to check this value; use a\n" "try/except statement instead. See gd_error(3).", NULL }, { "error_count", (getter)gdpy_dirfile_geterrorcount, NULL, "The number of errors encountered by the GetData library for this\n" "dirfile since the last time this member was accessed. Note:\n" "accessing this member, resets it to zero. See gd_error_count(3).", NULL }, { "error_string", (getter)gdpy_dirfile_geterrorstring, NULL, "A human-readable description of the last error encountered by the\n" "GetData library for this dirfile. See gd_error_string(3).", NULL }, { "flags", (getter)gdpy_dirfile_getflags, (setter)gdpy_dirfile_setflags, "The operational flags of the open dirfile. This contains a subset\n" "of the dirfile creation flags specified when the object was\n" "instantiated. See gd_flags(3).", NULL }, { "name", (getter)gdpy_dirfile_getname, NULL, "The name of the Dirfile. See gd_dirfilename(3).", NULL }, { "nfragments", (getter)gdpy_dirfile_getnfragments, NULL, "The number of format file fragments in the dirfile. See\n" "gd_nfragments(3)", NULL }, { "nframes", (getter)gdpy_dirfile_getnframes, NULL, "The number of frames in the dirfile. See gd_nframes(3).", NULL }, { "reference", (getter)gdpy_dirfile_getreference, (setter)gdpy_dirfile_setreference, "The reference field for the dirfile, which may be set to any existing\n" "RAW field. If no RAW fields are defined in the dirfile, this will\n" "be None. See gd_reference(3).", NULL }, { "standards", (getter)gdpy_dirfile_getstandards, (setter)gdpy_dirfile_setstandards, "The current Standards Version of the loaded dirfile. Setting this\n" "to pygetdata.VERSION_EARLIEST or pygetdata.VERSION_LATEST has the\n" "same effect as passing the corresponding C API symbols to\n" "gd_dirfile_standards(3), q.v.", NULL }, {"verbose_prefix", (getter)gdpy_dirfile_getverboseprefix, (setter)gdpy_dirfile_setverboseprefix, "If opened with pygetdata::VERBOSE, a string prefixed to error\n" "messages printed by the library, or None, if no prefix is\n" "defined. See gd_verbose_prefix(3)." }, {"mplex_lookback", (getter)gdpy_dirfile_getmplexlookback, (setter)gdpy_dirfile_setmplexlookback, "The number of MPLEX cycles to search before the requested start of\n" "the returned data when reading data from a MPLEX field. Set\n" "to zero to disable lookback, or to -1 to make the lookback\n" "unlimited. See gd_mplex_lookback(3) for the definition of a\n" "\"MPLEX cycle\"." }, { NULL } }; static PyMethodDef gdpy_dirfile_methods[] = { {"add", (PyCFunction)gdpy_dirfile_add, METH_VARARGS | METH_KEYWORDS, "add(entry)\n\n" "Add a field described by 'entry', which should be a pygetdata.entry\n" "object, to the database. See gd_add(3)." }, {"add_spec", (PyCFunction)gdpy_dirfile_addspec, METH_VARARGS | METH_KEYWORDS, "add_spec(line [, fragment_index])\n\n" "Add a field described by the field specification line 'line' to the\n" "database, by adding it to the format file fragment indexed by\n" "'fragment_index', which defaults to 0, if not given. See\n" "gd_add_spec(3)." }, {"alter", (PyCFunction)gdpy_dirfile_alter, METH_VARARGS | METH_KEYWORDS, "alter(field_code, entry [, recode])\n\n" "Modify the field metadata of the field specified by 'field_code',\n" "as described by 'entry', which should be a pygetdata.entry object.\n" "If recode is given and is non-zero, the data on disk will also be\n" "updated, if relevant, to reflect changes in the field metatdata.\n" "The entry.name and entry.fragment_index data descriptors are ignored\n" "by this function. To rename or change the fragment of a field\n" "use the rename() or move() methods. See gd_alter_entry(3)." }, {"alter_spec", (PyCFunction)gdpy_dirfile_alterspec, METH_VARARGS | METH_KEYWORDS, "alter_spec(line [, recode])\n\n" "Modify the field metadata described by the field specification line\n" "'line'. If recode is given and is non-zero, the data on disk will\n" "also be updated, if relevant, to reflect changes in the field\n" "metadata. See gd_alter_spec(3)." }, {"close", (PyCFunction)gdpy_dirfile_close, METH_NOARGS, "close()\n\n" "Flush all pending changes to disk (as if flush() were called) and\n" "then close the dirfile. It is not normally necessary to call this\n" "method explicitly: the dirfile will be closed when the dirfile\n" "object is destroyed. After successful completion, the dirfile will\n" "be invalidated, prohibiting further use of this object. See\n" "gd_close(3)." }, {"delete", (PyCFunction)gdpy_dirfile_delentry, METH_VARARGS | METH_KEYWORDS, "delete(field_code [, flags])\n\n" "Delete the field 'field_code' from the database. If 'flags' is\n" "omitted, it is assumed to be zero. Otherwise, 'flags' should be a\n" "bitwise or'd collection of the pygetdata.DEL_* symbols, whose\n" "meanings are described in the gd_delete manual page. See\n" "gd_delete(3)." }, {"discard", (PyCFunction)gdpy_dirfile_discard, METH_NOARGS, "discard()\n\n" "Discard pending metatdata changes to the dirfile (data changes are\n" "still written) and then close the dirfile. After this method\n" "successfully returns, the dirfile will be invalidated, prohibiting\n" "further use of this object. Call this method if you don't want the\n" "object to implicitly call gd_close() when it is deleted. See\n" "gd_discard(3)." }, {"flush", (PyCFunction)gdpy_dirfile_flush, METH_VARARGS | METH_KEYWORDS, "flush([field_code])\n\n" "Equivalent to sync([field_code]) && raw_close([field_code]).\n" "See gd_flush(3)." }, {"bof", (PyCFunction)gdpy_dirfile_getbof, METH_VARARGS | METH_KEYWORDS, "bof(field_code)\n\n" "Retrieve the sample number corresponding to the beginning-of-field\n" "marker for the field specified by 'field_code'. See gd_bof(3)." }, {"get_carray", (PyCFunction)gdpy_dirfile_getcarray, METH_VARARGS | METH_KEYWORDS, "get_carray(field_code, return_type [, start, len, as_list])\n\n" "Retrieve the value of the CARRAY field specified by 'field_code'.\n" "The 'return_type' parameter indicates the desired type of the\n" "elements of the array returned, and should be (typically) one of:\n" "pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT,\n" "or pygetdata.COMPLEX, although any GetData data type code is\n" "permitted. If NumPy support is present in pygetdata, and 'as_list'\n" "is not given or is zero, a NumPy array will be returned. Otherwise\n" "a list of values will be returned.\n\n" "The first element returned is given by 'start', counting from zero.\n" "If omitted, zero is assumed. The number of elements returned is\n" "given by 'len'. If omitted or zero, all elements from 'start' to\n" "the end of the array are returned. See gd_get_carray_slice(3)." }, {"get_constant", (PyCFunction)gdpy_dirfile_getconstant, METH_VARARGS | METH_KEYWORDS, "get_constant(field_code, return_type)\n\n" "Retrieve the value of the CONST field specified by 'field_code'.\n" "The 'return_type' parameter indicates the desired type of the object\n" "returned, and should be (typically) one of: pygetdata.INT,\n" "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n" "pygetdata.COMPLEX, although any GetData data type code is permitted.\n" "See gd_get_constant(3)." }, {"constants", (PyCFunction)gdpy_dirfile_getconstants, METH_VARARGS | METH_KEYWORDS, "constants(return_type)\n\n" "Retrieve all CONST fields, and their values. A list of tuples\n" "will be returned, each tuple containing the name and value of the\n" "field. The 'return_type' parameter indicates the desired type of\n" "the values returned, and should be (typically) one of:\n" "pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n" "pygetdata.COMPLEX, although any GetData data type code is permitted.\n" "See gd_constants(3), but note that this method returns both names\n" "and values, unlike the C API counterpart." }, {"array_len", (PyCFunction)gdpy_dirfile_arraylen, METH_VARARGS | METH_KEYWORDS, "array_len(field_code)\n\n" "Returns the length of the CARRAY or SARRAY specified by\n" "'field_code'. See gd_array_len(3)." }, {"carray_len", (PyCFunction)gdpy_dirfile_carraylen, METH_VARARGS | METH_KEYWORDS, "carray_len(field_code)\n\n" "This method is deprecated. Use array_len() instead." }, {"carrays", (PyCFunction)gdpy_dirfile_carrays, METH_VARARGS | METH_KEYWORDS, "carrays(return_type [, as_list])\n\n" "Retrieve all CARRAY fields, and their values. A list of tuples\n" "will be returned, each tuple containing the name and values of the\n" "field. If NumPy support is present in pygetdata, and 'as_list' is\n" "not given or zero, the values will be returned in NumPy arrays;\n" "otherwise, the values will be returned as lists.\n\n" "The 'return_type' parameter indicates the desired type of the values\n" "returned, and should be (typically) one of: pygetdata.INT,\n" "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n" "pygetdata.COMPLEX, although any GetData data type code is permitted.\n" "See gd_carrays(3), but note that this method returns both names\n" "and values, unlike the C API counterpart." }, {"getdata", (PyCFunction)gdpy_dirfile_getdata, METH_VARARGS | METH_KEYWORDS, "getdata(field_code [, return_type, first_frame, first_sample,\n" "num_frames, num_samples, as_list])\n\n" "Retrieve a data vector from the dirfile. If NumPy support is\n" "present in pygetdata, and 'as_list' is not given or zero, a NumPy\n" "array will be returned. Otherwise a list of data values will\n" "be returned. NumPy arrays should be preferred for large datasets:\n" "they are more efficient both in terms of memory usage and retrieval\n" "time.\n\n" "The 'return_type' parameter indicates the desired type of the values\n" "returned. For NumPy data, the NumPy array will have the dtype\n" "indicated. For list data it should be (typically) one of:\n" "pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n" "pygetdata.COMPLEX, although any GetData data type code is permitted.\n" "If omitted, the return type defaults to the native type of the field\n" "(see dirfile.native_type()).\n\n" "The 'first_frame' and 'first_sample' parameters indicate first\n" "datum to read. If they are both omitted, data is read from the\n" "first sample. Similarly, 'num_frames' and 'num_samples' indicate\n" "the amount of data. Omitting both is equivalent to setting\n" "'num_frames' to dirfile.nframes (ie. all available data). Fewer\n" "samples than requested may be returned without causing an error.\n" "See gd_getdata(3)." }, { "entry", (PyCFunction)gdpy_dirfile_getentry, METH_VARARGS | METH_KEYWORDS, "entry(field_code)\n\n" "Retrieve the field metadata for the specified 'field_code'. A\n" "pygetdata.entry object is returned. See gd_entry(3).\n" }, {"eof", (PyCFunction)gdpy_dirfile_geteof, METH_VARARGS | METH_KEYWORDS, "eof(field_code)\n\n" "Retrieve the sample number corresponding to the end-of-field marker\n" "(ie. the number of samples in the field) for the field specified by\n" "'field_code'. See gd_eof(3)." }, { "field_list", (PyCFunction)gdpy_dirfile_getfieldlist, METH_VARARGS | METH_KEYWORDS, "field_list([entry_type])\n\n" "Return a list of field names. If 'entry_type' is given, it should\n" "be one of the pygetdata.*_ENTRY symbols. If 'entry_type' is not\n" "given, or is pygetdata.NO_ENTRY, all fields in the database are\n" "returned. Otherwise, only the fields of the given type are\n" "returned. See gd_field_list(3) and gd_field_list_by_type(3)." }, { "fragment", (PyCFunction)gdpy_dirfile_getfragment, METH_VARARGS | METH_KEYWORDS, "fragment(fragment_index)\n\n" "Retrieve the metadata associated with the format file fragment\n" "indexed by 'fragment_index'. A pygetdata.fragment object is\n" "returned." }, {"fragment_index", (PyCFunction)gdpy_dirfile_getfragmentindex, METH_VARARGS | METH_KEYWORDS, "fragment_index(field_code)\n\n" "Return the fragment index of the format file fragment which defines\n" "the field specified by 'field_code'. See gd_fragment_index(3)." }, {"framenum", (PyCFunction)gdpy_dirfile_getframenum, METH_VARARGS | METH_KEYWORDS, "framenum(field_code, value [, start, end])\n\n" "Perform a reverse look-up on the field specified by 'field_code'\n" "(which must be monotonic) and returns the fractional frame number\n" "where the field equals 'value'. The search is performed between\n" "the frame limits 'start' and 'end'. If 'start' is omitted, the\n" "search begins at the first sample. If 'end' is omitted, the search\n" "ends at the last sample. See gd_framenum_subset(3)." }, {"hidden", (PyCFunction)gdpy_dirfile_hidden, METH_VARARGS | METH_KEYWORDS, "hidden(field_code)\n\n" "Returns true if field_code (alias or real field) is hidden See \n" "gd_hidden(3)." }, {"hide", (PyCFunction)gdpy_dirfile_hide, METH_VARARGS | METH_KEYWORDS, "hide(field_code)\n\n" "Sets the hidden flag on the specified field. See gd_hide(3)." }, {"linterp_tablename", (PyCFunction)gdpy_dirfile_linterptablename, METH_VARARGS | METH_KEYWORDS, "linterp_tablename(field_code)\n\n" "Return the pathname of the look-up table (LUT) on disk used by the\n" "LINTERP field specified by 'field_code'. See\n" "gd_linterp_tablename(3)." }, {"mcarrays", (PyCFunction)gdpy_dirfile_mcarrays, METH_VARARGS | METH_KEYWORDS, "mcarrays(parent, return_type [, as_list])\n\n" "Retrieve all CARRAY metafields, and their values, for the parent\n" "field 'parent'. A list of tuples will be returned, each tuple\n" "containing the name and values of the field. If NumPy support is\n" "present in pygetdata, and 'as_list' is not given or zero, the values\n" "will be returned in NumPy arrays; otherwise, the values will be\n" "returned as lists.\n\n" "The 'return_type' parameter indicates the desired type of the values\n" "returned, and should be (typically) one of: pygetdata.INT,\n" "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n" "pygetdata.COMPLEX, although any GetData data type code is permitted.\n" "See gd_mcarrays(3), but note that this method returns both names\n" "and values, unlike the C API counterpart." }, {"mconstants", (PyCFunction)gdpy_dirfile_getmconstants, METH_VARARGS | METH_KEYWORDS, "mconstants(parent, return_type)\n\n" "Retrieve all CONST metafields defined for the parent field 'parent',\n" "and their values. A list of tuples will be returned, each tuple\n" "containing the name and value of a field. The 'return_type'\n" "parameter indicates the desired type of the values returned, and\n" "should be (typically) one of: pygetdata.INT, pygetdata.LONG,\n" "pygetdata.ULONG, pygetdata.FLOAT, or pygetdata.COMPLEX, although any\n" "GetData data type code is permitted. See gd_mconstants(3), but\n" "note that this method returns both names and values, unlike the\n" "C API counterpart." }, { "mfield_list", (PyCFunction)gdpy_dirfile_getmfieldlist, METH_VARARGS | METH_KEYWORDS, "mfield_list(parent [, entry_type])\n\n" "Return a list of metafield names for the parent field 'parent'. If\n" "'entry_type' is given, it should be one of the pygetdata.*_ENTRY\n" "symbols. If 'entry_type' is not given, or is pygetdata.NO_ENTRY,\n" "all metafields for the given parent field are returned. Otherwise,\n" "only the metafields of the given type are returned. See\n" "gd_mfield_list(3) and gd_mfield_list_by_type(3)." }, {"mstrings", (PyCFunction)gdpy_dirfile_getmstrings, METH_VARARGS | METH_KEYWORDS, "mstrings(parent, return_type)\n\n" "Retrieve all STRING metafields defined for the parent field\n" "'parent', and their values. A list of tuples will be returned, each\n" "tuple containing the name and value of a field. See\n" "gd_mstrings(3), but note that this method returns both names and\n" "values, unlike the C API counterpart." }, { "mvector_list", (PyCFunction)gdpy_dirfile_getmvectorlist, METH_VARARGS | METH_KEYWORDS, "mvector_list(parent)\n\n" "Retrieve a list of all vector type metafields (that is: BIT, DIVIDE,\n" "LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RECIP, SBIT, and\n" "WINDOW metafields) for the parent field 'parent'. See\n" "gd_mvector_list(3)." }, {"native_type", (PyCFunction)gdpy_dirfile_getnativetype, METH_VARARGS | METH_KEYWORDS, "native_type(field_code)\n\n" "Retrieve the native data type of the field specified by\n" "'field_code'. The return value will be one of the data type codes:\n" "pygetdata.UINT8, pygetdata.INT8, &c. The native_type_name\n" "method behaves identically, but returns a human-readable string\n" "describing the data type. See gd_native_type(3)." }, {"native_type_name", (PyCFunction)gdpy_dirfile_getnativetypename, METH_VARARGS | METH_KEYWORDS, "native_type_name(field_code)\n\n" "Retrieve the native data type of the field specified by\n" "'field_code'. The return value will be a string describing the\n" "data type: 'UINT8', 'INT8', &c. The native_type method behaves\n" "identically, but returns a numeric data type code. See\n" "gd_native_type(3)." }, {"nentries", (PyCFunction)gdpy_dirfile_nentries, METH_VARARGS | METH_KEYWORDS, "nentries([parent, type, flags])\n\n" "Return a count of entries in the database. If 'parent' is given,\n" "metafields under 'parent' will be considered, otherwise top-level\n" "fields are counted. If given, 'type' should be either one of the\n" "the pygetdata.*_ENTRY symbols, or else one of the special\n" "pygetdata.*_ENTRIES symbols; if not given, 'type' defaults to\n" "pygetdata.ALL_ENTRIES. If given 'flags' should be a bitwise or'd\n" "collection of zero or more of the pygetdata.ENTRIES_* flags.\n" "See gd_nentries(3)." }, {"nfields", (PyCFunction)gdpy_dirfile_getnfields, METH_VARARGS | METH_KEYWORDS, "nfields([entry_type])\n\n" "Return the number of fields in the database. If 'entry_type' is\n" "given, it should be one of the pygetdata.*_ENTRY symbols. If\n" "'entry_type' is not given, or is pygetdata.NO_ENTRY, the total\n" "number of fields in the database is returned. Otherwise, only\n" "the number of fields of the given type is returned. See\n" "gd_nfields(3) and gd_nfields_by_type(3)." }, {"nmfields", (PyCFunction)gdpy_dirfile_getnmfields, METH_VARARGS | METH_KEYWORDS, "nmfields(parent [, entry_type])\n\n" "Return the number of metafields defined for the parent field\n" "'parent'. If 'entry_type' is given, it should be one of the\n" "pygetdata.*_ENTRY symbols. If 'entry_type' is not given, or is\n" "pygetdata.NO_ENTRY, the total number of metafields for this parent\n" "is returned. Otherwise, only the number of metafields of the given\n" "type is returned. See gd_nmfields(3) and gd_nmfields_by_type(3)." }, {"nmvectors", (PyCFunction)gdpy_dirfile_getnmvectors, METH_VARARGS | METH_KEYWORDS, "nmvectors(parent)\n\n" "Return the number of vector type metafields (that is: BIT, DIVIDE,\n" "LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RECIP, SBIT, and\n" "WINDOW metafields) for the parent field 'parent'. See\n" "gd_nmvectors(3)." }, {"nvectors", (PyCFunction)gdpy_dirfile_getnvectors, METH_NOARGS, "nvectors()\n\n" "Return the number of vector type fields (that is: BIT, DIVIDE,\n" "INDEX, LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RAW, RECIP,\n" "SBIT, and WINDOW fields) defined in the database. See\n" "gd_nvectors(3)." }, {"raw_filename", (PyCFunction)gdpy_dirfile_getrawfilename, METH_VARARGS | METH_KEYWORDS, "raw_filename(field_code)\n\n" "Return the pathname of the data file on disk backing the RAW field\n" "specified by 'field_code'. See gd_raw_filename(3)." }, {"spf", (PyCFunction)gdpy_dirfile_getspf, METH_VARARGS | METH_KEYWORDS, "spf(field_code)\n\n" "Return the number of samples per frame of the field specified by\n" "field code. See gd_spf(3)." }, {"get_string", (PyCFunction)gdpy_dirfile_getstring, METH_VARARGS | METH_KEYWORDS, "get_string(field_code)\n\n" "Retrieve the value of the STRING field specified by 'field_code'.\n" "See gd_get_string(3)." }, { "strings", (PyCFunction)gdpy_dirfile_getstrings, METH_NOARGS, "strings()\n\n" "Retrieve all STRING fields defined in the database. A list of\n" "tuples will be returned, each tuple containing the name and value of\n" "a field. See gd_strings(3), but note that this method returns both\n" "names and values, unlike the C API counterpart." }, { "vector_list", (PyCFunction)gdpy_dirfile_getvectorlist, METH_NOARGS, "vector_list()\n\n" "Retrieve a list of all vector type fields (that is: BIT, DIVIDE,\n" "INDEX, LINCOM, LINTERP, MPLEX, MULTIPLY, PHASE, POLYNOM, RAW, RECIP,\n" "SBIT, and WINDOW metafields) defined in the database. See\n" "gd_vector_list(3)." }, {"include", (PyCFunction)gdpy_dirfile_include, METH_VARARGS | METH_KEYWORDS, "include(filename [, fragment_index, flags, prefix, suffix])\n\n" "Add (and possibly create) a new format file fragment specified by\n" "'filename' to the database, as an include in the existing fragment\n" "indexed by 'fragment_index'. If 'fragment_index' is not given,\n" "zero is assumed (ie. the primary format file). If 'flags' is given,\n" "it should be a bitwise or'd collection of flags listed in the\n" "gd_include manual page. If 'prefix' or 'suffix' are given, they\n" "will be applied to the field codes defined in the file. See\n" "gd_include_affix(3)." }, {"madd", (PyCFunction)gdpy_dirfile_madd, METH_VARARGS | METH_KEYWORDS, "madd(entry, parent)\n\n" "Add a field described by 'entry', which should be a pygetdata.entry\n" "object, to the database as a metafield under the parent field given\n" "by 'parent'. See gd_madd(3)." }, {"madd_spec", (PyCFunction)gdpy_dirfile_maddspec, METH_VARARGS | METH_KEYWORDS, "madd_spec(line, parent)\n\n" "Add a field described by the field specification line 'line' to the\n" "database as a metafield under the parent field given by 'parent'.\n" "See gd_madd_spec(3)." }, {"malter_spec", (PyCFunction)gdpy_dirfile_malterspec, METH_VARARGS | METH_KEYWORDS, "malter_spec(line, parent [, recode])\n\n" "Modify the metadata described by the field specification line\n" "'line' for a metafield under the parent field 'parent'. If recode\n" "is given and is non-zero, the data on disk will also be updated, if\n" "relevant, to reflect changes in the metafield metadata. See\n" "gd_malter_spec(3)." }, {"metaflush", (PyCFunction)gdpy_dirfile_metaflush, METH_NOARGS, "metaflush()\n\n" "Flush all pending metadata changes to disk. See gd_metaflush(3)." }, {"move", (PyCFunction)gdpy_dirfile_move, METH_VARARGS | METH_KEYWORDS, "move(field_code, new_fragment [, flags])\n\n" "Move the specification of the field given by 'field_code' to the\n" "format file fragment indexed by 'new_fragment'. If 'flags' is given\n" "and is non-zero, it should be a bitwise or'd collection of the\n" "pygetdat.REN_* symbols. See gd_move(3)." }, {"put_carray", (PyCFunction)gdpy_dirfile_putcarray, METH_VARARGS | METH_KEYWORDS, "put_carray(field_code, data [, start])\n\n" "Store the data in the list or NumPy array 'data' in the CARRAY given\n" "by 'field_code'. If a list is provided, all entries must be of the\n" "same type. The parameter 'start' indicates where the first sample\n" "in which the data will be stored. Zero is assumed if not given.\n" "See gd_put_carray_slice(3)." /* ------- handy ruler ---------------------------------------------| */ }, {"put_constant", (PyCFunction)gdpy_dirfile_putconstant, METH_VARARGS | METH_KEYWORDS, "put_constant(field_code, value [, type])\n\n" "Store the value of 'value' in the CONST field given by 'field_code'.\n" "The 'value' parameter must be a simple numeric type. This method\n" "will use the most appropriate data type when passing the value to\n" "the C API. However, this behaviour can be overridden by explicitly\n" "specifying a C API type for the data using 'type'. If specified,\n" "'type' should be one of the data type codes: pygetdata.UINT8,\n" "pygetdata.INT8, &c. Note that this does not affect the storage type\n" "of the CONST field, merely how the data is transferred to the C API.\n" "See gd_put_constant(3)." }, {"putdata", (PyCFunction)gdpy_dirfile_putdata, METH_VARARGS | METH_KEYWORDS, "putdata(field_code, data [, type, first_frame, first_sample])\n\n" "Store the data in the list or NumPy array 'data' in the vector field\n" "given by 'field_code'. If a list is provided, all entries must be\n" "of the same type. The parameters 'first_frame' and 'first_sample'\n" "indicate the first sample in which the data will be stored. If\n" "neither are given, the data will be stored starting from the first\n" "sample in the field. The number of samples actually written is\n" "returned.\n\n" "This method will use the most appropriate data type when passing the\n" "data to the C API. However, this behaviour can be overridden by\n" "explicitly specifying a C API type for the data using 'type'. If\n" "specified, 'type' should be one of the data type codes:\n" "pygetdata.UINT8, pygetdata.INT8, &c. Note that this does not affect\n" "the storage type of the field, merely how the data is transferred to\n" "the C API. See gd_putdata(3)." }, {"put_string", (PyCFunction)gdpy_dirfile_putstring, METH_VARARGS | METH_KEYWORDS, "put_string(field_code, value)\n\n" "Store the string given by 'value' in the STRING field specified by\n" "'field_code'. See gd_put_string(3)." }, {"rename", (PyCFunction)gdpy_dirfile_rename, METH_VARARGS | METH_KEYWORDS, "rename(old_code, new_name [, flags])\n\n" "Change the name of the field specified by 'old_code' to 'new_name'.\n" "If 'flags' is given and is non-zero, it should be a bitwise or'd\n" "collection of the pygetdat.REN_* symbols. See gd_rename(3)." }, {"seek", (PyCFunction)gdpy_dirfile_seek, METH_VARARGS | METH_KEYWORDS, "seek(field_code, flags [, frame_num, sample_num])\n\n" "Set the field pointer of the field specified by 'field_code'. The\n" "'frame_num' and 'sample_num' parameters indicate desired position.\n" "If they are both omitted, the field pointer is set to sample zero.\n" "The 'flags' parameter must contain one of pygetdata.SEEK_SET,\n" "pygetdata.SEEK_CUR and pygetdata.SEEK_END, which may be bitwise or'd\n" "with pygetdata.SEEK_WRITE. See gd_seek(3)." }, {"set_callback", (PyCFunction)gdpy_dirfile_callback, METH_VARARGS | METH_KEYWORDS, "set_callback(sehandler, extra)\n\n" "Change or remove the parser callback function, and the caller object\n" "passed to it. If 'sehandler' is None, the current parser callback\n" "(if any) will be removed, otherwise, the current callback will be\n" "replaced by 'sehandler', which must be a callable object. The\n" "'extra' parameter is any object which will be passed to the callback\n" "handler, or None, if no such object is needed. See\n" "gd_parser_callback(3)." }, {"tell", (PyCFunction)gdpy_dirfile_tell, METH_VARARGS | METH_KEYWORDS, "tell(field_code)\n\n" "Report the current position of the field pointer of 'field_code'.\n" "See gd_tell(3)." }, {"unhide", (PyCFunction)gdpy_dirfile_unhide, METH_VARARGS | METH_KEYWORDS, "unhide(field_code)\n\n" "Clears the hidden flag on the specified field. See gd_unhide(3)." }, {"uninclude", (PyCFunction)gdpy_dirfile_uninclude, METH_VARARGS | METH_KEYWORDS, "uninclude(fragment_index [, del])\n\n" "Remove the format file fragment indexed by 'fragment_index' from the\n" "database. If 'del' is given, and is non-zero, the file will also be\n" "deleted from disk. This also removes all field defined in the\n" "specified fragment from the database. See gd_uninclude(3)." }, {"validate", (PyCFunction)gdpy_dirfile_validate, METH_VARARGS | METH_KEYWORDS, "validate(field_code)\n\n" "Check whether the field specified by 'field_code' is valid for\n" "reading and writing. Throws an error if it is not. See\n" "gd_validate(3)." }, {"sync", (PyCFunction)gdpy_dirfile_sync, METH_VARARGS | METH_KEYWORDS, "sync([field_code])\n\n" "Flush pending writes to the specified field to disk. This does\n" "not flush pending metadata changes. For that, use metaflush.\n" "However, if field_code is omitted, all data *and* metadata will be\n" "written to disk. See gd_sync(3)." }, {"raw_close", (PyCFunction)gdpy_dirfile_raw_close, METH_VARARGS | METH_KEYWORDS, "raw_close([field_code])\n\n" "Close any open raw data files associated with field_code, freeing\n" "resources which may be used for other purposes. If field_code is\n" "omitted, all open raw data files are closed. See gd_raw_close(3)." }, {"naliases", (PyCFunction)gdpy_dirfile_naliases, METH_VARARGS | METH_KEYWORDS, "naliases(field_code)\n\n" "This function returns the number of aliases defined for the specified\n" "field. If field_code is valid, this will be at least one. See\n" "gd_naliases(3)." }, {"alias_target", (PyCFunction)gdpy_dirfile_aliastarget, METH_VARARGS | METH_KEYWORDS, "alias_target(field_code)\n\n" "Returns the target of the alias specified by 'field_code'.\n" "See gd_alias_target(3)." }, {"aliases", (PyCFunction)gdpy_dirfile_aliaslist, METH_VARARGS | METH_KEYWORDS, "aliases(field_code)\n\n" "Returns a list of aliases for 'field_code'. If successful, the\n" "list returned will always contain at least one entry, field_code\n" "itself. See gd_alias_list(3)." }, {"add_alias", (PyCFunction)gdpy_dirfile_addalias, METH_VARARGS | METH_KEYWORDS, "add_alias(field_code, target [, fragment_index])\n\n" "Adds a new alias called 'field_code' pointing to 'target' to the\n" "fragment indexed by 'fragment_index', which defaults to 0 if not\n" "given. See gd_add_alias(3)." }, {"madd_alias", (PyCFunction)gdpy_dirfile_maddalias, METH_VARARGS | METH_KEYWORDS, "add_alias(parent, field_code, target)\n\n" "Adds a new alias called 'field_code' pointing to 'target' as a\n" "metalias under 'parent'. See gd_madd_alias(3)." }, {"strtok", (PyCFunction)gdpy_dirfile_strtok, METH_VARARGS | METH_KEYWORDS, "strtok([string])\n\n" "If 'string' is given, runs the GetData tokeniser on 'string' and\n" "returns the first token. If 'string' is not given, returns\n" "subsequent tokens (one per call) of the last string that was\n" "provided. Note: an error will result if the string being parsed\n" "goes out of scope. See gd_strtok(3)." }, {"desync", (PyCFunction)gdpy_dirfile_desync, METH_VARARGS | METH_KEYWORDS, "desync([flags])\n\n" "Returns non-zero if the metadata on disk has changed since the\n" "dirfile was opened, and optionally automatically reloads it. If\n" "given, flags should be a bitwise or'd collection of the\n" "pygetdata.DESYNC_... flags. See gd_desync(3)." }, {"entry_list", (PyCFunction)gdpy_dirfile_entrylist, METH_VARARGS | METH_KEYWORDS, "entry_list([parent, type, flags])\n\n" "Return a list of entry names in the database. If 'parent' is\n" "given metafields under 'parent' will be considered, otherwise\n" "top-level entries are returned. If given, 'type' should be either\n" "one of the the pygetdata.*_ENTRY symbols, or else one of the\n" "special pygetdata.*_ENTRIES symbols; if not given, 'type' defaults\n" "to pygetdata.ALL_ENTRIES. If given 'flags' should be a bitwise\n" "or'd collection of zero or more of the pygetdata.ENTRIES_* flags.\n" "See gd_entry_list(3)." }, { NULL, NULL, 0, NULL } }; #define DIRFILE_DOC \ "dirfile([name [, flags [, sehandler [, extra ]]])\n\n" \ "If 'name' is omitted or None, returns an invalid dirfile, as if\n" \ "gd_invalid_dirfile(3) were called. Othwerwise, if 'name' is a string,\n" \ "returns a dirfile object representing the dirfile specified by 'name'.\n" \ "The dirfile is opened by a call to gd_cbopen(3). See that manual page\n" \ "for full details on arguments. If present, 'flags' should be a bitwise\n" \ "or'd collection of gd_cbopen flags. If it is omitted, the default,\n" \ "pygetdata.RDONLY, is used.\n\n" \ "If a callback handler is desired, 'sehandler' should be a callable\n"\ "object (ie. a function) which accepts two objects. The first object is\n"\ "a dictionary with keys: 'suberror', 'line', 'linenum', and 'filename',\n"\ "providing the same information as the gd_pdata_t structure in the C API.\n"\ "The second object is the 'extra' object passed to this constructor, and\n"\ "may be any object desired by the caller. If no extra parameter was\n"\ /* ---------------------------------------------------------------------| */\ "specified, this will be None. The sehandler should return either:\n\n"\ " * an integer, one of the pygetdata.SYNTAX_... symbols; or\n"\ " * a string containing the corrected line, and pygetdata.SYNTAX_RESCAN\n"\ " is assumed; or\n"\ " * a tuple consisting of an integer, one of the pygetdata.SYNTAX_...\n"\ " symbols, and then, optionally, a string containing the corrected\n"\ " line.\n"\ "\n"\ "The dirfile will be automatically closed when garbage collection is run\n"\ "on the object. In general, however, an explicit call to close() or\n"\ "discard() is preferable on a writeable dirfile, since the implicit close\n"\ "performed on the dirfile when the object is deleted silently discards\n"\ "any errors encountered when the dirfile is flushed to disc. After\n"\ "explicitly calling close() or discard(), the dirfile will be\n"\ "invalidated, prohibiting further use of it.\n" PyTypeObject gdpy_dirfile = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ "pygetdata.dirfile", /* tp_name */ sizeof(struct gdpy_dirfile_t), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)gdpy_dirfile_delete, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ 0, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ DIRFILE_DOC, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ gdpy_dirfile_methods, /* tp_methods */ 0, /* tp_members */ gdpy_dirfile_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)gdpy_dirfile_init, /* tp_init */ 0, /* tp_alloc */ gdpy_dirfile_create, /* tp_new */ }; libgetdata-0.9.0/bindings/cxx/0000740000175000017500000000000012614323564016401 5ustar alastairalastairlibgetdata-0.9.0/bindings/cxx/Makefile.in0000640000175000017500000010064512614323564020456 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/cxx DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp $(getdata_include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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)$(getdata_includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libgetdata___la_DEPENDENCIES = ../../src/libgetdata.la am__objects_1 = am_libgetdata___la_OBJECTS = dirfile.lo bitentry.lo carrayentry.lo \ constentry.lo divideentry.lo entry.lo fragment.lo \ lincomentry.lo linterpentry.lo mplexentry.lo multiplyentry.lo \ phaseentry.lo polynomentry.lo rawentry.lo recipentry.lo \ sbitentry.lo stringentry.lo windowentry.lo $(am__objects_1) libgetdata___la_OBJECTS = $(am_libgetdata___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 = libgetdata___la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ $(AM_CXXFLAGS) $(CXXFLAGS) $(libgetdata___la_LDFLAGS) \ $(LDFLAGS) -o $@ 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f 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 = 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 = $(libgetdata___la_SOURCES) DIST_SOURCES = $(libgetdata___la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 HEADERS = $(getdata_include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign getdata_includedir = ${includedir}/getdata AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(top_srcdir)/src SUBDIRS = test getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.h \ getdata/lincomentry.h getdata/linterpentry.h \ getdata/bitentry.h getdata/multiplyentry.h \ getdata/phaseentry.h getdata/constentry.h \ getdata/stringentry.h getdata/indexentry.h \ getdata/sbitentry.h getdata/polynomentry.h \ getdata/fragment.h getdata/divideentry.h \ getdata/recipentry.h getdata/carrayentry.h \ getdata/windowentry.h getdata/mplexentry.h lib_LTLIBRARIES = libgetdata++.la libgetdata___la_SOURCES = dirfile.cpp bitentry.cpp carrayentry.cpp \ constentry.cpp divideentry.cpp entry.cpp \ fragment.cpp lincomentry.cpp \ linterpentry.cpp mplexentry.cpp multiplyentry.cpp \ phaseentry.cpp polynomentry.cpp rawentry.cpp \ recipentry.cpp sbitentry.cpp \ stringentry.cpp windowentry.cpp \ ${getdata_include_HEADERS} internal.h libgetdata___la_LIBADD = ../../src/libgetdata.la libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@ all: all-recursive .SUFFIXES: .SUFFIXES: .cpp .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 bindings/cxx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/cxx/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-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}; \ } libgetdata++.la: $(libgetdata___la_OBJECTS) $(libgetdata___la_DEPENDENCIES) $(EXTRA_libgetdata___la_DEPENDENCIES) $(AM_V_CXXLD)$(libgetdata___la_LINK) -rpath $(libdir) $(libgetdata___la_OBJECTS) $(libgetdata___la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/carrayentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/divideentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lincomentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linterpentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mplexentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multiplyentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/phaseentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/polynomentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recipentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sbitentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stringentry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windowentry.Plo@am__quote@ .cpp.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 $@ $< .cpp.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) '$<'` .cpp.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-getdata_includeHEADERS: $(getdata_include_HEADERS) @$(NORMAL_INSTALL) @list='$(getdata_include_HEADERS)'; test -n "$(getdata_includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(getdata_includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(getdata_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)$(getdata_includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(getdata_includedir)" || exit $$?; \ done uninstall-getdata_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(getdata_include_HEADERS)'; test -n "$(getdata_includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(getdata_includedir)'; $(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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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 $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(getdata_includedir)"; 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-libLTLIBRARIES clean-libtool clean-local \ 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-getdata_includeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES 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: uninstall-getdata_includeHEADERS \ uninstall-libLTLIBRARIES .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local cscopelist-am ctags ctags-am \ 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-getdata_includeHEADERS 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 installdirs-am 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-getdata_includeHEADERS uninstall-libLTLIBRARIES clean-local: rm -rf *~ getdata/*~ # 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: libgetdata-0.9.0/bindings/cxx/recipentry.cpp0000640000175000017500000000543312614323564021300 0ustar alastairalastair// Copyright (C) 2010, 2011, 2013 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; RecipEntry::RecipEntry(const char* field_code, const char* in_field1, double dividend, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_RECIP_ENTRY; E.in_fields[0] = strdup(in_field1); E.scalar[0] = 0; E.u.recip.cdividend[0] = E.u.recip.dividend = dividend; E.u.recip.cdividend[1] = 0; E.flags = 0; E.fragment_index = fragment_index; } RecipEntry::RecipEntry(const char* field_code, const char* in_field1, std::complex dividend, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_RECIP_ENTRY; E.in_fields[0] = strdup(in_field1); E.scalar[0] = 0; E.u.recip.cdividend[0] = E.u.recip.dividend = dividend.real(); E.u.recip.cdividend[1] = dividend.imag(); E.flags = GD_EN_COMPSCAL; E.fragment_index = fragment_index; } int RecipEntry::SetInput(const char* field) { char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[0]); E.in_fields[0] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int RecipEntry::SetDividend(double dividend) { E.u.recip.cdividend[0] = E.u.recip.dividend = dividend; E.u.recip.cdividend[1] = 0; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int RecipEntry::SetDividend(const char *scale) { int r = 0; SetScalar(0, scale); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) { r = gd_get_constant(D->D, scale, GD_COMPLEX128, &E.u.recip.cdividend); E.u.recip.dividend = E.u.recip.cdividend[0]; } } return r; } int RecipEntry::SetDividend(std::complex dividend) { E.u.recip.dividend = E.u.recip.cdividend[0] = dividend.real(); E.u.recip.cdividend[1] = dividend.imag(); E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } libgetdata-0.9.0/bindings/cxx/fragment.cpp0000640000175000017500000000535512614323564020722 0ustar alastairalastair// Copyright (C) 2008-2012, 2014 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; Fragment::Fragment(const GetData::Dirfile *dirfile, int index) { dtrace("%p, %i", dirfile, index); D = dirfile; ind = index; enc = (GetData::EncodingScheme)gd_encoding(D->D, index); end = gd_endianness(D->D, index); off = gd_frameoffset64(D->D, index); prot = gd_protection(D->D, index); name = gd_fragmentname(D->D, index); parent = (index == 0) ? -1 : gd_parent_fragment(D->D, index); if (gd_fragment_affixes(D->D, index, &prefix, &suffix) == -1) prefix = suffix = NULL; dreturnvoid(); } Fragment::~Fragment() { free(prefix); free(suffix); } int Fragment::ReWrite() const { return gd_rewrite_fragment(D->D, ind); } int Fragment::SetEncoding(GetData::EncodingScheme encoding, int recode) { int ret = gd_alter_encoding(D->D, (unsigned long)encoding, ind, recode); if (!ret) enc = encoding; return ret; } int Fragment::SetEndianness(unsigned long byte_sex, int recode) { int ret = gd_alter_endianness(D->D, byte_sex, ind, recode); if (!ret) end = byte_sex; return ret; } int Fragment::SetFrameOffset(gd_off64_t offset, int recode) { int ret = gd_alter_frameoffset64(D->D, offset, ind, recode); if (!ret) off = offset; return ret; } int Fragment::SetProtection(int protection_level) { int ret = gd_alter_protection(D->D, protection_level, ind); if (!ret) prot = protection_level; return ret; } int Fragment::SetPrefix(const char* new_prefix) { int ret = gd_alter_affixes(D->D, ind, new_prefix, suffix); free(prefix); free(suffix); if (!ret) ret = gd_fragment_affixes(D->D, ind, &prefix, &suffix); return ret; } int Fragment::SetSuffix(const char* new_suffix) { int ret = gd_alter_affixes(D->D, ind, prefix, new_suffix); free(prefix); free(suffix); if (!ret) ret = gd_fragment_affixes(D->D, ind, &prefix, &suffix); return ret; } libgetdata-0.9.0/bindings/cxx/phaseentry.cpp0000640000175000017500000000353612614323564021300 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; PhaseEntry::PhaseEntry(const char* field_code, const char* in_field, gd_shift_t shift, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_PHASE_ENTRY; E.in_fields[0] = strdup(in_field); E.u.phase.shift = shift; E.fragment_index = fragment_index; } int PhaseEntry::SetInput(const char* field) { char* ptr = strdup(field); if (ptr == NULL) return 0; free(E.in_fields[0]); E.in_fields[0] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int PhaseEntry::SetShift(gd_shift_t shift) { E.u.phase.shift = shift; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int PhaseEntry::SetShift(const char *shift) { int r = 0; SetScalar(0, shift); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, shift, GD_INT64, &E.u.phase.shift); } return r; } libgetdata-0.9.0/bindings/cxx/bitentry.cpp0000640000175000017500000000446212614323564020755 0ustar alastairalastair// Copyright (C) 2008-2012 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" BitEntry::BitEntry(const char* field_code, const char* in_field, int bitnum, int numbits, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_BIT_ENTRY; E.in_fields[0] = strdup(in_field); E.u.bit.bitnum = bitnum; E.u.bit.numbits = numbits; E.fragment_index = fragment_index; } int BitEntry::SetInput(const char* field) { char* ptr = strdup(field); if (ptr == NULL) return 0; free(E.in_fields[0]); E.in_fields[0] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int BitEntry::SetFirstBit(int first_bit) { E.u.bit.bitnum = first_bit; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int BitEntry::SetNumBits(int num_bits) { E.u.bit.numbits = num_bits; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int BitEntry::SetFirstBit(const char *first_bit) { int r = 0; SetScalar(0, first_bit); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, first_bit, GD_INT16, &E.u.bit.bitnum); } return r; } int BitEntry::SetNumBits(const char *num_bits) { int r = 0; SetScalar(1, num_bits); E.scalar[1] = strdup(num_bits); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, num_bits, GD_INT16, &E.u.bit.numbits); } return r; } libgetdata-0.9.0/bindings/cxx/getdata/0000740000175000017500000000000012614323564020012 5ustar alastairalastairlibgetdata-0.9.0/bindings/cxx/getdata/entry.h0000640000175000017500000001763312614323564021340 0ustar alastairalastair// Copyright (C) 2008-2013, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_ENTRY_H #define GETDATA_ENTRY_H #include #include namespace GetData { class Dirfile; enum DataType { Null = GD_NULL, Unknown = GD_UNKNOWN, UInt8 = GD_UINT8, Int8 = GD_INT8, UInt16 = GD_UINT16, Int16 = GD_INT16, UInt32 = GD_UINT32, Int32 = GD_INT32, UInt64 = GD_UINT64, Int64 = GD_INT64, Float32 = GD_FLOAT32, Float64 = GD_FLOAT64, Complex64 = GD_COMPLEX64, Complex128 = GD_COMPLEX128 }; enum EntryType { NoEntryType = GD_NO_ENTRY, RawEntryType = GD_RAW_ENTRY, LincomEntryType = GD_LINCOM_ENTRY, LinterpEntryType = GD_LINTERP_ENTRY, BitEntryType = GD_BIT_ENTRY, MultiplyEntryType = GD_MULTIPLY_ENTRY, PhaseEntryType = GD_PHASE_ENTRY, SBitEntryType = GD_SBIT_ENTRY, PolynomEntryType = GD_POLYNOM_ENTRY, ConstEntryType = GD_CONST_ENTRY, CarrayEntryType = GD_CARRAY_ENTRY, StringEntryType = GD_STRING_ENTRY, IndexEntryType = GD_INDEX_ENTRY, DivideEntryType = GD_DIVIDE_ENTRY, RecipEntryType = GD_RECIP_ENTRY, WindowEntryType = GD_WINDOW_ENTRY, MplexEntryType = GD_MPLEX_ENTRY }; enum WindOpType { WindOpEq = GD_WINDOP_EQ, WindOpNe = GD_WINDOP_NE, WindOpGe = GD_WINDOP_GE, WindOpGt = GD_WINDOP_GT, WindOpLe = GD_WINDOP_LE, WindOpLt = GD_WINDOP_LT, WindOpSet = GD_WINDOP_SET, WindOpClr = GD_WINDOP_CLR }; class Entry { friend class Dirfile; public: Entry(); virtual ~Entry(); /* Generic data */ int Associated() const { return (D != NULL); }; const char *Name() const { return E.field; }; EntryType Type() const { return (EntryType)E.field_type; }; void Dissociate() { D = NULL; }; int FragmentIndex() const { return E.fragment_index; }; int Move(int new_fragment, unsigned flags = 0); int Rename(const char* new_name, unsigned flags = 0); /* Specific data */ virtual const char *Input(int index) const { return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.in_fields[index] : NULL; }; virtual int ComplexScalars() const { if (E.field_type == GD_LINCOM_ENTRY || E.field_type == GD_POLYNOM_ENTRY || E.field_type == GD_RECIP_ENTRY) if (E.flags & GD_EN_COMPSCAL) return 1; return 0; } unsigned int Flags() const { return E.flags; }; virtual const char *Scalar(int index) const; virtual int ScalarIndex(int index) const; /* RAW methods */ virtual unsigned int SamplesPerFrame() const { return (E.field_type == GD_RAW_ENTRY) ? E.u.raw.spf : 0; }; virtual DataType RawType() const { return (E.field_type == GD_RAW_ENTRY) ? (DataType)E.u.raw.data_type : Unknown; }; /* LINCOM methods */ virtual int NFields() const { return (E.field_type == GD_LINCOM_ENTRY) ? E.u.lincom.n_fields : 0; }; virtual double Scale(int index) const { return (E.field_type == GD_LINCOM_ENTRY && CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.m[index] : 0; } virtual std::complex CScale(int index) const { return (E.field_type == GD_LINCOM_ENTRY && CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? std::complex(E.u.lincom.cm[index][0], E.u.lincom.cm[index][1]) : 0; } virtual double Offset(int index) const { return (E.field_type == GD_LINCOM_ENTRY && CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.b[index] : 0; } virtual std::complex COffset(int index) const { return (E.field_type == GD_LINCOM_ENTRY && CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? std::complex(E.u.lincom.cb[index][0], E.u.lincom.cb[index][1]) : 0; } /* LINTERP methods */ virtual const char *Table() const { return (E.field_type == GD_LINTERP_ENTRY) ? E.u.linterp.table : NULL; }; /* (S)BIT methods */ virtual int FirstBit() const { return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.bitnum : -1; }; virtual int NumBits() const { return (E.field_type == GD_BIT_ENTRY) ? E.u.bit.numbits : -1; }; /* PHASE methods */ virtual gd_shift_t Shift() const { return (E.field_type == GD_PHASE_ENTRY) ? E.u.phase.shift : 0; }; /* CONST methods */ virtual DataType ConstType() const { return (E.field_type == GD_CONST_ENTRY || E.field_type == GD_CARRAY_ENTRY) ? (DataType)E.u.scalar.const_type : Unknown; }; /* CARRAY methods */ virtual size_t ArrayLen() const { return (E.field_type == GD_CARRAY_ENTRY) ? E.u.scalar.array_len : 0; }; /* POLYNOM methods */ virtual int PolyOrd() const { return (E.field_type == GD_POLYNOM_ENTRY) ? E.u.polynom.poly_ord : 0; }; virtual double Coefficient(int index) const { return (E.field_type == GD_POLYNOM_ENTRY && index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0; } virtual std::complex CCoefficient(int index) const { return (E.field_type == GD_POLYNOM_ENTRY && index <= E.u.polynom.poly_ord) ? std::complex(E.u.polynom.ca[index][0], E.u.polynom.ca[index][1]) : 0; } /* RECIP methods */ virtual double Dividend() const { return (E.field_type == GD_RECIP_ENTRY) ? E.u.recip.dividend : 0; }; virtual std::complex CDividend() const { return (E.field_type == GD_RECIP_ENTRY) ? std::complex(E.u.recip.cdividend[0], E.u.recip.cdividend[1]) : 0; }; /* WINDOW methods */ virtual WindOpType WindOp() const { return (E.field_type == GD_WINDOW_ENTRY) ? (WindOpType)E.u.window.windop : (WindOpType)0; } virtual gd_triplet_t Threshold() const { gd_triplet_t zero; zero.r = 0; return (E.field_type == GD_WINDOW_ENTRY) ? E.u.window.threshold : zero; } /* MPLEX methods */ virtual int CountVal() const { return (E.field_type == GD_MPLEX_ENTRY) ? E.u.mplex.count_val : 0; } virtual int Period() const { return (E.field_type == GD_MPLEX_ENTRY) ? E.u.mplex.period : 0; } /* deprecated member alias */ virtual int gd_deprecated CountMax() const { return Period(); } /* Set methods */ void SetName(const char* name); void SetFragmentIndex(int fragment_index); protected: Entry(const Dirfile *dirfile, const char* field_code); static int CheckIndex(gd_entype_t field_type, int n_fields, int index); void SetDirfile(const GetData::Dirfile* dirfile); void SetScalar(int n, const char *code); gd_entry_t E; const Dirfile* D; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/stringentry.h0000640000175000017500000000254412614323564022562 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_STRINGENTRY_H #define GETDATA_STRINGENTRY_H #include namespace GetData { class Dirfile; class StringEntry : public Entry { friend class Dirfile; public: StringEntry() : Entry() { E.field_type = GD_STRING_ENTRY; }; StringEntry(const char* field_code, int fragment_index = 0); private: StringEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/divideentry.h0000640000175000017500000000313212614323564022512 0ustar alastairalastair// Copyright (C) 2010, 2011, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_DIVIDEENTRY_H #define GETDATA_DIVIDEENTRY_H #include namespace GetData { class Dirfile; class DivideEntry : public Entry { friend class Dirfile; public: DivideEntry() : Entry() { E.field_type = GD_DIVIDE_ENTRY; }; DivideEntry(const char* field_code, const char* in_field1, const char* in_field2, int fragment_index = 0); virtual const char *Input(int index) const { return (index == 0 || index == 1) ? E.in_fields[index] : NULL; }; int SetInput(const char* field, int index); private: DivideEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/multiplyentry.h0000640000175000017500000000314712614323564023133 0ustar alastairalastair// Copyright (C) 2008-2011, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_MULTIPLYENTRY_H #define GETDATA_MULTIPLYENTRY_H #include namespace GetData { class Dirfile; class MultiplyEntry : public Entry { friend class Dirfile; public: MultiplyEntry() : Entry() { E.field_type = GD_MULTIPLY_ENTRY; }; MultiplyEntry(const char* field_code, const char* in_field1, const char* in_field2, int fragment_index = 0); virtual const char *Input(int index) const { return (index == 0 || index == 1) ? E.in_fields[index] : NULL; }; int SetInput(const char* field, int index); private: MultiplyEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/mplexentry.h0000640000175000017500000000477512614323564022411 0ustar alastairalastair// Copyright (C) 2012, 2013, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_MPLEXENTRY_H #define GETDATA_MPLEXENTRY_H #include namespace GetData { class Dirfile; class MplexEntry : public Entry { friend class Dirfile; public: MplexEntry() : Entry() { E.field_type = GD_MPLEX_ENTRY; }; MplexEntry(const char* field_code, const char* in_field, const char *check_field, int count_val, int period, int fragment_index = 0); virtual const char *Input(int index) const { return (index == 0 || index == 1) ? E.in_fields[index] : NULL; }; virtual const char *Scalar(int index) const { return (index == 0 || index == 1) ? E.scalar[index] : NULL; }; virtual int ScalarIndex(int index) const { return (index == 0 || index == 1) ? E.scalar_ind[index] : 0; }; virtual int CountVal() const { return E.u.mplex.count_val; }; virtual int Period() const { return E.u.mplex.period; }; int SetInput(const char* field, int index); virtual int SetCountVal(int count_val); virtual int SetCountVal(const char* count_val); virtual int SetPeriod(int period); virtual int SetPeriod(const char* period); /* deprecated member aliases */ virtual int gd_deprecated CountMax() const { return Period(); }; virtual int gd_deprecated SetCountMax(int period) { return SetPeriod(period); } virtual int gd_deprecated SetCountMax(const char* period) { return SetPeriod(period); }; private: MplexEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/bitentry.h0000640000175000017500000000412612614323564022030 0ustar alastairalastair// Copyright (C) 2008-2012, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_BITENTRY_H #define GETDATA_BITENTRY_H #include namespace GetData { class Dirfile; class BitEntry : public Entry { friend class Dirfile; public: BitEntry() : Entry() { E.field_type = GD_BIT_ENTRY; }; BitEntry(const char* field_code, const char* in_field, int bitnum, int numbits = 1, int fragment_index = 0); virtual const char *Input(int index = 0) const { return (index == 0) ? E.in_fields[0] : NULL; }; virtual int FirstBit() const { return E.u.bit.bitnum; }; virtual int NumBits() const { return E.u.bit.numbits; }; int SetInput(const char* field); int SetFirstBit(int first_bit); int SetFirstBit(const char* first_bit); int SetNumBits(int num_bits); int SetNumBits(const char* num_bits); virtual const char *Scalar(int index) const { return (index == 0 || index == 1) ? E.scalar[index] : NULL; }; virtual int ScalarIndex(int index) const { return (index == 0 || index == 1) ? E.scalar_ind[index] : 0; }; private: BitEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/sbitentry.h0000640000175000017500000000413512614323564022213 0ustar alastairalastair// Copyright (C) 2008-2012, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_SBITENTRY_H #define GETDATA_SBITENTRY_H #include namespace GetData { class Dirfile; class SBitEntry : public Entry { friend class Dirfile; public: SBitEntry() : Entry() { E.field_type = GD_SBIT_ENTRY; }; SBitEntry(const char* field_code, const char* in_field, int bitnum, int numbits = 1, int fragment_index = 0); virtual const char *Input(int index = 0) const { return (index == 0) ? E.in_fields[0] : NULL; }; virtual int FirstBit() const { return E.u.bit.bitnum; }; virtual int NumBits() const { return E.u.bit.numbits; }; int SetInput(const char* field); int SetFirstBit(int first_bit); int SetFirstBit(const char* first_bit); int SetNumBits(int num_bits); int SetNumBits(const char* num_bits); virtual const char *Scalar(int index) const { return (index == 0 || index == 1) ? E.scalar[index] : NULL; }; virtual int ScalarIndex(int index) const { return (index == 0 || index == 1) ? E.scalar_ind[index] : 0; }; private: SBitEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/windowentry.h0000640000175000017500000000431112614323564022555 0ustar alastairalastair// Copyright (C) 2011, 2012, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_WINDOWENTRY_H #define GETDATA_WINDOWENTRY_H #include namespace GetData { class Dirfile; class WindowEntry : public Entry { friend class Dirfile; public: WindowEntry() : Entry() { E.field_type = GD_WINDOW_ENTRY; }; WindowEntry(const char* field_code, const char* in_field, const char *check_Field, WindOpType windop, gd_triplet_t threshold, int fragment_index = 0); virtual const char *Input(int index) const { return (index == 0 || index == 1) ? E.in_fields[index] : NULL; }; virtual const char *Scalar(int index = 0) const { return (index == 0) ? E.scalar[0] : NULL; }; virtual int ScalarIndex(int index = 0) const { return (index == 0) ? E.scalar_ind[0] : 0; }; virtual WindOpType WindOp() const { return (WindOpType)E.u.window.windop; }; virtual gd_triplet_t Threshold() const { return E.u.window.threshold; }; int SetInput(const char* field, int index); virtual int SetWindOp(WindOpType windop); virtual int SetThreshold(gd_triplet_t threshold); virtual int SetThreshold(const char* threshold); private: WindowEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/indexentry.h0000640000175000017500000000231412614323564022356 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_INDEXENTRY_H #define GETDATA_INDEXENTRY_H #include namespace GetData { class Dirfile; class IndexEntry : public Entry { friend class Dirfile; private: IndexEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/dirfile.h0000640000175000017500000002041612614323564021606 0ustar alastairalastair// Copyright (C) 2008-2012, 2014 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_DIRFILE_H #define GETDATA_DIRFILE_H // Enable the explicit 64-bit API (gd_getdata64() &c.) #ifndef GD_64BIT_API # define GD_64BIT_API #endif // Disable the legacy API since its symbols clash with us. #ifndef GD_NO_LEGACY_API # define GD_NO_LEGACY_API #endif // Use the C89 API since C++ compilers aren't required to support the // C99 _Complex keyword #ifndef GD_C89_API # define GD_C89_API #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include namespace GetData { class Entry; class RawEntry; int EncodingSupport(EncodingScheme encoding); class Dirfile { friend class Entry; friend class RawEntry; friend class LincomEntry; friend class LinterpEntry; friend class BitEntry; friend class SBitEntry; friend class MultiplyEntry; friend class DivideEntry; friend class RecipEntry; friend class PhaseEntry; friend class PolynomEntry; friend class WindowEntry; friend class MplexEntry; friend class ConstEntry; friend class CarrayEntry; friend class StringEntry; friend class IndexEntry; friend class Fragment; public: Dirfile(); Dirfile(const char *dirfilename, unsigned long flags = GD_RDONLY, gd_parser_callback_t sehandler = NULL, void* extra = NULL); Dirfile(DIRFILE *D); ~Dirfile(); int Add(GetData::Entry &entry) const; int AddAlias(const char *field_code, const char *target, int fragment_index = 0) const; int AddSpec(const char *spec, int fragment_index = 0) const; const char** Aliases(const char* field_code) const; const char* AliasTarget(const char* field_code) const; int AlterSpec(const char* spec, int recode = 0) const; size_t ArrayLen(const char *field_code) const; gd_off64_t BoF(const char *field_code) const; size_t CarrayLen(const char *field_code) const gd_deprecated; const gd_carray_t *Carrays(DataType type = Float64) const; int Close(); const void *Constants(DataType type = Float64) const; int Delete(const char* field_code, unsigned flags = 0) const; int DeSync(unsigned int flags = 0); int Discard(); GetData::Entry* Entry(const char *field_code) const; const char **EntryList(const char *parent = NULL, int type = 0, unsigned int flags = 0) const; gd_off64_t EoF(const char *field_code) const; int Error() const; int ErrorCount() const; const char *ErrorString(); const char *ErrorString(size_t n) gd_deprecated; unsigned long Flags(unsigned long set = 0, unsigned long reset = 0); const char **FieldList() const; const char **FieldListByType(EntryType type) const; int Flush(const char *field_code = NULL) const; GetData::Fragment *Fragment(int index) const; int FragmentIndex(const char* field_code) const; double FrameNum(const char* field_code, double value, gd_off64_t frame_start = 0, gd_off64_t frame_end = 0) const; int GetCarray(const char *field_code, DataType type, void *data_out, unsigned int start = 0, size_t len = 0) const; int GetConstant(const char *field_code, DataType type, void *data_out) const; size_t GetData(const char *field_code, gd_off64_t first_frame, gd_off64_t first_sample, size_t num_frames, size_t num_samples, DataType type, void* data_out) const; size_t GetString(const char *field_code, size_t len, char *data_out) const; int Hide(const char* field_code) const; int Hidden(const char* field_code) const; int Include(const char *file, int fragment_index = 0, unsigned long flags = 0) const; int IncludeAffix(const char *file, int fragment_index = 0, const char* prefix = NULL, const char* suffix = NULL, unsigned long flags = 0) const; char *LinterpTableName(const char *field_code); int MAdd(GetData::Entry &entry, const char *parent) const; int MAddAlias(const char* parent, const char* name, const char* target) const; int MAddSpec(const char *spec, const char *parent) const; int MAlterSpec(const char *line, const char *parent, int recode = 0) const; const gd_carray_t *MCarrays(const char *parent, DataType type = Float64) const; const void *MConstants(const char *parent, DataType type = Float64) const; int MetaFlush() const; const char **MFieldList(const char *parent) const; const char **MFieldListByType(const char *parent, EntryType type) const; void MplexLookback(int lookback) const; const char **MStrings(const char *parent) const; const char **MVectorList(const char *parent) const; int NAliases(const char* field_code) const; unsigned int NEntries(const char *parent = NULL, int type = 0, unsigned int flags = 0) const; unsigned int NFields() const; unsigned int NFieldsByType(EntryType type) const; unsigned int NMFields(const char *parent) const; unsigned int NMFieldsByType(const char *parent, EntryType type) const; unsigned int NMVectors(const char *parent) const; const char* Name() const; DataType NativeType(const char* field_code) const; int NFragments() const; gd_off64_t NFrames() const; unsigned int NVectors() const; int PutCarray(const char *field_code, DataType type, const void *data_in, unsigned int start = 0, size_t len = 0) const; int PutConstant(const char *field_code, DataType type, const void *data_in) const; size_t PutData(const char *field_code, gd_off64_t first_frame, gd_off64_t first_sample, size_t num_frames, size_t num_samples, DataType type, const void* data_in) const; size_t PutString(const char *field_code, const char *data_in) const; int RawClose(const char *field_code = NULL) const; GetData::RawEntry *Reference(const char* field_code = NULL) const; const char *ReferenceFilename(); unsigned int SamplesPerFrame(const char *field_code) const; gd_off64_t Seek(const char* field_code, gd_off64_t frame_num, gd_off64_t sample_num, int flags) const; void SetCallback(gd_parser_callback_t sehandler, void* extra = NULL) const; int Standards(int version = GD_VERSION_CURRENT) const; const char **Strings() const; int Sync(const char *field_code = NULL) const; gd_off64_t Tell(const char* field_code) const; char *StrTok(const char *string = NULL); int UnHide(const char* field_code) const; int UnInclude(int fragment_index, int del = 0) const; int Validate(const char* field_code) const; int VerbosePrefix(const char *prefix = NULL) const; const char **VectorList() const; private: DIRFILE* D; char *error_string; char *reference_name; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/carrayentry.h0000640000175000017500000000321712614323564022533 0ustar alastairalastair// Copyright (C) 2010, 2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_CARRAYENTRY_H #define GETDATA_CARRAYENTRY_H #include namespace GetData { class Dirfile; class CarrayEntry : public Entry { friend class Dirfile; public: CarrayEntry() : Entry() { E.field_type = GD_CARRAY_ENTRY; }; CarrayEntry(const char* field_code, DataType type, size_t array_len, int fragment_index = 0); virtual DataType ConstType() const { return (DataType)E.u.scalar.const_type; } virtual size_t ArrayLen() const { return E.u.scalar.array_len; } int SetArrayLen(size_t array_len); int SetType(DataType type); private: CarrayEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/phaseentry.h0000640000175000017500000000365512614323564022360 0ustar alastairalastair// Copyright (C) 2008-2011, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_PHASEENTRY_H #define GETDATA_PHASEENTRY_H #include namespace GetData { class Dirfile; class PhaseEntry : public Entry { friend class Dirfile; public: PhaseEntry() : Entry() { E.field_type = GD_PHASE_ENTRY; }; PhaseEntry(const char* field_code, const char* in_field, gd_shift_t shift, int fragment_index = 0); virtual const char *Input(int index = 0) const { return (index == 0) ? E.in_fields[0] : NULL; }; virtual gd_shift_t Shift() const { return E.u.phase.shift; }; int SetInput(const char* field); int SetShift(gd_shift_t shift); int SetShift(const char* shift); virtual const char *Scalar(int index = 0) const { return (index == 0) ? E.scalar[0] : NULL; }; virtual int ScalarIndex(int index = 0) const { return (index == 0) ? E.scalar_ind[0] : 0; }; private: PhaseEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/polynomentry.h0000640000175000017500000000511712614323564022750 0ustar alastairalastair// Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_POLYNOMENTRY_H #define GETDATA_POLYNOMENTRY_H #include namespace GetData { class Dirfile; class PolynomEntry : public Entry { friend class Dirfile; public: PolynomEntry() : Entry() { E.field_type = GD_POLYNOM_ENTRY; }; PolynomEntry(const char* field_code, int poly_ord, const char* in_field, double* a, int fragment_index = 0); PolynomEntry(const char* field_code, int poly_ord, const char* in_field, std::complex* ca, int fragment_index = 0); virtual const char *Input(int index = 0) const { return (index == 0) ? E.in_fields[0] : NULL; }; virtual int ComplexScalars() const { return (E.flags & GD_EN_COMPSCAL) ? 1 : 0; } virtual int PolyOrd() const { return E.u.polynom.poly_ord; }; virtual double Coefficient(int index) const { return (index >= 0 && index <= E.u.polynom.poly_ord) ? E.u.polynom.a[index] : 0; }; virtual std::complex CCoefficient(int index) const { return (index >= 0 && index <= E.u.polynom.poly_ord) ? std::complex(E.u.polynom.ca[index][0], E.u.polynom.ca[index][1]) : 0; }; virtual const char *Scalar(int index) const; virtual int ScalarIndex(int index) const; int SetPolyOrd(int poly_ord); int SetInput(const char* field); int SetCoefficient(double coeff, int index); int SetCoefficient(const char* coeff, int index); int SetCoefficient(std::complex coeff, int index); private: PolynomEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/recipentry.h0000640000175000017500000000462612614323564022361 0ustar alastairalastair// Copyright (C) 2010, 2011, 2013, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_RECIPENTRY_H #define GETDATA_RECIPENTRY_H #include namespace GetData { class Dirfile; class RecipEntry : public Entry { friend class Dirfile; public: RecipEntry() : Entry() { E.field_type = GD_RECIP_ENTRY; }; RecipEntry(const char* field_code, const char* in_field, double dividend, int fragment_index = 0); RecipEntry(const char* field_code, const char* in_field, std::complex cdividend, int fragment_index = 0); virtual const char *Input(int index = 0) const { return (index == 0) ? E.in_fields[0] : NULL; }; virtual const char *Scalar(int index = 0) const { return (index == 0) ? E.scalar[0] : NULL; }; virtual int ScalarIndex(int index = 0) const { return (index == 0) ? E.scalar_ind[0] : 0; }; virtual int ComplexScalars() const { return (E.flags & GD_EN_COMPSCAL) ? 1 : 0; } virtual double Dividend() const { return E.u.recip.dividend; }; virtual std::complex CDividend() const { return std::complex(E.u.recip.cdividend[0], E.u.recip.cdividend[1]); }; virtual int SetInput(const char* field); virtual int SetDividend(double coeff); virtual int SetDividend(const char* coeff); virtual int SetDividend(std::complex coeff); private: RecipEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/linterpentry.h0000640000175000017500000000330512614323564022725 0ustar alastairalastair// Copyright (C) 2008-2011, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_LINTERPENTRY_H #define GETDATA_LINTERPENTRY_H #include namespace GetData { class Dirfile; class LinterpEntry : public Entry { friend class Dirfile; public: LinterpEntry() : Entry() { E.field_type = GD_LINTERP_ENTRY; }; LinterpEntry(const char* field_code, const char* in_field, const char* table, int fragment_index = 0); virtual const char *Input(int index = 0) const { return (index == 0) ? E.in_fields[0] : NULL; }; virtual const char *Table() const { return E.u.linterp.table; }; int SetInput(const char* field); int SetTable(const char* table, int move_table = 0); private: LinterpEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/fragment.h0000640000175000017500000000516012614323564021772 0ustar alastairalastair// Copyright (C) 2008-2012 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_FRAGMENT_H #define GETDATA_FRAGMENT_H #include #include namespace GetData { enum EncodingScheme { AutoEncoding = GD_AUTO_ENCODED, Bzip2Encoding = GD_BZIP2_ENCODED, FlacEncoding = GD_FLAC_ENCODED, GzipEncoding = GD_GZIP_ENCODED, RawEncoding = GD_UNENCODED, SieEncoding = GD_SIE_ENCODED, SlimEncoding = GD_SLIM_ENCODED, TextEncoding = GD_TEXT_ENCODED, ZzipEncoding = GD_ZZIP_ENCODED, ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED }; class Dirfile; class Fragment { friend class Dirfile; public: virtual ~Fragment(); EncodingScheme Encoding() const { return enc; }; unsigned long Endianness() const { return end; }; gd_off64_t FrameOffset() const { return off; }; int Index() const { return ind; } const char* Name() const { return name; } int Parent() const { return parent; } const char *Prefix() { return prefix; }; int Protection() const { return prot; } int ReWrite() const; const char *Suffix() { return suffix; }; int SetEncoding(EncodingScheme encoding, int recode = 0); int SetEndianness(unsigned long byte_sex, int recode = 0); int SetFrameOffset(gd_off64_t offset, int recode = 0); int SetPrefix(const char *preix); int SetProtection(int protection_level); int SetSuffix(const char *suffix); protected: Fragment(const Dirfile *dirfile, int index); const Dirfile *D; EncodingScheme enc; unsigned long end; int ind; int prot; gd_off64_t off; const char* name; char* prefix; char* suffix; int parent; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/rawentry.h0000640000175000017500000000410612614323564022041 0ustar alastairalastair// Copyright (C) 2008-2012, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_RAWENTRY_H #define GETDATA_RAWENTRY_H #include namespace GetData { class Dirfile; class RawEntry : public Entry { friend class Dirfile; public: RawEntry() : Entry() { E.field_type = GD_RAW_ENTRY; filename = NULL; }; RawEntry(const char* field_code, DataType data_type, unsigned int spf, int fragment_index = 0); virtual ~RawEntry(); virtual unsigned int SamplesPerFrame() const { return E.u.raw.spf; }; virtual DataType RawType() const { return (DataType)E.u.raw.data_type; }; const char* FileName(); int SetSamplesPerFrame(unsigned int spf, int recode = 0); int SetSamplesPerFrame(const char *spf, int recode = 0); int SetType(DataType type, int recode = 0); virtual const char *Scalar(int index = 0) const { return (index == 0) ? E.scalar[0] : NULL; }; virtual int ScalarIndex(int index = 0) const { return (index == 0) ? E.scalar_ind[0] : 0; }; private: RawEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { filename = NULL; }; char *filename; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/constentry.h0000640000175000017500000000277112614323564022404 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_CONSTENTRY_H #define GETDATA_CONSTENTRY_H #include namespace GetData { class Dirfile; class ConstEntry : public Entry { friend class Dirfile; public: ConstEntry() : Entry() { E.field_type = GD_CONST_ENTRY; }; ConstEntry(const char* field_code, DataType type, int fragment_index = 0); virtual DataType ConstType() const { return (DataType)E.u.scalar.const_type; } int SetType(DataType type); private: ConstEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/getdata/lincomentry.h0000640000175000017500000000634212614323564022535 0ustar alastairalastair// Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifndef GETDATA_LINCOMENTRY_H #define GETDATA_LINCOMENTRY_H #include namespace GetData { class Dirfile; class LincomEntry : public Entry { friend class Dirfile; public: LincomEntry() : Entry() { E.field_type = GD_LINCOM_ENTRY; }; LincomEntry(const char* field_code, int n_fields, const char** in_fields, double* m, double* b, int fragment_index = 0); LincomEntry(const char* field_code, int n_fields, const char** in_fields, std::complex* cm, std::complex* cb, int fragment_index = 0); virtual const char *Input(int index) const { return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.in_fields[index] : NULL; }; virtual int ComplexScalars() const { return (E.flags & GD_EN_COMPSCAL) ? 1 : 0; } virtual int NFields() const { return E.u.lincom.n_fields; }; virtual double Scale(int index) const { return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.m[index] : 0; }; virtual std::complex CScale(int index) const { return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? std::complex(E.u.lincom.cm[index][0], E.u.lincom.cm[index][1]) : 0; }; virtual double Offset(int index) const { return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? E.u.lincom.b[index] : 0; }; virtual std::complex COffset(int index) const { return (CheckIndex(E.field_type, E.u.lincom.n_fields, index)) ? std::complex(E.u.lincom.cb[index][0], E.u.lincom.cb[index][1]) : 0; }; virtual const char *Scalar(int index) const; virtual int ScalarIndex(int index) const; int SetNFields(int nfields); int SetInput(const char* field, int index); int SetScale(double scale, int index); int SetScale(const char* scale, int index); int SetScale(std::complex scale, int index); int SetOffset(double offset, int index); int SetOffset(const char* scale, int index); int SetOffset(std::complex offset, int index); private: LincomEntry(const GetData::Dirfile *dirfile, const char* field_code) : Entry(dirfile, field_code) { }; }; } #endif libgetdata-0.9.0/bindings/cxx/entry.cpp0000640000175000017500000001162112614323564020251 0ustar alastairalastair// Copyright (C) 2008-2014 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; Entry::Entry() { memset(&E, 0, sizeof(E)); D = NULL; } Entry::Entry(const GetData::Dirfile *dirfile, const char* field_code) { D = dirfile; if (gd_entry(D->D, field_code, &E)) memset(&E, 0, sizeof(E)); } Entry::~Entry() { gd_free_entry_strings(&E); } int Entry::CheckIndex(gd_entype_t field_type, int n_fields, int index) { if (index < 0) return 0; switch (field_type) { case GD_RAW_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: return 0; case GD_LINCOM_ENTRY: if (index > n_fields) return 0; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (index > 2) return 0; case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: if (index > 1) return 0; } return 1; } int Entry::Move(int new_fragment, unsigned flags) { int ret = -1; if (D != NULL) ret = gd_move(D->D, E.field, new_fragment, flags); if (!ret) E.fragment_index = new_fragment; return ret; } int Entry::Rename(const char* new_name, unsigned flags) { char* ptr; int ret = -1; if (D != NULL) ret = gd_rename(D->D, E.field, new_name, flags); if (ret) { if (E.field == NULL) { E.field = strdup(new_name); } else { /* this buffer is used if E is a metafield, in which case we'll * replace the subfield name in E.field with new_name. The length * of the new code is * * strlen(E.field) - strlen() + strlen(new_name) * + 1 (for the trailing NUL). * * The subfield name in E.field must be at least one character long, so * the length of the new code is at most: * * strlen(E.field) - 1 + strlen(new_name) + 1 * = strlen(E.field) + strlen(new_name) */ char* nn = (char*)malloc(strlen(E.field) + strlen(new_name)); strcpy(nn, E.field); ptr = strchr(nn, '/'); if (ptr) { /* metafield */ strcpy(ptr + 1, new_name); } else { free(nn); nn = strdup(new_name); } free(E.field); E.field = nn; } } return ret; } void Entry::SetDirfile(const GetData::Dirfile* dirfile) { D = dirfile; } void Entry::SetName(const char* name) { this->Rename(name); } void Entry::SetFragmentIndex(int fragment_index) { this->Move(fragment_index); } static inline int scalar_ok(const gd_entry_t &E, int index) { if (index < 0) return 0; switch (E.field_type) { case GD_LINCOM_ENTRY: if (index >= GD_MAX_LINCOM + E.u.lincom.n_fields || (index >= E.u.lincom.n_fields && index < GD_MAX_LINCOM)) { return 0; } break; case GD_POLYNOM_ENTRY: if (index > E.u.polynom.poly_ord) return 0; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: case GD_MPLEX_ENTRY: if (index >= 2) return 0; break; case GD_RAW_ENTRY: case GD_PHASE_ENTRY: case GD_RECIP_ENTRY: case GD_WINDOW_ENTRY: if (index >= 1) return 0; break; case GD_LINTERP_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: return 0; } return 1; } const char *Entry::Scalar(int index) const { return scalar_ok(E, index) ? E.scalar[index] : NULL; } int Entry::ScalarIndex(int index) const { return scalar_ok(E, index) ? E.scalar_ind[index] : 0; } void Entry::SetScalar(int n, const char *code) { free(E.scalar[n]); if (code == NULL) E.scalar[n] = NULL; else { E.scalar[n] = strdup(code); char *ptr = strchr(E.scalar[n], '<'); if (ptr) { *ptr = '\0'; E.scalar_ind[n] = atoi(ptr + 1); } else E.scalar_ind[n] = -1; } } libgetdata-0.9.0/bindings/cxx/divideentry.cpp0000640000175000017500000000303512614323564021436 0ustar alastairalastair// Copyright (C) 2010-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; DivideEntry::DivideEntry(const char* field_code, const char* in_field1, const char* in_field2, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_DIVIDE_ENTRY; E.in_fields[0] = strdup(in_field1); E.in_fields[1] = strdup(in_field2); E.fragment_index = fragment_index; } int DivideEntry::SetInput(const char* field, int index) { if (index < 0 || index > 1) return -1; char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[index]); E.in_fields[index] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } libgetdata-0.9.0/bindings/cxx/rawentry.cpp0000640000175000017500000000376512614323564020775 0ustar alastairalastair// Copyright (C) 2008-2013 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; RawEntry::RawEntry(const char* field_code, DataType data_type, unsigned int spf, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_RAW_ENTRY; E.u.raw.spf = spf; E.u.raw.data_type = (gd_type_t)data_type; E.fragment_index = fragment_index; filename = NULL; } RawEntry::~RawEntry() { free(filename); } int RawEntry::SetSamplesPerFrame(unsigned int spf, int recode) { E.u.raw.spf = spf; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, recode); return 0; } int RawEntry::SetSamplesPerFrame(const char *spf, int recode) { int r = 0; SetScalar(0, spf); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, recode); if (!r) r = gd_get_constant(D->D, spf, GD_UINT16, &E.u.raw.spf); } return r; } int RawEntry::SetType(DataType type, int recode) { E.u.raw.data_type = (gd_type_t)type; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, recode); return 0; } const char* RawEntry::FileName() { free(filename); filename = gd_raw_filename(D->D, E.field); return filename; } libgetdata-0.9.0/bindings/cxx/test/0000740000175000017500000000000012614323564017360 5ustar alastairalastairlibgetdata-0.9.0/bindings/cxx/test/Makefile.in0000640000175000017500000006137312614323564021441 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ TESTS = big_test$(EXEEXT) check_PROGRAMS = $(am__EXEEXT_1) subdir = bindings/cxx/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = big_test$(EXEEXT) am_big_test_OBJECTS = big_test.$(OBJEXT) big_test_OBJECTS = $(am_big_test_OBJECTS) big_test_LDADD = $(LDADD) big_test_DEPENDENCIES = ../libgetdata++.la 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)/src depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f 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 = $(big_test_SOURCES) DIST_SOURCES = $(big_test_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2012, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src LDADD = ../libgetdata++.la big_test_SOURCES = big_test.cpp all: all-am .SUFFIXES: .SUFFIXES: .cpp .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 bindings/cxx/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/cxx/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: $(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-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 big_test$(EXEEXT): $(big_test_OBJECTS) $(big_test_DEPENDENCIES) $(EXTRA_big_test_DEPENDENCIES) @rm -f big_test$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(big_test_OBJECTS) $(big_test_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/big_test.Po@am__quote@ .cpp.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 $@ $< .cpp.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) '$<'` .cpp.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 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" 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 check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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-local 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-checkPROGRAMS clean-generic clean-libtool clean-local \ 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 TAGS all all-am check check-TESTS check-am \ check-local clean clean-checkPROGRAMS clean-generic \ clean-libtool clean-local cscopelist-am ctags ctags-am \ 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 tags-am uninstall uninstall-am # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf *odirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ # 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: libgetdata-0.9.0/bindings/cxx/test/big_test.cpp0000640000175000017500000013624312614323564021677 0ustar alastairalastair// Copyright (C) 2009-2015 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifdef HAVE_CONFIG_H #include "gd_config.h" #endif #undef GETDATA_LEGACY_API #include "getdata/dirfile.h" #include "internal.h" #include #include #include #include #include #include #include #include #include #ifdef HAVE_DIRECT_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #if MKDIR_NO_MODE #ifdef HAVE__MKDIR #define mkdir(f,m) _mkdir(f) #else #define mkdir(f,m) mkdir(f) #endif #endif #ifndef O_BINARY #define O_BINARY 0 #endif using namespace std; using namespace GetData; static int ne = 0; template static void CheckT(char c, int i, int t, int n, T v, T g, int r) { if (r) { ne++; cerr << c; if (i != -1) cerr << "(" << i << ")"; cerr << "[" << t; if (n != -1) cerr << ", " << n; cerr << "] = " << v << " (expected " << g << ")" << endl; } } static void CheckError(const Dirfile *d, int t, int n, int g) { int e = d->Error(); CheckT('e', -1, t, n, e, g, e != g); } static void CheckInt(int i, int t, int n, int v, int g) { CheckT('n', i, t, n, v, g, v != g); } template static void CheckFloat(char c, int i, int t, int n, T v, T g) { CheckT(c, i, t, n, v, g, (abs((v) - (g)) > 1e-10)); } #define CHECK_ERROR(t,g) CheckError(d,t,-1,g) #define CHECK_ERROR2(t,n,g) CheckError(d,t,n,g) #define CHECK_OK(t) CHECK_ERROR(t,GD_E_OK) #define CHECK_OK2(t,n) CHECK_ERROR2(t,n,GD_E_OK) #define CHECK_NONNULL(t,v) CheckT('p', -1, t, -1, v, NULL, !(v)) #define CHECK_NONNULL2(t,n,v) CheckT('p', -1, t, n, v, NULL, !(v)) #define CHECK_NULL(t,v) CheckT('p', -1, t, -1, v, NULL, !!(v)) #define CHECK_NULL2(t,n,v) CheckT('p', -1, t, n, v, NULL, !!(v)) #define CHECK_INT(t,v,g) CheckInt(-1, t, -1, v, g) #define CHECK_INT2(t,n,v,g) CheckInt(-1, t, n, v, g) #define CHECK_INT_ARRAY(t,m,v,g) \ for (i = 0; i < m; ++i) CheckInt(i, t, -1, v, g) #define CHECK_DOUBLE(t,v,g) CheckFloat('d', -1, t, -1, v, g) #define CHECK_DOUBLE2(t,n,v,g) CheckFloat('d', -1, t, n, v, g) #define CHECK_DOUBLE_ARRAY(t,n,m,v,g) \ for (i = 0; i < m; ++i) CheckFloat('d', i, t, n, v, g) #define CHECK_STRINGi(t,i,v,g) \ CheckT('s', i, t, -1, v, g, (strcmp((v), (g)))) #define CHECK_STRING(t,v,g) CHECK_STRINGi(t,-1,v,g) #define CHECK_STRING2(t,n,v,g) \ CheckT('s', -1, t, n, v, g, (strcmp((v), (g)))) #define CHECK_STRING_ARRAY(t,m,v,g) \ for (i = 0; i < m; ++i) \ CheckT('s', i, t, -1, v, g, (strcmp((v), (g)))) #define CHECK_EOSTRING(t,v,g) \ CheckT('S', -1, t, -1, v, g, \ (strcmp((v) + strlen(v) - strlen(g), (g)))) #define CHECK_COMPLEX2(t,n,v,g) \ CheckFloat >('c', -1, t, n, v, g) #define CHECK_COMPLEX_ARRAY(t,m,v,g) \ for (i = 0; i < m; ++i) CheckFloat >('c', i, t, -1, v, g) void run_tests(void) { const char* filedir = "dirfile"; const char* format = "dirfile/format"; const char* empty = "dirfile/empty"; const char* eformat = "dirfile/empty/format"; const char* format1 = "dirfile/format1"; const char* form2 = "dirfile/form2"; const char* new1 = "dirfile/new1"; const char* data = "dirfile/data"; const char* format_data = "/ENDIAN little\n" "data RAW INT8 8\n" "lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const\n" "/META data mstr STRING \"This is a string constant.\"\n" "/META data mconst CONST COMPLEX128 3.3;4.4\n" "/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n" "/META data mlut LINTERP data ./lut\n" "const CONST FLOAT64 5.5\n" "carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n" "linterp LINTERP data ./lut\n" "polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n" "bit BIT data 3 4\n" "sbit SBIT data 5 6\n" "mplex MPLEX data sbit 1 10\n" "mult MULTIPLY data sbit\n" "div DIVIDE mult bit\n" "recip RECIP div 6.5;4.3\n" "phase PHASE data 11\n" "window WINDOW linterp mult LT 4.1\n" "/ALIAS alias data\n" "string STRING \"Zaphod Beeblebrox\"\n"; const char* form2_data = "const2 CONST INT8 -19\n"; const int nfields = 17; unsigned char c[8]; unsigned char data_data[80]; signed char sc; int m, n, i; float fl; double dp, p[6], q[6]; const double *qp; complex cq[6]; const char **list; const char* str; char* tok; char buf[GD_MAX_LINE_LENGTH]; Dirfile *d; Entry *ent; RawEntry rent, *rep; LincomEntry lent, *lep; LinterpEntry nent, *nep; BitEntry bent, *bep; MultiplyEntry ment, *mep; PhaseEntry pent, *pep; PolynomEntry yent, *yep; DivideEntry dent, *dep; RecipEntry oent, *oep; SBitEntry sent, *sep; ConstEntry cent, *cep; CarrayEntry aent, *aep; StringEntry gent; WindowEntry went, *wep; MplexEntry xent, *xep; Fragment *frag; gd_triplet_t thresh; const gd_carray_t *carrays; char* fields[nfields + 10] = {(char*)"INDEX", (char*)"alias", (char*)"bit", (char*)"carray", (char*)"const", (char*)"data", (char*)"div", (char*)"lincom", (char*)"linterp", (char*)"mplex", (char*)"mult", (char*)"phase", (char*)"polynom", (char*)"recip", (char*)"sbit", (char*)"string", (char*)"window", NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; char *strings[3]; unlink(data); unlink(new1); unlink(format); unlink(format1); unlink(form2); rmdir(filedir); // Write the test dirfile mkdir(filedir, 0777); for (n = 0; n < 80; ++n) data_data[n] = (unsigned char)n + 1; n = open(format, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666); write(n, format_data, strlen(format_data)); close(n); n = open(form2, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666); write(n, form2_data, strlen(form2_data)); close(n); n = open(data, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, 0666); write(n, data_data, 80); close(n); // 1: Dirfile::Error check d = new Dirfile("x"); CHECK_ERROR(1, GD_E_IO); delete d; // 2: Dirfile::Dirfile check d = new Dirfile(filedir, GD_RDWR); CHECK_OK(2); // 3: Dirfile::GetData check n = d->GetData("data", 5, 0, 1, 0, UInt8, c); CHECK_OK(3); CHECK_INT(3,n,8); CHECK_INT_ARRAY(3,8,c[i],41 + i); // 12: Dirfile::GetConstant check n = d->GetConstant("const", Float64, &dp); CHECK_OK(12); CHECK_INT(12,n,0); CHECK_DOUBLE(12,dp,5.5); // 23: Dirfile::NFields check n = d->NFields(); CHECK_OK(23); CHECK_INT(23,n,nfields); // 25: Dirfile::FieldList check list = d->FieldList(); CHECK_OK(25); CHECK_STRING_ARRAY(25,n,list[i],fields[i]); // 26: Dirfile::NFields check n = d->NMFields("data"); CHECK_OK(26); CHECK_INT(26,n,4); // 27: Dirfile::MFieldList check fields[0] = (char*)"mstr"; fields[1] = (char*)"mconst"; fields[2] = (char*)"mcarray"; fields[3] = (char*)"mlut"; list = d->MFieldList("data"); CHECK_OK(27); CHECK_STRING_ARRAY(27,n,list[i],fields[i]); // 28: Dirfile::NFrames check n = d->NFrames(); CHECK_OK(28); CHECK_INT(28,n,10); // 29: Dirfile::SamplesPerFrame check n = d->SamplesPerFrame("data"); CHECK_OK(29); CHECK_INT(29,n,8); // 30: Dirfile::PutData check c[0] = 13; c[1] = 14; c[2] = 15; c[3] = 16; n = d->PutData("data", 5, 1, 0, 4, UInt8, c); CHECK_OK2(30,1); CHECK_INT2(30,1,n,4); n = d->GetData("data", 5, 0, 1, 0, UInt8, c); CHECK_OK2(30,2); CHECK_INT2(30,2,n,8); CHECK_INT_ARRAY(30,8,c[i],(i == 0 || i > 4) ? 41 + i : 12 + i); // 38: Dirfile::ErrorString check d->GetData("x", 5, 0, 1, 0, Null, NULL); str = d->ErrorString(); CHECK_STRING(38,str,"Field not found: x"); // 40: Dirfile::Entry / RawEntry check ent = d->Entry("data"); CHECK_OK(40); CHECK_INT2(40,1,ent->Type(),RawEntryType); CHECK_INT2(40,2,ent->FragmentIndex(),0); CHECK_INT2(40,3,ent->SamplesPerFrame(),8); CHECK_INT2(40,4,ent->RawType(),Int8); delete ent; // 42: Dirfile::Entry / LincomEntry check cq[0] = 1.1; cq[1] = 2.2; cq[2] = 2.2; cq[3] = complex(3.3, 4.4); cq[4] = 5.5; cq[5] = 5.5; ent = d->Entry("lincom"); CHECK_OK(42); CHECK_INT2(42,1,ent->Type(),LincomEntryType); CHECK_INT2(42,2,ent->NFields(),3); CHECK_INT2(42,3,ent->FragmentIndex(),0); CHECK_STRING2(42,4,ent->Input(0),"data"); CHECK_STRING2(42,5,ent->Input(1),"INDEX"); CHECK_STRING2(42,6,ent->Input(2),"linterp"); CHECK_INT2(42,7,ent->ComplexScalars(),1); CHECK_COMPLEX_ARRAY(42,3,ent->CScale(i),cq[i * 2]); CHECK_COMPLEX_ARRAY(42,3,ent->COffset(i),cq[i * 2 + 1]); delete ent; // 44: Dirfile::Entry / PolynomEntry check ent = d->Entry("polynom"); CHECK_OK(44); CHECK_INT2(44,1,ent->Type(),PolynomEntryType); CHECK_INT2(44,2,ent->PolyOrd(),5); CHECK_INT2(44,3,ent->FragmentIndex(),0); CHECK_STRING2(44,4,ent->Input(0),"data"); CHECK_INT2(44,7,ent->ComplexScalars(),1); CHECK_COMPLEX_ARRAY(44,6,ent->CCoefficient(i),cq[i]); delete ent; // 45: Dirfile::Entry / LinterpEntry check ent = d->Entry("linterp"); CHECK_OK(45); CHECK_INT2(45,1,ent->Type(),LinterpEntryType); CHECK_INT2(45,2,ent->FragmentIndex(),0); CHECK_STRING2(45,3,ent->Input(0),"data"); CHECK_STRING2(45,4,ent->Table(),"./lut"); delete ent; // 46: Dirfile::Entry / BitEntry check ent = d->Entry("bit"); CHECK_OK(46); CHECK_INT2(46,1,ent->Type(),BitEntryType); CHECK_INT2(46,2,ent->FragmentIndex(),0); CHECK_STRING2(46,3,ent->Input(0),"data"); CHECK_INT2(46,4,ent->NumBits(),4); CHECK_INT2(46,5,ent->FirstBit(),3); delete ent; // 47: Dirfile::Entry / SBitEntry check ent = d->Entry("sbit"); CHECK_OK(47); CHECK_INT2(47,1,ent->Type(),SBitEntryType); CHECK_INT2(47,2,ent->FragmentIndex(),0); CHECK_STRING2(47,3,ent->Input(0),"data"); CHECK_INT2(47,4,ent->NumBits(),6); CHECK_INT2(47,5,ent->FirstBit(),5); delete ent; // 48: Dirfile::Entry / MultiplyEntry check ent = d->Entry("mult"); CHECK_OK(48); CHECK_INT2(48,1,ent->Type(),MultiplyEntryType); CHECK_INT2(48,2,ent->FragmentIndex(),0); CHECK_STRING2(48,3,ent->Input(0),"data"); CHECK_STRING2(48,4,ent->Input(1),"sbit"); delete ent; // 49: Dirfile::Entry / PhaseEntry check ent = d->Entry("phase"); CHECK_OK(49); CHECK_INT2(49,1,ent->Type(),PhaseEntryType); CHECK_INT2(49,2,ent->FragmentIndex(),0); CHECK_STRING2(49,3,ent->Input(0),"data"); CHECK_INT2(49,4,ent->Shift(),11); delete ent; // 50: Dirfile::Entry / ConstEntry check ent = d->Entry("const"); CHECK_OK(50); CHECK_INT2(50,1,ent->Type(),ConstEntryType); CHECK_INT2(50,2,ent->FragmentIndex(),0); CHECK_INT2(50,3,ent->ConstType(),Float64); delete ent; // 51: Dirfile::Entry / StringEntry check ent = d->Entry("string"); CHECK_OK(51); CHECK_INT2(51,1,ent->Type(),StringEntryType); CHECK_INT2(51,2,ent->FragmentIndex(),0); delete ent; // 52: Dirfile::FragmentIndex check n = d->FragmentIndex("data"); CHECK_OK(52); CHECK_INT(52,n,0); // 53: Dirfile::Add / RawEntry check rent.SetName("new1"); rent.SetFragmentIndex(0); rent.SetSamplesPerFrame(3); rent.SetType(Float64); d->Add(rent); CHECK_OK2(53,1); ent = d->Entry("new1"); CHECK_OK2(53,2); CHECK_INT2(53,1,ent->Type(),RawEntryType); CHECK_INT2(53,2,ent->FragmentIndex(),0); CHECK_INT2(53,3,ent->SamplesPerFrame(),3); CHECK_INT2(53,4,ent->RawType(),Float64); delete ent; // 54: Dirfile::Add / LincomEntry check q[0] = 9.9; q[1] = 8.8; q[2] = 7.7; q[3] = 6.6; lent.SetName("new2"); lent.SetFragmentIndex(0); lent.SetNFields(2); lent.SetInput("in1", 0); lent.SetScale(q[0], 0); lent.SetOffset(q[1], 0); lent.SetInput("in2", 1); lent.SetScale(q[2], 1); lent.SetOffset(q[3], 1); d->Add(lent); CHECK_OK2(54,1); ent = d->Entry("new2"); CHECK_OK2(54,2); CHECK_INT2(54,1,ent->Type(),LincomEntryType); CHECK_INT2(54,2,ent->NFields(),2); CHECK_INT2(54,3,ent->FragmentIndex(),0); CHECK_STRING2(54,4,ent->Input(0),"in1"); CHECK_STRING2(54,5,ent->Input(1),"in2"); CHECK_INT2(54,6,ent->ComplexScalars(),0); CHECK_DOUBLE_ARRAY(54,7,2,ent->Scale(i),q[i * 2]); CHECK_DOUBLE_ARRAY(54,8,2,ent->Offset(i),q[i * 2 + 1]); delete ent; // 55: Dirfile::Add / LincomEntry check cq[0] = complex(1.1, 1.2); cq[1] = complex(1.3, 1.4); cq[2] = complex(1.4, 1.5); cq[3] = complex(1.6, 1.7); lent.Dissociate(); lent.SetName("new3"); lent.SetFragmentIndex(0); lent.SetNFields(2); lent.SetInput("in1", 0); lent.SetScale(cq[0], 0); lent.SetOffset(cq[1], 0); lent.SetInput("in2", 1); lent.SetScale(cq[2], 1); lent.SetOffset(cq[3], 1); d->Add(lent); CHECK_OK2(55,1); ent = d->Entry("new3"); CHECK_OK2(55,2); CHECK_INT2(55,1,ent->Type(),LincomEntryType); CHECK_INT2(55,2,ent->NFields(),2); CHECK_INT2(55,3,ent->FragmentIndex(),0); CHECK_STRING2(55,4,ent->Input(0),"in1"); CHECK_STRING2(55,5,ent->Input(1),"in2"); CHECK_INT2(55,6,ent->ComplexScalars(),1); CHECK_COMPLEX_ARRAY(55,2,ent->CScale(i),cq[i * 2]); CHECK_COMPLEX_ARRAY(55,2,ent->COffset(i),cq[i * 2 + 1]); delete ent; // 56: Dirfile::Add / PolynomEntry check q[0] = 3.9; q[1] = 4.8; q[2] = 5.7; q[3] = 6.6; yent.SetName("new4"); yent.SetFragmentIndex(0); yent.SetPolyOrd(3); yent.SetInput("in1"); yent.SetCoefficient(q[0], 0); yent.SetCoefficient(q[1], 1); yent.SetCoefficient(q[2], 2); yent.SetCoefficient(q[3], 3); d->Add(yent); CHECK_OK2(56,1); ent = d->Entry("new4"); CHECK_OK2(56,2); CHECK_INT2(56,1,ent->Type(),PolynomEntryType); CHECK_INT2(56,2,ent->PolyOrd(),3); CHECK_INT2(56,3,ent->FragmentIndex(),0); CHECK_STRING2(56,4,ent->Input(0),"in1"); CHECK_INT2(56,5,ent->ComplexScalars(),0); CHECK_DOUBLE_ARRAY(56,6,4,ent->Coefficient(i),q[i]); delete ent; // 57: Dirfile::Add / PolynomEntry check cq[0] = complex(3.1, 7); cq[1] = complex(4.2, 8); cq[2] = complex(5.2, 9); cq[3] = complex(6.3, 4.4); yent.Dissociate(); yent.SetName("new5"); yent.SetFragmentIndex(0); yent.SetPolyOrd(3); yent.SetInput("in2"); yent.SetCoefficient(cq[0], 0); yent.SetCoefficient(cq[1], 1); yent.SetCoefficient(cq[2], 2); yent.SetCoefficient(cq[3], 3); d->Add(yent); CHECK_OK2(57,1); ent = d->Entry("new5"); CHECK_OK2(57,2); CHECK_INT2(57,1,ent->Type(),PolynomEntryType); CHECK_INT2(57,2,ent->PolyOrd(),3); CHECK_INT2(57,3,ent->FragmentIndex(),0); CHECK_STRING2(57,4,ent->Input(0),"in2"); CHECK_INT2(57,7,ent->ComplexScalars(),1); CHECK_COMPLEX_ARRAY(57,4,ent->CCoefficient(i),cq[i]); delete ent; // 58: Dirfile::Add / LinterpEntry check nent.SetName("new6"); nent.SetFragmentIndex(0); nent.SetInput("in"); nent.SetTable("./some/table"); d->Add(nent); CHECK_OK2(58,1); ent = d->Entry("new6"); CHECK_OK2(58,2); CHECK_INT2(58,1,ent->Type(),LinterpEntryType); CHECK_INT2(58,2,ent->FragmentIndex(),0); CHECK_STRING2(58,3,ent->Input(0),"in"); CHECK_STRING2(58,4,ent->Table(),"./some/table"); delete ent; // 59: Dirfile::Add / BitEntry check bent.SetName("new7"); bent.SetFragmentIndex(0); bent.SetInput("in1"); bent.SetFirstBit(13); bent.SetNumBits(12); d->Add(bent); CHECK_OK2(59,1); ent = d->Entry("new7"); CHECK_OK(59); CHECK_INT2(59,1,ent->Type(),BitEntryType); CHECK_INT2(59,2,ent->FragmentIndex(),0); CHECK_STRING2(59,3,ent->Input(0),"in1"); CHECK_INT2(59,4,ent->NumBits(),12); CHECK_INT2(59,5,ent->FirstBit(),13); delete ent; // 60: Dirfile::Add / SBitEntry check sent.SetName("new8"); sent.SetFragmentIndex(0); sent.SetInput("in2"); sent.SetFirstBit(14); sent.SetNumBits(15); d->Add(sent); CHECK_OK2(60,1); ent = d->Entry("new8"); CHECK_OK(60); CHECK_INT2(60,1,ent->Type(),SBitEntryType); CHECK_INT2(60,2,ent->FragmentIndex(),0); CHECK_STRING2(60,3,ent->Input(0),"in2"); CHECK_INT2(60,4,ent->NumBits(),15); CHECK_INT2(60,5,ent->FirstBit(),14); delete ent; // 61: Dirfile::Add / MultiplyEntry check ment.SetName("new9"); ment.SetFragmentIndex(0); ment.SetInput("in1", 0); ment.SetInput("in2", 1); d->Add(ment); CHECK_OK2(61,1); ent = d->Entry("new9"); CHECK_OK2(61,2); CHECK_INT2(61,1,ent->Type(),MultiplyEntryType); CHECK_INT2(61,2,ent->FragmentIndex(),0); CHECK_STRING2(61,3,ent->Input(0),"in1"); CHECK_STRING2(61,4,ent->Input(1),"in2"); delete ent; // 62: Dirfile::Add / PhaseEntry check pent.SetName("new10"); pent.SetFragmentIndex(0); pent.SetInput("in1"); pent.SetShift(22); d->Add(pent); CHECK_OK2(62,1); ent = d->Entry("new10"); CHECK_OK(62); CHECK_INT2(62,1,ent->Type(),PhaseEntryType); CHECK_INT2(62,2,ent->FragmentIndex(),0); CHECK_STRING2(62,3,ent->Input(0),"in1"); CHECK_INT2(62,4,ent->Shift(),22); delete ent; // 63: Dirfile::Add / ConstEntry check cent.SetName("new11"); cent.SetFragmentIndex(0); cent.SetType(Float64); d->Add(cent); CHECK_OK2(63,1); ent = d->Entry("new11"); CHECK_OK2(63,2); CHECK_INT2(63,1,ent->Type(),ConstEntryType); CHECK_INT2(63,2,ent->FragmentIndex(),0); CHECK_INT2(63,3,ent->ConstType(),Float64); delete ent; // 64: Fragment check frag = d->Fragment(0); CHECK_OK(64); sprintf(buf, "dirfile%cformat", GD_DIRSEP); CHECK_EOSTRING(64,frag->Name(), buf); delete frag; // 65: Dirfile::NFragments check n = d->NFragments(); CHECK_OK(65); CHECK_INT(65,n,1); // 66: Dirfile::Include check n = d->Include("form2"); CHECK_OK2(66,1); CHECK_INT2(66,1,n,1); n = d->GetConstant("const2", Int8, &sc); CHECK_OK2(66,2); CHECK_INT2(66,2,sc,-19); // 67: Dirfile::NFieldsByType check n = d->NFieldsByType(LincomEntryType); CHECK_OK(67); CHECK_INT(67,n,3); // 68: Dirfile::FieldListByType check fields[0] = (char*)"lincom"; fields[1] = (char*)"new2"; fields[2] = (char*)"new3"; list = d->FieldListByType(LincomEntryType); CHECK_OK(68); CHECK_STRING_ARRAY(68,n,list[i],fields[i]); // 69: Dirfile::NVectors check n = d->NVectors(); CHECK_OK(69); CHECK_INT(69,n,24); // 70: Dirfile::VectorList check fields[0] = (char*)"INDEX"; fields[1] = (char*)"alias"; fields[2] = (char*)"bit"; fields[3] = (char*)"data"; fields[4] = (char*)"div"; fields[5] = (char*)"lincom"; fields[6] = (char*)"linterp"; fields[7] = (char*)"mplex"; fields[8] = (char*)"mult"; fields[9] = (char*)"new1"; fields[10] = (char*)"new10"; fields[11] = (char*)"new2"; fields[12] = (char*)"new3"; fields[13] = (char*)"new4"; fields[14] = (char*)"new5"; fields[15] = (char*)"new6"; fields[16] = (char*)"new7"; fields[17] = (char*)"new8"; fields[18] = (char*)"new9"; fields[19] = (char*)"phase"; fields[20] = (char*)"polynom"; fields[21] = (char*)"recip"; fields[22] = (char*)"sbit"; fields[23] = (char*)"window"; list = d->VectorList(); CHECK_OK(70); CHECK_STRING_ARRAY(70,n,list[i],fields[i]); // 81: Dirfile::GetString check n = d->GetString("string", GD_MAX_LINE_LENGTH, buf); CHECK_OK(81); CHECK_INT(81,n,18); CHECK_STRING(81,buf,"Zaphod Beeblebrox"); // 82: Dirfile::Add / StringEntry check gent.SetName("new12"); gent.SetFragmentIndex(0); d->Add(gent); CHECK_OK2(82,1); ent = d->Entry("new12"); CHECK_OK2(82,2); CHECK_INT2(82,1,ent->Type(),StringEntryType); CHECK_INT2(82,2,ent->FragmentIndex(),0); delete ent; n = d->GetString("new12", GD_MAX_LINE_LENGTH, buf); CHECK_OK2(82,3); CHECK_INT(82,n,1); CHECK_STRING(82,buf,""); // 84: Dirfile::AddSpec check d->AddSpec("lorem STRING \"Lorem ipsum\"", 0); CHECK_OK2(84,1); n = d->GetString("lorem", GD_MAX_LINE_LENGTH, buf); CHECK_OK2(84,2); CHECK_INT(84,n,12); CHECK_STRING(84,buf,"Lorem ipsum"); // 85: Dirfile::MAddSpec check d->MAddSpec("ipsum STRING \"dolor sit amet.\"", "lorem"); CHECK_OK2(85,1); n = d->GetString("lorem/ipsum", GD_MAX_LINE_LENGTH, buf); CHECK_OK2(85,2); CHECK_INT(85,n,16); CHECK_STRING(85,buf,"dolor sit amet."); // 86: Dirfile::PutConstant check sc = 86; n = d->PutConstant("const", Int8, &sc); CHECK_OK2(86,1); CHECK_INT2(86,1,n,0); n = d->GetConstant("const", Float32, &fl); CHECK_OK2(86,2); CHECK_INT2(86,2,n,0); CHECK_DOUBLE2(86,3,fl,86); // 94: Dirfile::PutString check n = d->PutString("string", "Arthur Dent"); CHECK_OK2(94,1); CHECK_INT2(94,1,n,12); n = d->GetString("string", GD_MAX_LINE_LENGTH, buf); CHECK_OK2(94,2); CHECK_INT2(94,2,n,12); CHECK_STRING(94,buf,"Arthur Dent"); // 95: Dirfile::NMFieldsByType check n = d->NMFieldsByType("data", LinterpEntryType); CHECK_OK(95); CHECK_INT(95,n,1); // 96: Dirfile::MFieldListByType check fields[0] = (char*)"mlut"; list = d->MFieldListByType("data", LinterpEntryType); CHECK_OK(96); CHECK_STRING_ARRAY(96,n,list[i],fields[i]); // 97: Dirfile::NMVectors check n = d->NMVectors("data"); CHECK_OK(97); CHECK_INT(97,n,1); // 98: Dirfile::MVectorList check fields[0] = (char*)"mlut"; list = d->MVectorList("data"); CHECK_OK(98); CHECK_STRING_ARRAY(98,n,list[i],fields[i]); // 99: RawEntry check rep = reinterpret_cast(d->Entry("new1")); CHECK_OK2(99,1); rep->SetType(Int32,0); CHECK_OK2(99,2); rep->SetSamplesPerFrame(4,0); CHECK_OK2(99,3); ent = d->Entry("new1"); CHECK_OK2(99,4); CHECK_INT2(99,1,ent->Type(),RawEntryType); CHECK_INT2(99,2,ent->FragmentIndex(),0); CHECK_INT2(99,3,ent->SamplesPerFrame(),4); CHECK_INT2(99,4,ent->RawType(),Int32); delete ent; // 100: LincomEntry check lep = reinterpret_cast(d->Entry("new2")); CHECK_OK2(100,1); lep->SetNFields(3); CHECK_OK2(100,2); lep->SetInput("in4",2); CHECK_OK2(100,3); lep->SetScale(1.96,2); CHECK_OK2(100,4); lep->SetOffset(0.22,2); CHECK_OK2(100,5); delete lep; q[0] = 9.9; q[1] = 8.8; q[2] = 7.7; q[3] = 6.6; q[4] = 1.96; q[5] = 0.22; ent = d->Entry("new2"); CHECK_OK2(100,6); CHECK_INT2(100,1,ent->Type(),LincomEntryType); CHECK_INT2(100,2,ent->NFields(),3); CHECK_INT2(100,3,ent->FragmentIndex(),0); CHECK_STRING2(100,4,ent->Input(0),"in1"); CHECK_STRING2(100,5,ent->Input(1),"in2"); CHECK_STRING2(100,6,ent->Input(2),"in4"); CHECK_INT2(100,7,ent->ComplexScalars(),0); CHECK_DOUBLE_ARRAY(100,8,3,ent->Scale(i),q[i * 2]); CHECK_DOUBLE_ARRAY(100,9,3,ent->Offset(i),q[i * 2 + 1]); delete ent; // 102: PolynomEntry check yep = reinterpret_cast(d->Entry("new4")); CHECK_OK2(102,1); yep->SetInput("in4"); CHECK_OK2(102,2); yep->SetPolyOrd(4); CHECK_OK2(102,3); yep->SetCoefficient(55.5,4); CHECK_OK2(102,4); delete yep; q[0] = 3.9; q[1] = 4.8; q[2] = 5.7; q[3] = 6.6; q[4] = 55.5; ent = d->Entry("new4"); CHECK_OK2(102,5); CHECK_INT2(102,1,ent->Type(),PolynomEntryType); CHECK_INT2(102,2,ent->PolyOrd(),4); CHECK_INT2(102,3,ent->FragmentIndex(),0); CHECK_STRING2(102,4,ent->Input(0),"in4"); CHECK_INT2(102,5,ent->ComplexScalars(),0); CHECK_DOUBLE_ARRAY(102,6,5,ent->Coefficient(i),q[i]); delete ent; // 104: LinterpEntry check nep = reinterpret_cast(d->Entry("new6")); CHECK_OK2(104,1); nep->SetInput("in3"); CHECK_OK2(104,2); nep->SetTable("./other/table"); CHECK_OK2(104,3); delete nep; ent = d->Entry("new6"); CHECK_OK2(104,2); CHECK_INT2(104,1,ent->Type(),LinterpEntryType); CHECK_INT2(104,2,ent->FragmentIndex(),0); CHECK_STRING2(104,3,ent->Input(0),"in3"); CHECK_STRING2(104,4,ent->Table(),"./other/table"); delete ent; // 105: BitEntry check bep = reinterpret_cast(d->Entry("new7")); CHECK_OK2(105,1); bep->SetInput("in3"); CHECK_OK2(105,2); bep->SetFirstBit(3); CHECK_OK2(105,3); bep->SetNumBits(2); CHECK_OK2(105,4); delete bep; ent = d->Entry("new7"); CHECK_OK(105); CHECK_INT2(105,1,ent->Type(),BitEntryType); CHECK_INT2(105,2,ent->FragmentIndex(),0); CHECK_STRING2(105,3,ent->Input(0),"in3"); CHECK_INT2(105,4,ent->NumBits(),2); CHECK_INT2(105,5,ent->FirstBit(),3); delete ent; // 106: SBitEntry check sep = reinterpret_cast(d->Entry("new8")); CHECK_OK2(106,1); sep->SetInput("in4"); CHECK_OK2(106,2); sep->SetFirstBit(1); CHECK_OK2(106,3); sep->SetNumBits(22); CHECK_OK2(106,4); delete sep; ent = d->Entry("new8"); CHECK_OK(106); CHECK_INT2(106,1,ent->Type(),SBitEntryType); CHECK_INT2(106,2,ent->FragmentIndex(),0); CHECK_STRING2(106,3,ent->Input(0),"in4"); CHECK_INT2(106,4,ent->NumBits(),22); CHECK_INT2(106,5,ent->FirstBit(),1); delete ent; // 107: MultiplyEntry check mep = reinterpret_cast(d->Entry("new9")); CHECK_OK2(107,1); mep->SetInput("in4",0); CHECK_OK2(107,2); mep->SetInput("in5",1); CHECK_OK2(107,3); delete mep; ent = d->Entry("new9"); CHECK_OK2(107,2); CHECK_INT2(107,1,ent->Type(),MultiplyEntryType); CHECK_INT2(107,2,ent->FragmentIndex(),0); CHECK_STRING2(107,3,ent->Input(0),"in4"); CHECK_STRING2(107,4,ent->Input(1),"in5"); delete ent; // 108: PhsaeEntry check pep = reinterpret_cast(d->Entry("new10")); CHECK_OK2(108,1); pep->SetInput("in2"); CHECK_OK2(108,2); pep->SetShift(8); CHECK_OK2(108,3); delete pep; ent = d->Entry("new10"); CHECK_OK(108); CHECK_INT2(108,1,ent->Type(),PhaseEntryType); CHECK_INT2(108,2,ent->FragmentIndex(),0); CHECK_STRING2(108,3,ent->Input(0),"in2"); CHECK_INT2(108,4,ent->Shift(),8); delete ent; // 109: ConstEntry check cep = reinterpret_cast(d->Entry("new11")); CHECK_OK2(109,1); cep->SetType(Float32); CHECK_OK2(109,2); delete cep; ent = d->Entry("new11"); CHECK_OK2(109,2); CHECK_INT2(109,1,ent->Type(),ConstEntryType); CHECK_INT2(109,2,ent->FragmentIndex(),0); CHECK_INT2(109,3,ent->ConstType(),Float32); delete ent; // 110: Fragment::Encoding check frag = d->Fragment(0); CHECK_OK(110); CHECK_INT(110,frag->Encoding(),RawEncoding); // 111: Fragment::Endianness check CHECK_INT(111,frag->Endianness(),GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN); delete frag; // 112: Dirfile::Name check str = d->Name(); CHECK_OK(112); CHECK_EOSTRING(112,str,"dirfile"); // 113: Fragment::Parent check frag = d->Fragment(1); CHECK_OK(113); CHECK_INT(113,frag->Parent(),0); // 114: Fragment::SetProtection check frag->SetProtection(GD_PROTECT_DATA); CHECK_OK(114); delete frag; // 115: Fragment::Protection check frag = d->Fragment(1); CHECK_OK(115); CHECK_INT(115,frag->Protection(),GD_PROTECT_DATA); // 116: RawEntry::FileName check str = rep->FileName(); CHECK_OK(116); sprintf(buf, "dirfile%cnew1", GD_DIRSEP); CHECK_EOSTRING(116,str, buf); delete rep; // 117: Dirfile::Reference check rep = d->Reference("new1"); CHECK_OK(117); CHECK_STRING(117,rep->Name(),"new1"); delete rep; // 118: Dirfile::EoF check n = d->EoF("lincom"); CHECK_OK(118); CHECK_INT(118,n,80); // 119: Fragment::SetEncoding check frag->SetEncoding(SlimEncoding,0); CHECK_OK(119); CHECK_INT(119,frag->Encoding(),SlimEncoding); // 120: Fragment::SetEndianness check frag->SetEndianness(GD_BIG_ENDIAN,0); CHECK_OK(120); CHECK_INT(120,frag->Endianness(),GD_BIG_ENDIAN); delete frag; // 121: Dirfile::AlterSpec check d->AlterSpec("new10 PHASE in1 3"); CHECK_OK2(121,1); ent = d->Entry("new10"); CHECK_OK2(121,2); CHECK_INT2(121,1,ent->Type(),PhaseEntryType); CHECK_INT2(121,2,ent->FragmentIndex(),0); CHECK_STRING2(121,3,ent->Input(0),"in1"); CHECK_INT2(121,4,ent->Shift(),3); delete ent; // 122: Dirfile::Delete check d->Delete("new10", 0); CHECK_OK2(122,1); ent = d->Entry("new10"); CHECK_ERROR2(122,2,GD_E_BAD_CODE); delete ent; // 123: Dirfile::MAlterSpec check d->MAlterSpec("mlut LINTERP data /new/lut", "data", 0); CHECK_OK2(123,1); ent = d->Entry("data/mlut"); CHECK_OK2(123,2); CHECK_INT2(123,3,ent->Type(),LinterpEntryType); CHECK_INT2(123,4,ent->FragmentIndex(),0); CHECK_STRING2(123,5,ent->Input(0),"data"); CHECK_STRING2(123,6,ent->Table(),"/new/lut"); delete ent; // 124: Entry::Move check ent = d->Entry("new9"); CHECK_OK2(124,1); ent->Move(1,0); CHECK_OK2(124,2); CHECK_INT(124,ent->FragmentIndex(),1); // 125: Entry::Rename check ent->Rename("newer",0); CHECK_OK2(125,1); delete ent; ent = d->Entry("new9"); CHECK_ERROR2(125,2,GD_E_BAD_CODE); delete ent; ent = d->Entry("newer"); CHECK_OK2(125,3); CHECK_INT2(125,1,ent->Type(),MultiplyEntryType); CHECK_INT2(125,2,ent->FragmentIndex(),1); CHECK_STRING2(125,3,ent->Input(0),"in4"); CHECK_STRING2(125,4,ent->Input(1),"in5"); delete ent; // 126: Dirfile::UnInclude check d->UnInclude(1,0); CHECK_OK2(126,1); ent = d->Entry("newer"); CHECK_ERROR2(126,2,GD_E_BAD_CODE); delete ent; // 127: Fragment::FrameOffset check frag = d->Fragment(0); CHECK_OK(127); CHECK_INT(127,frag->FrameOffset(),0); // 128: Fragment::SetFrameOffset check frag->SetFrameOffset(33,0); CHECK_OK(128); CHECK_INT(128,frag->FrameOffset(),33); // 129: Dirfile::NativeType check n = d->NativeType("data"); CHECK_OK(129); CHECK_INT(129,n,Int8); // 131: Dirfile::Validate check n = d->Validate("new7"); CHECK_ERROR(131,GD_E_BAD_CODE); CHECK_INT(131,n,-1); // 133: Dirfile::FrameNum check delete d->Reference("data"); dp = d->FrameNum("data", 33.3, 6); CHECK_OK(133); CHECK_DOUBLE(133,dp,37.0375); // 136: Dirfile::MAdd check q[0] = 9.9; q[1] = 8.8; q[2] = 7.7; q[3] = 6.6; lent.Dissociate(); lent.SetName("mnew136"); lent.SetNFields(2); lent.SetInput("in1", 0); lent.SetScale(q[0], 0); lent.SetOffset(q[1], 0); lent.SetInput("in2", 1); lent.SetScale(q[2], 1); lent.SetOffset(q[3], 1); d->MAdd(lent, "data"); CHECK_OK2(136,1); ent = d->Entry("data/mnew136"); CHECK_OK2(136,2); CHECK_INT2(136,1,ent->Type(),LincomEntryType); CHECK_INT2(136,2,ent->NFields(),2); CHECK_INT2(136,3,ent->FragmentIndex(),0); CHECK_STRING2(136,4,ent->Input(0),"in1"); CHECK_STRING2(136,5,ent->Input(1),"in2"); CHECK_INT2(136,6,ent->ComplexScalars(),0); CHECK_DOUBLE_ARRAY(136,7,2,ent->Scale(i),q[i * 2]); CHECK_DOUBLE_ARRAY(136,8,2,ent->Offset(i),q[i * 2 + 1]); delete ent; // 137: Dirfile::ReferenceFilename check str = d->ReferenceFilename(); CHECK_OK(137); sprintf(buf, "dirfile%cdata", GD_DIRSEP); CHECK_EOSTRING(137,str, buf); // 142: Dirfile::BoF check n = d->BoF("lincom"); CHECK_OK(142); CHECK_INT(142,n,264); // 143: Dirfile::Entry / DivideEntry check ent = d->Entry("div"); CHECK_OK(143); CHECK_INT2(143,1,ent->Type(),DivideEntryType); CHECK_INT2(143,2,ent->FragmentIndex(),0); CHECK_STRING2(143,3,ent->Input(0),"mult"); CHECK_STRING2(143,4,ent->Input(1),"bit"); delete ent; // 145: Dirfile::Entry / RecipEntry check ent = d->Entry("recip"); CHECK_OK(145); CHECK_INT2(145,1,ent->Type(),RecipEntryType); CHECK_INT2(145,2,ent->FragmentIndex(),0); CHECK_STRING2(145,3,ent->Input(0),"div"); CHECK_INT2(145,4,ent->ComplexScalars(),1); CHECK_COMPLEX2(145,5,ent->CDividend(),complex(6.5,4.3)); delete ent; // 146: Dirfile::Add / DivideEntry check dent.SetName("new14"); dent.SetFragmentIndex(0); dent.SetInput("in1", 0); dent.SetInput("in2", 1); d->Add(dent); CHECK_OK2(146,1); ent = d->Entry("new14"); CHECK_OK2(146,2); CHECK_INT2(146,1,ent->Type(),DivideEntryType); CHECK_INT2(146,2,ent->FragmentIndex(),0); CHECK_STRING2(146,3,ent->Input(0),"in1"); CHECK_STRING2(146,4,ent->Input(1),"in2"); delete ent; // 147: Dirfile::Add / RecipEntry check oent.SetName("new15"); oent.SetFragmentIndex(0); oent.SetInput("in3"); oent.SetDividend(31.9); d->Add(oent); ent = d->Entry("new15"); CHECK_OK2(147,1); CHECK_INT2(147,1,ent->Type(),RecipEntryType); CHECK_INT2(147,2,ent->FragmentIndex(),0); CHECK_STRING2(147,3,ent->Input(0),"in3"); CHECK_INT2(147,4,ent->ComplexScalars(),0); CHECK_DOUBLE2(147,5,ent->Dividend(),31.9); delete ent; // 148: Dirfile::Add / RecipEntry check oent.Dissociate(); oent.SetName("new16"); oent.SetFragmentIndex(0); oent.SetInput("in2"); oent.SetDividend(complex(33.3,44.4)); d->Add(oent); ent = d->Entry("new16"); CHECK_OK2(148,1); CHECK_INT2(148,1,ent->Type(),RecipEntryType); CHECK_INT2(148,2,ent->FragmentIndex(),0); CHECK_STRING2(148,3,ent->Input(0),"in2"); CHECK_INT2(148,4,ent->ComplexScalars(),1); CHECK_COMPLEX2(148,5,ent->CDividend(),complex(33.3,44.4)); delete ent; // 152: DivideEntry check dep = reinterpret_cast(d->Entry("new14")); CHECK_OK2(152,1); dep->SetInput("in4",0); CHECK_OK2(152,2); dep->SetInput("in5",1); CHECK_OK2(152,3); delete dep; ent = d->Entry("new14"); CHECK_OK2(152,2); CHECK_INT2(152,1,ent->Type(),DivideEntryType); CHECK_INT2(152,2,ent->FragmentIndex(),0); CHECK_STRING2(152,3,ent->Input(0),"in4"); CHECK_STRING2(152,4,ent->Input(1),"in5"); delete ent; // 153: RecipEntry check oep = reinterpret_cast(d->Entry("new15")); CHECK_OK2(153,1); oep->SetInput("in1"); CHECK_OK2(153,2); oep->SetDividend(complex(1.01,9.33)); CHECK_OK2(153,3); delete oep; ent = d->Entry("new15"); CHECK_INT2(148,1,ent->Type(),RecipEntryType); CHECK_INT2(148,2,ent->FragmentIndex(),0); CHECK_STRING2(148,3,ent->Input(0),"in1"); CHECK_INT2(148,4,ent->ComplexScalars(),1); CHECK_COMPLEX2(148,5,ent->CDividend(),complex(1.01,9.33)); delete ent; // 155: Fragment::ReWrite check frag->ReWrite(); CHECK_OK(155); delete frag; // 156: Invalid Dirfile check Dirfile *id = new Dirfile(); CheckError(id,156,1,GD_E_OK); id->NFragments(); CheckError(id,156,2,GD_E_BAD_DIRFILE); delete id; // 157: Dirfile::Standards check n = d->Standards(); CHECK_OK2(157,1); CHECK_INT(157,n,GD_DIRFILE_STANDARDS_VERSION); d->Standards(0); CHECK_ERROR2(157,2,GD_E_ARGUMENT); // 158: gd_get_carray n = d->GetCarray("carray", Float64, p); CHECK_OK(158); CHECK_INT(158,n,0); CHECK_DOUBLE_ARRAY(158,1,6,p[i],1.1 * (i + 1)); // 159: gd_get_carray_slice (INT8) n = d->GetCarray("carray", Float64, p, 2, 2); CHECK_OK(159); CHECK_INT(159,n,0); CHECK_DOUBLE_ARRAY(159,1,2,p[i],1.1 * (i + 3)); // 167: gd_carrays carrays = d->Carrays(Float64); CHECK_OK(167); CHECK_NONNULL(167,carrays); CHECK_INT2(167,1,carrays[0].n,6); CHECK_DOUBLE_ARRAY(167,2,6,((double*)carrays[0].d)[i],1.1 * (i + 1)); CHECK_INT2(167,2,carrays[1].n,0); // 168: gd_put_carray p[0] = 9.6; p[1] = 8.5; p[2] = 7.4; p[3] = 6.3; p[4] = 5.2; p[5] = 4.1; n = d->PutCarray("carray", Float64, p); CHECK_OK2(168, 1); n = d->GetCarray("carray", Float64, q); CHECK_OK2(168,2); CHECK_INT(168,n,0); CHECK_DOUBLE_ARRAY(168,1,6,q[i],9.6 - i * 1.1); // 169: gd_put_carray_slice (INT8) p[0] = 2.2; p[1] = 3.3; n = d->PutCarray("carray", Float64, p, 2, 2); CHECK_OK2(168, 1); n = d->GetCarray("carray", Float64, q); CHECK_OK2(168,2); CHECK_INT(168,n,0); CHECK_DOUBLE_ARRAY(168,1,6,q[i],(i == 2 || i == 3) ? i * 1.1 : 9.6 - i * 1.1); // 177: gd_array_len n = (int)d->ArrayLen("carray"); CHECK_OK(177); CHECK_INT(177,n,6); // 178: gd_entry (CARRAY) ent = d->Entry("carray"); CHECK_OK(178); CHECK_INT2(178,1,ent->Type(),CarrayEntryType); CHECK_INT2(178,2,ent->FragmentIndex(),0); CHECK_INT2(178,3,ent->ConstType(),Float64); CHECK_INT2(178,4,ent->ArrayLen(),6); delete ent; // 179: gd_add_carray aent.SetName("new17"); aent.SetFragmentIndex(0); aent.SetType(Float64); aent.SetArrayLen(4); d->Add(aent); CHECK_OK2(179,1); ent = d->Entry("new17"); CHECK_OK2(179,2); CHECK_INT2(179,1,ent->Type(),CarrayEntryType); CHECK_INT2(179,2,ent->FragmentIndex(),0); CHECK_INT2(179,3,ent->ConstType(),Float64); CHECK_INT2(179,4,ent->ArrayLen(),4); delete ent; // 180: gd_madd_carray aent.Dissociate(); aent.SetName("mnew17"); aent.SetFragmentIndex(0); aent.SetType(Float64); aent.SetArrayLen(2); d->MAdd(aent, "data"); CHECK_OK2(180,1); ent = d->Entry("data/mnew17"); CHECK_OK2(180,2); CHECK_INT2(180,1,ent->Type(),CarrayEntryType); CHECK_INT2(180,2,ent->FragmentIndex(),0); CHECK_INT2(180,3,ent->ConstType(),Float64); CHECK_INT2(180,4,ent->ArrayLen(),2); delete ent; // 181: gd_alter_carray aep = reinterpret_cast(d->Entry("new17")); CHECK_OK2(181,1); aep->SetType(Float32); CHECK_OK2(181,2); aep->SetArrayLen(12); CHECK_OK2(181,3); delete aep; ent = d->Entry("new17"); CHECK_OK2(181,2); CHECK_INT2(181,1,ent->Type(),CarrayEntryType); CHECK_INT2(181,2,ent->FragmentIndex(),0); CHECK_INT2(181,3,ent->ConstType(),Float32); CHECK_INT2(181,4,ent->ArrayLen(),12); delete ent; // 183: gd_constants p[0] = 86.; p[1] = 0.; n = d->NFieldsByType(ConstEntryType); qp = reinterpret_cast(d->Constants()); CHECK_OK(183); CHECK_DOUBLE_ARRAY(183,0,n,qp[i],p[i]); // 184: gd_mconstants p[0] = 3.3; p[1] = 0.; n = d->NMFieldsByType("data", ConstEntryType); qp = reinterpret_cast(d->MConstants("data")); CHECK_OK(184); CHECK_DOUBLE_ARRAY(184,0,n,qp[i],p[i]); // 199: gd_strings strings[0] = (char *)"Lorem ipsum"; strings[1] = (char *)""; strings[2] = (char *)"Arthur Dent"; n = d->NFieldsByType(StringEntryType); list = d->Strings(); CHECK_OK(199); CHECK_STRING_ARRAY(199,n,list[i],strings[i]); // 200: gd_strings strings[0] = (char *)"This is a string constant."; n = d->NMFieldsByType("data", StringEntryType); list = d->MStrings("data"); CHECK_OK(200); CHECK_STRING_ARRAY(200,n,list[i],strings[i]); // 203: gd_seek n = d->Seek("data", 35, 0, GD_SEEK_SET); CHECK_OK2(203,0); m = d->GetData("data", GD_HERE, 0, 1, 0, UInt8, c); CHECK_OK2(203,1); CHECK_INT2(203,0,n,35 * 8); CHECK_INT2(203,1,m,8); CHECK_INT_ARRAY(203,8,c[i],17 + i); // 204: gd_tell n = d->Tell("data"); CHECK_OK(204); CHECK_INT(204,n,288); // 205: gd_hide check n = d->Hide("data"); CHECK_OK(205); // 206: gd_hidden check n = d->Hidden("data"); CHECK_OK2(206, 1); CHECK_INT2(206, 1, n, 1); n = d->Hidden("lincom"); CHECK_OK2(206, 2); CHECK_INT2(206, 2, n, 0); // 207: gd_unhide check n = d->UnHide("data"); CHECK_OK2(206, 1); n = d->Hidden("data"); CHECK_OK2(206, 2); CHECK_INT2(206, 2, n, 0); // 208: gd_sync check d->Sync("data"); CHECK_OK(208); // 209: gd_flush check d->Flush("data"); CHECK_OK(209); // 210: gd_metaflush check d->MetaFlush(); CHECK_OK(210); // 211: gd_entry (WINDOW) check ent = d->Entry("window"); CHECK_OK(211); CHECK_INT2(211, 1, ent->Type(), WindowEntryType); CHECK_INT2(211, 2, ent->FragmentIndex(), 0); CHECK_INT2(211, 3, ent->WindOp(), WindOpLt); CHECK_STRING2(211, 4, ent->Input(0), "linterp"); CHECK_STRING2(211, 5, ent->Input(1), "mult"); CHECK_DOUBLE2(211, 6, ent->Threshold().r, 4.1); delete ent; // 212: Dirfile::Add / WindowEntry check went.SetName("new18"); went.SetFragmentIndex(0); went.SetInput("in1", 0); went.SetInput("in2", 1); went.SetWindOp(WindOpNe); thresh.i = 32; went.SetThreshold(thresh); d->Add(went); CHECK_OK2(212, 1); ent = d->Entry("new18"); CHECK_OK2(212, 2); CHECK_INT2(212, 1, ent->Type(), WindowEntryType); CHECK_INT2(212, 2, ent->FragmentIndex(), 0); CHECK_INT2(212, 3, ent->WindOp(), WindOpNe); CHECK_STRING2(212, 4, ent->Input(0), "in1"); CHECK_STRING2(212, 5, ent->Input(1), "in2"); CHECK_INT2(212, 6, ent->Threshold().i, 32); delete ent; // 214: gd_madd_window_i check went.Dissociate(); went.SetName("mnew18"); went.SetInput("in2", 0); went.SetInput("in3", 1); went.SetWindOp(WindOpSet); thresh.u = 128; went.SetThreshold(thresh); d->MAdd(went, "data"); CHECK_OK2(214, 1); ent = d->Entry("data/mnew18"); CHECK_OK2(214, 2); CHECK_INT2(214, 1, ent->Type(), WindowEntryType); CHECK_INT2(214, 2, ent->FragmentIndex(), 0); CHECK_INT2(214, 3, ent->WindOp(), WindOpSet); CHECK_STRING2(214, 4, ent->Input(0), "in2"); CHECK_STRING2(214, 5, ent->Input(1), "in3"); CHECK_INT2(214, 6, ent->Threshold().u, 128); delete ent; // 217: gd_alter_window_r check wep = reinterpret_cast(d->Entry("new18")); wep->SetInput("in3", 0); wep->SetInput("in4", 1); wep->SetWindOp(WindOpGe); thresh.r = 32e3; wep->SetThreshold(thresh); CHECK_OK2(217, 1); delete wep; ent = d->Entry("new18"); CHECK_OK2(217, 2); CHECK_INT2(217, 1, ent->Type(), WindowEntryType); CHECK_INT2(217, 2, ent->FragmentIndex(), 0); CHECK_INT2(217, 3, ent->WindOp(), WindOpGe); CHECK_STRING2(217, 4, ent->Input(0), "in3"); CHECK_STRING2(217, 5, ent->Input(1), "in4"); CHECK_DOUBLE2(217, 6, ent->Threshold().r, 32e3); delete ent; // 218: gd_alias_target check str = d->AliasTarget("alias"); CHECK_OK(218); CHECK_STRING(218, str, "data"); // 219: gd_add_alias check d->AddAlias("new20", "data", 0); CHECK_OK2(219, 1); str = d->AliasTarget("new20"); CHECK_OK2(219, 2); CHECK_STRING(219, str, "data"); // 220: gd_madd_alias check d->MAddAlias("data", "mnew20", "data"); CHECK_OK2(220, 1); str = d->AliasTarget("data/mnew20"); CHECK_OK2(220, 2); CHECK_STRING(220, str, "data"); // 221: gd_naliases check n = d->NAliases("data"); CHECK_OK(221); CHECK_INT(221, n, 4); // 222: gd_aliases check fields[1] = (char*)"data"; fields[2] = (char*)"alias"; fields[3] = (char*)"data/mnew20"; fields[4] = (char*)"new20"; list = d->Aliases("data"); CHECK_OK(222); CHECK_STRING_ARRAY(222,i,list[i],fields[i]); // 223: gd_include_affix check d->IncludeAffix("format1", 0, "A", "Z", GD_CREAT | GD_EXCL); CHECK_OK(223); // 226: gd_fragment_affixes check frag = d->Fragment(1); CHECK_STRING2(226, 1, frag->Prefix(), "A"); CHECK_STRING2(226, 2, frag->Suffix(), "Z"); // 227: gd_alter_affixes check frag->SetPrefix("B"); CHECK_OK2(227, 1); frag->SetSuffix("C"); CHECK_OK2(227, 2); CHECK_STRING2(227, 3, frag->Prefix(), "B"); CHECK_STRING2(227, 3, frag->Suffix(), "C"); delete frag; // 228: gd_entry (MPLEX) check ent = d->Entry("mplex"); CHECK_OK(228); CHECK_INT2(228, 1, ent->Type(), MplexEntryType); CHECK_INT2(228, 2, ent->FragmentIndex(), 0); CHECK_INT2(228, 3, ent->CountVal(), 1); CHECK_STRING2(228, 4, ent->Input(0), "data"); CHECK_STRING2(228, 5, ent->Input(1), "sbit"); CHECK_INT2(228, 6, ent->Period(), 10); delete ent; // 229: Dirfile::Add / MplexEntry check xent.SetName("new21"); xent.SetFragmentIndex(0); xent.SetInput("in1", 0); xent.SetInput("in2", 1); xent.SetCountVal(5); xent.SetPeriod(6); d->Add(xent); CHECK_OK2(229, 1); ent = d->Entry("new21"); CHECK_OK2(229, 2); CHECK_INT2(229, 1, ent->Type(), MplexEntryType); CHECK_INT2(229, 2, ent->FragmentIndex(), 0); CHECK_INT2(229, 3, ent->CountVal(), 5); CHECK_STRING2(229, 4, ent->Input(0), "in1"); CHECK_STRING2(229, 5, ent->Input(1), "in2"); CHECK_INT2(229, 6, ent->Period(), 6); delete ent; // 230: gd_madd_mplex check xent.Dissociate(); xent.SetName("mnew21"); xent.SetInput("in2", 0); xent.SetInput("in3", 1); xent.SetCountVal(0); xent.SetPeriod(12); d->MAdd(xent, "data"); CHECK_OK2(230, 1); ent = d->Entry("data/mnew21"); CHECK_OK2(230, 2); CHECK_INT2(230, 1, ent->Type(), MplexEntryType); CHECK_INT2(230, 2, ent->FragmentIndex(), 0); CHECK_INT2(230, 3, ent->CountVal(), 0); CHECK_STRING2(230, 4, ent->Input(0), "in2"); CHECK_STRING2(230, 5, ent->Input(1), "in3"); CHECK_INT2(230, 6, ent->Period(), 12); delete ent; // 231: gd_alter_mplex check xep = reinterpret_cast(d->Entry("new21")); xep->SetInput("in3", 0); xep->SetInput("in4", 1); xep->SetCountVal(3); xep->SetPeriod(7); CHECK_OK2(231, 1); delete xep; ent = d->Entry("new21"); CHECK_OK2(231, 2); CHECK_INT2(231, 1, ent->Type(), MplexEntryType); CHECK_INT2(231, 2, ent->FragmentIndex(), 0); CHECK_INT2(231, 3, ent->CountVal(), 3); CHECK_STRING2(231, 4, ent->Input(0), "in3"); CHECK_STRING2(231, 5, ent->Input(1), "in4"); CHECK_INT2(231, 6, ent->Period(), 7); delete ent; // 232: gd_tokenise tok = d->StrTok("\"test1 test2\" test3\\ test4"); CHECK_OK2(232, 1); CHECK_STRING2(232, 2, tok, "test1 test2"); free(tok); tok = d->StrTok(); CHECK_OK2(232, 3); CHECK_STRING2(232, 4, tok, "test3 test4"); free(tok); // 233: gd_raw_close check d->RawClose("data"); CHECK_OK(233); // 234: gd_desync check n = d->DeSync(); CHECK_OK(234); CHECK_INT(234, n, 0); // 235: gd_flags check n = d->Flags(GD_PRETTY_PRINT, 0); CHECK_OK(235); CHECK_INT(235, n, GD_PRETTY_PRINT); // 236: gd_verbose_prefix d->VerbosePrefix("big_test: "); CHECK_OK(236); // 237: gd_nentries n = d->NEntries("data", GD_SCALAR_ENTRIES, GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS); CHECK_OK2(237, 1); CHECK_INT2(237, 1, n, 4); n = d->NEntries(NULL, GD_VECTOR_ENTRIES, GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS); CHECK_OK2(237, 2); CHECK_INT2(237, 2, n, 26); // 239: gd_entry_list fields[0] = (char*)"INDEX"; fields[1] = (char*)"bit"; fields[2] = (char*)"data"; fields[3] = (char*)"div"; fields[4] = (char*)"lincom"; fields[5] = (char*)"linterp"; fields[6] = (char*)"mplex"; fields[7] = (char*)"mult"; fields[8] = (char*)"new1"; fields[9] = (char*)"new14"; fields[10] = (char*)"new15"; fields[11] = (char*)"new16"; fields[12] = (char*)"new18"; fields[13] = (char*)"new2"; fields[14] = (char*)"new21"; fields[15] = (char*)"new3"; fields[16] = (char*)"new4"; fields[17] = (char*)"new5"; fields[18] = (char*)"new6"; fields[19] = (char*)"new7"; fields[20] = (char*)"new8"; fields[21] = (char*)"phase"; fields[22] = (char*)"polynom"; fields[23] = (char*)"recip"; fields[24] = (char*)"sbit"; fields[25] = (char*)"window"; list = d->EntryList(NULL, GD_VECTOR_ENTRIES, GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS); CHECK_OK(239); CHECK_STRING_ARRAY(239,n,list[i],fields[i]); // 240: gd_mplex_lookback d->MplexLookback(GD_LOOKBACK_ALL); CHECK_OK(240); // 241: gd_linterp_tablename check tok = d->LinterpTableName("linterp"); CHECK_OK(241); sprintf(buf, "dirfile%clut", GD_DIRSEP); CHECK_EOSTRING(241,tok,buf); free(tok); // 242: gd_carrays carrays = d->MCarrays("data", Float64); CHECK_OK(242); CHECK_NONNULL(242,carrays); CHECK_INT2(242,1,carrays[0].n,5); CHECK_DOUBLE_ARRAY(242,2,5,((double*)carrays[0].d)[i],(1.9 + i * 0.9)); CHECK_INT2(242,3,carrays[1].n,2); CHECK_DOUBLE_ARRAY(242,4,2,((double*)carrays[1].d)[i],0); CHECK_INT2(242,5,carrays[2].n,0); // 271: gd_encoding_support n = EncodingSupport(GetData::SieEncoding); CHECK_INT(271, n, GD_RDWR); // 272: NULL return from gd_reference id = new Dirfile("dirfile/empty", GD_RDWR | GD_CREAT | GD_EXCL); CHECK_OK2(272, 1); rep = id->Reference(); CHECK_OK2(272, 2); CHECK_NULL(272, rep); id->Discard(); // =================================================================== d->Discard(); delete d; unlink(eformat); rmdir(empty); unlink(data); unlink(new1); unlink(format); unlink(format1); unlink(form2); rmdir(filedir); } int main(void) { run_tests(); if (ne) { cerr << "ne = " << ne << endl; return 1; } return 0; } libgetdata-0.9.0/bindings/cxx/test/Makefile.am0000640000175000017500000000236712614323564021426 0ustar alastairalastair# Copyright (C) 2008-2012, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(srcdir)/.. -I$(top_srcdir)/src LDADD=../libgetdata++.la TESTS=big_test big_test_SOURCES=big_test.cpp check_PROGRAMS=${TESTS} # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf *odirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ libgetdata-0.9.0/bindings/cxx/Makefile.am0000640000175000017500000000421212614323564020436 0ustar alastairalastair# Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign getdata_includedir = ${includedir}/getdata AM_CPPFLAGS = ${GD_CXX_WALL} $(GD_CXX_WEXTRA) -I$(top_srcdir)/src LIBS= SUBDIRS=test getdata_include_HEADERS = getdata/dirfile.h getdata/entry.h getdata/rawentry.h \ getdata/lincomentry.h getdata/linterpentry.h \ getdata/bitentry.h getdata/multiplyentry.h \ getdata/phaseentry.h getdata/constentry.h \ getdata/stringentry.h getdata/indexentry.h \ getdata/sbitentry.h getdata/polynomentry.h \ getdata/fragment.h getdata/divideentry.h \ getdata/recipentry.h getdata/carrayentry.h \ getdata/windowentry.h getdata/mplexentry.h lib_LTLIBRARIES=libgetdata++.la libgetdata___la_SOURCES = dirfile.cpp bitentry.cpp carrayentry.cpp \ constentry.cpp divideentry.cpp entry.cpp \ fragment.cpp lincomentry.cpp \ linterpentry.cpp mplexentry.cpp multiplyentry.cpp \ phaseentry.cpp polynomentry.cpp rawentry.cpp \ recipentry.cpp sbitentry.cpp \ stringentry.cpp windowentry.cpp \ ${getdata_include_HEADERS} internal.h libgetdata___la_LIBADD=../../src/libgetdata.la libgetdata___la_LDFLAGS = -version-info @GETDATAXX_VERSION@ clean-local: rm -rf *~ getdata/*~ libgetdata-0.9.0/bindings/cxx/constentry.cpp0000640000175000017500000000251512614323564021322 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; ConstEntry::ConstEntry(const char* field_code, DataType data_type, int fragment_index) { E.field = strdup(field_code); E.field_type = GD_CONST_ENTRY; E.u.scalar.const_type = (gd_type_t)data_type; E.fragment_index = fragment_index; } int ConstEntry::SetType(DataType type) { E.u.scalar.const_type = (gd_type_t)type; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } libgetdata-0.9.0/bindings/cxx/linterpentry.cpp0000640000175000017500000000335412614323564021653 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; LinterpEntry::LinterpEntry(const char* field_code, const char* in_field, const char* table, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_LINTERP_ENTRY; E.in_fields[0] = strdup(in_field); E.u.linterp.table = strdup(table); E.fragment_index = fragment_index; } int LinterpEntry::SetInput(const char* field) { char* ptr = strdup(field); if (ptr == NULL) return 0; free(E.in_fields[0]); E.in_fields[0] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int LinterpEntry::SetTable(const char* table, int move_table) { char* ptr = strdup(table); if (ptr == NULL) return 0; free(E.u.linterp.table); E.u.linterp.table = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, move_table); return 0; } libgetdata-0.9.0/bindings/cxx/internal.h0000640000175000017500000000373212614323564020375 0ustar alastairalastair// Copyright (C) 2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #ifdef HAVE_CONFIG_H #include "gd_config.h" #endif #undef GETDATA_LEGACY_API #include "getdata/dirfile.h" #include #include #include #include /* debugging macros */ #ifdef GETDATA_DEBUG extern "C" const char* gd_colnil(void); extern "C" const char* gd_coladd(void); extern "C" const char* gd_colsub(void); #define dtracevoid() printf("%s %s()\n", gd_coladd(), __func__) #define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", gd_coladd(), \ __func__, ##__VA_ARGS__) #define dprintf(fmt, ...) printf("%s %s:%i " fmt "\n", gd_colnil(), \ __func__, __LINE__, ##__VA_ARGS__) #define dreturnvoid() printf("%s %s = (nil)\n", gd_colsub(), __func__) #define dreturn(fmt, ...) printf("%s %s = " fmt "\n", gd_colsub(), \ __func__, ##__VA_ARGS__) #define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v) #else #define dtracevoid() #define dtrace(...) #define dprintf(...) #define dreturnvoid() #define dreturn(...) #define dwatch(...) #endif #ifdef _MSC_VER #define __gd_unused #else #define __gd_unused __attribute__ (( unused )) #endif using namespace GetData; libgetdata-0.9.0/bindings/cxx/lincomentry.cpp0000640000175000017500000001203612614323564021454 0ustar alastairalastair// Copyright (C) 2008-2011, 2013 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; LincomEntry::LincomEntry(const char* field_code, int n_fields, const char** in_fields, double* m, double* b, int fragment_index) : Entry() { int i; E.field = strdup(field_code); E.field_type = GD_LINCOM_ENTRY; E.u.lincom.n_fields = n_fields; E.fragment_index = fragment_index; E.flags = 0; for (i = 0; i < n_fields; ++i) { E.in_fields[i] = strdup(in_fields[i]); E.u.lincom.m[i] = m[i]; E.u.lincom.b[i] = b[i]; } } LincomEntry::LincomEntry(const char* field_code, int n_fields, const char** in_fields, std::complex* cm, std::complex* cb, int fragment_index) : Entry() { int i; E.field = strdup(field_code); E.field_type = GD_LINCOM_ENTRY; E.u.lincom.n_fields = n_fields; E.fragment_index = fragment_index; E.flags = GD_EN_COMPSCAL; for (i = 0; i < n_fields; ++i) { E.in_fields[i] = strdup(in_fields[i]); E.u.lincom.cm[i][0] = cm[i].real(); E.u.lincom.cm[i][1] = cm[i].imag(); E.u.lincom.cb[i][0] = cb[i].real(); E.u.lincom.cb[i][1] = cb[i].imag(); } } int LincomEntry::SetInput(const char* field, int index) { if (index < 0 || index >= GD_MAX_LINCOM) return -1; char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[index]); E.in_fields[index] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int LincomEntry::SetScale(double scale, int index) { if (index < 0 || index >= GD_MAX_LINCOM) return -1; E.u.lincom.cm[index][0] = E.u.lincom.m[index] = scale; E.u.lincom.cm[index][1] = 0; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int LincomEntry::SetScale(const char *scale, int index) { int r = 0; if (index < 0 || index >= GD_MAX_LINCOM) return -1; SetScalar(index, scale); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) { r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.lincom.cm + index); E.u.lincom.m[index] = E.u.lincom.cm[index][0]; } } return r; } int LincomEntry::SetScale(std::complex scale, int index) { if (index < 0 || index >= GD_MAX_LINCOM) return -1; E.u.lincom.m[index] = E.u.lincom.cm[index][0] = scale.real(); E.u.lincom.cm[index][1] = scale.imag(); E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int LincomEntry::SetOffset(double offset, int index) { if (index < 0 || index >= GD_MAX_LINCOM) return -1; E.u.lincom.cb[index][0] = E.u.lincom.b[index] = offset; E.u.lincom.cb[index][1] = 0; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int LincomEntry::SetOffset(const char *scale, int index) { int r = 0; if (index < 0 || index >= GD_MAX_LINCOM) return -1; SetScalar(index + GD_MAX_LINCOM, scale); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) { r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.lincom.cb + index); E.u.lincom.b[index] = E.u.lincom.cb[index][0]; } } return r; } int LincomEntry::SetOffset(std::complex offset, int index) { if (index < 0 || index >= GD_MAX_LINCOM) return -1; E.u.lincom.b[index] = E.u.lincom.cb[index][0] = offset.real(); E.u.lincom.cb[index][1] = offset.imag(); E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int LincomEntry::SetNFields(int nfields) { int old_n = E.u.lincom.n_fields; if (nfields < 1 || nfields > GD_MAX_LINCOM) return -1; if (nfields > old_n) { int i; for (i = old_n; i < nfields; ++i) { free(E.in_fields[i]); E.in_fields[i] = strdup("INDEX"); E.u.lincom.m[i] = E.u.lincom.b[i] = 0; } } E.u.lincom.n_fields = nfields; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } const char *LincomEntry::Scalar(int index) const { if (index < 0 || index >= E.u.lincom.n_fields) return NULL; return E.scalar[index]; } int LincomEntry::ScalarIndex(int index) const { if (index < 0 || index >= E.u.lincom.n_fields) return 0; return E.scalar_ind[index]; } libgetdata-0.9.0/bindings/cxx/sbitentry.cpp0000640000175000017500000000445712614323564021144 0ustar alastairalastair// Copyright (C) 2008-2012 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; SBitEntry::SBitEntry(const char* field_code, const char* in_field, int bitnum, int numbits, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_BIT_ENTRY; E.in_fields[0] = strdup(in_field); E.u.bit.bitnum = bitnum; E.u.bit.numbits = numbits; E.fragment_index = fragment_index; } int SBitEntry::SetInput(const char* field) { char* ptr = strdup(field); if (ptr == NULL) return 0; free(E.in_fields[0]); E.in_fields[0] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int SBitEntry::SetFirstBit(int first_bit) { E.u.bit.bitnum = first_bit; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int SBitEntry::SetNumBits(int num_bits) { E.u.bit.numbits = num_bits; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int SBitEntry::SetFirstBit(const char *first_bit) { int r = 0; SetScalar(0, first_bit); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, first_bit, GD_INT16, &E.u.bit.bitnum); } return r; } int SBitEntry::SetNumBits(const char *num_bits) { int r = 0; SetScalar(1, num_bits); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, num_bits, GD_INT16, &E.u.bit.numbits); } return r; } libgetdata-0.9.0/bindings/cxx/windowentry.cpp0000640000175000017500000000625312614323564021506 0ustar alastairalastair// Copyright (C) 2011, 2012 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" WindowEntry::WindowEntry(const char* field_code, const char* in_field, const char* check, WindOpType windop, gd_triplet_t threshold, int fragment_index) : Entry() { dtrace("\"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}, %i", field_code, in_field, check, (unsigned)windop, threshold.r, (unsigned long long)threshold.u, (long long)threshold.i, fragment_index); E.field = strdup(field_code); E.field_type = GD_WINDOW_ENTRY; E.in_fields[0] = strdup(in_field); E.in_fields[1] = strdup(check); E.scalar[0] = 0; E.u.window.windop = (gd_windop_t)windop; E.u.window.threshold = threshold; E.fragment_index = fragment_index; dreturnvoid(); } int WindowEntry::SetInput(const char* field, int index) { if (index < 0 || index > 1) return -1; char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[index]); E.in_fields[index] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int WindowEntry::SetWindOp(WindOpType windop) { int ret = 0; dtrace("0x%X", (unsigned)windop); E.u.window.windop = (gd_windop_t)windop; if (D != NULL) ret = gd_alter_entry(D->D, E.field, &E, 0); dreturn("%i", ret); return ret; } int WindowEntry::SetThreshold(gd_triplet_t threshold) { int ret = 0; dtrace("{%g,%llX,%lli}", threshold.r, (unsigned long long)threshold.u, (long long)threshold.i); E.u.window.threshold = threshold; if (D != NULL) ret = gd_alter_entry(D->D, E.field, &E, 0); dreturn("%i", ret); return ret; } int WindowEntry::SetThreshold(const char *threshold) { int r = 0; dtrace("\"%s\"", threshold); SetScalar(0, threshold); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) { switch(E.u.window.windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: r = gd_get_constant(D->D, threshold, GD_INT64, &E.u.window.threshold.i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: r = gd_get_constant(D->D, threshold, GD_UINT64, &E.u.window.threshold.u); break; default: r = gd_get_constant(D->D, threshold, GD_FLOAT64, &E.u.window.threshold.r); break; } } } dreturn("%i", r); return r; } libgetdata-0.9.0/bindings/cxx/carrayentry.cpp0000640000175000017500000000302712614323564021454 0ustar alastairalastair// Copyright (C) 2010-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" CarrayEntry::CarrayEntry(const char* field_code, DataType data_type, size_t array_len, int fragment_index) { E.field = strdup(field_code); E.field_type = GD_CARRAY_ENTRY; E.u.scalar.const_type = (gd_type_t)data_type; E.u.scalar.array_len = array_len; E.fragment_index = fragment_index; } int CarrayEntry::SetType(DataType type) { E.u.scalar.const_type = (gd_type_t)type; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int CarrayEntry::SetArrayLen(size_t array_len) { E.u.scalar.array_len = array_len; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } libgetdata-0.9.0/bindings/cxx/mplexentry.cpp0000640000175000017500000000546412614323564021327 0ustar alastairalastair// Copyright (C) 2012, 2013 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" MplexEntry::MplexEntry(const char* field_code, const char* in_field, const char* count, int count_val, int period, int fragment_index) : Entry() { dtrace("\"%s\", \"%s\", \"%s\", %i, %i, %i", field_code, in_field, count, count_val, period, fragment_index); E.field = strdup(field_code); E.field_type = GD_MPLEX_ENTRY; E.in_fields[0] = strdup(in_field); E.in_fields[1] = strdup(count); E.scalar[0] = E.scalar[1] = 0; E.u.mplex.count_val = count_val; E.u.mplex.period = period; E.fragment_index = fragment_index; dreturnvoid(); } int MplexEntry::SetInput(const char* field, int index) { if (index < 0 || index > 1) return -1; char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[index]); E.in_fields[index] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int MplexEntry::SetCountVal(int count_val) { int ret = 0; dtrace("%u", count_val); E.u.mplex.count_val = count_val; if (D != NULL) ret = gd_alter_entry(D->D, E.field, &E, 0); dreturn("%i", ret); return ret; } int MplexEntry::SetPeriod(int period) { int ret = 0; dtrace("%u", period); E.u.mplex.period = period; if (D != NULL) ret = gd_alter_entry(D->D, E.field, &E, 0); dreturn("%i", ret); return ret; } int MplexEntry::SetCountVal(const char *count_val) { int r = 0; dtrace("\"%s\"", count_val); SetScalar(0, count_val); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, count_val, GD_UINT16, &E.u.mplex.count_val); } dreturn("%i", r); return r; } int MplexEntry::SetPeriod(const char *period) { int r = 0; dtrace("\"%s\"", period); SetScalar(1, period); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) r = gd_get_constant(D->D, period, GD_UINT16, &E.u.mplex.period); } dreturn("%i", r); return r; } libgetdata-0.9.0/bindings/cxx/multiplyentry.cpp0000640000175000017500000000304512614323564022052 0ustar alastairalastair// Copyright (C) 2008-2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; MultiplyEntry::MultiplyEntry(const char* field_code, const char* in_field1, const char* in_field2, int fragment_index) : Entry() { E.field = strdup(field_code); E.field_type = GD_MULTIPLY_ENTRY; E.in_fields[0] = strdup(in_field1); E.in_fields[1] = strdup(in_field2); E.fragment_index = fragment_index; } int MultiplyEntry::SetInput(const char* field, int index) { if (index < 0 || index > 1) return -1; char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[index]); E.in_fields[index] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } libgetdata-0.9.0/bindings/cxx/polynomentry.cpp0000640000175000017500000000736012614323564021674 0ustar alastairalastair// Copyright (C) 2009, 2010, 2011, 2013 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; PolynomEntry::PolynomEntry(const char* field_code, int poly_ord, const char* in_field, double* a, int fragment_index) : Entry() { int i; E.field = strdup(field_code); E.field_type = GD_POLYNOM_ENTRY; E.u.polynom.poly_ord = poly_ord; E.fragment_index = fragment_index; E.flags = 0; E.in_fields[0] = strdup(in_field); for (i = 0; i <= poly_ord; ++i) E.u.polynom.a[i] = a[i]; } PolynomEntry::PolynomEntry(const char* field_code, int poly_ord, const char* in_field, std::complex* ca, int fragment_index) : Entry() { int i; E.field = strdup(field_code); E.field_type = GD_POLYNOM_ENTRY; E.u.polynom.poly_ord = poly_ord; E.fragment_index = fragment_index; E.flags = GD_EN_COMPSCAL; E.in_fields[0] = strdup(in_field); for (i = 0; i <= poly_ord; ++i) { E.u.polynom.ca[i][0] = ca[i].real(); E.u.polynom.ca[i][1] = ca[i].imag(); } } int PolynomEntry::SetInput(const char* field) { char* ptr = strdup(field); if (ptr == NULL) return -1; free(E.in_fields[0]); E.in_fields[0] = ptr; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int PolynomEntry::SetCoefficient(double coeff, int index) { if (index < 0 || index > GD_MAX_POLYORD) return -1; E.u.polynom.ca[index][0] = E.u.polynom.a[index] = coeff; E.u.polynom.ca[index][1] = 0; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int PolynomEntry::SetCoefficient(const char *scale, int index) { int r = 0; if (index < 0 || index > GD_MAX_POLYORD) return -1; SetScalar(index, scale); if (D != NULL) { r = gd_alter_entry(D->D, E.field, &E, 0); if (!r) { r = gd_get_constant(D->D, scale, GD_COMPLEX128, E.u.polynom.ca + index); E.u.polynom.a[index] = E.u.polynom.ca[index][0]; } } return r; } int PolynomEntry::SetCoefficient(std::complex coeff, int index) { if (index < 0 || index > GD_MAX_POLYORD) return -1; E.u.polynom.a[index] = E.u.polynom.ca[index][0] = coeff.real(); E.u.polynom.ca[index][1] = coeff.imag(); E.flags = GD_EN_COMPSCAL; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } int PolynomEntry::SetPolyOrd(int poly_ord) { int old_n = E.u.polynom.poly_ord; if (poly_ord < 2 || poly_ord > GD_MAX_POLYORD) return -1; if (poly_ord > old_n) { int i; for (i = old_n + 1; i <= poly_ord; ++i) E.u.polynom.a[i] = 0; } E.u.polynom.poly_ord = poly_ord; if (D != NULL) return gd_alter_entry(D->D, E.field, &E, 0); return 0; } const char *PolynomEntry::Scalar(int index) const { if (index < 0 || index > E.u.polynom.poly_ord) return NULL; return E.scalar[index]; } int PolynomEntry::ScalarIndex(int index) const { if (index < 0 || index > E.u.polynom.poly_ord) return 0; return E.scalar_ind[index]; } libgetdata-0.9.0/bindings/cxx/dirfile.cpp0000640000175000017500000003165312614323564020535 0ustar alastairalastair// Copyright (C) 2008-2012, 2014 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "getdata/dirfile.h" #include "internal.h" // This is not part of the Dirfile class, but it's convenient to put it here int GetData::EncodingSupport(GetData::EncodingScheme encoding) { return gd_encoding_support((unsigned long)encoding); } Dirfile::Dirfile() { D = gd_invalid_dirfile(); error_string = NULL; reference_name = NULL; } Dirfile::Dirfile(const char* filedir, unsigned long flags, gd_parser_callback_t sehandler, void* extra) { D = gd_cbopen(filedir, flags, sehandler, extra); error_string = NULL; reference_name = NULL; } Dirfile::Dirfile(DIRFILE* dirfile) { D = dirfile; error_string = NULL; reference_name = NULL; } Dirfile::~Dirfile() { free(error_string); free(reference_name); gd_close(D); } int Dirfile::Add(GetData::Entry &entry) const { int ret = gd_add(D, &entry.E); entry.SetDirfile(this); return ret; } int Dirfile::AddSpec(const char *spec, int format_file) const { return gd_add_spec(D, spec, format_file); } int Dirfile::MAdd(GetData::Entry &entry, const char *parent) const { int ret = gd_madd(D, &entry.E, parent); entry.SetDirfile(this); return ret; } int Dirfile::MAddSpec(const char *spec, const char *parent) const { return gd_madd_spec(D, spec, parent); } Entry *Dirfile::Entry(const char* field_code) const { GetData::EntryType type = (GetData::EntryType)gd_entry_type(D, field_code); switch(type) { case RawEntryType: return new GetData::RawEntry(this, field_code); case LincomEntryType: return new GetData::LincomEntry(this, field_code); case LinterpEntryType: return new GetData::LinterpEntry(this, field_code); case BitEntryType: return new GetData::BitEntry(this, field_code); case SBitEntryType: return new GetData::SBitEntry(this, field_code); case MultiplyEntryType: return new GetData::MultiplyEntry(this, field_code); case DivideEntryType: return new GetData::DivideEntry(this, field_code); case RecipEntryType: return new GetData::RecipEntry(this, field_code); case PhaseEntryType: return new GetData::PhaseEntry(this, field_code); case PolynomEntryType: return new GetData::PolynomEntry(this, field_code); case ConstEntryType: return new GetData::ConstEntry(this, field_code); case CarrayEntryType: return new GetData::CarrayEntry(this, field_code); case StringEntryType: return new GetData::StringEntry(this, field_code); case IndexEntryType: return new GetData::IndexEntry(this, field_code); case WindowEntryType: return new GetData::WindowEntry(this, field_code); case MplexEntryType: return new GetData::MplexEntry(this, field_code); case NoEntryType: break; } return NULL; } int Dirfile::Flush(const char* field_code) const { return gd_flush(D, field_code); } int Dirfile::MetaFlush() const { return gd_metaflush(D); } int Dirfile::Error() const { return gd_error(D); } int Dirfile::ErrorCount() const { return gd_error_count(D); } const char *Dirfile::ErrorString(size_t __gd_unused n) { return ErrorString(); } const char *Dirfile::ErrorString() { if (error_string) free(error_string); error_string = gd_error_string(D, NULL, 0); return error_string; } int Dirfile::Include(const char* file, int format_file, unsigned long flags) const { return gd_include(D, file, format_file, flags); } unsigned int Dirfile::SamplesPerFrame(const char* field_code) const { return gd_spf(D, field_code); } unsigned int Dirfile::NFields() const { return gd_nfields(D); } unsigned int Dirfile::NFieldsByType(EntryType type) const { return gd_nfields_by_type(D, (gd_entype_t)type); } const char** Dirfile::FieldListByType(EntryType type) const { return gd_field_list_by_type(D, (gd_entype_t)type); } unsigned int Dirfile::NMFields(const char *parent) const { return gd_nmfields(D, parent); } unsigned int Dirfile::NMFieldsByType(const char *parent, EntryType type) const { return gd_nmfields_by_type(D, parent, (gd_entype_t)type); } const char** Dirfile::MFieldListByType(const char *parent, EntryType type) const { return gd_mfield_list_by_type(D, parent, (gd_entype_t)type); } const gd_carray_t *Dirfile::Carrays(DataType type) const { return gd_carrays(D, (gd_type_t)type); } size_t Dirfile::ArrayLen(const char *field_code) const { return gd_array_len(D, field_code); } size_t Dirfile::CarrayLen(const char *field_code) const { return ArrayLen(field_code); } const void *Dirfile::Constants(DataType type) const { return gd_constants(D, (gd_type_t)type); } const char **Dirfile::Strings() const { return gd_strings(D); } const gd_carray_t *Dirfile::MCarrays(const char *parent, DataType type) const { return gd_mcarrays(D, parent, (gd_type_t)type); } const void *Dirfile::MConstants(const char *parent, DataType type) const { return gd_mconstants(D, parent, (gd_type_t)type); } const char **Dirfile::MStrings(const char *parent) const { return gd_mstrings(D, parent); } const char** Dirfile::FieldList() const { return gd_field_list(D); } const char** Dirfile::MFieldList(const char *parent) const { return gd_mfield_list(D, parent); } unsigned int Dirfile::NVectors() const { return gd_nvectors(D); } const char** Dirfile::VectorList() const { return gd_vector_list(D); } unsigned int Dirfile::NMVectors(const char *parent) const { return gd_nmvectors(D, parent); } const char** Dirfile::MVectorList(const char *parent) const { return gd_mvector_list(D, parent); } gd_off64_t Dirfile::NFrames() const { return gd_nframes64(D); } gd_off64_t Dirfile::EoF(const char *field_code) const { return gd_eof64(D, field_code); } gd_off64_t Dirfile::BoF(const char *field_code) const { return gd_bof64(D, field_code); } int Dirfile::GetCarray(const char *field_code, DataType type, void *data_out, unsigned int start, size_t len) const { if (len == 0) return gd_get_carray(D, field_code, (gd_type_t)type, data_out); else return gd_get_carray_slice(D, field_code, start, len, (gd_type_t)type, data_out); } int Dirfile::GetConstant(const char *field_code, DataType type, void *data_out) const { return gd_get_constant(D, field_code, (gd_type_t)type, data_out); } size_t Dirfile::GetData(const char* field_code, gd_off64_t first_frame, gd_off64_t first_sample, size_t num_frames, size_t num_samples, DataType type, void* data_out) const { return gd_getdata64(D, field_code, first_frame, first_sample, num_frames, num_samples, (gd_type_t)type, data_out); } size_t Dirfile::GetString(const char *field_code, size_t len, char* data_out) const { return gd_get_string(D, field_code, len, data_out); } int Dirfile::PutCarray(const char *field_code, DataType type, const void *data_in, unsigned int start, size_t len) const { if (len == 0) return gd_put_carray(D, field_code, (gd_type_t)type, data_in); else return gd_put_carray_slice(D, field_code, start, len, (gd_type_t)type, data_in); } int Dirfile::PutConstant(const char *field_code, DataType type, const void *data_in) const { return gd_put_constant(D, field_code, (gd_type_t)type, data_in); } size_t Dirfile::PutData(const char* field_code, gd_off64_t first_frame, gd_off64_t first_sample, size_t num_frames, size_t num_samples, DataType type, const void* data_in) const { return gd_putdata64(D, field_code, first_frame, first_sample, num_frames, num_samples, (gd_type_t)type, data_in); } size_t Dirfile::PutString(const char *field_code, const char* data_in) const { return gd_put_string(D, field_code, data_in); } GetData::Fragment* Dirfile::Fragment(int index) const { if (index < 0 || index >= gd_nfragments(D)) return NULL; return new GetData::Fragment(this, index); } int Dirfile::NFragments() const { return gd_nfragments(D); } const char* Dirfile::ReferenceFilename() { const char* ref = gd_reference(D, NULL); if (ref == NULL) return NULL; free(reference_name); reference_name = gd_raw_filename(D, ref); return reference_name; } int Dirfile::Discard() { int ret = gd_discard(D); if (!ret) D = gd_invalid_dirfile(); return ret; } int Dirfile::Close() { int ret = gd_close(D); if (!ret) D = gd_invalid_dirfile(); return ret; } void Dirfile::SetCallback(gd_parser_callback_t sehandler, void* extra) const { gd_parser_callback(D, sehandler, extra); } RawEntry* Dirfile::Reference(const char* field_code) const { const char* ref = gd_reference(D, field_code); if (ref == NULL) return NULL; return new RawEntry(this, ref); } int Dirfile::AlterSpec(const char *line, int recode) const { return gd_alter_spec(D, line, recode); } int Dirfile::MAlterSpec(const char* line, const char *parent, int recode) const { return gd_malter_spec(D, line, parent, recode); } int Dirfile::Delete(const char* field_code, unsigned flags) const { return gd_delete(D, field_code, flags); } int Dirfile::UnInclude(int fragment_index, int del) const { return gd_uninclude(D, fragment_index, del); } DataType Dirfile::NativeType(const char* field_code) const { return (DataType)gd_native_type(D, field_code); } int Dirfile::Validate(const char* field_code) const { return gd_validate(D, field_code); } double Dirfile::FrameNum(const char* field_code, double value, gd_off64_t frame_start, gd_off64_t frame_end) const { return gd_framenum_subset64(D, field_code, value, frame_start, frame_end); } int Dirfile::FragmentIndex(const char* field_code) const { return gd_fragment_index(D, field_code); } const char* Dirfile::Name() const { return gd_dirfilename(D); } int Dirfile::Standards(int version) const { return gd_dirfile_standards(D, version); } gd_off64_t Dirfile::Seek(const char* field_code, gd_off64_t frame_num, gd_off64_t sample_num, int flags) const { return gd_seek64(D, field_code, frame_num, sample_num, flags); } gd_off64_t Dirfile::Tell(const char* field_code) const { return gd_tell64(D, field_code); } int Dirfile::AddAlias(const char* field_code, const char* target, int fragment_index) const { return gd_add_alias(D, field_code, target, fragment_index); } const char** Dirfile::Aliases(const char* field_code) const { return gd_aliases(D, field_code); } const char* Dirfile::AliasTarget(const char* field_code) const { return gd_alias_target(D, field_code); } int Dirfile::Hide(const char* field_code) const { return gd_hide(D, field_code); } int Dirfile::Hidden(const char* field_code) const { return gd_hidden(D, field_code); } int Dirfile::IncludeAffix(const char *file, int fragment_index, const char* prefix, const char* suffix, unsigned long flags) const { return gd_include_affix(D, file, fragment_index, prefix, suffix, flags); } int Dirfile::MAddAlias(const char* parent, const char* name, const char* target) const { return gd_madd_alias(D, parent, name, target); } int Dirfile::NAliases(const char* field_code) const { return gd_naliases(D, field_code); } int Dirfile::Sync(const char* field_code) const { return gd_sync(D, field_code); } int Dirfile::RawClose(const char* field_code) const { return gd_raw_close(D, field_code); } int Dirfile::UnHide(const char* field_code) const { return gd_unhide(D, field_code); } char *Dirfile::StrTok(const char *string) { return gd_strtok(D, string); } int Dirfile::DeSync(unsigned int flags) { int desync = gd_desync(D, flags); if (desync && flags & GD_DESYNC_REOPEN) { free(error_string); free(reference_name); error_string = NULL; reference_name = NULL; } return desync; } unsigned long Dirfile::Flags(unsigned long set, unsigned long reset) { return gd_flags(D, set, reset); } int Dirfile::VerbosePrefix(const char *prefix) const { return gd_verbose_prefix(D, prefix); } void Dirfile::MplexLookback(int lookback) const { gd_mplex_lookback(D, lookback); } unsigned int Dirfile::NEntries(const char *parent, int type, unsigned int flags) const { return gd_nentries(D, parent, type, flags); } const char** Dirfile::EntryList(const char *parent, int type, unsigned int flags) const { return gd_entry_list(D, parent, type, flags); } char* Dirfile::LinterpTableName(const char *field_code) { return gd_linterp_tablename(D, field_code); } libgetdata-0.9.0/bindings/cxx/stringentry.cpp0000640000175000017500000000214612614323564021502 0ustar alastairalastair// Copyright (C) 2008, 2009, 2011 D. V. Wiebe // /////////////////////////////////////////////////////////////////////////// // // This file is part of the GetData project. // // GetData 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. // // GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., // 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // #include "internal.h" using namespace GetData; StringEntry::StringEntry(const char* field_code, int fragment_index) { E.field = strdup(field_code); E.field_type = GD_STRING_ENTRY; E.fragment_index = fragment_index; } libgetdata-0.9.0/bindings/Makefile.am0000640000175000017500000000326512614323564017643 0ustar alastairalastair# Copyright (C) 2008-2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign BUILDCC=@BUILDCC@ if MAKE_CXXBINDINGS CXX_SUBDIR=cxx endif if MAKE_F77BINDINGS F77_SUBDIR=f77 endif if MAKE_IDLBINDINGS IDL_SUBDIR=idl endif if MAKE_MATLABBINDINGS MATLAB_SUBDIR=matlab endif if MAKE_PYBINDINGS PY_SUBDIR=python endif if MAKE_PERLBINDINGS PERL_SUBDIR=perl endif if MAKE_PHPBINDINGS PHP_SUBDIR=php endif noinst_PROGRAMS=make_parameters make_parameters_SOURCES = make_parameters.c nodist_make_parameters_SOURCES = ../src/getdata.h ../src/gd_config.h SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${IDL_SUBDIR} ${PY_SUBDIR} \ ${PERL_SUBDIR} ${MATLAB_SUBDIR} ${PHP_SUBDIR} make_parameters$(EXEEXT): $(make_parameters_SOURCES) \ $(nodist_make_parameters_SOURCES) ${BUILDCC} $(DEFS) -I../src -o make_parameters$(EXEEXT) \ $(srcdir)/$(make_parameters_SOURCES) clean-local: rm -rf *~ libgetdata-0.9.0/bindings/f77/0000740000175000017500000000000012614323564016202 5ustar alastairalastairlibgetdata-0.9.0/bindings/f77/Makefile.in0000640000175000017500000010273712614323564020263 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/f77 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libf95getdata_la_DEPENDENCIES = libfgetdata.la nodist_libf95getdata_la_OBJECTS = getdata.lo libf95getdata_la_OBJECTS = $(nodist_libf95getdata_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 = libf95getdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=FC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(FCLD) \ $(AM_FCFLAGS) $(FCFLAGS) $(libf95getdata_la_LDFLAGS) \ $(LDFLAGS) -o $@ @MAKE_F95BINDINGS_TRUE@am_libf95getdata_la_rpath = -rpath $(libdir) libfgetdata_la_DEPENDENCIES = ../../src/libgetdata.la am_libfgetdata_la_OBJECTS = libfgetdata_la-fgetdata.lo libfgetdata_la_OBJECTS = $(am_libfgetdata_la_OBJECTS) libfgetdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libfgetdata_la_LDFLAGS) $(LDFLAGS) -o \ $@ 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)/src 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 = FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) AM_V_FC = $(am__v_FC_@AM_V@) am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) am__v_FC_0 = @echo " FC " $@; am__v_FC_1 = FCLD = $(FC) FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_FCLD = $(am__v_FCLD_@AM_V@) am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) am__v_FCLD_0 = @echo " FCLD " $@; am__v_FCLD_1 = SOURCES = $(nodist_libf95getdata_la_SOURCES) $(libfgetdata_la_SOURCES) DIST_SOURCES = $(libfgetdata_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 HEADERS = $(nodist_include_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ $(GD_FC_WALL) $(GD_FC_WEXTRA) FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign @MAKE_F95BINDINGS_TRUE@F95_INC = getdata.mod @MAKE_F95BINDINGS_TRUE@F95_LIB = libf95getdata.la EXTRA_DIST = getdata.f.in getdata.f90.in SUBDIRS = test BUILT_SOURCES = getdata.f $(F95_INC) nodist_include_HEADERS = getdata.f $(F95_INC) lib_LTLIBRARIES = libfgetdata.la $(F95_LIB) libfgetdata_la_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src libfgetdata_la_SOURCES = fgetdata.c fgetdata.h libfgetdata_la_LIBADD = ../../src/libgetdata.la libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@ nodist_libf95getdata_la_SOURCES = getdata.f90 libf95getdata_la_LIBADD = libfgetdata.la libf95getdata_la_LDFLAGS = -version-info @F95GETDATA_VERSION@ all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .f90 .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 bindings/f77/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/f77/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-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}; \ } libf95getdata.la: $(libf95getdata_la_OBJECTS) $(libf95getdata_la_DEPENDENCIES) $(EXTRA_libf95getdata_la_DEPENDENCIES) $(AM_V_FCLD)$(libf95getdata_la_LINK) $(am_libf95getdata_la_rpath) $(libf95getdata_la_OBJECTS) $(libf95getdata_la_LIBADD) $(LIBS) libfgetdata.la: $(libfgetdata_la_OBJECTS) $(libfgetdata_la_DEPENDENCIES) $(EXTRA_libfgetdata_la_DEPENDENCIES) $(AM_V_CCLD)$(libfgetdata_la_LINK) -rpath $(libdir) $(libfgetdata_la_OBJECTS) $(libfgetdata_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfgetdata_la-fgetdata.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 -o $@ $< .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 -o $@ `$(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 $@ $< libfgetdata_la-fgetdata.lo: fgetdata.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfgetdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libfgetdata_la-fgetdata.lo -MD -MP -MF $(DEPDIR)/libfgetdata_la-fgetdata.Tpo -c -o libfgetdata_la-fgetdata.lo `test -f 'fgetdata.c' || echo '$(srcdir)/'`fgetdata.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libfgetdata_la-fgetdata.Tpo $(DEPDIR)/libfgetdata_la-fgetdata.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fgetdata.c' object='libfgetdata_la-fgetdata.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libfgetdata_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libfgetdata_la-fgetdata.lo `test -f 'fgetdata.c' || echo '$(srcdir)/'`fgetdata.c .f90.o: $(AM_V_FC)$(FCCOMPILE) -c -o $@ $< .f90.obj: $(AM_V_FC)$(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .f90.lo: $(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nodist_includeHEADERS: $(nodist_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_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-nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_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) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ 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-nodist_includeHEADERS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES 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: uninstall-libLTLIBRARIES uninstall-nodist_includeHEADERS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local cscopelist-am ctags ctags-am \ 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-libLTLIBRARIES install-man \ install-nodist_includeHEADERS 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-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-nodist_includeHEADERS getdata.mod: getdata.o clean-local: rm -rf getdata.mod make_parameters.sed.in make_parameters.stamp \ make_parameters.sed getdata.f getdata.f90 getdata.mod rm -rf *~ make_parameters.sed.in: ../make_parameters ../../src/getdata.h ../make_parameters f > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters make_parameters.sed: make_parameters.stamp @if test ! -f $@; then \ rm -f make_parameters.stamp; \ $(MAKE) make_parameters.stamp; \ fi @HAVE_DIFF_TRUE@make_parameters.stamp: make_parameters.sed.in @HAVE_DIFF_TRUE@ @if $(DIFF) make_parameters.sed make_parameters.sed.in >/dev/null 2>&1; then \ @HAVE_DIFF_TRUE@ echo "make_parameters.sed is unchanged"; \ @HAVE_DIFF_TRUE@ else \ @HAVE_DIFF_TRUE@ rm -f make_parameters.sed; \ @HAVE_DIFF_TRUE@ cp make_parameters.sed.in make_parameters.sed; \ @HAVE_DIFF_TRUE@ fi; \ @HAVE_DIFF_TRUE@ touch make_parameters.stamp @HAVE_DIFF_FALSE@make_parameters.stamp: make_parameters.sed.in @HAVE_DIFF_FALSE@ @rm -f make_parameters.sed; \ @HAVE_DIFF_FALSE@ cp make_parameters.sed.in make_parameters.sed; \ @HAVE_DIFF_FALSE@ touch make_parameters.stamp getdata.f: $(srcdir)/getdata.f.in make_parameters.sed rm -f $@ $(SED) -f make_parameters.sed $(srcdir)/getdata.f.in > $@ chmod a-w $@ getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed rm -f $@ $(SED) -f make_parameters.sed $(srcdir)/getdata.f90.in > $@ chmod a-w $@ # 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: libgetdata-0.9.0/bindings/f77/getdata.f.in0000640000175000017500000003400512614323564020373 0ustar alastairalastairC Copyright (C) 2008-2014 D. V. Wiebe C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C This file is part of the GetData project. C C GetData is free software; you can redistribute it and/or modify it under C the terms of the GNU Lesser General Public License as published by the C Free Software Foundation; either version 2.1 of the License, or (at your C option) any later version. C C GetData is distributed in the hope that it will be useful, but WITHOUT C ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or C FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public C License for more details. C C You should have received a copy of the GNU Lesser General Public License C along with GetData; if not, write to the Free Software Foundation, Inc., C 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA C C Fortran 77 parameters for GetData. This file defines handy C constants useful to Fortran programs. @PARAMETERS@ C Externals C Corresponding to gd_alter_affixes(3) EXTERNAL GDAAFX C Corresponding to gd_add_alias(3) EXTERNAL GDADAL C Corresponding to gd_add_bit(3) EXTERNAL GDADBT C Corresponding to gd_add_carray(3) EXTERNAL GDADCA C Corresponding to gd_add_clincom(3) EXTERNAL GDADCL C Corresponding to gd_add_const(3) EXTERNAL GDADCO C Corresponding to gd_add_cpolynom(3) EXTERNAL GDADCP C Corresponding to gd_add_crecip(3) EXTERNAL GDADCR C Corresponding to gd_add_divide(3) EXTERNAL GDADDV C Corresponding to gd_add_lincom(3) EXTERNAL GDADLC C Corresponding to gd_add_linterp(3) EXTERNAL GDADLT C Corresponding to gd_add_multiply(3) EXTERNAL GDADMT C Corresponding to gd_add_mplex(3) EXTERNAL GDADMX C Corresponding to gd_add_phase(3) EXTERNAL GDADPH C Corresponding to gd_add_polynom(3) EXTERNAL GDADPN C Corresponding to gd_add_recip(3) EXTERNAL GDADRC C Corresponding to gd_add_raw(3) EXTERNAL GDADRW C Corresponding to gd_add_sbit(3) EXTERNAL GDADSB C Corresponding to gd_add_spec(3) EXTERNAL GDADSP C Corresponding to gd_add_string(3) EXTERNAL GDADST C Corresponding to gd_add_window(3) EXTERNAL GDADWD C Correpsonding to gd_alter_encoding(3) EXTERNAL GDAENC C Correpsonding to gd_alter_endianness(3) EXTERNAL GDAEND C Correpsonding to gd_alter_frameoffset(3) EXTERNAL GDAFOF C Correpsonding to gd_alter_bit(3) EXTERNAL GDALBT C Correpsonding to gd_alter_carray(3) EXTERNAL GDALCA C Correpsonding to gd_alter_clincom(3) EXTERNAL GDALCL C Correpsonding to gd_alter_const(3) EXTERNAL GDALCO C Correpsonding to gd_alter_cpolynom(3) EXTERNAL GDALCP C Correpsonding to gd_alter_crecip(3) EXTERNAL GDALCR C Correpsonding to gd_alter_divide(3) EXTERNAL GDALDV C Correpsonding to gd_alter_lincom(3) EXTERNAL GDALLC C Correpsonding to gd_alter_linterp(3) EXTERNAL GDALLT C Correpsonding to gd_alter_multiply(3) EXTERNAL GDALMT C Corresponding to gd_alter_mplex(3) EXTERNAL GDALMX C Correpsonding to gd_alter_phase(3) EXTERNAL GDALPH C Correpsonding to gd_alter_polynom(3) EXTERNAL GDALPN C Correpsonding to gd_alter_recip(3) EXTERNAL GDALRC C Correpsonding to gd_alter_raw(3) EXTERNAL GDALRW C Correpsonding to gd_alter_sbit(3) EXTERNAL GDALSB C Correpsonding to gd_alter_spec(3) EXTERNAL GDALSP C Correpsonding to gd_aliases(3) EXTERNAL GDALSS C Returns the maximum alias length EXTERNAL GDALSX C Corresponding to gd_alter_window(3) EXTERNAL GDALWD C Corresponding to gd_alter_protection(3) EXTERNAL GDAPRT C Corresponding to gd_array_len(3) EXTERNAL GDARLN C Alter a scalar parameter EXTERNAL GDASCA C Corresponding to gd_add(3) for BIT fields EXTERNAL GDASBT C Corresponding to gd_add(3) for complex-valued LINCOM fields EXTERNAL GDASCL C Corresponding to gd_add(3) for complex-valued POLYNOM fields EXTERNAL GDASCP C Corresponding to gd_add(3) for complex-valued RECIP fields EXTERNAL GDASCR C Corresponding to gd_add(3) for LINCOM fields EXTERNAL GDASLC C Corresponding to gd_add(3) for MPLEX fields EXTERNAL GDASMX C Corresponding to gd_add(3) for PHASE fields EXTERNAL GDASPH C Corresponding to gd_add(3) for POLYNOM fields EXTERNAL GDASPN C Corresponding to gd_add(3) for RECIP fields EXTERNAL GDASRC C Corresponding to gd_add(3) for RAW fields EXTERNAL GDASRW C Corresponding to gd_add(3) for SBIT fields EXTERNAL GDASSB C Corresponding to gd_add(3) for WINDOW fields EXTERNAL GDASWD C Corresponding to gd_alias_target(3) EXTERNAL GDATRG C The following function is deprecated! use GDARLN instead EXTERNAL GDCALN C Corresponding to gd_parser_callback(3) EXTERNAL GDCLBK C Corresponding to gd_close(3) EXTERNAL GDCLOS C Corresponding to gd_constants(3) (sort of) EXTERNAL GDCONS C Corresponding to gd_copen(3) EXTERNAL GDCOPN C Correpsonding to gd_delete(3) EXTERNAL GDDELE C Corresponding to gd_discard(3) EXTERNAL GDDSCD C Corresponding to gd_desync(3) EXTERNAL GDDSYN C Corresponding to gd_error_count(3) EXTERNAL GDECNT C Corresponding to gd_encoding_support(3) EXTERNAL GDENCS C Returns entry flags EXTERNAL GDENFL C Corresponding to gd_entry_list(3) (sort of) EXTERNAL GDENTN C Returns the maximum entry name length EXTERNAL GDENTX C Corresponding to gd_entry_type(3) EXTERNAL GDENTY C Corresponding to gd_error(3) EXTERNAL GDEROR C Corresponding to gd_error_string(3) EXTERNAL GDESTR C Corresponding to gd_field_list_by_type(3) (sort of) EXTERNAL GDFDNT C Returns the maximum field name length EXTERNAL GDFDNX C Corresponding to gd_flags(3) EXTERNAL GDFLAG C Corresponding to gd_field_list(3) (sort of) EXTERNAL GDFLDN C Corresponding to gd_flush(3) EXTERNAL GDFLSH C Corresponding to gd_framenum_subset(3) EXTERNAL GDFNSS C Corresponding to gd_framenum(3) EXTERNAL GDFNUM C Corresponding to gd_fragment_affixes(3) EXTERNAL GDFRAF C Corresponding to gd_fragment_index(3) EXTERNAL GDFRGI C Corresponding to gd_fragmentname(3) EXTERNAL GDFRGN C Corresponding to gd_bof(3) EXTERNAL GDGBOF C Corresponding to gd_get_carray_slice(3) EXTERNAL GDGCAS C Corresponding to gd_entry(3) for BIT fields EXTERNAL GDGEBT C Corresponding to gd_entry(3) for CARRAY fields EXTERNAL GDGECA C Corresponding to gd_entry(3) for complex-valued LINCOM fields EXTERNAL GDGECL C Corresponding to gd_entry(3) for CONST fields EXTERNAL GDGECO C Corresponding to gd_entry(3) for complex-valued POLYNOM fields EXTERNAL GDGECP C Corresponding to gd_entry(3) for complex-valued RECIP fields EXTERNAL GDGECR C Corresponding to gd_entry(3) for LINCOM fields EXTERNAL GDGELC C Corresponding to gd_entry(3) for LINTERP fields EXTERNAL GDGELT C Corresponding to gd_entry(3) for MULTIPLY fields EXTERNAL GDGEMT C Corresponding to gd_encoding(3) EXTERNAL GDGENC C Corresponding to gd_endianness(3) EXTERNAL GDGEND C Corresponding to gd_eof(3) EXTERNAL GDGEOF C Corresponding to gd_entry(3) for PHASE fields EXTERNAL GDGEPH C Corresponding to gd_entry(3) for POLYNOM fields EXTERNAL GDGEPN C Corresponding to gd_entry(3) for RECIP fields EXTERNAL GDGERC C Corresponding to gd_entry(3) for RAW fields EXTERNAL GDGERW C Corresponding to gd_entry(3) for SBIT fields EXTERNAL GDGESB C Corresponding to gd_getdata(3) EXTERNAL GDGETD C Corresponding to gd_entry(3) for WINDOW fields EXTERNAL GDGEWD C Correpsonding to gd_frameoffset(3) EXTERNAL GDGFOF C Corresponding to gd_protection(3) EXTERNAL GDGPRT C Retrieve a scalar parameter EXTERNAL GDGSCA C Corresponding to gd_spf(3) EXTERNAL GDGSPF C Corresponding to gd_get_carray(3) EXTERNAL GDGTCA C Corresponding to gd_get_constant(3) EXTERNAL GDGTCO C Corresponding to gd_get_string(3) EXTERNAL GDGTST C Corresponding to gd_hide(3) EXTERNAL GDHIDE C Corresponding to gd_hidden(3) EXTERNAL GDHIDN C Corresponding to gd_include_affixes(3) EXTERNAL GDINCA C Corresponding to gd_include(3) EXTERNAL GDINCL C Corresponding to gd_invalid_dirfile(3) EXTERNAL GDINVD C Corresponding to gd_alter_entry(3) for BIT fields EXTERNAL GDLSBT C Corresponding to gd_alter_entry(3) for complex-valued LINCOM fields EXTERNAL GDLSCL C Corresponding to gd_alter_entry(3) for complex-valued POLYNOM fields EXTERNAL GDLSCP C Corresponding to gd_alter_entry(3) for complex-valued RECIP fields EXTERNAL GDLSCR C Corresponding to gd_alter_entry(3) for LINCOM fields EXTERNAL GDLSLC C Corresponding to gd_alter_entry(3) for MPLEX fields EXTERNAL GDLSMX C Corresponding to gd_alter_entry(3) for PHASE fields EXTERNAL GDLSPH C Corresponding to gd_alter_entry(3) for POLYNOM fields EXTERNAL GDLSPN C Corresponding to gd_alter_entry(3) for RECIP fields EXTERNAL GDLSRC C Corresponding to gd_alter_entry(3) for RAW fields EXTERNAL GDLSRW C Corresponding to gd_alter_entry(3) for SBIT fields EXTERNAL GDLSSB C Corresponding to gd_alter_entry(3) for WINDOW fields EXTERNAL GDLSWD C Corresponding to gd_linterp_tablename(3) EXTERNAL GDLTTN C Corresponding to gd_mconstants(3) (sort of) EXTERNAL GDMCOS C Corresponding to gd_madd_alias(3) EXTERNAL GDMDAL C Corresponding to gd_madd_bit(3) EXTERNAL GDMDBT C Corresponding to gd_madd_carray(3) EXTERNAL GDMDCA C Corresponding to gd_madd_clincom(3) EXTERNAL GDMDCL C Corresponding to gd_madd_const(3) EXTERNAL GDMDCO C Corresponding to gd_madd_cpolynom(3) EXTERNAL GDMDCP C Corresponding to gd_madd_crecip(3) EXTERNAL GDMDCR C Corresponding to gd_madd_divide(3) EXTERNAL GDMDDV C Corresponding to gd_madd_lincom(3) EXTERNAL GDMDLC C Corresponding to gd_madd_linterp(3) EXTERNAL GDMDLT C Corresponding to gd_madd_multiply(3) EXTERNAL GDMDMT C Corresponding to gd_madd_mplex(3) EXTERNAL GDMDMX C Corresponding to gd_madd_phase(3) EXTERNAL GDMDPH C Corresponding to gd_madd_polynom(3) EXTERNAL GDMDPN C Corresponding to gd_madd_recip(3) EXTERNAL GDMDRC C Corresponding to gd_madd_sbit(3) EXTERNAL GDMDSB C Corresponding to gd_madd_spec(3) EXTERNAL GDMDSP C Corresponding to gd_madd_string(3) EXTERNAL GDMDST C Corresponding to gd_madd_window(3) EXTERNAL GDMDWD C Corresponding to gd_mfield_list(3) (sort of) EXTERNAL GDMFDN C Corresponding to gd_mfield_list_by_type(3) (sort of) EXTERNAL GDMFDT C Corresponding to gd_metaflush(3) EXTERNAL GDMFLS C Returns the maximum field name length for a meta field list EXTERNAL GDMFNX C Correpsonding to gd_malter_spec(3) EXTERNAL GDMLSP C Correpsonding to gd_move(3) EXTERNAL GDMOVE C Corresponding to gd_mstrings(3) (sort of) EXTERNAL GDMSTS C Returns the maximum length of the longest string metafield for a C field EXTERNAL GDMSTX C Corresponding to gd_mvector_list(3) (sort of) EXTERNAL GDMVEN C Corresponding to gd_mplex_lookback(3) EXTERNAL GDMXLB C Corresponding to gd_naliases(3) EXTERNAL GDNALS C Corresponding to gd_dirfilename(3) EXTERNAL GDNAME C Corresponding to gd_nentries(3) EXTERNAL GDNENT C Corresponding to gd_nfields_by_type(3) EXTERNAL GDNFDT C Corresponding to gd_nfields(3) EXTERNAL GDNFLD C Corresponding to gd_nfragments(3) EXTERNAL GDNFRG C Corresponding to gd_nframes(3) EXTERNAL GDNFRM C Corresponding to gd_nmfields(3) EXTERNAL GDNMFD C Corresponding to gd_nmfields_by_type(3) EXTERNAL GDNMFT C Corresponding to gd_nmvectors(3) EXTERNAL GDNMVE C Deregister a callback function (ie. gd_parser_callback(..., NULL)) EXTERNAL GDNOCB C Corresponding to gd_native_type(3) EXTERNAL GDNTYP C Corresponding to gd_nvectors(3) EXTERNAL GDNVEC C Corresponding to gd_open(3) EXTERNAL GDOPEN C Corresponding to gd_put_carray_slice(3) EXTERNAL GDPCAS C Corresponding to gd_parent_fragment(3) EXTERNAL GDPFRG C Corresponding to gd_put_carray(3) EXTERNAL GDPTCA C Corresponding to gd_put_constant(3) EXTERNAL GDPTCO C Corresponding to gd_put_string(3) EXTERNAL GDPTST C Corresponding to gd_putdata(3) EXTERNAL GDPUTD C Corresponding to gd_raw_close(3) EXTERNAL GDRCLO C Corresponding to gd_reference(3) EXTERNAL GDREFE C Correpsonding to gd_rename(3) EXTERNAL GDRENM C Corresponding to gd_rewrite_fragment(3) EXTERNAL GDRFRG C Corresponding to gd_raw_filename(3) EXTERNAL GDRWFN C Corresponding to gd_seek(3) EXTERNAL GDSEEK C Corresponding to gd_dirfile_standards(3) EXTERNAL GDSTDV C Corresponding to gd_strings(3) (sort of) EXTERNAL GDSTRS C Returns the length of the longest string field EXTERNAL GDSTRX C Corresponding to gd_sync(3) EXTERNAL GDSYNC C Corresponding to gd_tell(3) EXTERNAL GDTELL C Corresponding to gd_strtok(3) EXTERNAL GDTOKE C Corresponding to gd_unhide(3) EXTERNAL GDUHID C Corresponding to gd_uninclude(3) EXTERNAL GDUINC C Corresponding to gd_verbose_prefix(3) EXTERNAL GDVBPX C Corresponding to gd_vector_list(3) (sort of) EXTERNAL GDVECN C Corresponding to gd_validate(3) EXTERNAL GDVLDT libgetdata-0.9.0/bindings/f77/fgetdata.c0000640000175000017500000047337212614323564020147 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * ************************************************************************* * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "fgetdata.h" #include #include #include /* convert scalar_ind from C to FORTRAN */ #define GDF_SCIND_C2F(out,in) do { \ (out) = (in); if ((out) >= 0) (out)++; \ } while (0) /* convert scalar ind from FORTRAN to C */ #define GDF_SCIND_F2C(out,in) do { \ (out) = (in); if ((out) > 0) (out)--; \ } while (0) /* Fortran 77 has no facility to take a pointer to a DIRFILE* object. * Instead, we keep a list of them here. If we ever run out of these, * the caller will be abort()ed. */ static DIRFILE* f77dirfiles[GDF_N_DIRFILES]; static int f77dirfiles_initialised = 0; /* casting data pointers to function pointers is prohibited in C. This * container is used to get around that */ static struct _GDF_callback_container { _GDF_callback_t func; } f77callbacks[GDF_N_DIRFILES]; /* initialise the f77dirfiles array */ static void _GDF_InitDirfiles(void) { int i; dtracevoid(); for (i = 1; i < GDF_N_DIRFILES; ++i) f77dirfiles[i] = NULL; /* we keep entry zero as a generic, invalid dirfile to return if * dirfile lookup fails */ f77dirfiles[0] = gd_invalid_dirfile(); f77dirfiles_initialised = 1; dreturnvoid(); } /* make a C string */ static char *_GDF_CString(char **out, const char *in, int l) { int i; dtrace("%p, %p, %i", out, in, l); if (l < 0) { *out = NULL; dreturn("%p", NULL); return NULL; } *out = (char*)malloc(l + 1); for (i = 0; i < l; ++i) (*out)[i] = in[i]; (*out)[l] = '\0'; dreturn("\"%s\"", *out); return *out; } /* convert an int to a DIRFILE* */ static DIRFILE* _GDF_GetDirfile(int d) { dtrace("%i", d); if (!f77dirfiles_initialised) _GDF_InitDirfiles(); if (d < 0 || d >= GDF_N_DIRFILES || f77dirfiles[d] == NULL) { dreturn("%p [0]", f77dirfiles[0]); return f77dirfiles[0]; } dreturn("%p", f77dirfiles[d]); return f77dirfiles[d]; } /* convert a new DIRFILE* into an int */ static int _GDF_SetDirfile(DIRFILE* D, int close) { int i; dtrace("%p, %i", D, close); if (!f77dirfiles_initialised) _GDF_InitDirfiles(); for (i = 1; i < GDF_N_DIRFILES; ++i) if (f77dirfiles[i] == NULL) { f77dirfiles[i] = D; f77callbacks[i].func = NULL; dreturn("%i", i); return i; } /* out of f77dirfiles space: complain */ fputs("libfgetdata: DIRFILE space exhausted.", stderr); if (close) gd_discard(D); return -1; } /* delete the supplied dirfile */ static void _GDF_ClearDirfile(int d) { dtrace("%i", d); if (d != 0) f77dirfiles[d] = NULL; dreturnvoid(); } /* create a gd_triple_t value */ static gd_triplet_t _GDF_SetTriplet(gd_windop_t op, const void *data) { gd_triplet_t t; dtrace("%i, %p", op, data); switch(op) { case GD_WINDOP_EQ: case GD_WINDOP_NE: t.i = *(int32_t*)data; dreturn("%lli", (long long)t.i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: t.u = *(int32_t*)data; dreturn("%llu", (unsigned long long)t.u); break; default: t.r = *(double*)data; dreturn("%g", t.r); break; } return t; } /* create a Fortran space padded string */ static int _GDF_FString(char *dest, int32_t *dlen, const char *src) { int i, slen; dtrace("%p, %i, \"%s\"", dest, *dlen, src); if (src == NULL) { *dlen = 0; dreturn("%i", -1); return -1; } slen = strlen(src); if (slen <= *dlen) { for (i = 0; i < slen; ++i) dest[i] = src[i]; for (; i < *dlen; ++i) dest[i] = ' '; dreturn("%i", 0); return 0; } *dlen = slen; dreturn("%i", -1); return -1; } /* callback wrapper */ static int _GDF_Callback(gd_parser_data_t* pdata, void *f77_callback) { struct _GDF_callback_container *c = (struct _GDF_callback_container*)f77_callback; int unit; int r = GD_SYNTAX_ABORT; dtrace("%p, %p", pdata, f77_callback); if (c != NULL && c->func != NULL) { unit = _GDF_SetDirfile((DIRFILE*)pdata->dirfile, 0); if (unit < 0) { dreturn("%i", r); return r; } (c->func)(&r, &unit, &pdata->suberror, pdata->line, &pdata->linenum, pdata->filename); pdata->line[GD_MAX_LINE_LENGTH - 1] = '\0'; _GDF_ClearDirfile(unit); } dreturn("%i", r); return r; } /* gd_open wrapper */ void F77_FUNC(gdopen, GDOPEN) (int32_t *dirfile, const char *dirfilename, const int32_t *dirfilename_l, const int32_t *flags) { char *out; dtrace("%p, %p, %i, %i", dirfile, dirfilename, *dirfilename_l, *flags); *dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(&out, dirfilename, *dirfilename_l), *flags), 1); free(out); dreturn("%i", *dirfile); } /* gd_close wrapper */ void F77_FUNC(gdclos, GDCLOS) (const int32_t *dirfile) { dtrace("%i", *dirfile); if (*dirfile != 0) { gd_close(_GDF_GetDirfile(*dirfile)); _GDF_ClearDirfile(*dirfile); } dreturnvoid(); } /* gd_flush wrapper */ void F77_FUNC(gdflsh, GDFLSH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l); if (*field_code_l == 0) gd_flush(_GDF_GetDirfile(*dirfile), NULL); else { char *out; gd_flush(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l)); free(out); } dreturnvoid(); } /* gd_getdata wrapper */ void F77_FUNC(gdgetd, GDGETD) (int32_t *n_read, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *first_frame, const int32_t *first_sample, const int32_t *num_frames, const int32_t *num_samples, const int32_t *return_type, void *data_out) { char *out; dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%X, %p", n_read, *dirfile, field_code, *field_code_l, *first_frame, *first_sample, *num_frames, *num_samples, *return_type, data_out); *n_read = gd_getdata(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), *first_frame, *first_sample, *num_frames, *num_samples, (gd_type_t)*return_type, data_out); free(out); dreturn("%i", *n_read); } /* Return the maximum field name length */ void F77_FUNC(gdfdnx, GDFDNX) (int32_t *max, const int32_t *dirfile) { const char **fl; size_t len = 0; DIRFILE* D; unsigned int i, nfields; dtrace("%p, %i", max, *dirfile); D = _GDF_GetDirfile(*dirfile); nfields = gd_nfields(D); if (!gd_error(D)) { fl = gd_field_list(D); for (i = 0; i < nfields; ++i) if (strlen(fl[i]) > len) len = strlen(fl[i]); } *max = len; dreturn("%i", *max); } /* Return the maximum field name length for a meta list */ void F77_FUNC(gdmfnx, GDMFNX) (int32_t *max, const int32_t *dirfile, const char *parent, const int32_t *parent_l) { const char **fl; unsigned int i, nfields; size_t len = 0; DIRFILE* D = _GDF_GetDirfile(*dirfile); char *pa; dtrace("%p, %i, %p, %i", max, *dirfile, parent, *parent_l); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmfields(D, pa); if (!gd_error(D)) { fl = gd_mfield_list(D, pa); for (i = 0; i < nfields; ++i) if (strlen(fl[i]) > len) len = strlen(fl[i]); } *max = len; free(pa); dreturn("%i", *max); } /* gd_field_list wrapper -- this only returns one field name */ void F77_FUNC(gdfldn, GDFLDN) (char *name, int32_t *name_l, const int32_t *dirfile, const int32_t *field_num) { const char** fl; DIRFILE* D; unsigned int nfields; dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num); D = _GDF_GetDirfile(*dirfile); nfields = gd_nfields(D); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) { fl = gd_field_list(D); _GDF_FString(name, name_l, fl[*field_num - 1]); } else *name_l = 0; dreturn("%i", *name_l); } /* gd_mfield_list wrapper -- this only returns one field name */ void F77_FUNC(gdmfdn, GDMFDN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *field_num) { const char** fl; unsigned int nfields; DIRFILE* D = _GDF_GetDirfile(*dirfile); char *pa; dtrace("%p, %p, %i, %p, %i, %i", name, name_l, *dirfile, parent, *parent_l, *field_num); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmfields(D, pa); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) { fl = gd_mfield_list(D, pa); _GDF_FString(name, name_l, fl[*field_num - 1]); } else *name_l = 0; free(pa); dreturn("%i", *name_l); } /* gd_nfields wrapper */ void F77_FUNC(gdnfld, GDNFLD) (int32_t *nfields, const int32_t *dirfile) { *nfields = gd_nfields(_GDF_GetDirfile(*dirfile)); } /* gd_bof wrapper */ void F77_FUNC(gdgbof, GDGBOF) (int32_t *bof, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", bof, *dirfile, field_code, *field_code_l); *bof = gd_bof(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *bof); } /* gd_eof wrapper */ void F77_FUNC(gdgeof, GDGEOF) (int32_t *eof, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", eof, *dirfile, field_code, *field_code_l); *eof = gd_eof(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *eof); } /* gd_nframes wrapper */ void F77_FUNC(gdnfrm, GDNFRM) (int32_t *nframes, const int32_t *dirfile) { *nframes = gd_nframes(_GDF_GetDirfile(*dirfile)); } /* gd_spf wrapper */ void F77_FUNC(gdgspf, GDGSPF) (int32_t *spf, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; dtrace("%p, %i, %p, %i", spf, *dirfile, field_code, *field_code_l); *spf = gd_spf(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l)); free(out); dreturn("%i", *spf); } /* gd_putdata wrapper */ void F77_FUNC(gdputd, GDPUTD) (int32_t *n_wrote, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *first_frame, const int32_t *first_sample, const int32_t *num_frames, const int32_t *num_samples, const int32_t *data_type, const void *data_in) { char *out; dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%X, %p", n_wrote, *dirfile, field_code, *field_code_l, *first_frame, *first_sample, *num_frames, *num_samples, *data_type, data_in); *n_wrote = gd_putdata(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), *first_frame, *first_sample, *num_frames, *num_samples, (gd_type_t)*data_type, data_in); free(out); dreturn("%i", *n_wrote); } /* return the error number */ void F77_FUNC(gderor, GDEROR) (int32_t *error, const int32_t *dirfile) { dtrace("%p, %i", error, *dirfile); *error = gd_error(_GDF_GetDirfile(*dirfile)); dreturn("%i", *error); } /* gd_error_count wrapper */ void F77_FUNC(gdecnt, GDECNT) (int32_t *error_count, const int32_t *dirfile) { dtrace("%p, %i", error_count, *dirfile); *error_count = gd_error_count(_GDF_GetDirfile(*dirfile)); dreturn("%i", *error_count); } /* gd_error_string wrapper */ void F77_FUNC(gdestr, GDESTR) (const int32_t *dirfile, char *buffer, const int32_t *len) { int i; gd_error_string(_GDF_GetDirfile(*dirfile), buffer, *len); /* space pad */ for (i = 0; i < *len && buffer[i]; ++i) ; for (; i < *len; ++i) buffer[i] = ' '; } /* gd_entry_type wrapper */ void F77_FUNC(gdenty, GDENTY) (int32_t *type, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l); *type = (int)gd_entry_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *type); } /* gd_entry wrapper for RAW */ void F77_FUNC(gdgerw, GDGERW) (int32_t *spf, int32_t *dtype, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %p, %p, %i, %p, %i", spf, dtype, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_RAW_ENTRY) *spf = 0; else { *spf = E.EN(raw,spf); *dtype = E.EN(raw,data_type); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for LINCOM */ void F77_FUNC(gdgelc, GDGELC) (int32_t *nfields, char *infield1, int32_t *infield1_l, double *m1, double *b1, char *infield2, int32_t *infield2_l, double *m2, double *b2, char *infield3, int32_t *infield3_l, double *m3, double *b3, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i", nfields, infield1, infield1_l, m1, b1, infield2, infield2_l, m2, b2, infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_LINCOM_ENTRY) *nfields = 0; else { *nfields = E.EN(lincom,n_fields); *fragment_index = E.fragment_index; _GDF_FString(infield1, infield1_l, E.in_fields[0]); *m1 = E.EN(lincom,m)[0]; *b1 = E.EN(lincom,b)[0]; if (E.EN(lincom,n_fields) > 1) { _GDF_FString(infield2, infield2_l, E.in_fields[1]); *m2 = E.EN(lincom,m)[1]; *b2 = E.EN(lincom,b)[1]; } if (E.EN(lincom,n_fields) > 2) { _GDF_FString(infield3, infield3_l, E.in_fields[2]); *m3 = E.EN(lincom,m)[2]; *b3 = E.EN(lincom,b)[2]; } gd_free_entry_strings(&E); } free(out); dreturnvoid(); } void F77_FUNC(gdgecl, GDGECL) (int32_t *nfields, char *infield1, int32_t *infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1), char *infield2, int32_t *infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2), char *infield3, int32_t *infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3), int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; gd_entry_t E; dtrace("%p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i", nfields, infield1, infield1_l, m1, b1, infield2, infield2_l, m2, b2, infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E)) *nfields = 0; else if (E.field_type != GD_LINCOM_ENTRY) { *nfields = 0; gd_free_entry_strings(&E); } else { *nfields = E.EN(lincom,n_fields); *fragment_index = E.fragment_index; _GDF_FString(infield1, infield1_l, E.in_fields[0]); gd_cs2cp_(m1, E.EN(lincom,cm)[0]); gd_cs2cp_(b1, E.EN(lincom,cb)[0]); if (E.EN(lincom,n_fields) > 1) { _GDF_FString(infield2, infield2_l, E.in_fields[1]); gd_cs2cp_(m2, E.EN(lincom,cm)[1]); gd_cs2cp_(b2, E.EN(lincom,cb)[1]); } if (E.EN(lincom,n_fields) > 2) { _GDF_FString(infield3, infield3_l, E.in_fields[2]); gd_cs2cp_(m3, E.EN(lincom,cm)[2]); gd_cs2cp_(b3, E.EN(lincom,cb)[2]); } gd_free_entry_strings(&E); } free(fc); dreturnvoid(); } /* gd_entry wrapper for POLYNOM */ void F77_FUNC(gdgepn, GDGEPN) (int32_t *poly_ord, char *infield, int32_t *infield_l, double *a0, double *a1, double *a2, double *a3, double *a4, double *a5, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %p, %i, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i", poly_ord, infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY) *poly_ord = 0; else { *poly_ord = E.EN(polynom,poly_ord); *fragment_index = E.fragment_index; _GDF_FString(infield, infield_l, E.in_fields[0]); switch (E.EN(polynom,poly_ord)) { case 5: *a5 = E.EN(polynom,a)[5]; case 4: *a4 = E.EN(polynom,a)[4]; case 3: *a3 = E.EN(polynom,a)[3]; case 2: *a2 = E.EN(polynom,a)[2]; case 1: *a1 = E.EN(polynom,a)[1]; *a0 = E.EN(polynom,a)[0]; } gd_free_entry_strings(&E); } free(out); dreturnvoid(); } void F77_FUNC(gdgecp, GDGECP) (int32_t *poly_ord, char *infield, int32_t *infield_l, GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1), GD_DCOMPLEXP(a2), GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4), GD_DCOMPLEXP(a5), int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %p, %i, %p, %p, %p, %p, %p, %p, %p, %i, %p, %i", poly_ord, infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY) *poly_ord = 0; else { *poly_ord = E.EN(polynom,poly_ord); *fragment_index = E.fragment_index; _GDF_FString(infield, infield_l, E.in_fields[0]); switch (E.EN(polynom,poly_ord)) { case 5: gd_cs2cp_(a5, E.EN(polynom,ca)[5]); case 4: gd_cs2cp_(a4, E.EN(polynom,ca)[4]); case 3: gd_cs2cp_(a3, E.EN(polynom,ca)[3]); case 2: gd_cs2cp_(a2, E.EN(polynom,ca)[2]); case 1: gd_cs2cp_(a1, E.EN(polynom,ca)[1]); gd_cs2cp_(a0, E.EN(polynom,ca)[0]); } gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for LINTERP */ void F77_FUNC(gdgelt, GDGELT) (char *in_field, int32_t *in_field_l, char *table, int32_t *table_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field, *in_field_l, table, *table_l, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_LINTERP_ENTRY) *in_field_l = 0; else { _GDF_FString(table, table_l, E.EN(linterp,table)); _GDF_FString(in_field, in_field_l, E.in_fields[0]); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for BIT */ void F77_FUNC(gdgebt, GDGEBT) (char *in_field, int32_t *in_field_l, int32_t *bitnum, int32_t *numbits, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum, numbits, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_BIT_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); *bitnum = E.EN(bit,bitnum); *numbits = E.EN(bit,numbits); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for SBIT */ void F77_FUNC(gdgesb, GDGESB) (char *in_field, int32_t *in_field_l, int32_t *bitnum, int32_t *numbits, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum, numbits, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_SBIT_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); *bitnum = E.EN(bit,bitnum); *numbits = E.EN(bit,numbits); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } static void _GDF_GetEntryYoke(char *in_field1, int32_t *in_field1_l, char *in_field2, int32_t *in_field2_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, gd_entype_t type) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %i, %p, %i, %p, %i, 0x%X", in_field1, *in_field1_l, in_field2, *in_field2_l, fragment_index, *dirfile, field_code, *field_code_l, type); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != type) *in_field1_l = 0; else { _GDF_FString(in_field1, in_field1_l, E.in_fields[0]); _GDF_FString(in_field2, in_field2_l, E.in_fields[1]); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for MULTIPLY */ void F77_FUNC(gdgemt, GDGEMT) (char *in_field1, int32_t *in_field1_l, char *in_field2, int32_t *in_field2_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field1, *in_field1_l, in_field2, *in_field2_l, fragment_index, *dirfile, field_code, *field_code_l); _GDF_GetEntryYoke(in_field1, in_field1_l, in_field2, in_field2_l, fragment_index, dirfile, field_code, field_code_l, GD_MULTIPLY_ENTRY); dreturnvoid(); } /* gd_entry wrapper for DIVIDE */ void F77_FUNC(gdgedv, GDGEDV) (char *in_field1, int32_t *in_field1_l, char *in_field2, int32_t *in_field2_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field1, *in_field1_l, in_field2, *in_field2_l, fragment_index, *dirfile, field_code, *field_code_l); _GDF_GetEntryYoke(in_field1, in_field1_l, in_field2, in_field2_l, fragment_index, dirfile, field_code, field_code_l, GD_DIVIDE_ENTRY); dreturnvoid(); } /* gd_entry wrapper for WINDOW */ void F77_FUNC(gdgewd, GDGEWD) (char *in_field, int32_t *in_field_l, char *check_field, int32_t *check_field_l, int32_t *windop, int32_t *ithreshold, double *rthreshold, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; gd_entry_t E; dtrace("%p, %i, %p, %i, %p, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, check_field, *check_field_l, windop, ithreshold, rthreshold, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E) || E.field_type != GD_WINDOW_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); _GDF_FString(check_field, check_field_l, E.in_fields[1]); *windop = E.EN(window,windop); switch (E.EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: *ithreshold = E.EN(window,threshold.i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: *ithreshold = E.EN(window,threshold.u); break; default: *rthreshold = E.EN(window,threshold.r); break; } *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(fc); dreturnvoid(); } /* gd_entry wrapper for MPLEX */ void F77_FUNC(gdgemx, GDGEMX) (char *in_field, int32_t *in_field_l, char *count_field, int32_t *count_field_l, int32_t *val, int32_t *period, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; gd_entry_t E; dtrace("%p, %i, %p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, count_field, *count_field_l, val, period, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E) || E.field_type != GD_MPLEX_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); _GDF_FString(count_field, count_field_l, E.in_fields[1]); *val = E.EN(mplex,count_val); *period = E.EN(mplex,period); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(fc); dreturnvoid(); } /* gd_entry wrapper for RECIP */ void F77_FUNC(gdgerc, GDGERC) (char *in_field, int32_t *in_field_l, double *dividend, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, dividend, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_RECIP_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); *dividend = E.EN(recip,dividend); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } void F77_FUNC(gdgecr, GDGECR) (char *in_field, int32_t *in_field_l, GD_DCOMPLEXP(cdividend), int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, cdividend, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_RECIP_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); gd_cs2cp_(cdividend, E.EN(recip,cdividend)); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for PHASE */ void F77_FUNC(gdgeph, GDGEPH) (char *in_field, int32_t *in_field_l, int32_t *shift, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, shift, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_PHASE_ENTRY) *in_field_l = 0; else { _GDF_FString(in_field, in_field_l, E.in_fields[0]); *shift = E.EN(phase,shift); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for CONST */ void F77_FUNC(gdgeco, GDGECO) (int32_t *data_type, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %p, %i, %p, %i", data_type, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_CONST_ENTRY) *data_type = 0; else { *data_type = E.EN(scalar,const_type); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_entry wrapper for CARRAY */ void F77_FUNC(gdgeca, GDGECA) (int32_t *data_type, int32_t *array_len, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *out; gd_entry_t E; dtrace("%p, %p, %p, %i, %p, %i", data_type, array_len, fragment_index, *dirfile, field_code, *field_code_l); if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), &E) || E.field_type != GD_CARRAY_ENTRY) *data_type = 0; else { *data_type = E.EN(scalar,const_type); *array_len = E.EN(scalar,array_len); *fragment_index = E.fragment_index; gd_free_entry_strings(&E); } free(out); dreturnvoid(); } /* gd_fragment_index wrapper */ void F77_FUNC(gdfrgi, GDFRGI) (int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", fragment_index, *dirfile, field_code, *field_code_l); *fragment_index = gd_fragment_index(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *fragment_index); } /* gd_add_raw wrapper */ void F77_FUNC(gdadrw, GDADRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const int32_t *fragment_index) { char *out; dtrace("%i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l, *data_type, *spf, *fragment_index); gd_add_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), (gd_type_t)(*data_type), (unsigned int)*spf, *fragment_index); free(out); dreturnvoid(); } /* gd_add_lincom wrapper */ void F77_FUNC(gdadlc, GDADLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const double *b1, const char *in_field2, const int32_t *in_field2_l, const double *m2, const double *b2, const char *in_field3, const int32_t *in_field3_l, const double *m3, const double *b3, const int32_t *fragment_index) { char *fc; char *in_fields[3] = {NULL, NULL, NULL}; double m[3] = {0, 0, 0}; double b[3] = {0, 0, 0}; const int nf = *n_fields; dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p, %i", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3, *fragment_index); if (nf > 0) { _GDF_CString(in_fields, in_field1, *in_field1_l); m[0] = *m1; b[0] = *b1; } if (nf > 1) { _GDF_CString(in_fields + 1, in_field2, *in_field2_l); m[1] = *m2; b[1] = *b2; } if (nf > 2) { _GDF_CString(in_fields + 2, in_field3, *in_field3_l); m[2] = *m3; b[2] = *b3; } gd_add_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), nf, (const char**)in_fields, m, b, *fragment_index); free(fc); free(in_fields[0]); free(in_fields[1]); free(in_fields[2]); dreturnvoid(); } void F77_FUNC(gdadcl, GDADCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3), const int32_t *fragment_index) { char *fc; char *in_fields[3] = {NULL, NULL, NULL}; #ifdef GD_NO_C99_API double cm[6] = {0, 0, 0, 0, 0, 0}; double cb[6] = {0, 0, 0, 0, 0, 0}; #else double complex cm[3] = {0, 0, 0}; double complex cb[3] = {0, 0, 0}; #endif const int nf = *n_fields; dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p, %i", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3, *fragment_index); if (nf > 0) { _GDF_CString(in_fields, in_field1, *in_field1_l); gd_cp2ca_(cm, 0, m1); gd_cp2ca_(cb, 0, b1); } if (nf > 1) { _GDF_CString(in_fields + 1, in_field2, *in_field2_l); gd_cp2ca_(cm, 1, m2); gd_cp2ca_(cb, 1, b2); } if (nf > 2) { _GDF_CString(in_fields + 2, in_field3, *in_field3_l); gd_cp2ca_(cm, 2, m3); gd_cp2ca_(cb, 2, b3); } gd_add_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), nf, (const char**)in_fields, cm, cb, *fragment_index); free(fc); free(in_fields[0]); free(in_fields[1]); free(in_fields[2]); dreturnvoid(); } /* gd_add_polynom wrapper */ void F77_FUNC(gdadpn, GDADPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const double *a1, const double *a2, const double *a3, const double *a4, const double *a5, const int32_t *fragment_index) { char *fc, *inf; double a[6] = {0, 0, 0, 0, 0, 0}; const int po = (*poly_ord > 5) ? 5 : *poly_ord; dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5); _GDF_CString(&inf, in_field, *in_field_l); switch (po) { case 5: a[5] = *a5; case 4: a[4] = *a4; case 3: a[3] = *a3; case 2: a[2] = *a2; case 1: a[1] = *a1; a[0] = *a0; } gd_add_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), po, inf, a, *fragment_index); free(fc); free(inf); dreturnvoid(); } void F77_FUNC(gdadcp, GDADCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1), const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5), const int32_t *fragment_index) { char *fc, *inf; #ifdef GD_NO_C99_API double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #else double complex ca[6] = {0, 0, 0, 0, 0, 0}; #endif const int po = (*poly_ord > 5) ? 5 : *poly_ord; dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5); _GDF_CString(&inf, in_field, *in_field_l); switch (po) { case 5: gd_cp2ca_(ca, 5, a5); case 4: gd_cp2ca_(ca, 4, a4); case 3: gd_cp2ca_(ca, 3, a3); case 2: gd_cp2ca_(ca, 2, a2); case 1: gd_cp2ca_(ca, 1, a1); gd_cp2ca_(ca, 0, a0); } gd_add_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), po, inf, ca, *fragment_index); free(fc); free(inf); dreturnvoid(); } /* gd_add_linterp wrapper */ void F77_FUNC(gdadlt, GDADLT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *table, const int32_t *table_l, const int32_t *fragment_index) { char *fc, *in, *tab; dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, table, *table_l, *fragment_index); gd_add_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&tab, table, *table_l), *fragment_index); free(fc); free(in); free(tab); dreturnvoid(); } /* gd_add_bit wrapper */ void F77_FUNC(gdadbt, GDADBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits, const int32_t *fragment_index) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits, *fragment_index); gd_add_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits, *fragment_index); free(fc); free(in); dreturnvoid(); } /* gd_add_sbit wrapper */ void F77_FUNC(gdadsb, GDADSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits, const int32_t *fragment_index) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits, *fragment_index); gd_add_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits, *fragment_index); free(fc); free(in); dreturnvoid(); } /* gd_add_multiply wrapper */ void F77_FUNC(gdadmt, GDADMT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l, const int32_t *fragment_index) { char *fc, *in1, *in2; dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field1, *in_field1_l, in_field2, *in_field2_l, *fragment_index); gd_add_multiply(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2, *in_field2_l), *fragment_index); free(fc); free(in1); free(in2); dreturnvoid(); } /* gd_add_divide wrapper */ void F77_FUNC(gdaddv, GDADDV) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l, const int32_t *fragment_index) { char *fc, *in1, *in2; dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field1, *in_field1_l, in_field2, *in_field2_l, *fragment_index); gd_add_divide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2, *in_field2_l), *fragment_index); free(fc); free(in1); free(in2); dreturnvoid(); } /* gd_add_recip wrapper */ void F77_FUNC(gdadrc, GDADRC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const int32_t *fragment_index) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %g, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *dividend, *fragment_index); gd_add_recip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *dividend, *fragment_index); free(fc); free(in); dreturnvoid(); } void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *cdividend, const int32_t *fragment_index) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %g;%g, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, cdividend[0], cdividend[1], *fragment_index); gd_add_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), cdividend, *fragment_index); free(fc); free(in); dreturnvoid(); } /* gd_add_phase wrapper */ void F77_FUNC(gdadph, GDADPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift, const int32_t *fragment_index) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *shift, *fragment_index); gd_add_phase(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *shift, *fragment_index); free(fc); free(in); dreturnvoid(); } /* gd_fragmentname wrapper */ void F77_FUNC(gdfrgn, GDFRGN) (char *filename, int32_t *filename_l, const int32_t *dirfile, const int32_t *index) { dtrace("%p, %i, %i, %i", filename, *filename_l, *dirfile, *index); _GDF_FString(filename, filename_l, gd_fragmentname(_GDF_GetDirfile(*dirfile), *index)); dreturnvoid(); } /* gd_nfragments wrapper */ void F77_FUNC(gdnfrg, GDNFRG) (int32_t *nformats, const int32_t *dirfile) { *nformats = gd_nfragments(_GDF_GetDirfile(*dirfile)); } /* gd_metaflush wrapper */ void F77_FUNC(gdmfls, GDMFLS) (const int32_t *dirfile) { dtrace("%i", *dirfile); gd_metaflush(_GDF_GetDirfile(*dirfile)); dreturnvoid(); } /* gd_rewrite_fragment wrapper */ void F77_FUNC(gdrfrg, GDRFRG) (const int32_t *dirfile, const int32_t *fragment) { dtrace("%i, %i", *dirfile, *fragment); gd_rewrite_fragment(_GDF_GetDirfile(*dirfile), *fragment); dreturnvoid(); } /* gd_include wrapper */ void F77_FUNC(gdincl, GDINCL) (const int32_t *dirfile, const char *file, const int32_t *file_l, const int32_t *fragment_index, const int32_t *flags) { char *fi; dtrace("%i, %p, %i, %i, 0x%X", *dirfile, file, *file_l, *fragment_index, *flags); gd_include(_GDF_GetDirfile(*dirfile), _GDF_CString(&fi, file, *file_l), *fragment_index, *flags); free(fi); dreturnvoid(); } /* gd_nfield_by_type wrapper */ void F77_FUNC(gdnfdt, GDNFDT) (int32_t *nfields, const int32_t *dirfile, const int32_t *type) { dtrace("%p, %i, 0x%X", nfields, *dirfile, *type); *nfields = gd_nfields_by_type(_GDF_GetDirfile(*dirfile), (gd_entype_t)*type); dreturn("%i", *nfields); } /* gd_nvectors wrapper */ void F77_FUNC(gdnvec, GDNVEC) (int32_t *nvectors, const int32_t *dirfile) { *nvectors = gd_nvectors(_GDF_GetDirfile(*dirfile)); } /* gd_field_list_by_type wrapper -- this only returns one field name */ void F77_FUNC(gdfdnt, GDFDNT) (char *name, int32_t *name_l, const int32_t *dirfile, const int32_t *type, const int32_t *field_num) { const char** fl; DIRFILE* D; unsigned int nfields; dtrace("%p, %p, %i, 0x%X, %i", name, name_l, *dirfile, *type, *field_num); D = _GDF_GetDirfile(*dirfile); nfields = gd_nfields_by_type(D, (gd_entype_t)*type); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) { fl = gd_field_list_by_type(D, (gd_entype_t)*type); _GDF_FString(name, name_l, fl[*field_num - 1]); } else *name_l = 0; dreturn("%i", *name_l); } /* gd_vector_list wrapper -- this only returns one field name */ void F77_FUNC(gdvecn, GDVECN) (char *name, int32_t *name_l, const int32_t *dirfile, const int32_t *field_num) { const char** fl; DIRFILE *D; unsigned int nfields; dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num); D = _GDF_GetDirfile(*dirfile); nfields = gd_nvectors(D); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) { fl = gd_vector_list(D); _GDF_FString(name, name_l, fl[*field_num - 1]); } else *name_l = 0; dreturn("%i", *name_l); } /* gd_mfield_list_by_type wrapper -- this only returns one field name */ void F77_FUNC(gdmfdt, GDMFDT) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *field_num) { const char **fl; unsigned int nfields; DIRFILE *D; char *pa; dtrace("%p, %i, %i, %p, %i, 0x%X, %i", name, *name_l, *dirfile, parent, *parent_l, *type, *field_num); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmfields_by_type(D, pa, (gd_entype_t)*type); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) { fl = gd_mfield_list_by_type(D, pa, (gd_entype_t)*type); _GDF_FString(name, name_l, fl[*field_num - 1]); } else *name_l = 0; free(pa); dreturnvoid(); } /* gd_mvector_list wrapper -- this only returns one field name */ void F77_FUNC(gdmven, GDMVEN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *field_num) { const char** fl; unsigned int nfields; DIRFILE* D; char *pa; dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmvectors(D, pa); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nfields) { fl = gd_mvector_list(D, pa); _GDF_FString(name, name_l, fl[*field_num - 1]); } else *name_l = 0; free(pa); dreturn("%i", *name_l); } /* gd_madd_lincom wrapper */ void F77_FUNC(gdmdlc, GDMDLC) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const double *b1, const char *in_field2, const int32_t *in_field2_l, const double *m2, const double *b2, const char *in_field3, const int32_t *in_field3_l, const double *m3, const double *b3) { char *pa, *fc; char *in_fields[3] = {NULL, NULL, NULL}; double m[3] = {0, 0, 0}; double b[3] = {0, 0, 0}; const int nf = *n_fields; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, " "%p", *dirfile, parent, *parent_l, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3); if (nf > 0) { _GDF_CString(in_fields, in_field1, *in_field1_l); m[0] = *m1; b[0] = *b1; } if (nf > 1) { _GDF_CString(in_fields + 1, in_field2, *in_field2_l); m[1] = *m2; b[1] = *b2; } if (nf > 2) { _GDF_CString(in_fields + 2, in_field3, *in_field3_l); m[2] = *m3; b[2] = *b3; } gd_madd_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), nf, (const char**)in_fields, m, b); free(pa); free(fc); free(in_fields[0]); free(in_fields[1]); free(in_fields[2]); dreturnvoid(); } void F77_FUNC(gdmdcl, GDMDCL) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3)) { char *pa, *fc; char *in_fields[3] = {NULL, NULL, NULL}; #ifdef GD_NO_C99_API double cm[6] = {0, 0, 0, 0, 0, 0}; double cb[6] = {0, 0, 0, 0, 0, 0}; #else double complex cm[3] = {0, 0, 0}; double complex cb[3] = {0, 0, 0}; #endif const int nf = *n_fields; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, " "%p", *dirfile, parent, *parent_l, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3); if (nf > 0) { _GDF_CString(in_fields, in_field1, *in_field1_l); gd_cp2ca_(cm, 0, m1); gd_cp2ca_(cb, 0, b1); } if (nf > 1) { _GDF_CString(in_fields + 1, in_field2, *in_field2_l); gd_cp2ca_(cm, 1, m2); gd_cp2ca_(cb, 1, b2); } if (nf > 2) { _GDF_CString(in_fields + 2, in_field3, *in_field3_l); gd_cp2ca_(cm, 2, m3); gd_cp2ca_(cb, 2, b3); } gd_madd_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), nf, (const char**)in_fields, cm, cb); free(pa); free(fc); free(in_fields[0]); free(in_fields[1]); free(in_fields[2]); dreturnvoid(); } /* gd_madd_polynom wrapper */ void F77_FUNC(gdmdpn, GDMDPN) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const double *a1, const double *a2, const double *a3, const double *a4, const double *a5) { char *pa, *fc, *inf; double a[6] = {0, 0, 0, 0, 0, 0}; const int po = (*poly_ord > 5) ? 5 : *poly_ord; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, parent, *parent_l, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5); _GDF_CString(&inf, in_field, *in_field_l); switch (po) { case 5: a[5] = *a5; case 4: a[4] = *a4; case 3: a[3] = *a3; case 2: a[2] = *a2; default: a[1] = *a1; a[0] = *a0; } gd_madd_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), po, inf, a); free(pa); free(fc); free(inf); dreturnvoid(); } void F77_FUNC(gdmdcp, GDMDCP) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1), const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5)) { char *pa, *fc, *inf; #ifdef GD_NO_C99_API double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #else double complex ca[6] = {0, 0, 0, 0, 0, 0}; #endif int po = *poly_ord; if (po > 5) po = 5; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, parent, *parent_l, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5); _GDF_CString(&inf, in_field, *in_field_l); switch (po) { case 5: gd_cp2ca_(ca, 5, a5); case 4: gd_cp2ca_(ca, 4, a4); case 3: gd_cp2ca_(ca, 3, a3); case 2: gd_cp2ca_(ca, 2, a2); case 1: gd_cp2ca_(ca, 1, a1); gd_cp2ca_(ca, 0, a0); } gd_madd_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), po, inf, ca); free(pa); free(fc); free(inf); dreturnvoid(); } /* gd_madd_linterp wrapper */ void F77_FUNC(gdmdlt, GDMDLT) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *table, const int32_t *table_l) { char *pa, *fc, *in, *tab; dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, table, *table_l); gd_madd_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&tab, table, *table_l)); free(pa); free(fc); free(in); free(tab); dreturnvoid(); } /* gd_madd_bit wrapper */ void F77_FUNC(gdmdbt, GDMDBT) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits) { char *pa, *fc, *in; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits); gd_madd_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits); free(pa); free(fc); free(in); dreturnvoid(); } /* gd_madd_sbit wrapper */ void F77_FUNC(gdmdsb, GDMDSB) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits) { char *pa, *fc, *in; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits); gd_madd_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits); free(pa); free(fc); free(in); dreturnvoid(); } /* gd_madd_multiply wrapper */ void F77_FUNC(gdmdmt, GDMDMT) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l) { char *pa, *fc, *in1, *in2; dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field1, *in_field1_l, in_field2, *in_field2_l); gd_madd_multiply(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2, *in_field2_l)); free(pa); free(fc); free(in1); free(in2); dreturnvoid(); } /* gd_madd_divide wrapper */ void F77_FUNC(gdmddv, GDMDDV) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l) { char *pa, *fc, *in1, *in2; dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field1, *in_field1_l, in_field2, *in_field2_l); gd_madd_divide(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2, *in_field2_l)); free(pa); free(fc); free(in1); free(in2); dreturnvoid(); } /* gd_madd_recip wrapper */ void F77_FUNC(gdmdrc, GDMDRC) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend) { char *pa, *fc, *in1; dtrace("%i, %p, %i, %p, %i, %p, %i, %g", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, *dividend); gd_madd_recip(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field, *in_field_l), *dividend); free(pa); free(fc); free(in1); dreturnvoid(); } void F77_FUNC(gdmdcr, GDMDCR) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend)) { char *pa, *fc, *in1; dtrace("%i, %p, %i, %p, %i, %p, %i, %g;%g", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, crealp(cdividend), cimagp(cdividend)); #ifdef GD_NO_C99_API gd_madd_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field, *in_field_l), cdividend); #else gd_madd_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field, *in_field_l), *cdividend); #endif free(pa); free(fc); free(in1); dreturnvoid(); } /* gd_madd_phase wrapper */ void F77_FUNC(gdmdph, GDMDPH) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift) { char *pa, *fc, *in; dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, *shift); gd_madd_phase(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *shift); free(pa); free(fc); free(in); dreturnvoid(); } /* gd_add_const wrapper */ void F77_FUNC(gdadco, GDADCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *data_type, const void *value, const int32_t *fragment_index) { char *fc; dtrace("%i, %p, %i, %i, %i, %p, %i", *dirfile, field_code, *field_code_l, *const_type, *data_type, value, *fragment_index); gd_add_const(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*const_type, (gd_type_t)*data_type, value, *fragment_index); free(fc); dreturnvoid(); } /* gd_madd_const wrapper */ void F77_FUNC(gdmdco, GDMDCO) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *data_type, const void *value) { char *pa, *fc; dtrace("%i, %p, %i, %p, %i, %i, %i, %p", *dirfile, parent, *parent_l, field_code, *field_code_l, *const_type, *data_type, value); gd_madd_const(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*const_type, (gd_type_t)*data_type, value); free(pa); free(fc); dreturnvoid(); } /* gd_add_carray wrapper */ void F77_FUNC(gdadca, GDADCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, int32_t *array_len, const int32_t *data_type, const void *value, const int32_t *fragment_index) { char *fc; dtrace("%i, %p, %i, 0x%X, %i, 0x%X, %p, %i", *dirfile, field_code, *field_code_l, *const_type, *array_len, *data_type, value, *fragment_index); gd_add_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*const_type, *array_len, (gd_type_t)*data_type, value, *fragment_index); free(fc); dreturnvoid(); } /* gd_madd_carray wrapper */ void F77_FUNC(gdmdca, GDMDCA) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *array_len, const int32_t *data_type, const void *value) { char *pa, *fc; dtrace("%i, %p, %i, %p, %i, 0x%X, %i, 0x%X, %p", *dirfile, parent, *parent_l, field_code, *field_code_l, *const_type, *array_len, *data_type, value); gd_madd_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*const_type, *array_len, (gd_type_t)*data_type, value); free(pa); free(fc); dreturnvoid(); } /* gd_add_string wrapper */ void F77_FUNC(gdadst, GDADST) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *value, const int32_t *value_l, const int32_t *fragment_index) { char *fc, *va; dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, value, *value_l, *fragment_index); gd_add_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&va, value, *value_l), *fragment_index); free(fc); free(va); dreturnvoid(); } /* gd_madd_string wrapper */ void F77_FUNC(gdmdst, GDMDST) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *value, const int32_t *value_l) { char *pa, *fc, *va; dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, value, *value_l); gd_madd_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&va, value, *value_l)); free(pa); free(fc); free(va); dreturnvoid(); } /* gd_add_spec wrapper */ void F77_FUNC(gdadsp, GDADSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const int32_t *fragment_index) { char *sp; dtrace("%i, %p, %i, %i", *dirfile, spec, *spec_l, *fragment_index); gd_add_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec, *spec_l), *fragment_index); free(sp); dreturnvoid(); } /* gd_madd_spec wrapper */ void F77_FUNC(gdmdsp, GDMDSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const char *parent, const int32_t *parent_l) { char *pa, *sp; dtrace("%i, %p, %i, %p, %i", *dirfile, spec, *spec_l, parent, *parent_l); gd_madd_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec, *spec_l), _GDF_CString(&pa, parent, *parent_l)); free(pa); free(sp); dreturnvoid(); } /* gd_get_constant wrapper */ void F77_FUNC(gdgtco, GDGTCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *return_type, void *data_out) { char *fc; dtrace("%i, %p, %i, %i, %p", *dirfile, field_code, *field_code_l, *return_type, data_out); gd_get_constant(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*return_type, data_out); free(fc); dreturnvoid(); } /* gd_get_carray wrapper */ void F77_FUNC(gdgtca, GDGTCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *return_type, void *data_out) { char *fc; dtrace("%i, %p, %i, 0x%X, %p", *dirfile, field_code, *field_code_l, *return_type, data_out); gd_get_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*return_type, data_out); free(fc); dreturnvoid(); } /* gd_get_carray_slice wrapper */ void F77_FUNC(gdgcas, GDGCAS) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *start, const int32_t *n, const int32_t *return_type, void *data_out) { char *fc; dtrace("%i, %p, %i, %i, %i, 0x%X, %p", *dirfile, field_code, *field_code_l, *start, *n, *return_type, data_out); gd_get_carray_slice(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *start - 1, (size_t)*n, (gd_type_t)*return_type, data_out); free(fc); dreturnvoid(); } /* gd_carray_len wrapper -- deprecated */ void F77_FUNC(gdcaln, GDCALN) (int32_t *len, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", len, *dirfile, field_code, *field_code_l); *len = gd_array_len(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *len); } /* gd_get_string wrapper */ void F77_FUNC(gdgtst, GDGTST) (int32_t *size, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *len, char *data_out) { char *fc, *out; int l = *len; dtrace("%p, %i, %p, %i, %i, %p", size, *dirfile, field_code, *field_code_l, *len, data_out); out = (char*)malloc(l + 1); *size = gd_get_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (size_t)*len, out) - 1; _GDF_FString(data_out, &l, out); free(fc); free(out); dreturn("%i", *size); } /* gd_put_constant wrapper */ void F77_FUNC(gdptco, GDPTCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const void *data_in) { char *fc; dtrace("%i, %p, %i, 0x%X, %p", *dirfile, field_code, *field_code_l, *data_type, data_in); gd_put_constant(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*data_type, data_in); free(fc); dreturnvoid(); } /* gd_put_carray wrapper */ void F77_FUNC(gdptca, GDPTCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const void *data_in) { char *fc; dtrace("%i, %p, %i, 0x%X, %p", *dirfile, field_code, *field_code_l, *data_type, data_in); gd_put_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*data_type, data_in); free(fc); dreturnvoid(); } /* gd_put_carray_slice wrapper */ void F77_FUNC(gdpcas, GDPCAS) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *start, const int32_t *n, const int32_t *data_type, const void *data_in) { char *fc; dtrace("%i, %p, %i, %i, %i, 0x%X, %p", *dirfile, field_code, *field_code_l, *start, *n, *data_type, data_in); gd_put_carray_slice(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *start - 1, (size_t)*n, (gd_type_t)*data_type, data_in); free(fc); dreturnvoid(); } /* gd_put_string wrapper */ void F77_FUNC(gdptst, GDPTST) (int32_t *n_wrote, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *len, const char *data_in) { char *fc, *in; dtrace("%p, %i, %p, %i, %i, %p", n_wrote, *dirfile, field_code, *field_code_l, *len, data_in); *n_wrote = gd_put_string(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, data_in, *len)) - 1; free(fc); free(in); dreturn("%i", *n_wrote); } /* gd_nmfields wrapper */ void F77_FUNC(gdnmfd, GDNMFD) (int32_t *nfields, const int32_t *dirfile, const char *parent, const int32_t *parent_l) { char *pa; dtrace("%p, %i, %p, %i", nfields, *dirfile, parent, *parent_l); *nfields = gd_nmfields(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l)); free(pa); dreturn("%i", *nfields); } /* gd_nmfields_by_type wrapper */ void F77_FUNC(gdnmft, GDNMFT) (int32_t *nfields, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type) { char *pa; dtrace("%p, %i, %p, %i, 0x%X", nfields, *dirfile, parent, *parent_l, *type); *nfields = gd_nmfields_by_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), (gd_entype_t)*type); free(pa); dreturn("%i", *nfields); } /* gd_nmvectors wrapper */ void F77_FUNC(gdnmve, GDNMVE) (int32_t *nvectors, const int32_t *dirfile, const char *parent, const int32_t *parent_l) { char *pa; dtrace("%p, %i, %p, %i", nvectors, *dirfile, parent, *parent_l); *nvectors = gd_nmvectors(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l)); free(pa); dreturn("%i", *nvectors); } /* gd_discard wrapper */ void F77_FUNC(gddscd, GDDSCD) (const int32_t *dirfile) { dtrace("%i", *dirfile); if (*dirfile != 0) { gd_discard(_GDF_GetDirfile(*dirfile)); _GDF_ClearDirfile(*dirfile); } dreturnvoid(); } /* gd_cbopen wrapper */ void F77_FUNC(gdcopn, GDCOPN) (int32_t *dirfile, const char *dirfilename, const int32_t *dirfilename_l, const int32_t *flags, const _GDF_callback_t callback) { const struct _GDF_callback_container temp = { callback }; DIRFILE *D; char *out; dtrace("%p, %p, %i, 0x%X, %p", dirfile, dirfilename, *dirfilename_l, *flags, callback); _GDF_CString(&out, dirfilename, *dirfilename_l); D = gd_cbopen(out, *flags, _GDF_Callback, (void*)&temp); *dirfile = _GDF_SetDirfile(D, 1); if (*dirfile >= 0) { /* save the callback */ f77callbacks[*dirfile].func = callback; /* and tell getdata its new location */ gd_parser_callback(D, _GDF_Callback, f77callbacks + *dirfile); } free(out); dreturn("%i", *dirfile); } /* gd_parser_callback wrapper */ void F77_FUNC(gdclbk, GDCLBK) (const int32_t *dirfile, const _GDF_callback_t callback) { dtrace("%i, %p", *dirfile, callback); /* ensure *dirfile is sane */ if (*dirfile < 0 || *dirfile >= GDF_N_DIRFILES) { dreturnvoid(); return; } /* we only have to modify GetData's callback pointer if f77callbacks is * NULL for this dirfile (inidicating no previous callback); otherwise, just * update the saved callback pointer */ if (f77callbacks[*dirfile].func == NULL) { f77callbacks[*dirfile].func = callback; gd_parser_callback(_GDF_GetDirfile(*dirfile), _GDF_Callback, f77callbacks + *dirfile); } else f77callbacks[*dirfile].func = callback; dreturnvoid(); } /* deregister a callback function (ie. gd_parser_callback(..., NULL) */ void F77_FUNC(gdnocb, GDNOCB) (const int32_t *dirfile) { dtrace("%i", *dirfile); /* ensure *dirfile is sane */ if (*dirfile >= 0 && *dirfile < GDF_N_DIRFILES) { f77callbacks[*dirfile].func = NULL; gd_parser_callback(_GDF_GetDirfile(*dirfile), NULL, NULL); } dreturnvoid(); } /* gd_alter_bit wrapper */ void F77_FUNC(gdalbt, GDALBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits); gd_alter_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits); free(fc); free(in); dreturnvoid(); } /* gd_alter_sbit wrapper */ void F77_FUNC(gdalsb, GDALSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, *numbits); gd_alter_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *bitnum, *numbits); free(fc); free(in); dreturnvoid(); } /* gd_alter_const wrapper */ void F77_FUNC(gdalco, GDALCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type) { char *fc; dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *const_type); gd_alter_const(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*const_type); free(fc); dreturnvoid(); } /* gd_alter_carray wrapper */ void F77_FUNC(gdalca, GDALCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *array_len) { char *fc; dtrace("%i, %p, %i, 0x%X, %i", *dirfile, field_code, *field_code_l, *const_type, *array_len); gd_alter_carray(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), (gd_type_t)*const_type, (size_t)*array_len); free(fc); dreturnvoid(); } /* gd_alter_lincom wrapper */ void F77_FUNC(gdallc, GDALLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const double *b1, const char *in_field2, const int32_t *in_field2_l, const double *m2, const double *b2, const char *in_field3, const int32_t *in_field3_l, const double *m3, const double *b3) { char *fc = NULL; char *in_fields[3] = {NULL, NULL, NULL}; double m[3] = {0, 0, 0}; double b[3] = {0, 0, 0}; const int nf = *n_fields; dtrace("%i, %p, %i, %i, %p, %i, %g, %g, %p, %i, %g, %g, %p, %i, %g, %g", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, *m1, *b1, in_field2, *in_field2_l, *m2, *b2, in_field3, *in_field3_l, *m3, *b3); if (nf > 0) { _GDF_CString(in_fields, in_field1, *in_field1_l); m[0] = *m1; b[0] = *b1; } if (nf > 1) { _GDF_CString(in_fields + 1, in_field2, *in_field2_l); m[1] = *m2; b[1] = *b2; } if (nf > 2) { _GDF_CString(in_fields + 2, in_field3, *in_field3_l); m[2] = *m3; b[2] = *b3; } gd_alter_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), nf, (const char**)in_fields, m, b); free(fc); free(in_fields[0]); free(in_fields[1]); free(in_fields[2]); dreturnvoid(); } /* gd_alter_clincom wrapper */ void F77_FUNC(gdalcl, GDALCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3)) { char *fc; char *in_fields[3] = {NULL, NULL, NULL}; #ifdef GD_NO_C99_API double cm[6] = {0, 0, 0, 0, 0, 0}; double cb[6] = {0, 0, 0, 0, 0, 0}; #else double complex cm[3] = {0, 0, 0}; double complex cb[3] = {0, 0, 0}; #endif const int nf = *n_fields; dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3); if (nf > 0) { _GDF_CString(in_fields, in_field1, *in_field1_l); gd_cp2ca_(cm, 0, m1); gd_cp2ca_(cb, 0, b1); } if (nf > 1) { _GDF_CString(in_fields + 1, in_field2, *in_field2_l); gd_cp2ca_(cm, 1, m2); gd_cp2ca_(cb, 1, b2); } if (nf > 2) { _GDF_CString(in_fields + 2, in_field3, *in_field3_l); gd_cp2ca_(cm, 2, m3); gd_cp2ca_(cb, 2, b3); } gd_alter_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), nf, (const char**)in_fields, cm, cb); free(fc); free(in_fields[0]); free(in_fields[1]); free(in_fields[2]); dreturnvoid(); } /* gd_alter_polynom wrapper */ void F77_FUNC(gdalpn, GDALPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const double *a1, const double *a2, const double *a3, const double *a4, const double *a5) { char *fc, *inf; double a[6] = {0, 0, 0, 0, 0, 0}; const int po = (*poly_ord > 5) ? 5 : *poly_ord; dtrace("%i, %p, %i, %i, %p, %i, %g, %g, %p, %p, %p, %p", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, *a0, *a1, a2, a3, a4, a5); _GDF_CString(&inf, in_field, *in_field_l); switch (po) { case 5: a[5] = *a5; case 4: a[4] = *a4; case 3: a[3] = *a3; case 2: a[2] = *a2; default: a[1] = *a1; a[0] = *a0; } gd_alter_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), po, inf, a); free(fc); free(inf); dreturnvoid(); } /* gd_alter_cpolynom wrapper */ void F77_FUNC(gdalcp, GDALCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1), const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5)) { char *fc, *inf; #ifdef GD_NO_C99_API double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; #else double complex ca[6] = {0, 0, 0, 0, 0, 0}; #endif const int po = (*poly_ord > 5) ? 5 : *poly_ord; dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5); _GDF_CString(&inf, in_field, *in_field_l); switch (po) { case 5: gd_cp2ca_(ca, 5, a5); case 4: gd_cp2ca_(ca, 4, a4); case 3: gd_cp2ca_(ca, 3, a3); case 2: gd_cp2ca_(ca, 2, a2); default: gd_cp2ca_(ca, 1, a1); gd_cp2ca_(ca, 0, a0); } gd_alter_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), po, inf, ca); free(fc); free(inf); dreturnvoid(); } /* gd_alter_multiply wrapper */ void F77_FUNC(gdalmt, GDALMT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l) { char *fc, *in1, *in2; dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, field_code, *field_code_l, in_field1, *in_field1_l, in_field2, *in_field2_l); gd_alter_multiply(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2, *in_field2_l)); free(fc); free(in1); free(in2); dreturnvoid(); } /* gd_alter_divide wrapper */ void F77_FUNC(gdaldv, GDALDV) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l) { char *fc, *in1, *in2; dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, field_code, *field_code_l, in_field1, *in_field1_l, in_field2, *in_field2_l); gd_alter_divide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), _GDF_CString(&in2, in_field2, *in_field2_l)); free(fc); free(in1); free(in2); dreturnvoid(); } /* gd_alter_recip wrapper */ void F77_FUNC(gdalrc, GDALRC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const double *dividend) { char *fc, *in1; dtrace("%i, %p, %i, %p, %i, %g", *dirfile, field_code, *field_code_l, in_field1, *in_field1_l, *dividend); gd_alter_recip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), *dividend); free(fc); free(in1); dreturnvoid(); } void F77_FUNC(gdalcr, GDALCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(cdividend)) { char *fc, *in1; dtrace("%i, %p, %i, %p, %i, %g;%g", *dirfile, field_code, *field_code_l, in_field1, *in_field1_l, crealp(cdividend), cimagp(cdividend)); #ifdef GD_NO_C99_API gd_alter_crecip89(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), cdividend); #else gd_alter_crecip(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in1, in_field1, *in_field1_l), *cdividend); #endif free(fc); free(in1); dreturnvoid(); } /* gd_alter_phase wrapper */ void F77_FUNC(gdalph, GDALPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift) { char *fc, *in; dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *shift); gd_alter_phase(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), *shift); free(fc); free(in); dreturnvoid(); } /* gd_encoding wrapper */ void F77_FUNC(gdgenc, GDGENC) (int32_t *encoding, const int32_t *dirfile, const int32_t *fragment) { *encoding = gd_encoding(_GDF_GetDirfile(*dirfile), *fragment); } /* gd_endianness wrapper */ void F77_FUNC(gdgend, GDGEND) (int32_t *endianness, const int32_t *dirfile, const int32_t *fragment) { *endianness = gd_endianness(_GDF_GetDirfile(*dirfile), *fragment); } /* dirfilename wrapper */ void F77_FUNC(gdname, GDNAME) (char *name, int32_t *name_l, const int32_t *dirfile) { const char *dn = gd_dirfilename(_GDF_GetDirfile(*dirfile)); _GDF_FString(name, name_l, dn); } /* gd_parent_fragment wrapper */ void F77_FUNC(gdpfrg, GDPFRG) (int32_t *parent, const int32_t *dirfile, const int32_t *fragment) { *parent = gd_parent_fragment(_GDF_GetDirfile(*dirfile), *fragment); } /* gd_alter_protection wrapper */ void F77_FUNC(gdaprt, GDAPRT) (const int32_t *dirfile, const int32_t *protection_level, const int32_t *fragment) { gd_alter_protection(_GDF_GetDirfile(*dirfile), *protection_level, *fragment); } /* gd_protection wrapper */ void F77_FUNC(gdgprt, GDGPRT) (int32_t *protection_level, const int32_t *dirfile, const int32_t *fragment) { *protection_level = gd_protection(_GDF_GetDirfile(*dirfile), *fragment); } /* gd_raw_filename wrapper */ void F77_FUNC(gdrwfn, GDRWFN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc, *fn; dtrace("%p, %i, %i, %p, %i", name, *name_l, *dirfile, field_code, *field_code_l); fn = gd_raw_filename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); _GDF_FString(name, name_l, fn); free(fc); free(fn); dreturn("%i", *name_l); } /* gd_reference wrapper */ void F77_FUNC(gdrefe, GDREFE) (char *name, int32_t *name_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; const char *ref; dtrace("%p, %p, %i, %p, %i", name, name_l, *dirfile, field_code, *field_code_l); _GDF_CString(&fc, field_code, *field_code_l); /* F95 bindings pass an empty string instead of NULL */ if (*field_code_l == 0) { free(fc); fc = NULL; } ref = gd_reference(_GDF_GetDirfile(*dirfile), fc); _GDF_FString(name, name_l, ref); free(fc); dreturn("%i", *name_l); } /* gd_alter_encoding wrapper */ void F77_FUNC(gdaenc, GDAENC) (const int32_t *dirfile, const int32_t *encoding, const int32_t *fragment, const int32_t *recode) { gd_alter_encoding(_GDF_GetDirfile(*dirfile), *encoding, *fragment, *recode); } /* gd_alter_endianness wrapper */ void F77_FUNC(gdaend, GDAEND) (const int32_t *dirfile, const int32_t *endianness, const int32_t *fragment, const int32_t *recode) { gd_alter_endianness(_GDF_GetDirfile(*dirfile), *endianness, *fragment, *recode); } /* gd_alter_linterp wrapper */ void F77_FUNC(gdallt, GDALLT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *table, const int32_t *table_l, const int32_t *recode) { char *fc, *in, *tab; dtrace("%i, %p, %i, %p, %i, %p %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, table, *table_l, *recode); gd_alter_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&tab, table, *table_l), *recode); free(fc); free(in); free(tab); dreturnvoid(); } /* gd_alter_raw wrapper */ void F77_FUNC(gdalrw, GDALRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const int32_t *recode) { char *out; dtrace("%i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l, *data_type, *spf, *recode); gd_alter_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l), (gd_type_t)(*data_type), (unsigned int)*spf, *recode); free(out); dreturnvoid(); } /* gd_alter_spec wrapper */ void F77_FUNC(gdalsp, GDALSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const int32_t *move) { char *sp; dtrace("%i, %p, %i, %i", *dirfile, spec, *spec_l, *move); gd_alter_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec, *spec_l), *move); free(sp); dreturnvoid(); } /* gd_delete wrapper */ void F77_FUNC(gddele, GDDELE) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *flags) { char *fc; dtrace("%i, %p, %i, %i", *dirfile, field_code, *field_code_l, *flags); gd_delete(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *flags); free(fc); dreturnvoid(); } /* gd_malter_spec wrapper */ void F77_FUNC(gdmlsp, GDMLSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const char *parent, const int32_t *parent_l, const int32_t *move) { char *sp, *pa; dtrace("%i, %p, %i, %p, %i, %i", *dirfile, spec, *spec_l, parent, *parent_l, *move); gd_malter_spec(_GDF_GetDirfile(*dirfile), _GDF_CString(&sp, spec, *spec_l), _GDF_CString(&pa, parent, *parent_l), *move); free(pa); free(sp); dreturnvoid(); } /* gd_move wrapper */ void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *new_fragment, const int32_t *flags) { char *fc; dtrace("%i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *new_fragment, *flags); gd_move(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *new_fragment, *flags); free(fc); dreturnvoid(); } /* gd_rename wrapper */ void F77_FUNC(gdrenm, GDRENM) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *new_name, const int32_t *new_name_l, const int32_t *flags) { char *fc, *nn; dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, new_name, *new_name_l, *flags); gd_rename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&nn, new_name, *new_name_l), *flags); free(nn); free(fc); dreturnvoid(); } /* gd_uninclude wrapper */ void F77_FUNC(gduinc, GDUINC) (const int32_t *dirfile, const int32_t *fragment, const int32_t *del) { gd_uninclude(_GDF_GetDirfile(*dirfile), *fragment, *del); } /* gd_alter_frameoffset wrapper */ void F77_FUNC(gdafof, GDAFOF) (const int32_t *dirfile, const int32_t *offset, const int32_t *fragment, const int32_t *recode) { gd_alter_frameoffset(_GDF_GetDirfile(*dirfile), *offset, *fragment, *recode); } /* gd_frameoffset wrapper */ void F77_FUNC(gdgfof, GDGFOF) (int32_t *offset, const int32_t *dirfile, const int32_t *fragment) { *offset = gd_frameoffset(_GDF_GetDirfile(*dirfile), *fragment); } /* gd_native_type wrapper */ void F77_FUNC(gdntyp, GDNTYP) (int32_t *type, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l); *type = gd_native_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *type); } /* returns the entry flags */ void F77_FUNC(gdenfl, GDENFL) (int32_t *flags, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; gd_entry_t E; DIRFILE *D; dtrace("%p, %i, %p, %i", flags, *dirfile, field_code, *field_code_l); D = _GDF_GetDirfile(*dirfile); if (gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E) == 0) { *flags = E.flags; gd_free_entry_strings(&E); } else *flags = -1; free(fc); dreturn("%i", *flags); } /* gd_validate wrapper */ void F77_FUNC(gdvldt, GDVLDT) (int32_t *valid, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", valid, *dirfile, field_code, *field_code_l); *valid = gd_validate(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *valid); } /* gd_framenum wrapper */ void F77_FUNC(gdfnum, GDFNUM) (double *framenum, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const double *value) { char *fc; dtrace("%p, %i, %p. %i, %g", framenum, *dirfile, field_code, *field_code_l, *value); *framenum = gd_framenum(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *value); free(fc); dreturn("%g", *value); } /* gd_framenum_subset wrapper */ void F77_FUNC(gdfnss, GDFNSS) (double *framenum, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const double *value, const int32_t *start, const int32_t *end) { char *fc; dtrace("%p, %i, %p, %i, %g, %i, %i", framenum, *dirfile, field_code, *field_code_l, *value, *start, *end); *framenum = gd_framenum_subset(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *value, *start, *end); free(fc); dreturn("%g", *framenum); } /* retrieve a scalar parameter */ void F77_FUNC(gdgsca, GDGSCA) (char *scalar, int32_t *scalar_l, int32_t *scalar_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *index) { char *fc; int ok = 0; gd_entry_t E; DIRFILE *D; dtrace("%p, %p, %p, %i, %p, %i, %i", scalar, scalar_l, scalar_index, *dirfile, field_code, *field_code_l, *index); D = _GDF_GetDirfile(*dirfile); gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E); free(fc); if (!gd_error(D) && *index > 0) { ok = 1; switch (E.field_type) { case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_LINTERP_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: ok = 0; break; case GD_LINCOM_ENTRY: if (*index > GD_MAX_LINCOM + E.EN(lincom,n_fields) || (*index > E.EN(lincom,n_fields) && *index <= GD_MAX_LINCOM)) { ok = 0; } break; case GD_POLYNOM_ENTRY: if (*index > E.EN(polynom,poly_ord) + 1) ok = 0; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: case GD_MPLEX_ENTRY: if (*index > 2) ok = 0; break; case GD_RECIP_ENTRY: case GD_RAW_ENTRY: case GD_PHASE_ENTRY: case GD_WINDOW_ENTRY: if (*index > 1) ok = 0; break; } } if (ok && E.scalar[*index - 1] == NULL) ok = 0; _GDF_FString(scalar, scalar_l, (ok) ? E.scalar[*index - 1] : ""); GDF_SCIND_C2F(*scalar_index, E.scalar_ind[*index - 1]); gd_free_entry_strings(&E); dreturnvoid(); } /* set a scalar parameter */ void F77_FUNC(gdasca, GDASCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *index, const char *scalar, const int32_t *scalar_l, int32_t *scalar_index, int32_t *recode) { int ok = 1; char *fc; gd_entry_t E; DIRFILE *D; dtrace("%i, %p, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *index, scalar, *scalar_l, *scalar_index, *recode); D = _GDF_GetDirfile(*dirfile); if (*index < 1) { dreturnvoid(); return; } if (gd_entry(D, _GDF_CString(&fc, field_code, *field_code_l), &E) == -1) { dreturnvoid(); return; } switch (E.field_type) { case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_LINTERP_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: ok = 0; break; case GD_LINCOM_ENTRY: if (*index > GD_MAX_LINCOM + E.EN(lincom,n_fields) || (*index > E.EN(lincom,n_fields) && *index <= GD_MAX_LINCOM)) { ok = 0; } break; case GD_POLYNOM_ENTRY: if (*index > E.EN(polynom,poly_ord) + 1) ok = 0; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: case GD_MPLEX_ENTRY: if (*index > 2) ok = 0; break; case GD_RAW_ENTRY: case GD_PHASE_ENTRY: case GD_RECIP_ENTRY: case GD_WINDOW_ENTRY: if (*index > 1) ok = 0; break; } if (!ok || gd_error(D)) { dreturnvoid(); return; } free(E.scalar[*index - 1]); _GDF_CString(E.scalar + *index - 1, scalar, *scalar_l); GDF_SCIND_F2C(E.scalar_ind[*index - 1], *scalar_index); gd_alter_entry(D, fc, &E, *recode); gd_free_entry_strings(&E); free(fc); dreturnvoid(); } /* gd_invalid_dirfile wrapper */ void F77_FUNC(gdinvd, GDINVD) (int32_t *dirfile) { dtrace("%p", dirfile); *dirfile = _GDF_SetDirfile(gd_invalid_dirfile(), 1); dreturn("%i", *dirfile); } /* gd_dirfile_standards wrapper */ void F77_FUNC(gdstdv, GDSTDV) (int32_t *vers, const int32_t *dirfile) { dtrace("%p, %i", vers, *dirfile); *vers = gd_dirfile_standards(_GDF_GetDirfile(*dirfile), *vers); dreturn("%i", *vers); } /* gd_seek wrapper */ void F77_FUNC(gdseek, GDSEEK) (int32_t *pos, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *frame_num, const int32_t *sample_num, const int32_t *flags) { char *fc; dtrace("%p, %i, %p, %i, %i, %i, 0x%X", pos, *dirfile, field_code, *field_code_l, *frame_num, *sample_num, *flags); *pos = (int)gd_seek(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), *frame_num, *sample_num, *flags); free(fc); dreturn("%i", *pos); } /* gd_tell wrapper */ void F77_FUNC(gdtell, GDTELL) (int32_t *pos, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", pos, *dirfile, field_code, *field_code_l); *pos = (int)gd_tell(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *pos); } /* gd_constants wrapper -- this only returns one value */ void F77_FUNC(gdcons, GDCONS) (void *value, const int32_t *dirfile, const int32_t *return_type, const int32_t *field_num) { const void *v; DIRFILE *D; unsigned int nfields; dtrace("%p, %i, 0x%X, %i", value, *dirfile, *return_type, *field_num); D = _GDF_GetDirfile(*dirfile); nfields = gd_nfields_by_type(D, GD_CONST_ENTRY); if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) { v = gd_constants(D, (gd_type_t)*return_type); if (!gd_error(D)) memcpy(value, (char*)v + (*field_num - 1) * GD_SIZE(*return_type), GD_SIZE(*return_type)); } dreturnvoid(); } /* gd_mconstants wrapper -- this only returns one value */ void F77_FUNC(gdmcos, GDMCOS) (void *value, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *return_type, const int32_t *field_num) { const void *v; DIRFILE *D; char *pa; unsigned int nfields; dtrace("%p, %i, %p, %i, 0x%X, %i", value, *dirfile, parent, *parent_l, *return_type, *field_num); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmfields_by_type(D, pa, GD_CONST_ENTRY); if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) { v = gd_mconstants(D, pa, (gd_type_t)*return_type); if (!gd_error(D)) memcpy(value, (char*)v + (*field_num - 1) * GD_SIZE(*return_type), GD_SIZE(*return_type)); } free(pa); dreturnvoid(); } /* gd_strings wrapper -- this only returns one value */ void F77_FUNC(gdstrs, GDSTRS) (char *value, int32_t *value_l, const int32_t *dirfile, const int32_t *field_num) { const char **v; DIRFILE *D; unsigned int nfields; dtrace("%p, %i, %i, %i", value, *value_l, *dirfile, *field_num); D = _GDF_GetDirfile(*dirfile); nfields = gd_nfields_by_type(D, GD_STRING_ENTRY); if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) { v = gd_strings(D); _GDF_FString(value, value_l, gd_error(D) ? "" : v[*field_num - 1]); } else *value_l = 0; dreturn("%i", *value_l); } /* gd_mstrings wrapper -- this only returns one value */ void F77_FUNC(gdmsts, GDMSTS) (void *value, int32_t *value_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *field_num) { const char **v; char *pa; DIRFILE *D; unsigned int nfields; dtrace("%p, %i, %i, %p, %i, %i", value, *value_l, *dirfile, parent, *parent_l, *field_num); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmfields_by_type(D, pa, GD_STRING_ENTRY); if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) { v = gd_mstrings(D, pa); _GDF_FString((char*)value, value_l, gd_error(D) ? "" : ((char**)v)[*field_num - 1]); } else *value_l = 0; free(pa); dreturnvoid(); } /* Return the maximum string value length */ void F77_FUNC(gdstrx, GDSTRX) (int32_t *max, const int32_t *dirfile) { const char **v; size_t len = 0; DIRFILE *D; unsigned int i, nfields; dtrace("%p, %i", max, *dirfile); D = _GDF_GetDirfile(*dirfile); nfields = gd_nfields_by_type(D, GD_STRING_ENTRY); if (!gd_error(D)) { v = gd_strings(D); for (i = 0; i < nfields; ++i) if (strlen(v[i]) > len) len = strlen(v[i]); } *max = (int)len; dreturn("%i", *max); } /* Return the maximum meta string value length */ void F77_FUNC(gdmstx, GDMSTX) (int32_t *max, const int32_t *dirfile, const char *parent, const int32_t *parent_l) { const char **v; size_t len = 0; DIRFILE *D; char *pa; unsigned int i, nfields; dtrace("%p, %i, %p, %i", max, *dirfile, parent, *parent_l); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nfields = gd_nmfields_by_type(D, pa, GD_STRING_ENTRY); if (!gd_error(D)) { v = gd_mstrings(D, pa); for (i = 0; i < nfields; ++i) if (strlen(v[i]) > len) len = strlen(v[i]); } *max = (int)len; free(pa); dreturn("%i", *max); } /* gd_add_alias wrapper */ void F77_FUNC(gdadal, GDADAL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *target, const int32_t *target_l, const int32_t *fragment_index) { char *tg, *fc; dtrace("%i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, target, *target_l, *fragment_index); gd_add_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&tg, target, *target_l), *fragment_index); free(fc); free(tg); dreturnvoid(); } /* gd_add_window wrapper */ void F77_FUNC(gdadwd, GDADWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold, const int32_t *fragment_index) { char *in, *cf, *fc; gd_triplet_t t; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, check_field, *check_field_l, *windop, threshold, *fragment_index); t = _GDF_SetTriplet((gd_windop_t)*windop, threshold); gd_add_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t, *fragment_index); free(fc); free(cf); free(in); dreturnvoid(); } /* gd_madd_window wrapper */ void F77_FUNC(gdmdwd, GDMDWD) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold) { char *in, *cf, *fc, *pa; gd_triplet_t t; dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i, %i, %p", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, check_field, *check_field_l, *windop, threshold); t = _GDF_SetTriplet((gd_windop_t)*windop, threshold); gd_madd_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t); free(pa); free(fc); free(cf); free(in); dreturnvoid(); } /* gd_add_mplex wrapper */ void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const int32_t *period, const int32_t *fragment_index) { char *in, *cf, *fc; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field, *count_field_l, *val, *period, *fragment_index); gd_add_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, count_field, *count_field_l), *val, *period, *fragment_index); free(fc); free(cf); free(in); dreturnvoid(); } /* gd_madd_mplex wrapper */ void F77_FUNC(gdmdmx, GDMDMX) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const int32_t *period) { char *in, *cf, *fc, *pa; dtrace("%i, %p, %i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, in_field, *in_field_l, count_field, *count_field_l, *val, *period); gd_madd_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, count_field, *count_field_l), *val, *period); free(pa); free(fc); free(cf); free(in); dreturnvoid(); } /* gd_alias_target */ void F77_FUNC(gdatrg, GDATRG) (char *target, int32_t *target_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { const char *targ; char *fc; dtrace("%p, %i, %i, %p, %i", target, *target_l, *dirfile, field_code, *field_code_l); targ = gd_alias_target(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); _GDF_FString(target, target_l, targ); free(fc); dreturn("%i", *target_l); } /* Return the maximum alias length */ void F77_FUNC(gdalsx, GDALSX) (int32_t *max, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { const char **al; size_t len = 0; char *fc; unsigned int i, nalias; DIRFILE *D; dtrace("%p, %i, %p, %i", max, *dirfile, field_code, *field_code_l); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&fc, field_code, *field_code_l); nalias = gd_naliases(D, fc); if (!gd_error(D)) { al = gd_aliases(D, fc); for (i = 0; i < nalias; ++i) if (strlen(al[i]) > len) len = strlen(al[i]); } *max = len; free(fc); dreturn("%zu", len); } /* gd_naliases */ void F77_FUNC(gdnals, GDNALS) (int32_t *nalias, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", nalias, *dirfile, field_code, *field_code_l); *nalias = gd_naliases(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *nalias); } /* gd_aliases -- this only returns one alias */ void F77_FUNC(gdalss, GDALSS) (char *alias, int32_t *alias_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *num) { const char **al; char *fc; unsigned int nalias; DIRFILE *D; dtrace("%p, %i, %i, %p, %i, %i", alias, *alias_l, *dirfile, field_code, *field_code_l, *num); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&fc, field_code, *field_code_l); nalias = gd_naliases(D, fc); if (!gd_error(D) && *num > 0 && *num <= (int)nalias) { al = gd_aliases(D, fc); _GDF_FString(alias, alias_l, al[*num - 1]); } else *alias_l = 0; free(fc); dreturn("%i", *alias_l); } /* gd_alter_affixes */ void F77_FUNC(gdaafx, GDAAFX) (const int32_t *dirfile, const int32_t *index, const char *prefix, const int32_t *prefix_l, const char *suffix, const int32_t *suffix_l) { char *px, *sx; dtrace("%i, %i, %p, %i, %p, %i", *dirfile, *index, prefix, *prefix_l, suffix, *suffix_l); gd_alter_affixes(_GDF_GetDirfile(*dirfile), *index, _GDF_CString(&px, prefix, *prefix_l), _GDF_CString(&sx, suffix, *suffix_l)); free(sx); free(px); dreturnvoid(); } /* gd_alter_window */ void F77_FUNC(gdalwd, GDALWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold) { char *fc, *in, *cf; gd_triplet_t t; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p", *dirfile, field_code, *field_code_l, in_field, *in_field_l, check_field, *check_field_l, *windop, threshold); t = _GDF_SetTriplet((gd_windop_t)*windop, threshold); gd_alter_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t); free(cf); free(in); free(fc); dreturnvoid(); } /* gd_alter_mplex */ void F77_FUNC(gdalmx, GDALMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const int32_t *period) { char *fc, *in, *cf; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field, *count_field_l, *val, *period); gd_alter_mplex(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, count_field, *count_field_l), *val, *period); free(cf); free(in); free(fc); dreturnvoid(); } /* gd_fragment_affixes */ void F77_FUNC(gdfraf, GDFRAF) (char *prefix, int32_t *prefix_l, char *suffix, int32_t *suffix_l, const int32_t *dirfile, const int32_t *index) { char *px, *sx; dtrace("%p, %i, %p, %i, %i, %i", prefix, *prefix_l, suffix, *suffix_l, *dirfile, *index); if (!gd_fragment_affixes(_GDF_GetDirfile(*dirfile), *index, &px, &sx)) { _GDF_FString(prefix, prefix_l, px); _GDF_FString(suffix, suffix_l, sx); free(px); free(sx); } else *prefix_l = *suffix_l = 0; dreturnvoid(); } /* gd_hidden */ void F77_FUNC(gdhidn, GDHIDN) (int32_t *result, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", result, *dirfile, field_code, *field_code_l); *result = gd_hidden(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *result); } /* gd_hide */ void F77_FUNC(gdhide, GDHIDE) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l); gd_hide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturnvoid(); } /* gd_unhide */ void F77_FUNC(gduhid, GDUHID) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l); gd_unhide(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturnvoid(); } /* gd_madd_alias wrapper */ void F77_FUNC(gdmdal, GDMDAL) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *target, const int32_t *target_l) { char *pa, *tg, *fc; dtrace("%i, %p, %i, %p, %i, %p, %i", *dirfile, parent, *parent_l, field_code, *field_code_l, target, *target_l); gd_madd_alias(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), _GDF_CString(&fc, field_code, *field_code_l), _GDF_CString(&tg, target, *target_l)); free(fc); free(tg); free(pa); dreturnvoid(); } /* gd_include_affix wrapper */ void F77_FUNC(gdinca, GDINCA) (const int32_t *dirfile, const char *file, const int32_t *file_l, const int32_t *fragment_index, const char *prefix, const int32_t *prefix_l, const char *suffix, const int32_t *suffix_l, const int32_t *flags) { char *fi, *px, *sx; dtrace("%i, %p, %i, %i, %p, %i, %p, %i, %i", *dirfile, file, *file_l, *fragment_index, prefix, *prefix_l, suffix, *suffix_l, *flags); gd_include_affix(_GDF_GetDirfile(*dirfile), _GDF_CString(&fi, file, *file_l), *fragment_index, _GDF_CString(&px, prefix, *prefix_l), _GDF_CString(&sx, suffix, *suffix_l), *flags); free(sx); free(px); free(fi); dreturnvoid(); } /* gd_sync wrapper */ void F77_FUNC(gdsync, GDSYNC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l); if (*field_code_l == 0) gd_sync(_GDF_GetDirfile(*dirfile), NULL); else { char *out; gd_sync(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l)); free(out); } dreturnvoid(); } /* gd_raw_close wrapper */ void F77_FUNC(gdrclo, GDRCLO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l); if (*field_code_l == 0) gd_sync(_GDF_GetDirfile(*dirfile), NULL); else { char *out; gd_raw_close(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code, *field_code_l)); free(out); } dreturnvoid(); } /* gd_strtok wrapper */ void F77_FUNC(gdtoke, GDTOKE) (char *toke, int32_t *toke_l, const int32_t *dirfile, const char *string, const int32_t *string_l) { char *token, *st = NULL; DIRFILE *D; dtrace("%p, %p, %i, %p, %i", toke, toke_l, *dirfile, string, *string_l); D = _GDF_GetDirfile(*dirfile); if (*string_l > 0) _GDF_CString(&st, string, *string_l); token = gd_strtok(D, st); free(st); _GDF_FString(toke, toke_l, token); free(token); dreturn("%i", *toke_l); } /* gd_desync wrapper */ void F77_FUNC(gddsyn, GDDSYN) (int32_t *desync, const int32_t *dirfile, const int32_t *flags) { dtrace("%p, %i, %i", desync, *dirfile, *flags); *desync = gd_desync(_GDF_GetDirfile(*dirfile), *flags); dreturn("%i", *desync); } /* gd_flags wrapper */ void F77_FUNC(gdflag, GDFLAG) (int32_t *flags, const int32_t *dirfile, const int32_t *set, const int32_t *reset) { dtrace("%p, %i, 0x%X, 0x%X", flags, *dirfile, *set, *reset); *flags = gd_flags(_GDF_GetDirfile(*dirfile), *set, *reset); dreturn("%i", *flags); } /* gd_verbose_prefix wrapper */ void F77_FUNC(gdvbpx, GDVBPX) (const int32_t *dirfile, const char *prefix, const int32_t *prefix_l) { char *px; dtrace("%i, %p, %i", *dirfile, prefix, *prefix_l); gd_verbose_prefix(_GDF_GetDirfile(*dirfile), _GDF_CString(&px, prefix, *prefix_l)); free(px); dreturnvoid(); } /* gd_mplex_lookback wrapper */ void F77_FUNC(gdmxlb, GDMXLB) (const int32_t *dirfile, const int32_t *lookback) { dtrace("%i, %i", *dirfile, *lookback); gd_mplex_lookback(_GDF_GetDirfile(*dirfile), *lookback); dreturnvoid(); } /* gd_nentries wrapper */ void F77_FUNC(gdnent, GDNENT) (int32_t *nentries, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *flags) { char *pa; dtrace("%p, %i, %p, %i, 0x%X, 0x%X", nentries, *dirfile, parent, *parent_l, *type, *flags); *nentries = gd_nentries(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent, *parent_l), (unsigned int)*type, (unsigned int)*flags); free(pa); dreturn("%i", *nentries); } /* Return the maximum field name length */ void F77_FUNC(gdentx, GDENTX) (int32_t *max, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *flags) { const char **el; char *pa; size_t len = 0; DIRFILE* D; unsigned int i, nentries; const unsigned int utype = (unsigned int)*type; const unsigned int uflags = (unsigned int)*flags; dtrace("%p, %i, %p, %i, 0x%X, 0x%X", max, *dirfile, parent, *parent_l, utype, uflags); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nentries = gd_nentries(D, pa, utype, uflags); if (!gd_error(D)) { el = gd_entry_list(D, pa, utype, uflags); for (i = 0; i < nentries; ++i) if (strlen(el[i]) > len) len = strlen(el[i]); } *max = len; free(pa); dreturn("%i", *max); } /* gd_entry_list wrapper -- this only returns one entry name */ void F77_FUNC(gdentn, GDENTN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *flags, const int32_t *field_num) { const char** el; char *pa; DIRFILE* D; unsigned int nentries; const unsigned int utype = (unsigned int)*type; const unsigned int uflags = (unsigned int)*flags; dtrace("%p, %p, %i, %p, %i, 0x%X, 0x%X, %i", name, name_l, *dirfile, parent, *parent_l, utype, uflags, *field_num); D = _GDF_GetDirfile(*dirfile); _GDF_CString(&pa, parent, *parent_l); nentries = gd_nentries(D, pa, utype, uflags); if (!gd_error(D) && *field_num > 0 && *field_num <= (int)nentries) { el = gd_entry_list(D, pa, utype, uflags); _GDF_FString(name, name_l, el[*field_num - 1]); } else *name_l = 0; free(pa); dreturn("%i", *name_l); } /* gd_linterp_tablename wrapper */ void F77_FUNC(gdlttn, GDLTTN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc, *fn; dtrace("%p, %i, %i, %p, %i", name, *name_l, *dirfile, field_code, *field_code_l); fn = gd_linterp_tablename(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); _GDF_FString(name, name_l, fn); free(fc); free(fn); dreturn("%i", *name_l); } /* gd_add_raw with scalar parameters */ void F77_FUNC(gdasrw, GDASRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const char *spf_scalar, const int32_t *spf_scalar_l, const int32_t *spf_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; dtrace("%i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *data_type, *spf, spf_scalar, *spf_scalar_l, *spf_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_RAW_ENTRY; E.fragment_index = *fragment_index; E.EN(raw,data_type) = *data_type; E.EN(raw,spf) = *spf; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(E.scalar, spf_scalar, *spf_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *spf_scalar_ind); gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.scalar[0]); dreturnvoid(); } void F77_FUNC(gdaslc, GDASLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1, const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const double *m2, const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2, const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const double *m3, const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3, const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; int i, n; dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %p, %i, " "%g, %p, %i, %i, %g, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, " "%i, %i", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, *m1, m1_scalar, *m1_scalar_l, *m1_scalar_ind, *b1, b1_scalar, *b1_scalar_l, *b1_scalar_ind, in_field2, *in_field2_l, *m2, m2_scalar, *m2_scalar_l, *m2_scalar_ind, *b2, b2_scalar, *b2_scalar_l, *b2_scalar_ind, in_field3, *in_field3_l, *m3, m3_scalar, *m3_scalar_l, *m3_scalar_ind, *b3, b3_scalar, *b3_scalar_l, *b3_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_LINCOM_ENTRY; E.fragment_index = *fragment_index; n = E.EN(lincom,n_fields) = *n_fields; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind); E.EN(lincom,m[0]) = *m1; E.EN(lincom,b[0]) = *b1; if (n > 1) { _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l); _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l); _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind); E.EN(lincom,m[1]) = *m2; E.EN(lincom,b[1]) = *b2; } if (n > 2) { _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l); _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l); _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind); E.EN(lincom,m[2]) = *m3; E.EN(lincom,b[2]) = *b3; } gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); for (i = 0; i < n; ++i) { free(E.in_fields[i]); free(E.scalar[i]); free(E.scalar[i + GD_MAX_LINCOM]); } dreturnvoid(); } void F77_FUNC(gdascl, GDASCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; int i, n; dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, " "%i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, " "%g;%g, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, crealp(m1), cimagp(m1), m1_scalar, *m1_scalar_l, *m1_scalar_ind, crealp(b1), cimagp(b1), b1_scalar, *b1_scalar_l, *b1_scalar_ind, in_field2, *in_field2_l, crealp(m2), cimagp(m2), m2_scalar, *m2_scalar_l, *m2_scalar_ind, crealp(b2), cimagp(b2), b2_scalar, *b2_scalar_l, *b2_scalar_ind, in_field3, *in_field3_l, crealp(m3), cimagp(m3), m3_scalar, *m3_scalar_l, *m3_scalar_ind, crealp(b3), cimagp(b3), b3_scalar, *b3_scalar_l, *b3_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_LINCOM_ENTRY; E.fragment_index = *fragment_index; n = E.EN(lincom,n_fields) = *n_fields; _GDF_CString(&E.field, field_code, *field_code_l); E.flags = GD_EN_COMPSCAL; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind); gd_cp2cs_(E.EN(lincom,cm)[0], m1); gd_cp2cs_(E.EN(lincom,cb)[0], b1); if (n > 1) { _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l); _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l); _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind); gd_cp2cs_(E.EN(lincom,cm)[1], m2); gd_cp2cs_(E.EN(lincom,cb)[1], b2); } if (n > 2) { _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l); _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l); _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind); gd_cp2cs_(E.EN(lincom,cm)[2], m3); gd_cp2cs_(E.EN(lincom,cb)[2], b3); } gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); for (i = 0; i < n; ++i) { free(E.in_fields[i]); free(E.scalar[i]); free(E.scalar[i + GD_MAX_LINCOM]); } dreturnvoid(); } void F77_FUNC(gdaspn, GDASPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const double *a1, const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const double *a3, const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const double *a5, const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; int i, n; dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %g, %p, %i, " "%i, %g, %p, %i, %i, %g, %p, %i, %i, %g, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, *a0, a0_scalar, *a0_scalar_l, *a0_scalar_ind, *a1, a1_scalar, *a1_scalar_l, *a1_scalar_ind, *a2, a2_scalar, *a2_scalar_l, *a2_scalar_ind, *a3, a3_scalar, *a3_scalar_l, *a3_scalar_ind, *a4, a4_scalar, *a4_scalar_l, *a4_scalar_ind, *a5, a5_scalar, *a5_scalar_l, *a5_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_POLYNOM_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; n = E.EN(polynom,poly_ord) = *poly_ord; if (n > 5) n = 5; else if (n < 1) n = 1; switch (n) { case 5: _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l); GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind); E.EN(polynom,a[5]) = *a5; /* fallthrough */ case 4: _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l); GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind); E.EN(polynom,a[4]) = *a4; /* fallthrough */ case 3: _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind); E.EN(polynom,a[3]) = *a3; /* fallthrough */ case 2: _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind); E.EN(polynom,a[2]) = *a2; /* fallthrough */ default: _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind); E.EN(polynom,a[1]) = *a1; _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind); E.EN(polynom,a[0]) = *a0; } gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); for (i = 0; i <= n; ++i) free(E.scalar[i]); dreturnvoid(); } void F77_FUNC(gdascp, GDASCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; int i, n; dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, " "%p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, crealp(a0), cimagp(a0), a0_scalar, *a0_scalar_l, *a0_scalar_ind, crealp(a1), cimagp(a1), a1_scalar, *a1_scalar_l, *a1_scalar_ind, crealp(a2), cimagp(a2), a2_scalar, *a2_scalar_l, *a2_scalar_ind, crealp(a3), cimagp(a3), a3_scalar, *a3_scalar_l, *a3_scalar_ind, crealp(a4), cimagp(a4), a4_scalar, *a4_scalar_l, *a4_scalar_ind, crealp(a5), cimagp(a5), a5_scalar, *a5_scalar_l, *a5_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_POLYNOM_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; n = E.EN(polynom,poly_ord) = *poly_ord; E.flags = GD_EN_COMPSCAL; if (n > 5) n = 5; else if (n < 1) n = 1; switch (n) { case 5: _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l); GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[5], a5); /* fallthrough */ case 4: _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l); GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[4], a4); /* fallthrough */ case 3: _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[3], a3); /* fallthrough */ case 2: _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[2], a2); /* fallthrough */ default: _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[1], a1); _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[0], a0); } gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); for (i = 0; i <= n; ++i) free(E.scalar[i]); dreturnvoid(); } void F77_FUNC(gdasph, GDASPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift, const char *shift_scalar, const int32_t *shift_scalar_l, const int32_t *shift_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *shift, shift_scalar, *shift_scalar_l, *shift_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_PHASE_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; E.EN(phase,shift) = *shift; _GDF_CString(E.scalar + 0, shift_scalar, *shift_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *shift_scalar_ind); gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); free(E.scalar[0]); dreturnvoid(); } void F77_FUNC(gdasrc, GDASRC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const char *dividend_scalar, const int32_t *dividend_scalar_l, const int32_t *dividend_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; dtrace("%i, %p, %i, %p, %i, %g, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *dividend, dividend_scalar, *dividend_scalar_l, *dividend_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_RECIP_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; E.EN(recip,dividend) = *dividend; _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind); gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); free(E.scalar[0]); dreturnvoid(); } void F77_FUNC(gdascr, GDASCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const char *dividend_scalar, const int32_t *dividend_scalar_l, const int32_t *dividend_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; dtrace("%i, %p, %i, %p, %i, %g;%g, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, dividend[0], dividend[1], dividend_scalar, *dividend_scalar_l, *dividend_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_RECIP_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.fragment_index = *fragment_index; gd_li2cs_(E.EN(recip,cdividend), dividend[0], dividend[1]); _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind); gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); free(E.scalar[0]); dreturnvoid(); } void F77_FUNC(gdaswd, GDASWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold, const char *threshold_scalar, const int32_t *threshold_scalar_l, const int32_t *threshold_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, check_field, *check_field_l, *windop, threshold, threshold_scalar, *threshold_scalar_l, *threshold_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_WINDOW_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); _GDF_CString(&E.in_fields[1], check_field, *check_field_l); E.fragment_index = *fragment_index; E.EN(window,windop) = *windop; E.EN(window,threshold) = _GDF_SetTriplet(E.EN(window,windop), threshold); _GDF_CString(E.scalar + 0, threshold_scalar, *threshold_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *threshold_scalar_ind); gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); free(E.in_fields[1]); free(E.scalar[0]); dreturnvoid(); } void F77_FUNC(gdasmx, GDASMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const char *val_scalar, const int32_t *val_scalar_l, const int32_t *val_scalar_ind, const int32_t *period, const char *period_scalar, const int32_t *period_scalar_l, const int32_t *period_scalar_ind, const int32_t *fragment_index) { gd_entry_t E; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field, *count_field_l, *val, val_scalar, *val_scalar_l, *val_scalar_ind, *period, period_scalar, *period_scalar_l, *period_scalar_ind, *fragment_index); memset(&E, 0, sizeof(E)); E.field_type = GD_MPLEX_ENTRY; _GDF_CString(&E.field, field_code, *field_code_l); _GDF_CString(&E.in_fields[0], in_field, *in_field_l); _GDF_CString(&E.in_fields[1], count_field, *count_field_l); E.fragment_index = *fragment_index; E.EN(mplex,count_val) = *val; E.EN(mplex,period) = *period; _GDF_CString(E.scalar + 0, val_scalar, *val_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *val_scalar_ind); _GDF_CString(E.scalar + 1, period_scalar, *period_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *period_scalar_ind); gd_add(_GDF_GetDirfile(*dirfile), &E); free(E.field); free(E.in_fields[0]); free(E.in_fields[1]); free(E.scalar[0]); free(E.scalar[1]); dreturnvoid(); } void F77_FUNC(gdlsph, GDLSPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift, const char *shift_scalar, const int32_t *shift_scalar_l, const int32_t *shift_scalar_ind) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *shift, shift_scalar, *shift_scalar_l, *shift_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_PHASE_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.EN(phase,shift) = *shift; _GDF_CString(E.scalar + 0, shift_scalar, *shift_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *shift_scalar_ind); gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); free(E.scalar[0]); dreturnvoid(); } void F77_FUNC(gdlspn, GDLSPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const double *a1, const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const double *a3, const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const double *a5, const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind) { char *fc; gd_entry_t E; int i, n; dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %g, " "%p, %i, %i, %g, %p, %i, %i, %g, %p, %i, %i, %g, %p, %i, %i", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, *a0, a0_scalar, *a0_scalar_l, *a0_scalar_ind, *a1, a1_scalar, *a1_scalar_l, *a1_scalar_ind, *a2, a2_scalar, *a2_scalar_l, *a2_scalar_ind, *a3, a3_scalar, *a3_scalar_l, *a3_scalar_ind, *a4, a4_scalar, *a4_scalar_l, *a4_scalar_ind, *a5, a5_scalar, *a5_scalar_l, *a5_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_POLYNOM_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); n = E.EN(polynom,poly_ord) = *poly_ord; if (n > 5) n = 5; else if (n < 1) n = 1; switch (n) { case 5: _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l); GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind); E.EN(polynom,a)[5] = *a5; /* fallthrough */ case 4: _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l); GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind); E.EN(polynom,a)[4] = *a4; /* fallthrough */ case 3: _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind); E.EN(polynom,a)[3] = *a3; /* fallthrough */ case 2: _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind); E.EN(polynom,a)[2] = *a2; /* fallthrough */ default: _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind); E.EN(polynom,a)[1] = *a1; _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind); E.EN(polynom,a)[0] = *a0; } gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); for (i = 0; i <= n; ++i) free(E.scalar[i]); dreturnvoid(); } void F77_FUNC(gdlscp, GDLSCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind) { char *fc; gd_entry_t E; int i, n; dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, " "%p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i", *dirfile, field_code, *field_code_l, *poly_ord, in_field, *in_field_l, crealp(a0), cimagp(a0), a0_scalar, *a0_scalar_l, *a0_scalar_ind, crealp(a1), cimagp(a1), a1_scalar, *a1_scalar_l, *a1_scalar_ind, crealp(a2), cimagp(a2), a2_scalar, *a2_scalar_l, *a2_scalar_ind, crealp(a3), cimagp(a3), a3_scalar, *a3_scalar_l, *a3_scalar_ind, crealp(a4), cimagp(a4), a4_scalar, *a4_scalar_l, *a4_scalar_ind, crealp(a5), cimagp(a5), a5_scalar, *a5_scalar_l, *a5_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_POLYNOM_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); n = E.EN(polynom,poly_ord) = *poly_ord; E.flags = GD_EN_COMPSCAL; if (n > 5) n = 5; else if (n < 1) n = 1; switch (n) { case 5: _GDF_CString(E.scalar + 5, a5_scalar, *a5_scalar_l); GDF_SCIND_F2C(E.scalar_ind[5], *a5_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[5], a5); /* fallthrough */ case 4: _GDF_CString(E.scalar + 4, a4_scalar, *a4_scalar_l); GDF_SCIND_F2C(E.scalar_ind[4], *a4_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[4], a4); /* fallthrough */ case 3: _GDF_CString(E.scalar + 3, a3_scalar, *a3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[3], *a3_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[3], a3); /* fallthrough */ case 2: _GDF_CString(E.scalar + 2, a2_scalar, *a2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *a2_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[2], a2); /* fallthrough */ default: _GDF_CString(E.scalar + 1, a1_scalar, *a1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *a1_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[1], a1); _GDF_CString(E.scalar + 0, a0_scalar, *a0_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *a0_scalar_ind); gd_cp2cs_(E.EN(polynom,ca)[0], a0); } gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); for (i = 0; i <= n; ++i) free(E.scalar[i]); dreturnvoid(); } void F77_FUNC(gdlswd, GDLSWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold, const char *threshold_scalar, const int32_t *threshold_scalar_l, const int32_t *threshold_scalar_ind) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, check_field, *check_field_l, *windop, threshold, threshold_scalar, *threshold_scalar_l, *threshold_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_WINDOW_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); _GDF_CString(&E.in_fields[1], check_field, *check_field_l); E.EN(window,windop) = *windop; E.EN(window,threshold) = _GDF_SetTriplet(E.EN(window,windop), threshold); _GDF_CString(E.scalar + 0, threshold_scalar, *threshold_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *threshold_scalar_ind); gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); free(E.in_fields[1]); free(E.scalar[0]); dreturnvoid(); } /* common code for gdasbt and gdassb */ static void _GDF_AddBitSBit(int32_t dirfile, const char *field_code, int32_t field_code_l, const char *in_field, int32_t in_field_l, int32_t bitnum, const char *bitnum_scalar, int32_t bitnum_scalar_l, int32_t bitnum_scalar_ind, int32_t numbits, const char *numbits_scalar, int32_t numbits_scalar_l, int32_t numbits_scalar_ind, int32_t fragment_index, int sbit) { gd_entry_t E; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i, %i", dirfile, field_code, field_code_l, in_field, in_field_l, bitnum, bitnum_scalar, bitnum_scalar_l, bitnum_scalar_ind, numbits, numbits_scalar, numbits_scalar_l, numbits_scalar_ind, fragment_index, sbit); memset(&E, 0, sizeof(E)); E.field_type = sbit ? GD_SBIT_ENTRY : GD_BIT_ENTRY; E.fragment_index = fragment_index; E.EN(bit,bitnum) = bitnum; E.EN(bit,numbits) = numbits; _GDF_CString(&E.field, field_code, field_code_l); _GDF_CString(E.in_fields, in_field, in_field_l); _GDF_CString(E.scalar, bitnum_scalar, bitnum_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], bitnum_scalar_ind); _GDF_CString(E.scalar + 1, numbits_scalar, numbits_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], numbits_scalar_ind); gd_add(_GDF_GetDirfile(dirfile), &E); free(E.field); free(E.in_fields[0]); free(E.scalar[0]); free(E.scalar[1]); dreturnvoid(); } /* gd_add_bit with scalar parameters */ void F77_FUNC(gdasbt, GDASBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind, const int32_t *fragment_index) { dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, *fragment_index); _GDF_AddBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, *fragment_index, 0); dreturnvoid(); } /* gd_add_sbit with scalar parameters */ void F77_FUNC(gdassb, GDASSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind, const int32_t *fragment_index) { dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, *fragment_index); _GDF_AddBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, *fragment_index, 1); dreturnvoid(); } /* common code for gdlsbt and gdlssb */ static void _GDF_AlterBitSBit(int32_t dirfile, const char *field_code, int32_t field_code_l, const char *in_field, int32_t in_field_l, int32_t bitnum, const char *bitnum_scalar, int32_t bitnum_scalar_l, int32_t bitnum_scalar_ind, int32_t numbits, const char *numbits_scalar, int32_t numbits_scalar_l, int32_t numbits_scalar_ind, int sbit) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i, %i", dirfile, field_code, field_code_l, in_field, in_field_l, bitnum, bitnum_scalar, bitnum_scalar_l, bitnum_scalar_ind, numbits, numbits_scalar, numbits_scalar_l, numbits_scalar_ind, sbit); memset(&E, 0, sizeof(E)); E.field_type = sbit ? GD_SBIT_ENTRY : GD_BIT_ENTRY; E.EN(bit,bitnum) = bitnum; E.EN(bit,numbits) = numbits; _GDF_CString(E.in_fields, in_field, in_field_l); _GDF_CString(E.scalar, bitnum_scalar, bitnum_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], bitnum_scalar_ind); _GDF_CString(E.scalar + 1, numbits_scalar, numbits_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], numbits_scalar_ind); gd_alter_entry(_GDF_GetDirfile(dirfile), _GDF_CString(&fc, field_code, field_code_l), &E, 0); free(fc); free(E.in_fields[0]); free(E.scalar[0]); free(E.scalar[1]); dreturnvoid(); } /* gd_alter_bit with scalar parameters */ void F77_FUNC(gdlsbt, GDLSBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind) { dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind); _GDF_AlterBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, 0); dreturnvoid(); } /* gd_alter_sbit with scalar parameters */ void F77_FUNC(gdlssb, GDLSSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind) { dtrace("%i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind); _GDF_AlterBitSBit(*dirfile, field_code, *field_code_l, in_field, *in_field_l, *bitnum, bitnum_scalar, *bitnum_scalar_l, *bitnum_scalar_ind, *numbits, numbits_scalar, *numbits_scalar_l, *numbits_scalar_ind, 1); dreturnvoid(); } /* gd_alter_lincom with scalar parameters */ void F77_FUNC(gdlslc, GDLSLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1, const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const double *m2, const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2, const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const double *m3, const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3, const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind) { gd_entry_t E; int i, n; char *fc; dtrace("%i, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, %i, %p, %i, " "%g, %p, %i, %i, %g, %p, %i, %i, %p, %i, %g, %p, %i, %i, %g, %p, %i, " "%i", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, *m1, m1_scalar, *m1_scalar_l, *m1_scalar_ind, *b1, b1_scalar, *b1_scalar_l, *b1_scalar_ind, in_field2, *in_field2_l, *m2, m2_scalar, *m2_scalar_l, *m2_scalar_ind, *b2, b2_scalar, *b2_scalar_l, *b2_scalar_ind, in_field3, *in_field3_l, *m3, m3_scalar, *m3_scalar_l, *m3_scalar_ind, *b3, b3_scalar, *b3_scalar_l, *b3_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_LINCOM_ENTRY; n = E.EN(lincom,n_fields) = *n_fields; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind); E.EN(lincom,m[0]) = *m1; E.EN(lincom,b[0]) = *b1; if (n > 1) { _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l); _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l); _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind); E.EN(lincom,m[1]) = *m2; E.EN(lincom,b[1]) = *b2; } if (n > 2) { _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l); _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l); _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind); E.EN(lincom,m[2]) = *m3; E.EN(lincom,b[2]) = *b3; } gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); for (i = 0; i < n; ++i) { free(E.in_fields[i]); free(E.scalar[i]); free(E.scalar[i + GD_MAX_LINCOM]); } dreturnvoid(); } /* gd_alter_clincom with scalar parameters */ void F77_FUNC(gdlscl, GDLSCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind) { gd_entry_t E; int i, n; char *fc; dtrace("%i, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, " "%i, %g;%g, %p, %i, %i, %g;%g, %p, %i, %i, %p, %i, %g;%g, %p, %i, %i, " "%g;%g, %p, %i, %i", *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l, crealp(m1), cimagp(m1), m1_scalar, *m1_scalar_l, *m1_scalar_ind, crealp(b1), cimagp(b1), b1_scalar, *b1_scalar_l, *b1_scalar_ind, in_field2, *in_field2_l, crealp(m2), cimagp(m2), m2_scalar, *m2_scalar_l, *m2_scalar_ind, crealp(b2), cimagp(b2), b2_scalar, *b2_scalar_l, *b2_scalar_ind, in_field3, *in_field3_l, crealp(m3), cimagp(m3), m3_scalar, *m3_scalar_l, *m3_scalar_ind, crealp(b3), cimagp(b3), b3_scalar, *b3_scalar_l, *b3_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_LINCOM_ENTRY; n = E.EN(lincom,n_fields) = *n_fields; E.flags = GD_EN_COMPSCAL; _GDF_CString(E.in_fields + 0, in_field1, *in_field1_l); _GDF_CString(E.scalar + 0, m1_scalar, *m1_scalar_l); _GDF_CString(E.scalar + 0 + GD_MAX_LINCOM, b1_scalar, *b1_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *m1_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[0 + GD_MAX_LINCOM], *b1_scalar_ind); gd_cp2cs_(E.EN(lincom,cm)[0], m1); gd_cp2cs_(E.EN(lincom,cb)[0], b1); if (n > 1) { _GDF_CString(E.in_fields + 1, in_field2, *in_field2_l); _GDF_CString(E.scalar + 1, m2_scalar, *m2_scalar_l); _GDF_CString(E.scalar + 1 + GD_MAX_LINCOM, b2_scalar, *b2_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *m2_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[1 + GD_MAX_LINCOM], *b2_scalar_ind); gd_cp2cs_(E.EN(lincom,cm)[1], m2); gd_cp2cs_(E.EN(lincom,cb)[1], b2); } if (n > 2) { _GDF_CString(E.in_fields + 2, in_field3, *in_field3_l); _GDF_CString(E.scalar + 2, m3_scalar, *m3_scalar_l); _GDF_CString(E.scalar + 2 + GD_MAX_LINCOM, b3_scalar, *b3_scalar_l); GDF_SCIND_F2C(E.scalar_ind[2], *m3_scalar_ind); GDF_SCIND_F2C(E.scalar_ind[2 + GD_MAX_LINCOM], *b3_scalar_ind); gd_cp2cs_(E.EN(lincom,cm)[2], m3); gd_cp2cs_(E.EN(lincom,cb)[2], b3); } gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); for (i = 0; i < n; ++i) { free(E.in_fields[i]); free(E.scalar[i]); free(E.scalar[i + GD_MAX_LINCOM]); } dreturnvoid(); } /* gd_alter_recip with scalar parameters */ void F77_FUNC(gdlsrc, GDLSRC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const char *dividend_scalar, const int32_t *dividend_scalar_l, const int32_t *dividend_scalar_ind) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %p, %i, %g, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, *dividend, dividend_scalar, *dividend_scalar_l, *dividend_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_RECIP_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); E.EN(recip,dividend) = *dividend; _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind); gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); free(E.scalar[0]); dreturnvoid(); } /* gd_alter_crecip with scalar parameters */ void F77_FUNC(gdlscr, GDLSCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const char *dividend_scalar, const int32_t *dividend_scalar_l, const int32_t *dividend_scalar_ind) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %p, %i, %g;%g, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, dividend[0], dividend[1], dividend_scalar, *dividend_scalar_l, *dividend_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_RECIP_ENTRY; E.flags = GD_EN_COMPSCAL; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); gd_li2cs_(E.EN(recip,cdividend), dividend[0], dividend[1]); _GDF_CString(E.scalar + 0, dividend_scalar, *dividend_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *dividend_scalar_ind); gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); free(E.scalar[0]); dreturnvoid(); } /* gd_alter_raw with scalar parameters */ void F77_FUNC(gdlsrw, GDLSRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const char *spf_scalar, const int32_t *spf_scalar_l, const int32_t *spf_scalar_ind, const int32_t *recode) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %i, %i, %p, %i, %i, %i", *dirfile, field_code, *field_code_l, *data_type, *spf, spf_scalar, *spf_scalar_l, *spf_scalar_ind, *recode); memset(&E, 0, sizeof(E)); E.field_type = GD_RAW_ENTRY; E.EN(raw,data_type) = *data_type; E.EN(raw,spf) = *spf; _GDF_CString(E.scalar, spf_scalar, *spf_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *spf_scalar_ind); gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, *recode); free(fc); free(E.scalar[0]); dreturnvoid(); } /* gd_alter_mplex with scalar parameters */ void F77_FUNC(gdlsmx, GDLSMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const char *val_scalar, const int32_t *val_scalar_l, const int32_t *val_scalar_ind, const int32_t *period, const char *period_scalar, const int32_t *period_scalar_l, const int32_t *period_scalar_ind) { gd_entry_t E; char *fc; dtrace("%i, %p, %i, %p, %i, %p, %i, %i, %p, %i, %i, %i, %p, %i, %i", *dirfile, field_code, *field_code_l, in_field, *in_field_l, count_field, *count_field_l, *val, val_scalar, *val_scalar_l, *val_scalar_ind, *period, period_scalar, *period_scalar_l, *period_scalar_ind); memset(&E, 0, sizeof(E)); E.field_type = GD_MPLEX_ENTRY; _GDF_CString(&E.in_fields[0], in_field, *in_field_l); _GDF_CString(&E.in_fields[1], count_field, *count_field_l); E.EN(mplex,count_val) = *val; E.EN(mplex,period) = *period; _GDF_CString(E.scalar + 0, val_scalar, *val_scalar_l); GDF_SCIND_F2C(E.scalar_ind[0], *val_scalar_ind); _GDF_CString(E.scalar + 1, period_scalar, *period_scalar_l); GDF_SCIND_F2C(E.scalar_ind[1], *period_scalar_ind); gd_alter_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l), &E, 0); free(fc); free(E.in_fields[0]); free(E.in_fields[1]); free(E.scalar[0]); free(E.scalar[1]); dreturnvoid(); } /* gd_encoding_support */ void F77_FUNC(gdencs,GDENCS) (int32_t *ret, const int32_t *encoding) { dtrace("%p, 0x%X", ret, *encoding); *ret = gd_encoding_support((unsigned long)*encoding); dreturn("%i", *ret); } /* gd_array_len wrapper */ void F77_FUNC(gdarln, GDARLN) (int32_t *len, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l) { char *fc; dtrace("%p, %i, %p, %i", len, *dirfile, field_code, *field_code_l); *len = gd_array_len(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code, *field_code_l)); free(fc); dreturn("%i", *len); } libgetdata-0.9.0/bindings/f77/getdata.f90.in0000640000175000017500000033262412614323564020554 0ustar alastairalastair! Copyright (C) 2008-2015 D. V. Wiebe ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! This file is part of the GetData project. ! ! GetData 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. ! ! GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., ! 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ! ! -*- F95 -*- module getdata implicit none @PARAMETERS95@ integer, parameter :: GD_FIELD_LEN=@GD_MAX_LINE_LENGTH@ type gd_entry integer :: field_type, n_fields, spf, data_type, bitnum, numbits, shift integer :: fragment_index, flags, poly_ord, array_len, windop, ithreshold integer :: count_val, period character (len=GD_FIELD_LEN), dimension(3) :: field character (len=GD_FIELD_LEN), dimension(6) :: scalar integer, dimension(6) :: scalar_ind double precision, dimension(3) :: m, b double precision, dimension(6) :: a double precision :: dividend, rthreshold double complex, dimension(3) :: cm, cb double complex, dimension(6) :: ca double complex :: cdividend end type contains function fgd_open (dirfilename, flags) integer :: fgd_open character (len=*), intent (in) :: dirfilename integer, intent (in) :: flags ! call f77 library call gdopen(fgd_open, TRIM(dirfilename), LEN_TRIM(dirfilename), flags) end function function fgd_cbopen (dirfilename, flags, sehandler) integer :: fgd_cbopen character (len=*), intent (in) :: dirfilename integer, intent (in) :: flags interface subroutine sehandler(act, dirfile_unit, suberror, line) integer, intent (out) :: act integer, intent (in) :: dirfile_unit, suberror character (len=@GD_MAX_LINE_LENGTH@), intent (inout) :: line end subroutine end interface ! call f77 library call gdcopn(fgd_cbopen, TRIM(dirfilename), LEN_TRIM(dirfilename), flags, & sehandler) end function subroutine fgd_discard (dirfile) integer, intent(in) :: dirfile ! call f77 library call gddscd(dirfile) end subroutine subroutine fgd_close (dirfile) integer, intent(in) :: dirfile ! call f77 library call gdclos(dirfile) end subroutine subroutine fgd_flush (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code ! call f77 library -- this will take care of figuring out whether ! field_code is empty or not call gdflsh(dirfile, TRIM(field_code), LEN_TRIM(field_code)) end subroutine ! getdata with return_type=GD_NULL function fgd_getdata_n (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples) integer :: fgd_getdata_n integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples ! call f77 library call gdgetd(fgd_getdata_n, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_NULL, 0) end function ! getdata with return_type=GD_INT8 function fgd_getdata_i1 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_i1 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*1, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_i1, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT8, data_out) end function ! getdata with return_type=GD_INT16 function fgd_getdata_i2 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_i2 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*2, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_i2, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT16, data_out) end function ! getdata with return_type=GD_INT32 function fgd_getdata_i4 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_i4 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*4, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_i4, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT32, data_out) end function ! getdata with return_type=GD_INT64 function fgd_getdata_i8 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_i8 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*8, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_i8, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT64, data_out) end function ! getdata with return_type=GD_FLOAT32 function fgd_getdata_r4 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_r4 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples real*4, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_r4, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_FLOAT32, data_out) end function ! getdata with return_type=GD_FLOAT64 function fgd_getdata_r8 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_r8 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples double precision, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_r8, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_FLOAT64, data_out) end function ! getdata with return_type=GD_COMPLEX64 function fgd_getdata_c8 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_c8 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples complex, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_c8, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_COMPLEX64, data_out) end function ! getdata with return_type=GD_COMPLEX128 function fgd_getdata_c16 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_out) integer :: fgd_getdata_c16 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples double complex, dimension(:), intent(out) :: data_out ! call f77 library call gdgetd(fgd_getdata_c16, dirfile, TRIM(field_code), & LEN_TRIM(field_code), first_frame, first_sample, num_frames, num_samples, & GD_COMPLEX128, data_out) end function !get_constant with return_type=GD_NULL subroutine fgd_get_constant_n (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_NULL, 0) end subroutine !get_constant with return_type=GD_INT8 subroutine fgd_get_constant_i1 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*1, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, & data_out) end subroutine !get_constant with return_type=GD_INT16 subroutine fgd_get_constant_i2 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*2, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, & data_out) end subroutine !get_constant with return_type=GD_INT32 subroutine fgd_get_constant_i4 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*4, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, & data_out) end subroutine !get_constant with return_type=GD_INT64 subroutine fgd_get_constant_i8 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*8, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, & data_out) end subroutine !get_constant with return_type=GD_FLOAT32 subroutine fgd_get_constant_r4 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code real*4, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, & data_out) end subroutine !get_constant with return_type=GD_FLOAT64 subroutine fgd_get_constant_r8 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code double precision, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, & data_out) end subroutine !get_constant with return_type=GD_COMPLEX64 subroutine fgd_get_constant_c8 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code complex, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, & data_out) end subroutine !get_constant with return_type=GD_COMPLEX128 subroutine fgd_get_constant_c16 (dirfile, field_code, data_out) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code double complex, intent(out) :: data_out ! call f77 library call gdgtco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX128, & data_out) end subroutine function fgd_get_string (dirfile, field_code, length, data_out) integer :: fgd_get_string integer, intent(in) :: dirfile, length character (len=*), intent(in) :: field_code character (len=*), intent(out) :: data_out ! call f77 library call gdgtst(fgd_get_string, dirfile, TRIM(field_code), LEN_TRIM(field_code), & length, data_out) end function function fgd_nfields (dirfile) integer :: fgd_nfields integer, intent(in) :: dirfile ! call f77 library call gdnfld(fgd_nfields, dirfile) end function function fgd_nfields_by_type (dirfile, entype) integer :: fgd_nfields_by_type integer, intent(in) :: dirfile, entype call gdnfdt(fgd_nfields_by_type, dirfile, entype) end function function fgd_nvectors (dirfile) integer :: fgd_nvectors integer, intent(in) :: dirfile call gdnvec(fgd_nvectors, dirfile) end function function fgd_nmfields (dirfile, parent) integer :: fgd_nmfields integer, intent(in) :: dirfile character (len=*), intent(in) :: parent ! call f77 library call gdnmfd(fgd_nmfields, dirfile, TRIM(parent), LEN_TRIM(parent)) end function function fgd_nmfields_by_type (dirfile, parent, entype) integer :: fgd_nmfields_by_type integer, intent(in) :: dirfile, entype character (len=*), intent(in) :: parent call gdnmft(fgd_nmfields_by_type, dirfile, TRIM(parent), & LEN_TRIM(parent), entype) end function function fgd_nmvectors (dirfile, parent) integer :: fgd_nmvectors integer, intent(in) :: dirfile character (len=*), intent(in) :: parent call gdnmve(fgd_nmvectors, dirfile, TRIM(parent), LEN_TRIM(parent)) end function function fgd_field_name_max (dirfile) integer :: fgd_field_name_max integer, intent(in) :: dirfile ! call f77 library call gdfdnx(fgd_field_name_max, dirfile) end function function fgd_mfield_name_max (dirfile, parent) integer :: fgd_mfield_name_max integer, intent(in) :: dirfile character (len=*), intent(in) :: parent ! call f77 library call gdmfnx(fgd_mfield_name_max, dirfile, TRIM(parent), LEN_TRIM(parent)) end function subroutine fgd_field_list (field_list, dirfile, field_len) character(len=*), dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile integer, intent(inout) :: field_len integer :: max_len, nfields, i ! make sure the field list is large enough max_len = fgd_field_name_max(dirfile) if (field_len .lt. max_len) then field_len = max_len else nfields = fgd_nfields(dirfile) do i=1,nfields ! call f77 library call gdfldn(field_list(i), field_len, dirfile, i) end do end if end subroutine subroutine fgd_field_list_by_type (field_list, dirfile, entype, field_len) character(len=*), dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile, entype integer, intent(inout) :: field_len integer :: max_len, nfields, i ! make sure the field list is large enough max_len = fgd_field_name_max(dirfile) if (field_len .lt. max_len) then field_len = max_len else nfields = fgd_nfields_by_type(dirfile, entype) do i=1,nfields ! call f77 library call gdfdnt(field_list(i), field_len, dirfile, entype, i) end do end if end subroutine subroutine fgd_vector_list (field_list, dirfile, field_len) character(len=*), dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile integer, intent(inout) :: field_len integer :: max_len, nfields, i ! make sure the field list is large enough max_len = fgd_field_name_max(dirfile) if (field_len .lt. max_len) then field_len = max_len else nfields = fgd_nvectors(dirfile) do i=1,nfields ! call f77 library call gdvecn(field_list(i), field_len, dirfile, i) end do end if end subroutine subroutine fgd_mfield_list (field_list, dirfile, parent, field_len) character(len=*), dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile integer, intent(inout) :: field_len integer :: max_len, nfields, i character (len=*), intent(in) :: parent ! make sure the field list is large enough max_len = fgd_mfield_name_max(dirfile, parent) if (field_len .lt. max_len) then field_len = max_len else nfields = fgd_nmfields(dirfile, parent) do i=1,nfields ! call f77 library call gdmfdn(field_list(i), field_len, dirfile, TRIM(parent), & LEN_TRIM(parent), i) end do end if end subroutine subroutine fgd_mfield_list_by_type (field_list, dirfile, parent, entype, & field_len) character(len=*), dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile, entype integer, intent(inout) :: field_len integer :: max_len, nfields, i character (len=*), intent(in) :: parent ! make sure the field list is large enough max_len = fgd_mfield_name_max(dirfile, parent) if (field_len .lt. max_len) then field_len = max_len else nfields = fgd_nmfields_by_type(dirfile, parent, entype) do i=1,nfields ! call f77 library call gdmfdt(field_list(i), field_len, dirfile, TRIM(parent), & LEN_TRIM(parent), entype, i) end do end if end subroutine subroutine fgd_mvector_list (field_list, dirfile, parent, field_len) character(len=*), dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile integer, intent(inout) :: field_len integer :: max_len, nfields, i character (len=*), intent(in) :: parent ! make sure the field list is large enough max_len = fgd_mfield_name_max(dirfile, parent) if (field_len .lt. max_len) then field_len = max_len else nfields = fgd_nmvectors(dirfile, parent) do i=1,nfields ! call f77 library call gdmven(field_list(i), field_len, dirfile, TRIM(parent), & LEN_TRIM(parent), i) end do end if end subroutine function fgd_bof (dirfile, field_code) integer :: fgd_bof integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code ! call f77 library call gdgbof(fgd_bof, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function function fgd_eof (dirfile, field_code) integer :: fgd_eof integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code ! call f77 library call gdgeof(fgd_eof, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function function fgd_nframes (dirfile) integer :: fgd_nframes integer, intent(in) :: dirfile ! call f77 library call gdnfrm(fgd_nframes, dirfile) end function function fgd_spf (dirfile, field_code) integer :: fgd_spf integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code ! call f77 library call gdgspf(fgd_spf, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function ! putdata with data_type=GD_INT8 function fgd_putdata_i1 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_i1 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*1, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_i1, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT8, data_in) end function ! putdata with data_type=GD_INT16 function fgd_putdata_i2 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_i2 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*2, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_i2, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT16, data_in) end function ! putdata with data_type=GD_INT32 function fgd_putdata_i4 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_i4 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*4, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_i4, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT32, data_in) end function ! putdata with data_type=GD_INT64 function fgd_putdata_i8 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_i8 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples integer*8, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_i8, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_INT64, data_in) end function ! putdata with data_type=GD_FLOAT32 function fgd_putdata_r4 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_r4 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples real*4, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_r4, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_FLOAT32, data_in) end function ! putdata with data_type=GD_FLOAT64 function fgd_putdata_r8 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_r8 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples double precision, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_r8, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_FLOAT64, data_in) end function ! putdata with data_type=GD_COMPLEX64 function fgd_putdata_c8 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_c8 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples complex, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_c8, dirfile, TRIM(field_code), LEN_TRIM(field_code), & first_frame, first_sample, num_frames, num_samples, GD_COMPLEX64, data_in) end function ! putdata with data_type=GD_COMPLEX128 function fgd_putdata_c16 (dirfile, field_code, first_frame, first_sample, & num_frames, num_samples, data_in) integer :: fgd_putdata_c16 integer, intent(in) :: dirfile, first_frame, first_sample, num_frames character (len=*), intent(in) :: field_code integer, intent(in) :: num_samples double complex, dimension(:), intent(in) :: data_in ! call f77 library call gdputd(fgd_putdata_c16, dirfile, TRIM(field_code), & LEN_TRIM(field_code), first_frame, first_sample, num_frames, num_samples, & GD_COMPLEX128, data_in) end function ! put_constant with data_type=GD_INT8 subroutine fgd_put_constant_i1 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*1, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, data_in) end subroutine ! put_constant with data_type=GD_INT16 subroutine fgd_put_constant_i2 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*2, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, & data_in) end subroutine ! put_constant with data_type=GD_INT32 subroutine fgd_put_constant_i4 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*4, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, & data_in) end subroutine ! put_constant with data_type=GD_INT64 subroutine fgd_put_constant_i8 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer*8, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, & data_in) end subroutine ! put_constant with data_type=GD_FLOAT32 subroutine fgd_put_constant_r4 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code real*4, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, & data_in) end subroutine ! put_constant with data_type=GD_FLOAT64 subroutine fgd_put_constant_r8 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code double precision, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, & data_in) end subroutine ! put_constant with data_type=GD_COMPLEX64 subroutine fgd_put_constant_c8 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code complex, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, & data_in) end subroutine ! put_constant with data_type=GD_COMPLEX128 subroutine fgd_put_constant_c16 (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code double complex, intent(in) :: data_in ! call f77 library call gdptco(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX128, & data_in) end subroutine function fgd_put_string (dirfile, field_code, data_in) integer :: fgd_put_string integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code, data_in call gdptst(fgd_put_string, dirfile, TRIM(field_code), LEN_TRIM(field_code), & LEN_TRIM(data_in), TRIM(data_in)) end function function fgd_error (dirfile) integer :: fgd_error integer, intent(in) :: dirfile ! call f77 library call gderor(fgd_error, dirfile) end function function fgd_error_count (dirfile) integer :: fgd_error_count integer, intent(in) :: dirfile ! call f77 library call gdecnt(fgd_error_count, dirfile) end function subroutine fgd_error_string (dirfile, buffer, len) integer, intent(in) :: dirfile, len character (len=*), intent(out) :: buffer ! call f77 library call gdestr(dirfile, buffer, len) end subroutine function fgd_entry (dirfile, field_code, ent) integer :: fgd_entry integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code type(gd_entry), intent(out) :: ent integer :: i ! the call may modify the lengths, so don't use parameters integer :: len1 = GD_FIELD_LEN integer :: len2 = GD_FIELD_LEN integer :: len3 = GD_FIELD_LEN ! get field type from f77 library call gdenty(fgd_entry, dirfile, TRIM(field_code), LEN_TRIM(field_code)) ! flags call gdenfl(ent%flags, dirfile, TRIM(field_code), LEN_TRIM(field_code)) if (fgd_entry .EQ. GD_RAW_ENTRY) then ! raw call gdgerw(ent%spf, ent%data_type, ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) else if (fgd_entry .EQ. GD_LINCOM_ENTRY) then ! lincom if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdgecl(ent%n_fields, ent%field(1), len1, ent%cm(1), ent%cb(1), & ent%field(2), len2, ent%cm(2), ent%cb(2), ent%field(3), len3, ent%cm(3), & ent%cb(3), ent%fragment_index, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) else call gdgelc(ent%n_fields, ent%field(1), len1, ent%m(1), ent%b(1), & ent%field(2), len2, ent%m(2), ent%b(2), ent%field(3), len3, ent%m(3), & ent%b(3), ent%fragment_index, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) end if do i=1,6 len1 = GD_FIELD_LEN call gdgsca(ent%scalar(i), len1, ent%scalar_ind(i), dirfile, & TRIM(field_code), LEN_TRIM(field_code), i) end do else if (fgd_entry .EQ. GD_LINTERP_ENTRY) then ! linterp call gdgelt(ent%field(1), len1, ent%field(2), len2, ent%fragment_index, & dirfile, TRIM(field_code), LEN_TRIM(field_code)) else if (fgd_entry .EQ. GD_BIT_ENTRY) then ! bit call gdgebt(ent%field(1), len1, ent%bitnum, ent%numbits, & ent%fragment_index, dirfile, TRIM(field_code), LEN_TRIM(field_code)) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(2), len1, ent%scalar_ind(2), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 2) else if (fgd_entry .EQ. GD_SBIT_ENTRY) then ! sbit call gdgesb(ent%field(1), len1, ent%bitnum, ent%numbits, & ent%fragment_index, dirfile, TRIM(field_code), LEN_TRIM(field_code)) call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(2), len1, ent%scalar_ind(2), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 2) else if (fgd_entry .EQ. GD_MULTIPLY_ENTRY) then ! multiply call gdgemt(ent%field(1), len1, ent%field(2), len2, ent%fragment_index, & dirfile, TRIM(field_code), LEN_TRIM(field_code)) else if (fgd_entry .EQ. GD_DIVIDE_ENTRY) then ! divide call gdgedv(ent%field(1), len1, ent%field(2), len2, ent%fragment_index, & dirfile, TRIM(field_code), LEN_TRIM(field_code)) else if (fgd_entry .EQ. GD_PHASE_ENTRY) then !phase call gdgeph(ent%field(1), len1, ent%shift, ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) else if (fgd_entry .EQ. GD_POLYNOM_ENTRY) then ! polynom if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdgecp(ent%poly_ord, ent%field(1), len1, ent%ca(1), ent%ca(2), & ent%ca(3), ent%ca(4), ent%ca(5), ent%ca(6), ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) else call gdgepn(ent%poly_ord, ent%field(1), len1, ent%a(1), ent%a(2), & ent%a(3), ent%a(4), ent%a(5), ent%a(6), ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) end if do i=1,6 len1 = GD_FIELD_LEN call gdgsca(ent%scalar(i), len1, ent%scalar_ind(i), dirfile, & TRIM(field_code), LEN_TRIM(field_code), i) end do else if (fgd_entry .EQ. GD_RECIP_ENTRY) then ! recip if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdgecr(ent%field(1), len1, ent%cdividend, ent%fragment_index, & dirfile, TRIM(field_code), LEN_TRIM(field_code)) else call gdgerc(ent%field(1), len1, ent%dividend, ent%fragment_index, & dirfile, TRIM(field_code), LEN_TRIM(field_code)) end if len1 = GD_FIELD_LEN call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) else if (fgd_entry .EQ. GD_WINDOW_ENTRY) then ! window call gdgewd(ent%field(1), len1, ent%field(2), len2, ent%windop, & ent%ithreshold, ent%rthreshold, ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) else if (fgd_entry .EQ. GD_MPLEX_ENTRY) then ! mplex call gdgemx(ent%field(1), len1, ent%field(2), len2, ent%count_val, & ent%period, ent%fragment_index, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(1), len1, ent%scalar_ind(1), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 1) len1 = GD_FIELD_LEN call gdgsca(ent%scalar(2), len1, ent%scalar_ind(2), dirfile, & TRIM(field_code), LEN_TRIM(field_code), 2) else if (fgd_entry .EQ. GD_CONST_ENTRY) then !const call gdgeco(ent%data_type, ent%fragment_index, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) else if (fgd_entry .EQ. GD_CARRAY_ENTRY) then !carray call gdgeca(ent%data_type, ent%array_len, ent%fragment_index, dirfile, & TRIM(field_code), LEN_TRIM(field_code)) else if (fgd_entry .EQ. GD_STRING_ENTRY) then !string call gdfrgi(ent%fragment_index, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) else ! on the off chance we got a type we weren't prepared to deal with fgd_entry = GD_NO_ENTRY end if ent%field_type = fgd_entry end function function fgd_entry_type (dirfile, field_code) integer :: fgd_entry_type integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdenty(fgd_entry_type, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) end function function fgd_fragment_index (dirfile, field_code) integer :: fgd_fragment_index integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdfrgi(fgd_fragment_index, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) end function subroutine fgd_add (dirfile, field_code, ent) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code type(gd_entry), intent(in) :: ent integer*4 :: zero = 0 character (len=1) :: nil = "" if (ent%field_type .EQ. GD_RAW_ENTRY) then call gdasrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%data_type, ent%spf, TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), & ent%scalar_ind(1), ent%fragment_index) else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then call gdaslc(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%m(1), & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%b(1), TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), & ent%scalar_ind(4), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%m(2), & TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), ent%scalar_ind(2), & ent%b(2), TRIM(ent%scalar(5)), LEN_TRIM(ent%scalar(5)), & ent%scalar_ind(5), TRIM(ent%field(3)), LEN_TRIM(ent%field(3)), ent%m(3), & TRIM(ent%scalar(3)), LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), & ent%b(3), TRIM(ent%scalar(6)), LEN_TRIM(ent%scalar(6)), & ent%scalar_ind(6), ent%fragment_index) else call gdascl(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%n_fields, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cm(1), & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%cb(1), TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), & ent%scalar_ind(4), TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), & ent%cm(2), TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), & ent%scalar_ind(2), ent%cb(2), TRIM(ent%scalar(5)), & LEN_TRIM(ent%scalar(5)), ent%scalar_ind(5), TRIM(ent%field(3)), & LEN_TRIM(ent%field(3)), ent%cm(3), TRIM(ent%scalar(3)), & LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), ent%cb(3), & TRIM(ent%scalar(6)), LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), & ent%fragment_index) end if else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then call gdadlt(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%fragment_index) else if (ent%field_type .EQ. GD_BIT_ENTRY) then call gdasbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%numbits, TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), & ent%scalar_ind(2), ent%fragment_index) else if (ent%field_type .EQ. GD_SBIT_ENTRY) then call gdassb(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%bitnum, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%numbits, TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), & ent%scalar_ind(2), ent%fragment_index) else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then call gdadmt(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%fragment_index) else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then call gdaddv(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%fragment_index) else if (ent%field_type .EQ. GD_PHASE_ENTRY) then call gdasph(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%fragment_index) else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then call gdaspn(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%a(1), & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%a(2), TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), & ent%scalar_ind(2), ent%a(3), TRIM(ent%scalar(3)), & LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), ent%a(4), & TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), ent%scalar_ind(4), & ent%a(5), TRIM(ent%scalar(5)), LEN_TRIM(ent%scalar(5)), & ent%scalar_ind(5), ent%a(6), TRIM(ent%scalar(6)), & LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), ent%fragment_index) else call gdascp(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%poly_ord, TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%ca(1), & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%ca(2), TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), & ent%scalar_ind(2), ent%ca(3), TRIM(ent%scalar(3)), & LEN_TRIM(ent%scalar(3)), ent%scalar_ind(3), ent%ca(4), & TRIM(ent%scalar(4)), LEN_TRIM(ent%scalar(4)), ent%scalar_ind(4), & ent%ca(5), TRIM(ent%scalar(5)), LEN_TRIM(ent%scalar(5)), & ent%scalar_ind(5), ent%ca(6), TRIM(ent%scalar(6)), & LEN_TRIM(ent%scalar(6)), ent%scalar_ind(6), ent%fragment_index) end if else if (ent%field_type .EQ. GD_RECIP_ENTRY) then if (IAND(GD_EN_COMPSCAL, ent%flags) .EQ. 0) then call gdasrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%dividend, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%fragment_index) else call gdascr(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%cdividend, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%fragment_index) end if else if (ent%field_type .EQ. GD_WINDOW_ENTRY) then if ((ent%windop .EQ. GD_WINDOP_EQ) .OR. (ent%windop .EQ. GD_WINDOP_NE) & .OR. (ent%windop .EQ. GD_WINDOP_SET) .OR. (ent%windop .EQ. GD_WINDOP_CLR)) & then call gdaswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%fragment_index) else call gdaswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%windop, ent%rthreshold, & TRIM(ent%scalar(1)), LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), & ent%fragment_index) end if else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then call gdasmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%count_val, TRIM(ent%scalar(1)), & LEN_TRIM(ent%scalar(1)), ent%scalar_ind(1), ent%period, & TRIM(ent%scalar(2)), LEN_TRIM(ent%scalar(2)), ent%scalar_ind(2), & ent%fragment_index) else if (ent%field_type .EQ. GD_CONST_ENTRY) then call gdadco(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%data_type, GD_INT32, zero, ent%fragment_index) else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then call fgd_add_carray(dirfile, field_code, ent%data_type, ent%array_len, & ent%fragment_index) else if (ent%field_type .EQ. GD_STRING_ENTRY) then call gdadst(dirfile, TRIM(field_code), LEN_TRIM(field_code), nil, zero, & ent%fragment_index) end if end subroutine subroutine fgd_add_bit (dirfile, field_name, in_field, bitnum, numbits, & fragment_index) integer, intent(in) :: dirfile, bitnum, numbits, fragment_index character (len=*), intent(in) :: field_name, in_field call gdadbt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), bitnum, numbits, fragment_index) end subroutine subroutine fgd_add_sbit (dirfile, field_name, in_field, bitnum, numbits, & fragment_index) integer, intent(in) :: dirfile, bitnum, numbits, fragment_index character (len=*), intent(in) :: field_name, in_field call gdadsb(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), bitnum, numbits, fragment_index) end subroutine subroutine fgd_add_const (dirfile, field_name, const_type, fragment_index) integer, intent(in) :: dirfile, const_type, fragment_index character (len=*), intent(in) :: field_name integer*4 :: zero = 0 call gdadco(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, & GD_INT32, zero, fragment_index) end subroutine subroutine fgd_add_lincom (dirfile, field_name, n_fields, in_field1, m1, b1, & in_field2, m2, b2, in_field3, m3, b3, fragment_index) integer, intent(in) :: dirfile, n_fields, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double precision, intent(in) :: m1, b1, m2, b2, m3, b3 call gdadlc(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, & TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), & LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3, & fragment_index) end subroutine subroutine fgd_add_clincom (dirfile, field_name, n_fields, in_field1, m1, b1, & in_field2, m2, b2, in_field3, m3, b3, fragment_index) integer, intent(in) :: dirfile, n_fields, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double complex, intent(in) :: m1, b1, m2, b2, m3, b3 call gdadcl(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, & TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), & LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3, & fragment_index) end subroutine subroutine fgd_add_polynom (dirfile, field_name, poly_ord, in_field, a0, a1, & a2, a3, a4, a5, fragment_index) integer, intent(in) :: dirfile, poly_ord, fragment_index character (len=*), intent(in) :: field_name, in_field double precision, intent(in) :: a0, a1, a2, a3, a4, a5 call gdadpn(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, & TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5, & fragment_index) end subroutine subroutine fgd_add_cpolynom (dirfile, field_name, poly_ord, in_field, a0, a1, & a2, a3, a4, a5, fragment_index) integer, intent(in) :: dirfile, poly_ord, fragment_index character (len=*), intent(in) :: field_name, in_field double complex, intent(in) :: a0, a1, a2, a3, a4, a5 call gdadcp(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, & TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5, & fragment_index) end subroutine subroutine fgd_add_linterp (dirfile, field_name, in_field, table, & fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field, table call gdadlt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), TRIM(table), LEN_TRIM(table), fragment_index) end subroutine subroutine fgd_add_multiply (dirfile, field_name, in_field1, in_field2, & fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2 call gdadmt(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2), & fragment_index) end subroutine subroutine fgd_add_divide (dirfile, field_name, in_field1, in_field2, & fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2 call gdaddv(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2), & fragment_index) end subroutine subroutine fgd_add_recip (dirfile, field_name, in_field, dividend, & fragment_index) integer, intent(in) :: dirfile, fragment_index double precision, intent(in) :: dividend character (len=*), intent(in) :: field_name, in_field call gdadrc(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), dividend, fragment_index) end subroutine subroutine fgd_add_crecip (dirfile, field_name, in_field, cdividend, & fragment_index) integer, intent(in) :: dirfile, fragment_index double complex, intent(in) :: cdividend character (len=*), intent(in) :: field_name, in_field call gdadcr(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), cdividend, fragment_index) end subroutine subroutine fgd_add_phase (dirfile, field_name, in_field, phase, fragment_index) integer, intent(in) :: dirfile, phase, fragment_index character (len=*), intent(in) :: field_name, in_field call gdadph(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), phase, fragment_index) end subroutine subroutine fgd_add_raw (dirfile, field_code, data_type, spf, fragment_index) integer, intent(in) :: dirfile, data_type, spf, fragment_index character (len=*), intent(in) :: field_code call gdadrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), data_type, spf, & fragment_index) end subroutine subroutine fgd_add_string (dirfile, field_code, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_code character (len=1) :: nil = "" call gdadst(dirfile, TRIM(field_code), LEN_TRIM(field_code), nil, 0, & fragment_index) end subroutine subroutine fgd_madd (dirfile, parent, field_code, ent) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code, parent type(gd_entry), intent(in) :: ent integer*4 :: zero = 0 character (len=1) :: nil = "" if (ent%field_type .EQ. GD_LINCOM_ENTRY) then if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdmdcl(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%n_fields, TRIM(ent%field(1)), & LEN_TRIM(ent%field(1)), ent%cm(1), ent%cb(1), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%cm(2), ent%cb(2), TRIM(ent%field(3)), & LEN_TRIM(ent%field(3)), ent%cm(3), ent%cb(3)) else call gdmdlc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%n_fields, TRIM(ent%field(1)), & LEN_TRIM(ent%field(1)), ent%m(1), ent%b(1), TRIM(ent%field(2)), & LEN_TRIM(ent%field(2)), ent%m(2), ent%b(2), TRIM(ent%field(3)), & LEN_TRIM(ent%field(3)), ent%m(3), ent%b(3)) end if else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then call gdmdlt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2))) else if (ent%field_type .EQ. GD_BIT_ENTRY) then call gdmdbt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & ent%bitnum, ent%numbits) else if (ent%field_type .EQ. GD_SBIT_ENTRY) then call gdmdsb(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & ent%bitnum, ent%numbits) else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then call gdmdmt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2))) else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then call gdmddv(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2))) else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdmdcp(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%poly_ord, TRIM(ent%field(1)), & LEN_TRIM(ent%field(1)), ent%ca(1), ent%ca(2), ent%ca(3), ent%ca(4), & ent%ca(5), ent%ca(6)) else call gdmdpn(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%poly_ord, TRIM(ent%field(1)), & LEN_TRIM(ent%field(1)), ent%a(1), ent%a(2), ent%a(3), ent%a(4), & ent%a(5), ent%a(6)) end if else if (ent%field_type .EQ. GD_RECIP_ENTRY) then if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdmdcr(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & ent%cdividend) else call gdmdrc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & ent%dividend) end if else if (ent%field_type .EQ. GD_PHASE_ENTRY) then call gdmdph(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), ent%shift) else if (ent%field_type .EQ. GD_WINDOW_ENTRY) then if ((ent%windop .EQ. GD_WINDOP_EQ) .OR. (ent%windop .EQ. GD_WINDOP_NE) & .OR. (ent%windop .EQ. GD_WINDOP_SET) .OR. (ent%windop .EQ. GD_WINDOP_CLR)) & then call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%windop, ent%ithreshold, & ent%fragment_index) else call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%windop, ent%rthreshold, & ent%fragment_index) end if else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then call gdmdmx(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(ent%field(1)), LEN_TRIM(ent%field(1)), & TRIM(ent%field(2)), LEN_TRIM(ent%field(2)), ent%count_val, ent%period) else if (ent%field_type .EQ. GD_CONST_ENTRY) then call gdmdco(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), ent%data_type, GD_INT32, zero) else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then call fgd_madd_carray(dirfile, parent, field_code, ent%data_type, & ent%array_len) else if (ent%field_type .EQ. GD_STRING_ENTRY) then call gdmdst(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), nil, zero) end if end subroutine subroutine fgd_madd_bit (dirfile, parent, field_name, in_field, bitnum, & numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field, parent call gdmdbt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), bitnum, numbits) end subroutine subroutine fgd_madd_sbit (dirfile, parent, field_name, in_field, bitnum, & numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field, parent call gdmdsb(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), bitnum, numbits) end subroutine subroutine fgd_madd_const (dirfile, parent, field_name, const_type) integer, intent(in) :: dirfile, const_type character (len=*), intent(in) :: field_name, parent integer*4 :: zero = 0 call gdmdco(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), const_type, GD_INT32, zero) end subroutine subroutine fgd_madd_lincom (dirfile, parent, field_name, n_fields, in_field1, & m1, b1, in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 character (len=*), intent(in) :: parent double precision, intent(in) :: m1, b1, m2, b2, m3, b3 call gdmdlc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), n_fields, TRIM(in_field1), LEN_TRIM(in_field1), m1, & b1, TRIM(in_field2), LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), & LEN_TRIM(in_field3), m3, b3) end subroutine subroutine fgd_madd_clincom (dirfile, parent, field_name, n_fields, in_field1, & m1, b1, in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 character (len=*), intent(in) :: parent double complex, intent(in) :: m1, b1, m2, b2, m3, b3 call gdmdcl(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), n_fields, TRIM(in_field1), LEN_TRIM(in_field1), m1, & b1, TRIM(in_field2), LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), & LEN_TRIM(in_field3), m3, b3) end subroutine subroutine fgd_madd_polynom (dirfile, parent, field_name, poly_ord, in_field, & a0, a1, a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field character (len=*), intent(in) :: parent double precision, intent(in) :: a0, a1, a2, a3, a4, a5 call gdmdpn(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), poly_ord, TRIM(in_field), LEN_TRIM(in_field), a0, & a1, a2, a3, a4, a5) end subroutine subroutine fgd_madd_cpolynom (dirfile, parent, field_name, poly_ord, in_field, & a0, a1, a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field character (len=*), intent(in) :: parent double complex, intent(in) :: a0, a1, a2, a3, a4, a5 call gdmdcp(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), poly_ord, TRIM(in_field), LEN_TRIM(in_field), a0, & a1, a2, a3, a4, a5) end subroutine subroutine fgd_madd_linterp (dirfile, parent, field_name, in_field, table) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field, table, parent call gdmdlt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), TRIM(table), & LEN_TRIM(table)) end subroutine subroutine fgd_madd_multiply (dirfile, parent, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2, parent call gdmdmt(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), & LEN_TRIM(in_field2)) end subroutine subroutine fgd_madd_divide (dirfile, parent, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2, parent call gdmddv(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), & LEN_TRIM(in_field2)) end subroutine subroutine fgd_madd_recip (dirfile, parent, field_name, in_field, dividend) integer, intent(in) :: dirfile double precision, intent(in) :: dividend character (len=*), intent(in) :: field_name, in_field, parent call gdmdrc(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), dividend) end subroutine subroutine fgd_madd_crecip (dirfile, parent, field_name, in_field, cdividend) integer, intent(in) :: dirfile double complex, intent(in) :: cdividend character (len=*), intent(in) :: field_name, in_field, parent call gdmdcr(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), cdividend) end subroutine subroutine fgd_madd_phase (dirfile, parent, field_name, in_field, phase) integer, intent(in) :: dirfile, phase character (len=*), intent(in) :: field_name, in_field, parent call gdmdph(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), TRIM(in_field), LEN_TRIM(in_field), phase) end subroutine subroutine fgd_madd_string (dirfile, parent, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code, parent character (len=1) :: nil = "" call gdmdst(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), nil, 0) end subroutine subroutine fgd_add_spec (dirfile, spec, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: spec call gdadsp(dirfile, TRIM(spec), LEN_TRIM(spec), fragment_index) end subroutine subroutine fgd_madd_spec (dirfile, spec, parent) integer, intent(in) :: dirfile character (len=*), intent(in) :: parent, spec call gdmdsp(dirfile, TRIM(spec), LEN_TRIM(spec), TRIM(parent), & LEN_TRIM(parent)) end subroutine function fgd_fragmentname (dirfile, ind) character (len=GD_MAX_LINE_LENGTH) :: fgd_fragmentname integer, intent(in) :: dirfile, ind integer :: l = GD_MAX_LINE_LENGTH call gdfrgn(fgd_fragmentname, l, dirfile, ind) end function function fgd_nfragments (dirfile) integer :: fgd_nfragments integer, intent(in) :: dirfile call gdnfrg(fgd_nfragments, dirfile) end function subroutine fgd_metaflush (dirfile) integer, intent(in) :: dirfile call gdmfls(dirfile) end subroutine subroutine fgd_rewrite_fragment (dirfile, fragment) integer, intent(in) :: dirfile, fragment call gdrfrg(dirfile, fragment) end subroutine subroutine fgd_include (dirfile, fragmentname, fragment_index, flags) integer, intent(in) :: dirfile, fragment_index, flags character (len=*), intent(in) :: fragmentname call gdincl(dirfile, TRIM(fragmentname), LEN_TRIM(fragmentname), & fragment_index, flags) end subroutine function fgd_reference (dirfile, field_code) character (len=GD_FIELD_LEN) :: fgd_reference integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer :: l = GD_FIELD_LEN call gdrefe(fgd_reference, l, dirfile, TRIM(field_code), LEN_TRIM(field_code)) if (l .EQ. 0) then fgd_reference = "" endif end function subroutine fgd_parser_callback (dirfile, sehandler) integer, intent(in) :: dirfile interface subroutine sehandler(act, dirfile_unit, suberror, line) integer, intent (out) :: act integer, intent (in) :: dirfile_unit, suberror character (len=@GD_MAX_LINE_LENGTH@), intent (inout) :: line end subroutine end interface call gdclbk(dirfile, sehandler) end subroutine function fgd_encoding (dirfile, fragment) integer :: fgd_encoding integer, intent(in) :: dirfile, fragment call gdgenc(fgd_encoding, dirfile, fragment) end function subroutine fgd_alter_encoding (dirfile, encoding, fragment, recode) integer, intent(in) :: dirfile, encoding, fragment, recode call gdaenc(dirfile, encoding, fragment, recode) end subroutine function fgd_endianness (dirfile, fragment) integer :: fgd_endianness integer, intent(in) :: dirfile, fragment call gdgend(fgd_endianness, dirfile, fragment) end function subroutine fgd_alter_endianness (dirfile, endianness, fragment, recode) integer, intent(in) :: dirfile, endianness, fragment, recode call gdaend(dirfile, endianness, fragment, recode) end subroutine function fgd_frameoffset (dirfile, fragment) integer :: fgd_frameoffset integer, intent(in) :: dirfile, fragment call gdgfof(fgd_frameoffset, dirfile, fragment) end function subroutine fgd_alter_frameoffset (dirfile, frameoffset, fragment, recode) integer, intent(in) :: dirfile, frameoffset, fragment, recode call gdafof(dirfile, frameoffset, fragment, recode) end subroutine function fgd_protection (dirfile, fragment) integer :: fgd_protection integer, intent(in) :: dirfile, fragment call gdgprt(fgd_protection, dirfile, fragment) end function subroutine fgd_alter_protection (dirfile, protection_level, fragment) integer, intent(in) :: dirfile, protection_level, fragment call gdaprt(dirfile, protection_level, fragment) end subroutine function fgd_parent_fragment (dirfile, fragment) integer :: fgd_parent_fragment integer, intent(in) :: dirfile, fragment call gdpfrg(fgd_parent_fragment, dirfile, fragment) end function subroutine fgd_uninclude (dirfile, fragment, del) integer, intent(in) :: dirfile, fragment, del call gduinc(dirfile, fragment, del) end subroutine function fgd_raw_filename (dirfile, field_code) character (len=GD_MAX_LINE_LENGTH) :: fgd_raw_filename integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer :: l = GD_MAX_LINE_LENGTH call gdrwfn (fgd_raw_filename, l, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) end function subroutine fgd_move (dirfile, field_code, new_fragment, flags) integer, intent(in) :: dirfile, new_fragment, flags character (len=*), intent(in) :: field_code call gdmove (dirfile, TRIM(field_code), LEN_TRIM(field_code), new_fragment, & flags) end subroutine ! calculate in_fields string lengths subroutine fgd__set_field_len (field_len, m, ent) integer, dimension(3), intent(out) :: field_len integer, intent(in) :: m type(gd_entry), intent(in) :: ent integer :: i do i=1,m field_len(i) = LEN_TRIM(ent%field(i)) if (field_len(i) .eq. 0) then field_len(i) = -1 end if end do end subroutine ! calculate scalar string lengths subroutine fgd__set_scalar_len (scalar_len, remove_scalars, mask, ent) integer, dimension(6), intent(out) :: scalar_len integer, intent(in) :: remove_scalars, mask type(gd_entry), intent(in) :: ent integer :: i do i=1,6 if (BTEST(IAND(NOT(remove_scalars), mask), i - 1)) then scalar_len(i) = LEN_TRIM(ent%scalar(i)) else scalar_len(i) = -1 end if end do end subroutine subroutine fgd_alter_entry (dirfile, field_code, ent, remove_scalars, recode) integer, intent(in) :: dirfile, remove_scalars, recode character (len=*), intent(in) :: field_code type(gd_entry), intent(in) :: ent ! lincom scalar bitmasks integer, parameter, dimension(3) :: lincom_mask = (/ 9, 27, 63 /) ! polynom scalar bitmasks integer, parameter, dimension(6) :: polynom_mask = (/ 3, 7, 15, 31, 63, 127 /) integer, dimension(6) :: scalar_len integer, dimension(3) :: field_len integer :: n if (ent%field_type .EQ. GD_RAW_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent) call gdlsrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%data_type, ent%spf, TRIM(ent%scalar(1)), scalar_len(1), & ent%scalar_ind(1), recode) else if (ent%field_type .EQ. GD_LINCOM_ENTRY) then n = ent%n_fields if (n .gt. 3 .or. n .lt. 1) then n = 3 end if call fgd__set_scalar_len(scalar_len, remove_scalars, lincom_mask(n), ent) call fgd__set_field_len(field_len, n, ent) if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdlscl(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%n_fields, TRIM(ent%field(1)), field_len(1), & ent%cm(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%cb(1), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), & TRIM(ent%field(2)), field_len(2), & ent%cm(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), & ent%cb(2), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), & TRIM(ent%field(3)), field_len(3), & ent%cm(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), & ent%cb(3), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6)) else call gdlslc(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%n_fields, TRIM(ent%field(1)), field_len(1), & ent%m(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%b(1), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), & TRIM(ent%field(2)), field_len(2), & ent%m(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), & ent%b(2), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), & TRIM(ent%field(3)), field_len(3), & ent%m(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), & ent%b(3), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6)) end if else if (ent%field_type .EQ. GD_LINTERP_ENTRY) then call fgd__set_field_len(field_len, 2, ent) call gdallt(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), recode) else if (ent%field_type .EQ. GD_BIT_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 3, ent) call fgd__set_field_len(field_len, 1, ent) call gdlsbt(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), & ent%bitnum, TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%numbits, TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2)) else if (ent%field_type .EQ. GD_SBIT_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 3, ent) call fgd__set_field_len(field_len, 1, ent) call gdlssb(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), & ent%bitnum, TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%numbits, TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2)) else if (ent%field_type .EQ. GD_MULTIPLY_ENTRY) then call fgd__set_field_len(field_len, 2, ent) call gdalmt(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2)) else if (ent%field_type .EQ. GD_DIVIDE_ENTRY) then call fgd__set_field_len(field_len, 2, ent) call gdaldv(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2)) else if (ent%field_type .EQ. GD_PHASE_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent) call fgd__set_field_len(field_len, 1, ent) call gdlsph(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), ent%shift, & TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1)) else if (ent%field_type .EQ. GD_POLYNOM_ENTRY) then n = ent%poly_ord if (n .gt. 6 .or. n .lt. 2) then n = 6 end if call fgd__set_scalar_len(scalar_len, remove_scalars, polynom_mask(n), ent) call fgd__set_field_len(field_len, 1, ent) if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdlscp(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%poly_ord, TRIM(ent%field(1)), field_len(1), & ent%ca(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%ca(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), & ent%ca(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), & ent%ca(4), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), & ent%ca(5), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), & ent%ca(6), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6)) else call gdlspn(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%poly_ord, TRIM(ent%field(1)), field_len(1), & ent%a(1), TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%a(2), TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2), & ent%a(3), TRIM(ent%scalar(3)), scalar_len(3), ent%scalar_ind(3), & ent%a(4), TRIM(ent%scalar(4)), scalar_len(4), ent%scalar_ind(4), & ent%a(5), TRIM(ent%scalar(5)), scalar_len(5), ent%scalar_ind(5), & ent%a(6), TRIM(ent%scalar(6)), scalar_len(6), ent%scalar_ind(6)) end if else if (ent%field_type .EQ. GD_RECIP_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent) call fgd__set_field_len(field_len, 1, ent) if (IAND(GD_EN_COMPSCAL, ent%flags) .NE. 0) then call gdlscr(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), ent%cdividend, TRIM(ent%scalar(1)), & scalar_len(1), ent%scalar_ind(1)) else call gdlsrc(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), ent%dividend, TRIM(ent%scalar(1)), & scalar_len(1), ent%scalar_ind(1)) end if else if (ent%field_type .EQ. GD_WINDOW_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 1, ent) call fgd__set_field_len(field_len, 2, ent) if ((ent%windop .EQ. GD_WINDOP_EQ) .OR. (ent%windop .EQ. GD_WINDOP_NE) & .OR. (ent%windop .EQ. GD_WINDOP_SET) .OR. (ent%windop .EQ. GD_WINDOP_CLR)) & then call gdlswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), & ent%windop, ent%ithreshold, TRIM(ent%scalar(1)), scalar_len(1), & ent%scalar_ind(1)) else call gdlswd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), & ent%windop, ent%rthreshold, TRIM(ent%scalar(1)), scalar_len(1), & ent%scalar_ind(1)) end if else if (ent%field_type .EQ. GD_MPLEX_ENTRY) then call fgd__set_scalar_len(scalar_len, remove_scalars, 3, ent) call fgd__set_field_len(field_len, 2, ent) call gdlsmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(ent%field(1)), field_len(1), TRIM(ent%field(2)), field_len(2), & ent%count_val, TRIM(ent%scalar(1)), scalar_len(1), ent%scalar_ind(1), & ent%period, TRIM(ent%scalar(2)), scalar_len(2), ent%scalar_ind(2)) else if (ent%field_type .EQ. GD_CONST_ENTRY) then call gdalco(dirfile, TRIM(field_code), LEN_TRIM(field_code), ent%data_type) else if (ent%field_type .EQ. GD_CARRAY_ENTRY) then call gdalca(dirfile, TRIM(field_code), LEN_TRIM(field_code), & ent%data_type, ent%array_len) end if end subroutine subroutine fgd_alter_bit (dirfile, field_name, in_field, bitnum, numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field call gdalbt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), bitnum, numbits) end subroutine subroutine fgd_alter_sbit (dirfile, field_name, in_field, bitnum, numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field call gdalsb(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), bitnum, numbits) end subroutine subroutine fgd_alter_const (dirfile, field_name, const_type) integer, intent(in) :: dirfile, const_type character (len=*), intent(in) :: field_name call gdalco(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type) end subroutine subroutine fgd_alter_lincom (dirfile, field_name, n_fields, in_field1, m1, b1, & in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double precision, intent(in) :: m1, b1, m2, b2, m3, b3 call gdallc(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, & TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), & LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3) end subroutine subroutine fgd_alter_clincom (dirfile, field_name, n_fields, in_field1, m1, & b1, in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double complex, intent(in) :: m1, b1, m2, b2, m3, b3 call gdalcl(dirfile, TRIM(field_name), LEN_TRIM(field_name), n_fields, & TRIM(in_field1), LEN_TRIM(in_field1), m1, b1, TRIM(in_field2), & LEN_TRIM(in_field2), m2, b2, TRIM(in_field3), LEN_TRIM(in_field3), m3, b3) end subroutine subroutine fgd_alter_polynom (dirfile, field_name, poly_ord, in_field, a0, a1, & a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field double precision, intent(in) :: a0, a1, a2, a3, a4, a5 call gdalpn(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, & TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5) end subroutine subroutine fgd_alter_cpolynom (dirfile, field_name, poly_ord, in_field, a0, & a1, a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field double complex, intent(in) :: a0, a1, a2, a3, a4, a5 call gdalcp(dirfile, TRIM(field_name), LEN_TRIM(field_name), poly_ord, & TRIM(in_field), LEN_TRIM(in_field), a0, a1, a2, a3, a4, a5) end subroutine subroutine fgd_alter_linterp (dirfile, field_name, in_field, table, move) integer, intent(in) :: dirfile, move character (len=*), intent(in) :: field_name, in_field, table call gdallt(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), TRIM(table), LEN_TRIM(table), move) end subroutine subroutine fgd_alter_multiply (dirfile, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2 call gdalmt(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2)) end subroutine subroutine fgd_alter_divide (dirfile, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2 call gdaldv(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field1), LEN_TRIM(in_field1), TRIM(in_field2), LEN_TRIM(in_field2)) end subroutine subroutine fgd_alter_recip (dirfile, field_name, in_field, dividend) integer, intent(in) :: dirfile double precision, intent(in) :: dividend character (len=*), intent(in) :: field_name, in_field call gdalrc(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), dividend) end subroutine subroutine fgd_alter_crecip (dirfile, field_name, in_field, cdividend) integer, intent(in) :: dirfile double complex, intent(in) :: cdividend character (len=*), intent(in) :: field_name, in_field call gdalcr(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), cdividend) end subroutine subroutine fgd_alter_phase (dirfile, field_name, in_field, phase) integer, intent(in) :: dirfile, phase character (len=*), intent(in) :: field_name, in_field call gdalph(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), phase) end subroutine subroutine fgd_alter_raw (dirfile, field_code, data_type, spf, move) integer, intent(in) :: dirfile, data_type, spf, move character (len=*), intent(in) :: field_code call gdalrw(dirfile, TRIM(field_code), LEN_TRIM(field_code), data_type, spf, & move) end subroutine subroutine fgd_alter_spec (dirfile, spec, recode) integer, intent(in) :: dirfile, recode character (len=*), intent(in) :: spec call gdalsp(dirfile, TRIM(spec), LEN_TRIM(spec), recode) end subroutine subroutine fgd_malter_spec (dirfile, spec, parent, recode) integer, intent(in) :: dirfile, recode character (len=*), intent(in) :: parent, spec call gdmlsp(dirfile, TRIM(spec), LEN_TRIM(spec), TRIM(parent), & LEN_TRIM(parent), recode) end subroutine subroutine fgd_rename (dirfile, field_code, new_name, flags) integer, intent(in) :: dirfile, flags character (len=*), intent(in) :: field_code, new_name call gdrenm(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(new_name), & LEN_TRIM(new_name), flags) end subroutine subroutine fgd_delete (dirfile, field_code, flags) integer, intent(in) :: dirfile, flags character (len=*), intent(in) :: field_code call gddele(dirfile, TRIM(field_code), LEN_TRIM(field_code), flags) end subroutine function fgd_native_type (dirfile, field_code) integer :: fgd_native_type integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdntyp(fgd_native_type, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function function fgd_validate (dirfile, field_code) integer :: fgd_validate integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdvldt(fgd_validate, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function function fgd_framenum (dirfile, field_code, value) double precision :: fgd_framenum integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code double precision, intent(in) :: value call gdfnum(fgd_framenum, dirfile, TRIM(field_code), LEN_TRIM(field_code), & value) end function function fgd_framenum_subset (dirfile, field_code, value, frame_start, & frame_end) double precision :: fgd_framenum_subset integer, intent(in) :: dirfile, frame_start, frame_end character (len=*), intent(in) :: field_code double precision, intent(in) :: value call gdfnss(fgd_framenum_subset, dirfile, TRIM(field_code), & LEN_TRIM(field_code), value, frame_start, frame_end) end function subroutine fgd_dirfilename (dirfilename, l, dirfile, fragment_index) character (len=*), intent(out) :: dirfilename integer, intent(in) :: dirfile, fragment_index integer, intent(inout) :: l call gdname(dirfilename, l, dirfile, fragment_index) end subroutine function fgd_invalid_dirfile () integer :: fgd_invalid_dirfile call gdinvd(fgd_invalid_dirfile) end function function fgd_dirfile_standards (dirfile, version) integer :: fgd_dirfile_standards integer, intent(in) :: dirfile, version fgd_dirfile_standards = version call gdstdv(fgd_dirfile_standards, dirfile) end function !gd_get_carray_slice with return_type=GD_NULL subroutine fgd_get_carray_n (dirfile, field_code, start, array_len) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_NULL, 0) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_NULL, 0) end if end subroutine !gd_get_carray_slice with return_type=GD_INT8 subroutine fgd_get_carray_i1 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*1, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT8, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_INT16 subroutine fgd_get_carray_i2 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*2, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT16, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_INT32 subroutine fgd_get_carray_i4 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*4, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT32, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_INT64 subroutine fgd_get_carray_i8 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*8, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT64, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_FLOAT32 subroutine fgd_get_carray_r4 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code real*4, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_FLOAT32, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_FLOAT64 subroutine fgd_get_carray_r8 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code double precision, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_FLOAT64, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_COMPLEX64 subroutine fgd_get_carray_c8 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code complex, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, & data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_COMPLEX64, data_out) end if end subroutine !gd_get_carray_slice with return_type=GD_COMPLEX128 subroutine fgd_get_carray_c16 (dirfile, field_code, start, array_len, data_out) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code double complex, dimension(:), intent(out) :: data_out ! call f77 library if (array_len .eq. 0) then call gdgtca(dirfile, TRIM(field_code), LEN_TRIM(field_code), & GD_COMPLEX128, data_out) else call gdgcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_COMPLEX128, data_out) end if end subroutine ! put_carray_slice with data_type=GD_INT8 subroutine fgd_put_carray_i1 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*1, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT8, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT8, data_in) end if end subroutine ! put_carray_slice with data_type=GD_INT16 subroutine fgd_put_carray_i2 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*2, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT16, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT16, data_in) end if end subroutine ! put_carray_slice with data_type=GD_INT32 subroutine fgd_put_carray_i4 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*4, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT32, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT32, data_in) end if end subroutine ! put_carray_slice with data_type=GD_INT64 subroutine fgd_put_carray_i8 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code integer*8, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_INT64, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_INT64, data_in) end if end subroutine ! put_carray_slice with data_type=GD_FLOAT32 subroutine fgd_put_carray_r4 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code real*4, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT32, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_FLOAT32, data_in) end if end subroutine ! put_carray_slice with data_type=GD_FLOAT64 subroutine fgd_put_carray_r8 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code double precision, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_FLOAT64, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_FLOAT64, data_in) end if end subroutine ! put_carray_slice with data_type=GD_COMPLEX64 subroutine fgd_put_carray_c8 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code complex, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), GD_COMPLEX64, & data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_COMPLEX64, data_in) end if end subroutine ! put_carray_slice with data_type=GD_COMPLEX128 subroutine fgd_put_carray_c16 (dirfile, field_code, start, array_len, data_in) integer, intent(in) :: dirfile, start, array_len character (len=*), intent(in) :: field_code double complex, dimension(:), intent(in) :: data_in ! call f77 library if (array_len .eq. 0) then call gdptca(dirfile, TRIM(field_code), LEN_TRIM(field_code), & GD_COMPLEX128, data_in) else call gdpcas(dirfile, TRIM(field_code), LEN_TRIM(field_code), start, & array_len, GD_COMPLEX128, data_in) end if end subroutine function fgd_array_len (dirfile, field_code) integer :: fgd_array_len integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code ! call f77 library call gdarln(fgd_array_len, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function function fgd_carray_len (dirfile, field_code) integer :: fgd_carray_len integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code fgd_carray_len = fgd_array_len(dirfile,field_code) end function subroutine fgd_add_carray (dirfile, field_name, const_type, array_len, & fragment_index) integer, intent(in) :: dirfile, const_type, fragment_index, array_len character (len=*), intent(in) :: field_name integer*1, dimension(array_len) :: zero zero = 0 call gdadca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, & array_len, GD_INT8, zero, fragment_index) end subroutine subroutine fgd_madd_carray (dirfile, parent, field_name, const_type, array_len) integer, intent(in) :: dirfile, const_type, array_len character (len=*), intent(in) :: field_name, parent integer*1, dimension(array_len) :: zero zero = 0 call gdmdca(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), const_type, array_len, GD_INT8, zero) end subroutine subroutine fgd_alter_carray (dirfile, field_name, const_type, array_len) integer, intent(in) :: dirfile, const_type, array_len character (len=*), intent(in) :: field_name call gdalca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, & array_len) end subroutine function fgd_seek (dirfile, field_name, frame_num, sample_num, flags) integer :: fgd_seek integer, intent(in) :: dirfile, frame_num, sample_num, flags character (len=*), intent(in) :: field_name call gdseek(fgd_seek, dirfile, TRIM(field_name), LEN_TRIM(field_name), & frame_num, sample_num, flags) end function function fgd_tell (dirfile, field_name) integer :: fgd_tell integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name call gdtell(fgd_tell, dirfile, TRIM(field_name), LEN_TRIM(field_name)) end function ! gd_constants with return_type=GD_INT8 subroutine fgd_constants_i1 (constants, dirfile) integer*1, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_INT8, i) end do end subroutine ! gd_constants with return_type=GD_INT16 subroutine fgd_constants_i2 (constants, dirfile) integer*2, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_INT16, i) end do end subroutine ! gd_constants with return_type=GD_INT32 subroutine fgd_constants_i4 (constants, dirfile) integer*4, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_INT32, i) end do end subroutine ! gd_constants with return_type=GD_INT64 subroutine fgd_constants_i8 (constants, dirfile) integer*8, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_INT64, i) end do end subroutine ! gd_constants with return_type=GD_FLOAT32 subroutine fgd_constants_r4 (constants, dirfile) real*4, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_FLOAT32, i) end do end subroutine ! gd_constants with return_type=GD_FLOAT64 subroutine fgd_constants_r8 (constants, dirfile) real*8, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_FLOAT64, i) end do end subroutine ! gd_constants with return_type=GD_COMPLEX64 subroutine fgd_constants_c8 (constants, dirfile) complex, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_COMPLEX64, i) end do end subroutine ! gd_constants with return_type=GD_COMPLEX128 subroutine fgd_constants_c16 (constants, dirfile) double complex, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY) do i=1,nfields ! call f77 library call gdcons(constants(i), dirfile, GD_COMPLEX128, i) end do end subroutine ! gd_mconstants with return_type=GD_INT8 subroutine fgd_mconstants_i1 (constants, dirfile, parent) integer*1, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_INT8, i) end do end subroutine ! gd_mconstants with return_type=GD_INT16 subroutine fgd_mconstants_i2 (constants, dirfile, parent) integer*2, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_INT16, i) end do end subroutine ! gd_mconstants with return_type=GD_INT32 subroutine fgd_mconstants_i4 (constants, dirfile, parent) integer*4, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_INT32, i) end do end subroutine ! gd_mconstants with return_type=GD_INT64 subroutine fgd_mconstants_i8 (constants, dirfile, parent) integer*8, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_INT64, i) end do end subroutine ! gd_mconstants with return_type=GD_FLOAT32 subroutine fgd_mconstants_r4 (constants, dirfile, parent) real*4, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_FLOAT32, i) end do end subroutine ! gd_mconstants with return_type=GD_FLOAT64 subroutine fgd_mconstants_r8 (constants, dirfile, parent) real*8, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_FLOAT64, i) end do end subroutine ! gd_mconstants with return_type=GD_COMPLEX64 subroutine fgd_mconstants_c8 (constants, dirfile, parent) complex, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_COMPLEX64, i) end do end subroutine ! gd_mconstants with return_type=GD_COMPLEX128 subroutine fgd_mconstants_c16 (constants, dirfile, parent) double complex, dimension(:), intent(out) :: constants integer, intent(in) :: dirfile integer :: nfields, i character (len=*), intent(in) :: parent nfields = fgd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY) do i=1,nfields ! call f77 library call gdmcos(constants(i), dirfile, TRIM(parent), LEN_TRIM(parent), & GD_COMPLEX128, i) end do end subroutine function fgd_string_value_max (dirfile) integer :: fgd_string_value_max integer, intent(in) :: dirfile ! call f77 library call gdstrx(fgd_string_value_max, dirfile) end function subroutine fgd_strings (strings, dirfile, string_len) character(len=*), dimension(:), intent(out) :: strings integer, intent(in) :: dirfile integer, intent(inout) :: string_len integer :: max_len, nfields, i ! make sure the string list is large enough max_len = fgd_string_value_max(dirfile) if (string_len .lt. max_len) then string_len = max_len else nfields = fgd_nfields_by_type(dirfile, GD_STRING_ENTRY) do i=1,nfields ! call f77 library call gdstrs(strings(i), string_len, dirfile, i) end do end if end subroutine function fgd_mstring_value_max (dirfile, parent) integer :: fgd_mstring_value_max integer, intent(in) :: dirfile character (len=*), intent(in) :: parent ! call f77 library call gdmstx(fgd_mstring_value_max, dirfile, TRIM(parent), LEN_TRIM(parent)) end function subroutine fgd_mstrings (strings, dirfile, parent, string_len) character(len=*), dimension(:), intent(out) :: strings integer, intent(in) :: dirfile integer, intent(inout) :: string_len integer :: max_len, nfields, i character (len=*), intent(in) :: parent ! make sure the field list is large enough max_len = fgd_mstring_value_max(dirfile, parent) if (string_len .lt. max_len) then string_len = max_len else nfields = fgd_nmfields_by_type(dirfile, parent, GD_STRING_ENTRY) do i=1,nfields ! call f77 library call gdmsts(strings(i), string_len, dirfile, TRIM(parent), & LEN_TRIM(parent), i) end do end if end subroutine subroutine fgd_add_alias (dirfile, field_code, targ, fragment_index) integer, intent(in) :: dirfile, fragment_index character(len=*), intent(in) :: field_code, targ call gdadal(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(targ), & LEN_TRIM(targ), fragment_index) end subroutine subroutine fgd_add_window_i (dirfile, field_code, in_field, check_field, & windop, threshold, fragment_index) character(len=*), intent(in) :: field_code, in_field, check_field integer, intent(in) :: dirfile, windop, threshold, fragment_index ! convert to double precision, if necessary if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. & windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, 1d0 * threshold, fragment_index) else call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, threshold, fragment_index) end if end subroutine subroutine fgd_add_window_r (dirfile, field_code, in_field, check_field, & windop, threshold, fragment_index) character(len=*), intent(in) :: field_code, in_field, check_field integer, intent(in) :: dirfile, windop, fragment_index double precision, intent(in) :: threshold ! convert to integer, if necessary if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. & windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, threshold, fragment_index) else call gdadwd(dirfile, TRIM(field_code), LEN_TRIM(field_code), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, threshold, INT(fragment_index)) end if end subroutine subroutine fgd_madd_window_i (dirfile, parent, field_code, in_field, & check_field, windop, threshold) character(len=*), intent(in) :: parent, field_code, in_field, check_field integer, intent(in) :: dirfile, windop, threshold ! convert to double precision, if necessary if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. & windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), & TRIM(check_field), LEN_TRIM(check_field), windop, 1d0 * threshold) else call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), & TRIM(check_field), LEN_TRIM(check_field), windop, threshold) end if end subroutine subroutine fgd_madd_window_r (dirfile, parent, field_code, in_field, & check_field, windop, threshold) character(len=*), intent(in) :: parent, field_code, in_field, check_field integer, intent(in) :: dirfile, windop double precision, intent(in) :: threshold ! convert to integer, if necessary if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. & windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), & TRIM(check_field), LEN_TRIM(check_field), windop, threshold) else call gdmdwd(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), & TRIM(check_field), LEN_TRIM(check_field), windop, INT(threshold)) end if end subroutine function fgd_alias_target (dirfile, field_code) character (len=GD_MAX_LINE_LENGTH) :: fgd_alias_target integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code integer :: l = GD_MAX_LINE_LENGTH call gdatrg(fgd_alias_target, l, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) end function function fgd_naliases (dirfile, field_code) integer :: fgd_naliases integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code call gdnals(fgd_naliases, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function function fgd_alias_max (dirfile, field_code) integer :: fgd_alias_max integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code call gdalsx(fgd_alias_max, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function subroutine fgd_aliases (aliases, dirfile, field_code, alias_len) character(len=*), dimension(:), intent(out) :: aliases integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code integer, intent(inout) :: alias_len integer :: max_len, nalias, i ! make sure the field list is large enough max_len = fgd_alias_max(dirfile, field_code) if (alias_len .lt. max_len) then alias_len = max_len else nalias = fgd_naliases(dirfile, field_code) do i=1,nalias call gdalss(aliases(i), alias_len, dirfile, TRIM(field_code), & LEN_TRIM(field_code), i) end do end if end subroutine subroutine fgd_alter_affixes (dirfile, fragment_index, prefix, suffix) integer, intent(in) :: dirfile, fragment_index character(len=*), intent(in) :: prefix, suffix call gdaafx(dirfile, fragment_index, TRIM(prefix), LEN_TRIM(prefix), & TRIM(suffix), LEN_TRIM(suffix)) end subroutine subroutine fgd_alter_window_i (dirfile, field_name, in_field, check_field, & windop, threshold) integer, intent(in) :: dirfile, windop, threshold character (len=*), intent(in) :: field_name, in_field, check_field ! convert to double precision, if necessary if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. & windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, 1d0 * threshold) else call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, threshold) end if end subroutine subroutine fgd_alter_window_r (dirfile, field_name, in_field, check_field, & windop, threshold) integer, intent(in) :: dirfile, windop character (len=*), intent(in) :: field_name, in_field, check_field double precision, intent(in) :: threshold ! convert to integer, if necessary if (windop .NE. GD_WINDOP_EQ .AND. windop .NE. GD_WINDOP_NE .AND. & windop .NE. GD_WINDOP_SET .AND. windop .NE. GD_WINDOP_CLR) then call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, threshold) else call gdalwd(dirfile, TRIM(field_name), LEN_TRIM(field_name), & TRIM(in_field), LEN_TRIM(in_field), TRIM(check_field), & LEN_TRIM(check_field), windop, INT(threshold)) end if end subroutine function fgd_hidden (dirfile, field_code) integer :: fgd_hidden integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdhidn(fgd_hidden, dirfile, TRIM(field_code), LEN_TRIM(field_code)) end function subroutine fgd_hide (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdhide(dirfile, TRIM(field_code), LEN_TRIM(field_code)) end subroutine subroutine fgd_unhide (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gduhid(dirfile, TRIM(field_code), LEN_TRIM(field_code)) end subroutine subroutine fgd_madd_alias (dirfile, parent, field_code, targ) integer, intent(in) :: dirfile character(len=*), intent(in) :: parent, field_code, targ call gdmdal(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(targ), LEN_TRIM(targ)) end subroutine subroutine fgd_include_affix (dirfile, fragmentname, fragment_index, prefix, & suffix, flags) integer, intent(in) :: dirfile, fragment_index, flags character (len=*), intent(in) :: fragmentname, prefix, suffix call gdinca(dirfile, TRIM(fragmentname), LEN_TRIM(fragmentname), & fragment_index, TRIM(prefix), LEN_TRIM(prefix), TRIM(suffix), & LEN_TRIM(suffix), flags) end subroutine subroutine fgd_sync (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdsync(dirfile, TRIM(field_code), LEN_TRIM(field_code)) end subroutine subroutine fgd_raw_close (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code call gdrclo(dirfile, TRIM(field_code), LEN_TRIM(field_code)) end subroutine subroutine fgd_fragment_affixes (prefix, pl, suffix, sl, dirfile, & fragment_index) character(len=*), intent(out) :: prefix, suffix integer, intent(in) :: dirfile, fragment_index integer, intent(inout) :: pl, sl call gdfraf(prefix, pl, suffix, sl, dirfile, fragment_index) end subroutine subroutine fgd_add_mplex (dirfile, field_code, in_field, count_field, & count_val, period, fragment_index) character(len=*), intent(in) :: field_code, in_field, count_field integer, intent(in) :: dirfile, count_val, period, fragment_index call gdadmx(dirfile, TRIM(field_code), LEN_TRIM(field_code), TRIM(in_field), & LEN_TRIM(in_field), TRIM(count_field), LEN_TRIM(count_field), count_val, & period, fragment_index) end subroutine subroutine fgd_madd_mplex (dirfile, parent, field_code, in_field, count_field, & count_val, period) character(len=*), intent(in) :: parent, field_code, in_field, count_field integer, intent(in) :: dirfile, count_val, period call gdmdmx(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_code), & LEN_TRIM(field_code), TRIM(in_field), LEN_TRIM(in_field), TRIM(count_field), & LEN_TRIM(count_field), count_val, period) end subroutine subroutine fgd_alter_mplex (dirfile, field_name, in_field, count_field, & count_val, period) integer, intent(in) :: dirfile, count_val, period character (len=*), intent(in) :: field_name, in_field, count_field call gdalmx(dirfile, TRIM(field_name), LEN_TRIM(field_name), TRIM(in_field), & LEN_TRIM(in_field), TRIM(count_field), LEN_TRIM(count_field), count_val, & period) end subroutine subroutine fgd_strtok (token, l, dirfile, string) character (len=*), intent(out) :: token integer, intent(inout) :: l integer, intent(in) :: dirfile character (len=*), intent(in) :: string call gdtoke(token, l, dirfile, TRIM(string), LEN_TRIM(string)) end subroutine function fgd_desync (dirfile, flags) integer :: fgd_desync integer, intent(in) :: dirfile, flags call gddsyn(fgd_desync, dirfile, flags) end function function fgd_flags (dirfile, set, reset) integer :: fgd_flags integer, intent(in) :: dirfile, set, reset call gdflag(fgd_flags, dirfile, set, reset) end function subroutine fgd_verbose_prefix(dirfile, prefix) integer, intent(in) :: dirfile character (len=*), intent(in) :: prefix call gdvbpx(dirfile, TRIM(prefix), LEN_TRIM(prefix)) end subroutine subroutine fgd_mplex_lookback(dirfile, lookback) integer, intent(in) :: dirfile, lookback call gdmxlb(dirfile, lookback) end subroutine function fgd_nentries (dirfile, parent, entype, flags) integer :: fgd_nentries integer, intent(in) :: dirfile, entype, flags character (len=*), intent(in) :: parent integer :: parent_l parent_l = LEN_TRIM(parent) if (parent_l .EQ. 0) parent_l = -1 ! call f77 library call gdnent(fgd_nentries, dirfile, TRIM(parent), parent_l, entype, flags) end function function fgd_entry_name_max (dirfile, parent, entype, flags) integer :: fgd_entry_name_max integer, intent(in) :: dirfile, entype, flags character (len=*), intent(in) :: parent integer :: parent_l parent_l = LEN_TRIM(parent) if (parent_l .EQ. 0) parent_l = -1 ! call f77 library call gdentx(fgd_entry_name_max, dirfile, TRIM(parent), parent_l, entype, & flags) end function subroutine fgd_entry_list (entry_list, dirfile, parent, entype, flags, & entry_len) character(len=*), dimension(:), intent(out) :: entry_list integer, intent(in) :: dirfile, entype, flags integer, intent(inout) :: entry_len character (len=*), intent(in) :: parent integer :: max_len, nentries, i, parent_l ! make sure the entry list is large enough max_len = fgd_entry_name_max(dirfile, parent, entype, flags) parent_l = LEN_TRIM(parent) if (parent_l .EQ. 0) parent_l = -1 if (entry_len .lt. max_len) then entry_len = max_len else nentries = fgd_nentries(dirfile, parent, entype, flags) do i=1,nentries ! call f77 library call gdentn(entry_list(i), entry_len, dirfile, TRIM(parent), parent_l, & entype, flags, i) end do end if end subroutine function fgd_linterp_tablename (dirfile, field_code) character (len=GD_MAX_LINE_LENGTH) :: fgd_linterp_tablename integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code integer :: l = GD_MAX_LINE_LENGTH call gdlttn (fgd_linterp_tablename, l, dirfile, TRIM(field_code), & LEN_TRIM(field_code)) end function function fgd_encoding_support (encoding) integer :: fgd_encoding_support integer, intent(in) :: encoding call gdencs(fgd_encoding_support, encoding) end function end module libgetdata-0.9.0/bindings/f77/test/0000740000175000017500000000000012614323564017161 5ustar alastairalastairlibgetdata-0.9.0/bindings/f77/test/big_test.f0000640000175000017500000025251012614323564021137 0ustar alastairalastairC Copyright (C) 2009-2015 D. V. Wiebe C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C This file is part of the GetData project. C C GetData is free software; you can redistribute it and/or modify it under C the terms of the GNU Lesser General Public License as published by the C Free Software Foundation; either version 2.1 of the License, or (at your C option) any later version. C C GetData is distributed in the hope that it will be useful, but WITHOUT C ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or C FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public C License for more details. C C You should have received a copy of the GNU Lesser General Public License C along with GetData; if not, write to the Free Software Foundation, Inc., C 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA C C General test C C This very large test checks almost every procedure defined by the C F77 bindings. Procedures not tested include: GDCOPN GDMFLS GDCLOS C GDCLBK GDDSCD (although this last one is used) C Check functions SUBROUTINE CHKERR(NE, T, D, V) INCLUDE "getdata.f" INTEGER NE, T, D, V, E CALL GDEROR(E, D) IF (E .NE. V) THEN NE = NE + 1 WRITE(*, 9001) T, E, V ENDIF 9001 FORMAT('e[', i6, '] = ', i4, ', expected ', i4) END SUBROUTINE SUBROUTINE CHKINT(NE, T, N, V) INTEGER NE, T, N, V IF (N .NE. V) THEN NE = NE + 1 WRITE(*, 9002) T, N, V ENDIF 9002 FORMAT('n[', i6, '] = ', i4, ', expected ', i4) END SUBROUTINE SUBROUTINE CHKER2(NE, T, I, D, V) INCLUDE "getdata.f" INTEGER NE, T, I, D, V, E CALL GDEROR(E, D) IF (E .NE. V) THEN NE = NE + 1 WRITE(*, 9006) I, T, E, V ENDIF 9006 FORMAT('e(', i6, ')[', i6, '] = ', i4, ', expected ', i4) END SUBROUTINE SUBROUTINE CHKIN2(NE, T, I, N, V) INTEGER NE, T, I, N, V IF (N .NE. V) THEN NE = NE + 1 WRITE(*, 9007) I, T, N, V ENDIF 9007 FORMAT('n(', i6, ')[', i6, '] = ', i4, ', expected ', i4) END SUBROUTINE SUBROUTINE CHKST2(NE, T, I, N, V) INTEGER NE, T, I CHARACTER*(*) N, V IF (N .NE. V) THEN NE = NE + 1 WRITE(*, 9008) I, T, N, V ENDIF 9008 FORMAT('s(', i6, ')[', i6, '] = "', a, '", expected "', a, '"') END SUBROUTINE SUBROUTINE CHKSTR(NE, T, N, V) INTEGER NE, T CHARACTER*(*) N, V IF (N .NE. V) THEN NE = NE + 1 WRITE(*, 9009) T, N, V ENDIF 9009 FORMAT('s[', i6, '] = "', a, '", expected "', a, '"') END SUBROUTINE SUBROUTINE CHKDB2(NE, T, I, N, V) INTEGER NE, T, I REAL*8 N, V C This is good to single precision IF (ABS(N - V) .GT. 1E-7) THEN NE = NE + 1 WRITE(*, 9010) I, T, N, V ENDIF 9010 FORMAT('d(', i6, ')[', i6, '] = ', d16.10, ', expected ', d16.10) END SUBROUTINE SUBROUTINE CHKCP2(NE, T, I, N, V) INTEGER NE, T, I COMPLEX*16 N, V IF (ABS(N - V) .GT. 1E-7) THEN NE = NE + 1 WRITE(*, 9011) I, T, REAL(REAL(N)), REAL(AIMAG(N)), +REAL(REAL(V)), REAL(AIMAG(V)) ENDIF 9011 FORMAT('x(', i6, ')[', i6, '] = ', d16.10, ';', d16.10, +', expected ', d16.10, ';', d16.10) END SUBROUTINE SUBROUTINE CHKDBL(NE, T, N, V) INTEGER NE, T REAL*8 N, V IF (ABS(N - V) .GT. 1E-7) THEN NE = NE + 1 WRITE(*, 9012) T, N, V ENDIF 9012 FORMAT('d[', i6, '] = ', d16.10, ', expected ', d16.10) END SUBROUTINE SUBROUTINE CHKCPX(NE, T, N, V) INTEGER NE, T COMPLEX*16 N, V IF (ABS(N - V) .GT. 1E-7) THEN NE = NE + 1 WRITE(*, 9013) T, REAL(REAL(N)), REAL(AIMAG(N)), +REAL(REAL(V)), REAL(AIMAG(V)) ENDIF 9013 FORMAT('x[', i6, '] = ', d16.10, ';', d16.10, +', expected ', d16.10, ';', d16.10) END SUBROUTINE SUBROUTINE CHKEOS(NE, T, N, V) INTEGER NE, T, F CHARACTER*(*) N, V F = INDEX(N, V) IF (F .EQ. 0) THEN F = 1 ENDIF CALL CHKSTR(NE, T, N(F:), V) END SUBROUTINE SUBROUTINE CHKEOK(NE, T, D) INTEGER NE, T, D INCLUDE "getdata.f" CALL CHKERR(NE, T, D, GD_EOK) END SUBROUTINE SUBROUTINE CHKOK2(NE, T, I, D) INTEGER NE, T, I, D INCLUDE "getdata.f" CALL CHKER2(NE, T, I, D, GD_EOK) END SUBROUTINE PROGRAM BIGTST INCLUDE "getdata.f" INCLUDE "test_getdata.f" CHARACTER*12 fildir PARAMETER (fildir = 'test_dirfile') CHARACTER*19 frmat PARAMETER (frmat = 'test_dirfile/format') CHARACTER*18 frm2 PARAMETER (frm2 = 'test_dirfile/form2') CHARACTER*17 dat PARAMETER (dat = 'test_dirfile/data') INTEGER flen PARAMETER (flen = 11) INTEGER nfields PARAMETER (nfields = 17) INTEGER slen PARAMETER (slen = 26) INTEGER plen PARAMETER (plen = 4096) C An ISO-1539 conforming Fortran-77 compiler will either consider C this a single character, if it treats backslash as an escape C character, or else silently truncate it to a single '\', if it C doesn't. CHARACTER*1 backslash PARAMETER (backslash = '\\') CHARACTER*26 strings(3) CHARACTER*11 fields(nfields + 10) CHARACTER*11 fn CHARACTER*26 str CHARACTER*4096 path INTEGER*1 c(8) INTEGER*1 datdat(80) INTEGER*1 k INTEGER i INTEGER d INTEGER m INTEGER n INTEGER l INTEGER j INTEGER ne REAL fl REAL*8 dp REAL*8 p(6), q(6) COMPLEX*16 dc COMPLEX*16 cp(6), cq(6) CALL SYSTEM ( 'rm -rf ' // fildir ) CALL SYSTEM ( 'mkdir ' // fildir ) DO 10 k = 1, 80 datdat(k) = k 10 CONTINUE fields( 1) = 'INDEX ' fields( 2) = 'alias ' fields( 3) = 'bit ' fields( 4) = 'carray ' fields( 5) = 'const ' fields( 6) = 'data ' fields( 7) = 'div ' fields( 8) = 'lincom ' fields( 9) = 'linterp' fields(10) = 'mplex ' fields(11) = 'mult ' fields(12) = 'phase ' fields(13) = 'polynom' fields(14) = 'recip ' fields(15) = 'sbit ' fields(16) = 'string ' fields(17) = 'window ' C Write the test dirfile OPEN(1, FILE=frmat, STATUS='NEW') WRITE(1, *) '/ENDIAN little' WRITE(1, *) 'data RAW INT8 8' WRITE(1, *) 'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp + const const' WRITE(1, *) '/META data mstr STRING "This is a string constant."' WRITE(1, *) '/META data mconst CONST COMPLEX128 3.3;4.4' WRITE(1, *) '/META data mlut LINTERP DATA ./lut' WRITE(1, *) 'const CONST FLOAT64 5.5' WRITE(1, *) 'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6' WRITE(1, *) 'linterp LINTERP data ./lut' WRITE(1, *) 'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 + const const' WRITE(1, *) 'bit BIT data 3 4' WRITE(1, *) 'sbit SBIT data 5 6' WRITE(1, *) 'mplex MPLEX data sbit 1 10' WRITE(1, *) 'mult MULTIPLY data sbit' WRITE(1, *) 'phase PHASE data 11' WRITE(1, *) 'div DIVIDE mult bit' WRITE(1, *) 'recip RECIP div 6.5;4.3' WRITE(1, *) 'window WINDOW linterp mult LT 4.1' WRITE(1, *) '/ALIAS alias data' WRITE(1, *) 'string STRING "Zaphod Beeblebrox"' CLOSE(1, STATUS='KEEP') OPEN(1, FILE=frm2, STATUS='NEW') WRITE(1, *) 'const2 CONST INT8 -19' CLOSE(1, STATUS='KEEP') OPEN(1, FILE=dat, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=80, +STATUS='NEW') WRITE(1, REC=1) datdat CLOSE(1, STATUS='KEEP') ne = 0 C 1: GDEROR check CALL GDOPEN(d, "x", 1, GD_RO) CALL CHKERR(ne, 1, d, GD_EIO) C 2: GDOPEN check CALL GDOPEN(d, fildir, 12, GD_RW) CALL CHKEOK(ne, 2, d) C 3: GDGETD check CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c) CALL CHKEOK(ne, 3, d) CALL CHKINT(ne, 3, n, 8) DO 30 i = 1, 8 CALL CHKIN2(ne, 3, i, INT(c(i)), 40 + i) 30 CONTINUE C 12: GDGTCO check CALL GDGTCO(d, 'const', 5, GD_F32, fl) CALL CHKEOK(ne, 12, d) CALL CHKDBL(ne, 12, 1d0 * fl, 5.5d0) C 21: GDFDNX check CALL GDFDNX(i, d) CALL CHKEOK(ne, 21, d) CALL CHKINT(ne, 21, i, 7) C 22: GDMFNX check CALL GDMFNX(i, d, 'data', 4) CALL CHKEOK(ne, 22, d) CALL CHKINT(ne, 22, i, 6) C 23: GDNFLD check CALL GDNFLD(n, d) CALL CHKEOK(ne, 23, d) CALL CHKINT(ne, 23, n, nfields) C 24: This is a check of (one of many instances of) _GDF_FString l = 2 CALL GDFLDN(fn, l, d, 1) CALL CHKEOK(ne, 24, d) CALL CHKINT(ne, 24, l, 5) C 25: GDFLDN check DO 250 i = 1, n l = flen CALL GDFLDN(fn, l, d, i) CALL CHKOK2(ne, 25, i, d) CALL CHKIN2(ne, 25, i, l, flen) CALL CHKST2(ne, 25, i, fn, fields(i)) 250 CONTINUE C 26: GDNMFD check CALL GDNMFD(n, d, 'data', 4) CALL CHKEOK(ne, 26, d) CALL CHKINT(ne, 26, n, 3) C 27: GDMFDN check fields(1) = 'mstr' fields(2) = 'mconst' fields(3) = 'mlut' DO 270 i = 1, n l = flen CALL GDMFDN(fn, l, d, 'data', 4, i) CALL CHKOK2(ne, 27, i, d) CALL CHKIN2(ne, 27, i, l, flen) CALL CHKST2(ne, 27, i, fn, fields(i)) 270 CONTINUE C 28: GDNFRM check CALL GDNFRM(n, d) CALL CHKEOK(ne, 28, d) CALL CHKINT(ne, 28, n, 10) C 29: GDGSPF check CALL GDGSPF(n, d, 'data', 4) CALL CHKEOK(ne, 29, d) CALL CHKINT(ne, 29, n, 8) C 30: GDPUTD check c(1) = 13 c(2) = 14 c(3) = 15 c(4) = 16 c(5) = 17 c(6) = 18 c(7) = 19 c(8) = 20 CALL GDPUTD(n, d, 'data', 4, 5, 1, 0, 4, GD_I8, c) CALL CHKEOK(ne, 30, d) CALL CHKINT(ne, 30, n, 4) CALL GDGETD(n, d, 'data', 4, 5, 0, 1, 0, GD_I8, c) DO 300 i = 1, 8 IF (i .EQ. 1 .OR. i .GT. 5) THEN n = 40 + i ELSE n = 11 + i ENDIF CALL CHKIN2(ne, 30, i, INT(c(i)), n) 300 CONTINUE C 38: GDESTR check CALL GDGETD(n, d, 'x', 1, 5, 0, 1, 0, GD_I8, c) CALL GDESTR(d, str, slen) CALL CHKSTR(ne, 38, str, 'Field not found: x') C 39: GDENTY check CALL GDENTY(n, d, 'data', 4) CALL CHKEOK(ne, 39, d) CALL CHKINT(ne, 39, n, GD_RWE) C 40: GDGERW check CALL GDGERW(l, i, n, d, 'data', 4) CALL CHKEOK(ne, 40, d) CALL CHKIN2(ne, 40, 1, n, 0) CALL CHKIN2(ne, 40, 2, l, 8) CALL CHKIN2(ne, 40, 3, i, GD_I8) C 41: GDGELC check l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), +p(4), fields(3), l, p(5), p(6), n, d, 'lincom', 6) CALL CHKEOK(ne, 41, d) CALL CHKIN2(ne, 41, 1, l, flen) CALL CHKIN2(ne, 41, 2, i, 3) CALL CHKIN2(ne, 41, 3, n, 0) CALL CHKST2(ne, 41, 4, fields(1), 'data') CALL CHKST2(ne, 41, 5, fields(2), 'INDEX') CALL CHKST2(ne, 41, 6, fields(3), 'linterp') q(1) = 1.1 q(2) = 2.2 q(3) = 2.2 q(4) = 3.3 q(5) = 5.5 q(6) = 5.5 DO 410 i=1,6 CALL CHKDB2(ne, 41, i, p(i), q(i)) 410 CONTINUE C 42: GDGECL check l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), +cp(4), fields(3), l, cp(5), cp(6), n, d, 'lincom', 6) CALL CHKEOK(ne, 42, d) CALL CHKIN2(ne, 42, 1, l, flen) CALL CHKIN2(ne, 42, 2, i, 3) CALL CHKIN2(ne, 42, 3, n, 0) CALL CHKST2(ne, 42, 4, fields(1), 'data') CALL CHKST2(ne, 42, 5, fields(2), 'INDEX') CALL CHKST2(ne, 42, 6, fields(3), 'linterp') cq(1) = dcmplx(1.1d0, 0.0d0) cq(2) = dcmplx(2.2d0, 0.0d0) cq(3) = dcmplx(2.2d0, 0.0d0) cq(4) = dcmplx(3.3d0, 4.4d0) cq(5) = dcmplx(5.5d0, 0.0d0) cq(6) = dcmplx(5.5d0, 0.0d0) DO 420 i=1,6 CALL CHKCP2(ne, 42, 6 + i, cp(i), cq(i)) 420 CONTINUE C 43: GDGEPN check l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), +n, d, 'polynom', 7) CALL CHKEOK(ne, 43, d) CALL CHKIN2(ne, 43, 1, l, flen) CALL CHKIN2(ne, 43, 2, i, 5) CALL CHKIN2(ne, 43, 3, n, 0) CALL CHKST2(ne, 43, 4, fn, 'data') q(1) = 1.1 q(2) = 2.2 q(3) = 2.2 q(4) = 3.3 q(5) = 5.5 q(6) = 5.5 DO 430 i=1,6 CALL CHKDB2(ne, 43, i, p(i), q(i)) 430 CONTINUE C 44: GDGECP check l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), +n, d, 'polynom', 7) CALL CHKEOK(ne, 44, d) CALL CHKIN2(ne, 44, 1, l, flen) CALL CHKIN2(ne, 44, 2, i, 5) CALL CHKIN2(ne, 44, 3, n, 0) CALL CHKST2(ne, 44, 4, fn, 'data') cq(1) = dcmplx(1.1d0, 0.0) cq(2) = dcmplx(2.2d0, 0.0) cq(3) = dcmplx(2.2d0, 0.0) cq(4) = dcmplx(3.3d0, 4.4d0) cq(5) = dcmplx(5.5d0, 0.0) cq(6) = dcmplx(5.5d0, 0.0) DO 440 i=1,6 CALL CHKCP2(ne, 44, i, cp(i), cq(i)) 440 CONTINUE C 45: GDGELT check l = flen CALL GDGELT(fn, l, str, slen, n, d, 'linterp', 7) CALL CHKEOK(ne, 45, d) CALL CHKIN2(ne, 45, 1, l, flen) CALL CHKIN2(ne, 45, 2, n, 0) CALL CHKST2(ne, 45, 3, fn, 'data') CALL CHKST2(ne, 45, 4, str, './lut') C 46: GDGEBT check l = flen CALL GDGEBT(fn, l, m, i, n, d, 'bit', 3) CALL CHKEOK(ne, 46, d) CALL CHKIN2(ne, 46, 1, l, flen) CALL CHKIN2(ne, 46, 2, n, 0) CALL CHKIN2(ne, 46, 3, i, 4) CALL CHKIN2(ne, 46, 4, m, 3) CALL CHKST2(ne, 46, 5, fn, 'data') C 47: GDGESB check l = flen CALL GDGESB(fn, l, m, i, n, d, 'sbit', 4) CALL CHKEOK(ne, 47, d) CALL CHKIN2(ne, 47, 1, l, flen) CALL CHKIN2(ne, 47, 2, n, 0) CALL CHKIN2(ne, 47, 3, i, 6) CALL CHKIN2(ne, 47, 4, m, 5) CALL CHKST2(ne, 47, 5, fn, 'data') C 48: GDGEMT check l = flen CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'mult', 4) CALL CHKEOK(ne, 48, d) CALL CHKIN2(ne, 48, 1, l, flen) CALL CHKIN2(ne, 48, 2, n, 0) CALL CHKST2(ne, 48, 3, fields(1), 'data') CALL CHKST2(ne, 48, 4, fields(2), 'sbit') C 49: GDGEPH check l = flen CALL GDGEPH(fn, l, i, n, d, 'phase', 5) CALL CHKEOK(ne, 49, d) CALL CHKIN2(ne, 49, 1, l, flen) CALL CHKIN2(ne, 49, 2, n, 0) CALL CHKIN2(ne, 49, 3, i, 11) CALL CHKST2(ne, 49, 4, fn, 'data') C 50: GDGECO check CALL GDGECO(i, n, d, 'const', 5) CALL CHKEOK(ne, 50, d) CALL CHKIN2(ne, 50, 1, n, 0) CALL CHKIN2(ne, 50, 2, i, GD_F64) C 52: GDFRGI check CALL GDFRGI(n, d, 'const', 5) CALL CHKEOK(ne, 52, d) CALL CHKINT(ne, 52, n, 0) C 53: GDADRW check CALL GDADRW(d, 'new1', 4, GD_F64, 3, 0) CALL CHKOK2(ne, 53, 1, d) CALL GDGERW(l, i, n, d, 'new1', 4) CALL CHKOK2(ne, 53, 2, d) CALL CHKIN2(ne, 53, 3, n, 0) CALL CHKIN2(ne, 53, 4, l, 3) CALL CHKIN2(ne, 53, 5, i, GD_F64) C 54: GDADLC check CALL GDADLC(d, 'new2', 4, 2, 'in1', 3, 9.9d0, 8.8d0, 'in2', 3, +7.7d0, 6.6d0, '', 0, 0d0, 0d0, 0) CALL CHKOK2(ne, 54, 1, d) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), +p(4), fields(3), l, p(5), p(6), n, d, 'new2', 4) CALL CHKOK2(ne, 54, 2, d) CALL CHKIN2(ne, 54, 3, l, flen) CALL CHKIN2(ne, 54, 4, i, 2) CALL CHKIN2(ne, 54, 5, n, 0) CALL CHKST2(ne, 54, 6, fields(1), 'in1') CALL CHKST2(ne, 54, 7, fields(2), 'in2') q(1) = 9.9d0 q(2) = 8.8d0 q(3) = 7.7d0 q(4) = 6.6d0 q(5) = 5.5 q(6) = 5.5 DO 540 i=1,4 CALL CHKDB2(ne, 54, i, p(i), q(i)) 540 CONTINUE C 55: GDADCL check cq(1) = dcmplx(1.1d0, 1.2d0) cq(2) = dcmplx(1.3d0, 1.4d0) cq(3) = dcmplx(1.4d0, 1.5d0) cq(4) = dcmplx(1.6d0, 1.7d0) CALL GDADCL(d, 'new3', 4, 2, 'in1', 3, cq(1), cq(2), 'in2', 3, +cq(3), cq(4), '', 0, cq(5), cq(6), 0) CALL CHKOK2(ne, 55, 1, d) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new3', 4) CALL CHKOK2(ne, 55, 2, d) CALL CHKIN2(ne, 55, 3, l, flen) CALL CHKIN2(ne, 55, 4, i, 2) CALL CHKIN2(ne, 55, 5, n, 0) CALL CHKST2(ne, 55, 6, fields(1), 'in1') CALL CHKST2(ne, 55, 7, fields(2), 'in2') cq(1) = dcmplx(1.1d0, 1.2d0) cq(2) = dcmplx(1.3d0, 1.4d0) cq(3) = dcmplx(1.4d0, 1.5d0) cq(4) = dcmplx(1.6d0, 1.7d0) DO 550 i=1,4 CALL CHKCP2(ne, 55, i + 7, cp(i), cq(i)) 550 CONTINUE C 56: GDADPN check CALL GDADPN(d, 'new4', 4, 3, 'in1', 3, 3d3, 4d4, 5d5, 6d6, 0d0, +0d0, 0) CALL CHKOK2(ne, 56, 1, d) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), +n, d, 'new4', 4) CALL CHKOK2(ne, 56, 2, d) CALL CHKIN2(ne, 56, 1, l, flen) CALL CHKIN2(ne, 56, 2, i, 3) CALL CHKIN2(ne, 56, 3, n, 0) CALL CHKST2(ne, 56, 4, fn, 'in1') q(1) = 3d3 q(2) = 4d4 q(3) = 5d5 q(4) = 6d6 q(5) = 5.5d0 q(6) = 5.5d0 DO 560 i=1,4 CALL CHKDB2(ne, 56, i, p(i), q(i)) 560 CONTINUE C 57: GDADCP check cq(1) = dcmplx(3.1d0, 7.0d0) cq(2) = dcmplx(4.2d0, 8.0d0) cq(3) = dcmplx(5.2d0, 9.0d0) cq(4) = dcmplx(6.3d0, 4.4d0) CALL GDADCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4), +cq(5), cq(6), 0) CALL CHKOK2(ne, 57, 1, d) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), +n, d, 'new5', 4) CALL CHKOK2(ne, 57, 2, d) CALL CHKIN2(ne, 57, 1, l, flen) CALL CHKIN2(ne, 57, 2, i, 3) CALL CHKIN2(ne, 57, 3, n, 0) CALL CHKST2(ne, 57, 4, fn, 'in1') cq(1) = dcmplx(3.1d0, 7.0d0) cq(2) = dcmplx(4.2d0, 8.0d0) cq(3) = dcmplx(5.2d0, 9.0d0) cq(4) = dcmplx(6.3d0, 4.4d0) DO 570 i=1,4 CALL CHKCP2(ne, 57, i, cp(i), cq(i)) 570 CONTINUE C 58: GDADLT check CALL GDADLT(d, "new6", 4, "in", 2, "./some/table", 12, 0) CALL CHKOK2(ne, 58, 1, d) l = flen CALL GDGELT(fn, l, str, slen, n, d, 'new6', 4) CALL CHKOK2(ne, 58, 2, d) CALL CHKIN2(ne, 58, 1, l, flen) CALL CHKIN2(ne, 58, 2, n, 0) CALL CHKST2(ne, 58, 3, fn, 'in') CALL CHKST2(ne, 58, 4, str, './some/table') C 59: GDADBT check CALL GDADBT(d, "new7", 4, "in", 2, 13, 12, 0) CALL CHKOK2(ne, 59, 1, d) l = flen CALL GDGEBT(fn, l, m, i, n, d, 'new7', 4) CALL CHKOK2(ne, 59, 2, d) CALL CHKIN2(ne, 59, 1, l, flen) CALL CHKIN2(ne, 59, 2, n, 0) CALL CHKIN2(ne, 59, 3, i, 12) CALL CHKIN2(ne, 59, 4, m, 13) CALL CHKST2(ne, 59, 5, fn, 'in') C 60: GDADSB check CALL GDADSB(d, "new8", 4, "in", 2, 13, 12, 0) CALL CHKOK2(ne, 60, 1, d) l = flen CALL GDGESB(fn, l, m, i, n, d, 'new8', 4) CALL CHKOK2(ne, 60, 2, d) CALL CHKIN2(ne, 60, 1, l, flen) CALL CHKIN2(ne, 60, 2, n, 0) CALL CHKIN2(ne, 60, 3, i, 12) CALL CHKIN2(ne, 60, 4, m, 13) CALL CHKST2(ne, 60, 5, fn, 'in') C 61: GDADMT check CALL GDADMT(d, 'new9', 4, 'in1', 3, 'in2', 3, 0) CALL CHKOK2(ne, 61, 1, d) l = flen CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4) CALL CHKOK2(ne, 61, 2, d) CALL CHKIN2(ne, 61, 1, l, flen) CALL CHKIN2(ne, 61, 2, n, 0) CALL CHKST2(ne, 61, 3, fields(1), 'in1') CALL CHKST2(ne, 61, 4, fields(2), 'in2') C 62: GDADPH check CALL GDADPH(d, 'new10', 5, 'in1', 3, 22, 0) CALL CHKOK2(ne, 62, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'new10', 5) CALL CHKOK2(ne, 62, 2, d) CALL CHKIN2(ne, 62, 1, l, flen) CALL CHKIN2(ne, 62, 2, n, 0) CALL CHKIN2(ne, 62, 3, i, 22) CALL CHKST2(ne, 62, 4, fn, 'in1') C 63: GDADCO check CALL GDADCO(d, 'new11', 5, GD_F64, GD_F32, -8.1, 0) CALL CHKOK2(ne, 63, 1, d) CALL GDGECO(i, n, d, 'new11', 5) CALL CHKOK2(ne, 63, 2, d) CALL CHKIN2(ne, 63, 1, n, 0) CALL CHKIN2(ne, 63, 2, i, GD_F64) CALL GDGTCO(d, 'new11', 5, GD_F32, fl) CALL CHKOK2(ne, 63, 3, d) CALL CHKDBL(ne, 63, 1d0 * fl, 1d0 * (-8.1)) C 64: GDFRGN check l = plen CALL GDFRGN(path, l, d, 0) CALL CHKEOK(ne, 64, d) CALL CHKINT(ne, 64, l, plen) CALL CHKEOS(ne, 64, path, fildir//DIRSEP//'format') C 65: GDNFRG check CALL GDNFRG(n, d) CALL CHKEOK(ne, 65, d) CALL CHKINT(ne, 65, n, 1) C 66: GDINCL check CALL GDINCL(d, 'form2', 5, 0, 0) CALL CHKOK2(ne, 66, 1, d) CALL GDGTCO(d, 'const2', 6, GD_I8, c(1)) CALL CHKOK2(ne, 66, 2, d) CALL CHKINT(ne, 66, INT(c(1)), -19) C 67: GDNFDT check CALL GDNFDT(n, d, GD_LCE) CALL CHKEOK(ne, 67, d) CALL CHKINT(ne, 67, n, 3) C 68: GDFDNT check fields(1) = 'lincom' fields(2) = 'new2' fields(3) = 'new3' DO 680 i = 1, n l = flen CALL GDFDNT(fn, l, d, GD_LCE, i) CALL CHKOK2(ne, 68, i, d) CALL CHKIN2(ne, 68, i, l, flen) CALL CHKST2(ne, 68, i, fn, fields(i)) 680 CONTINUE C 69: GDNVEC check CALL GDNVEC(n, d) CALL CHKEOK(ne, 69, d) CALL CHKINT(ne, 69, n, 24) C 70: GDVECN check fields( 1) = 'INDEX ' fields( 2) = 'alias ' fields( 3) = 'bit ' fields( 4) = 'data ' fields( 5) = 'div ' fields( 6) = 'lincom ' fields( 7) = 'linterp' fields( 8) = 'mplex ' fields( 9) = 'mult ' fields(10) = 'new1 ' fields(11) = 'new10 ' fields(12) = 'new2 ' fields(13) = 'new3 ' fields(14) = 'new4 ' fields(15) = 'new5 ' fields(16) = 'new6 ' fields(17) = 'new7 ' fields(18) = 'new8 ' fields(19) = 'new9 ' fields(20) = 'phase ' fields(21) = 'polynom' fields(22) = 'recip ' fields(23) = 'sbit ' fields(24) = 'window ' DO 700 i = 1, n l = flen CALL GDVECN(fn, l, d, i) CALL CHKOK2(ne, 70, i, d) CALL CHKIN2(ne, 70, i, l, flen) CALL CHKST2(ne, 70, i, fn, fields(i)) 700 CONTINUE C 71: GDMDLC check CALL GDMDLC(d, 'data', 4, 'mnew1', 5, 2, 'in1', 3, 9.9d0, 8.8d0, +'in2', 3, 7.7d0, 6.6d0, '', 0, 0d0, 0d0) CALL CHKOK2(ne, 71, 1, d) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), +p(4), fields(3), l, p(5), p(6), n, d, 'data/mnew1', 10) CALL CHKOK2(ne, 71, 2, d) CALL CHKIN2(ne, 71, 3, l, flen) CALL CHKIN2(ne, 71, 4, i, 2) CALL CHKIN2(ne, 71, 5, n, 0) CALL CHKST2(ne, 71, 6, fields(1), 'in1') CALL CHKST2(ne, 71, 7, fields(2), 'in2') q(1) = 9.9d0 q(2) = 8.8d0 q(3) = 7.7d0 q(4) = 6.6d0 q(5) = 5.5 q(6) = 5.5 DO 710 i=1,4 CALL CHKDB2(ne, 71, i, p(i), q(i)) 710 CONTINUE C 72: GDMDCL check cq(1) = dcmplx(1.1d0, 1.2d0) cq(2) = dcmplx(1.3d0, 1.4d0) cq(3) = dcmplx(1.4d0, 1.5d0) cq(4) = dcmplx(1.6d0, 1.7d0) CALL GDMDCL(d, 'data', 4, 'mnew2', 5, 2, 'in1', 3, cq(1), cq(2), +'in2', 3, cq(3), cq(4), '', 0, cq(5), cq(6)) CALL CHKOK2(ne, 72, 1, d) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), +cp(4), fields(3), l, cp(5), cp(6), n, d, 'data/mnew2', 10) CALL CHKOK2(ne, 72, 2, d) CALL CHKIN2(ne, 72, 1, l, flen) CALL CHKIN2(ne, 72, 2, i, 2) CALL CHKIN2(ne, 72, 3, n, 0) CALL CHKST2(ne, 72, 4, fields(1), 'in1') CALL CHKST2(ne, 72, 5, fields(2), 'in2') cq(1) = dcmplx(1.1d0, 1.2d0) cq(2) = dcmplx(1.3d0, 1.4d0) cq(3) = dcmplx(1.4d0, 1.5d0) cq(4) = dcmplx(1.6d0, 1.7d0) DO 720 i=1,4 CALL CHKCP2(ne, 72, i, cp(i), cq(i)) 720 CONTINUE C 73: GDMDPN check CALL GDMDPN(d, 'data', 4, 'mnew3', 5, 3, 'in1', 3, 3d3, 4d4, 5d5, +6d6, 0d0, 0d0) CALL CHKOK2(ne, 73, 1, d) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), +n, d, 'data/mnew3', 10) CALL CHKOK2(ne, 73, 2, d) CALL CHKIN2(ne, 73, 1, l, flen) CALL CHKIN2(ne, 73, 2, i, 3) CALL CHKIN2(ne, 73, 3, n, 0) CALL CHKST2(ne, 73, 4, fn, 'in1') q(1) = 3d3 q(2) = 4d4 q(3) = 5d5 q(4) = 6d6 q(5) = 5.5d0 q(6) = 5.5d0 DO 730 i=1,4 CALL CHKDB2(ne, 73, i, p(i), q(i)) 730 CONTINUE C 74: GDMDCP check cq(1) = dcmplx(1.1d0, 0.0) cq(2) = dcmplx(2.2d0, 0.0) cq(3) = dcmplx(2.2d0, 0.0) cq(4) = dcmplx(3.3d0, 4.4d0) CALL GDMDCP(d, 'data', 4, 'mnew5', 5, 3, 'in1', 3, cq(1), cq(2), +cq(3), cq(4), cq(5), cq(6)) CALL CHKOK2(ne, 74, 1, d) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), +n, d, 'data/mnew5', 10) CALL CHKOK2(ne, 74, 2, d) CALL CHKIN2(ne, 74, 1, l, flen) CALL CHKIN2(ne, 74, 2, i, 3) CALL CHKIN2(ne, 74, 3, n, 0) CALL CHKST2(ne, 74, 4, fn, 'in1') cq(1) = dcmplx(1.1d0, 0.0) cq(2) = dcmplx(2.2d0, 0.0) cq(3) = dcmplx(2.2d0, 0.0) cq(4) = dcmplx(3.3d0, 4.4d0) DO 740 i=1,4 CALL CHKCP2(ne, 74, i, cp(i), cq(i)) 740 CONTINUE C 75: GDMDLT check CALL GDMDLT(d, "data", 4, "mnew6", 5, "in", 2, "./more/table", 12) CALL CHKOK2(ne, 75, 1, d) l = flen CALL GDGELT(fn, l, str, slen, n, d, 'data/mnew6', 10) CALL CHKOK2(ne, 75, 2, d) CALL CHKIN2(ne, 75, 1, l, flen) CALL CHKIN2(ne, 75, 2, n, 0) CALL CHKST2(ne, 75, 3, fn, 'in') CALL CHKST2(ne, 75, 4, str, './more/table') C 76: GDMDBT check CALL GDMDBT(d, "data", 4, "mnew7", 5, "in", 2, 13, 12) CALL CHKOK2(ne, 76, 1, d) l = flen CALL GDGEBT(fn, l, m, i, n, d, 'data/mnew7', 10) CALL CHKOK2(ne, 76, 2, d) CALL CHKIN2(ne, 76, 1, l, flen) CALL CHKIN2(ne, 76, 2, n, 0) CALL CHKIN2(ne, 76, 3, i, 12) CALL CHKIN2(ne, 76, 4, m, 13) CALL CHKST2(ne, 76, 5, fn, 'in') C 77: GDMDSB check CALL GDMDSB(d, "data", 4, "mnew8", 5, "in", 2, 13, 12) CALL CHKOK2(ne, 77, 1, d) l = flen CALL GDGESB(fn, l, m, i, n, d, 'data/mnew8', 10) CALL CHKOK2(ne, 77, 2, d) CALL CHKIN2(ne, 77, 1, l, flen) CALL CHKIN2(ne, 77, 2, n, 0) CALL CHKIN2(ne, 77, 3, i, 12) CALL CHKIN2(ne, 77, 4, m, 13) CALL CHKST2(ne, 77, 5, fn, 'in') C 78: GDMDMT check CALL GDMDMT(d, 'data', 4, 'mnew9', 5, 'in1', 3, 'in2', 3) CALL CHKOK2(ne, 78, 1, d) l = flen CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'data/mnew9', 10) CALL CHKOK2(ne, 78, 2, d) CALL CHKIN2(ne, 78, 1, l, flen) CALL CHKIN2(ne, 78, 2, n, 0) CALL CHKST2(ne, 78, 3, fields(1), 'in1') CALL CHKST2(ne, 78, 4, fields(2), 'in2') C 79: GDMDPH check CALL GDMDPH(d, 'data', 4, 'mnew10', 6, 'in1', 3, 22) CALL CHKOK2(ne, 79, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'data/mnew10', 11) CALL CHKOK2(ne, 79, 2, d) CALL CHKIN2(ne, 79, 1, l, flen) CALL CHKIN2(ne, 79, 2, n, 0) CALL CHKIN2(ne, 79, 3, i, 22) CALL CHKST2(ne, 79, 4, fn, 'in1') C 80: GDMDCO check CALL GDMDCO(d, 'data', 4, 'mnew11', 6, GD_F64, GD_F32, -8.1) CALL CHKOK2(ne, 80, 1, d) CALL GDGECO(i, n, d, 'data/mnew11', 11) CALL CHKOK2(ne, 80, 2, d) CALL CHKIN2(ne, 80, 1, l, flen) CALL CHKIN2(ne, 80, 2, n, 0) CALL CHKIN2(ne, 80, 3, i, GD_F64) CALL GDGTCO(d, 'data/mnew11', 11, GD_F32, fl) CALL CHKOK2(ne, 80, 3, d) CALL CHKDBL(ne, 80, 1d0 * fl, 1d0 * (-8.1)) C 81: GDGTST check CALL GDGTST(n, d, 'string', 6, slen, str) CALL CHKEOK(ne, 81, d) CALL CHKINT(ne, 81, n, 17) CALL CHKSTR(ne, 81, str, "Zaphod Beeblebrox") C 82: GDADST check CALL GDADST(d, 'new12', 5, "---string---", 12, 0) CALL CHKOK2(ne, 82, 1, d) CALL GDGTST(n, d, 'new12', 5, slen, str) CALL CHKOK2(ne, 82, 2, d) CALL CHKSTR(ne, 82, str, "---string---") C 83: GDMDST check CALL GDMDST(d, "data", 4, 'mnew12', 6, "kai su, technon;", 16) CALL CHKOK2(ne, 83, 1, d) CALL GDGTST(n, d, 'data/mnew12', 11, slen, str) CALL CHKOK2(ne, 83, 2, d) CALL CHKSTR(ne, 83, str, "kai su, technon;") C 84: GDADSP check CALL GDADSP(d, 'lorem STRING "Lorem ipsum"', 26, 0) CALL CHKOK2(ne, 84, 1, d) CALL GDGTST(n, d, 'lorem', 5, slen, str) CALL CHKOK2(ne, 84, 2, d) CALL CHKSTR(ne, 84, str, "Lorem ipsum") C 85: GDMDSP check CALL GDMDSP(d, 'ipsum STRING "dolor sit amet."', 30, 'lorem', 5) CALL CHKOK2(ne, 85, 1, d) CALL GDGTST(n, d, 'lorem/ipsum', 11, slen, str) CALL CHKOK2(ne, 85, 2, d) CALL CHKSTR(ne, 85, str, "dolor sit amet.") C 86: GDPTCO check CALL GDPTCO(d, 'const', 5, GD_I32, 10) CALL CHKOK2(ne, 86, 1, d) CALL GDGTCO(d, 'const', 5, GD_F32, fl) CALL CHKOK2(ne, 86, 2, d) CALL CHKDBL(ne, 86, 1d0 * fl, 10.0d0) C 94: GDPTST check CALL GDPTST(n, d, 'string', 6, 11, "Arthur Dent") CALL CHKOK2(ne, 94, 1, d) CALL CHKINT(ne, 94, n, 11) CALL GDGTST(n, d, 'string', 6, slen, str) CALL CHKOK2(ne, 94, 2, d) CALL CHKSTR(ne, 94, str, "Arthur Dent") C 95: GDNMFT check CALL GDNMFT(n, d, "data", 4, GD_LCE) CALL CHKEOK(ne, 95, d) CALL CHKINT(ne, 95, n, 2) C 96: GDMFDT check fields(1) = 'mnew1' fields(2) = 'mnew2' DO 960 i = 1, n l = flen CALL GDMFDT(fn, l, d, "data", 4, GD_LCE, i) CALL CHKOK2(ne, 96, i, d) CALL CHKIN2(ne, 96, i, l, flen) CALL CHKST2(ne, 96, i, fn, fields(i)) 960 CONTINUE C 97: GDNMVE check CALL GDNMVE(n, d, "data", 4) CALL CHKEOK(ne, 97, d) CALL CHKINT(ne, 97, n, 10) C 98: GDMVEN check fields(1) = 'mlut ' fields(2) = 'mnew1 ' fields(3) = 'mnew2 ' fields(4) = 'mnew3 ' fields(5) = 'mnew5 ' fields(6) = 'mnew6 ' fields(7) = 'mnew7 ' fields(8) = 'mnew8 ' fields(9) = 'mnew9 ' fields(10) = 'mnew10' DO 980 i = 1, n l = flen CALL GDMVEN(fn, l, d, "data", 4, i) CALL CHKOK2(ne, 98, i, d) CALL CHKIN2(ne, 98, i, l, flen) CALL CHKST2(ne, 98, i, fn, fields(i)) 980 CONTINUE C 99: GDALRW check CALL GDALRW(d, 'new1', 4, GD_I32, 4, 0) CALL CHKOK2(ne, 99, 1, d) CALL GDGERW(l, i, n, d, 'new1', 4) CALL CHKOK2(ne, 99, 2, d) CALL CHKIN2(ne, 99, 3, n, 0) CALL CHKIN2(ne, 99, 4, l, 4) CALL CHKIN2(ne, 99, 5, i, GD_I32) C 100: GDALLC check CALL GDALLC(d, 'new2', 4, 3, 'in4', 3, 9.9d-1, 7.8d0, 'in5', 3, +1.1d1, 2.2d-2, 'in6', 3, 1.96d0, 0d0) CALL CHKOK2(ne, 100, 1, d) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), +p(4), fields(3), l, p(5), p(6), n, d, 'new2', 4) CALL CHKOK2(ne, 100, 2, d) CALL CHKIN2(ne, 100, 3, l, flen) CALL CHKIN2(ne, 100, 4, i, 3) CALL CHKIN2(ne, 100, 5, n, 0) CALL CHKST2(ne, 100, 6, fields(1), 'in4') CALL CHKST2(ne, 100, 7, fields(2), 'in5') CALL CHKST2(ne, 100, 8, fields(3), 'in6') q(1) = 9.9d-1 q(2) = 7.8d0 q(3) = 1.1d1 q(4) = 2.2d-2 q(5) = 1.96d0 q(6) = 0d0 DO 1000 i=1,6 CALL CHKDB2(ne, 100, i, p(i), q(i)) 1000 CONTINUE C 101: GDALCL check cq(1) = dcmplx(0.1d0, 0.2d0) cq(2) = dcmplx(0.3d0, 0.4d0) cq(3) = dcmplx(0.4d0, 0.5d0) cq(4) = dcmplx(0.6d0, 0.7d0) CALL GDALCL(d, 'new3', 4, 2, 'in4', 3, cq(1), cq(2), 'in3', 3, +cq(3), cq(4), '', 0, cq(5), cq(6)) CALL CHKOK2(ne, 101, 1, d) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new3', 4) CALL CHKOK2(ne, 101, 2, d) CALL CHKIN2(ne, 101, 1, l, flen) CALL CHKIN2(ne, 101, 2, i, 2) CALL CHKIN2(ne, 101, 3, n, 0) CALL CHKST2(ne, 101, 4, fields(1), 'in4') CALL CHKST2(ne, 101, 5, fields(2), 'in3') cq(1) = dcmplx(0.1d0, 0.2d0) cq(2) = dcmplx(0.3d0, 0.4d0) cq(3) = dcmplx(0.4d0, 0.5d0) cq(4) = dcmplx(0.6d0, 0.7d0) DO 1010 i=1,4 CALL CHKCP2(ne, 101, i, cp(i), cq(i)) 1010 CONTINUE C 102: GDALPN check CALL GDALPN(d, 'new4', 4, 4, 'in1', 3, 3d0, 4d0, 5d0, 6d0, 7d0, +0d0) CALL CHKOK2(ne, 102, 1, d) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), +n, d, 'new4', 4) CALL CHKOK2(ne, 102, 2, d) CALL CHKIN2(ne, 102, 1, l, flen) CALL CHKIN2(ne, 102, 2, i, 4) CALL CHKIN2(ne, 102, 3, n, 0) CALL CHKST2(ne, 102, 4, fn, 'in1') DO 1020 i=1,5 CALL CHKDB2(ne, 102, i, p(i), 2d0 + i) 1020 CONTINUE C 103: GDALCP check cq(1) = dcmplx(1.1d0, 5.0d0) cq(2) = dcmplx(1.2d0, 4.0d0) cq(3) = dcmplx(1.2d0, 3.0d0) cq(4) = dcmplx(1.3d0, 2.4d0) CALL GDALCP(d, 'new5', 4, 3, 'in1', 3, cq(1), cq(2), cq(3), cq(4), +cq(5), cq(6)) CALL CHKOK2(ne, 103, 1, d) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), +n, d, 'new5', 4) CALL CHKOK2(ne, 103, 2, d) CALL CHKIN2(ne, 103, 1, l, flen) CALL CHKIN2(ne, 103, 2, i, 3) CALL CHKIN2(ne, 103, 3, n, 0) CALL CHKST2(ne, 103, 4, fn, 'in1') cq(1) = dcmplx(1.1d0, 5.0d0) cq(2) = dcmplx(1.2d0, 4.0d0) cq(3) = dcmplx(1.2d0, 3.0d0) cq(4) = dcmplx(1.3d0, 2.4d0) DO 1030 i=1,4 CALL CHKCP2(ne, 103, i, cp(i), cq(i)) 1030 CONTINUE C 104: GDALLT check CALL GDALLT(d, "new6", 4, "in3", 3, "./other/table", 13, 0) CALL CHKOK2(ne, 104, 1, d) l = flen CALL GDGELT(fn, l, str, slen, n, d, 'new6', 4) CALL CHKOK2(ne, 104, 2, d) CALL CHKIN2(ne, 104, 1, l, flen) CALL CHKIN2(ne, 104, 2, n, 0) CALL CHKST2(ne, 104, 3, fn, 'in3') CALL CHKST2(ne, 104, 4, str, './other/table') C 105: GDALBT check CALL GDALBT(d, "new7", 4, "in3", 3, 3, 2) CALL CHKOK2(ne, 105, 1, d) l = flen CALL GDGEBT(fn, l, m, i, n, d, 'new7', 4) CALL CHKOK2(ne, 105, 2, d) CALL CHKIN2(ne, 105, 1, l, flen) CALL CHKIN2(ne, 105, 2, n, 0) CALL CHKIN2(ne, 105, 3, i, 2) CALL CHKIN2(ne, 105, 4, m, 3) CALL CHKST2(ne, 105, 5, fn, 'in3') C 106: GDALSB check CALL GDALSB(d, "new8", 4, "out", 3, 1, 22) CALL CHKOK2(ne, 106, 1, d) l = flen CALL GDGESB(fn, l, m, i, n, d, 'new8', 4) CALL CHKOK2(ne, 106, 2, d) CALL CHKIN2(ne, 106, 1, l, flen) CALL CHKIN2(ne, 106, 2, n, 0) CALL CHKIN2(ne, 106, 3, i, 22) CALL CHKIN2(ne, 106, 4, m, 1) CALL CHKST2(ne, 106, 5, fn, 'out') C 107: GDALMT check CALL GDALMT(d, 'new9', 4, 'in6', 3, 'in4', 3) CALL CHKOK2(ne, 107, 1, d) l = flen CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4) CALL CHKOK2(ne, 107, 2, d) CALL CHKIN2(ne, 107, 1, l, flen) CALL CHKIN2(ne, 107, 2, n, 0) CALL CHKST2(ne, 107, 3, fields(1), 'in6') CALL CHKST2(ne, 107, 4, fields(2), 'in4') C 108: GDALPH check CALL GDALPH(d, 'new10', 5, 'in2', 3, 8) CALL CHKOK2(ne, 108, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'new10', 5) CALL CHKOK2(ne, 108, 2, d) CALL CHKIN2(ne, 108, 1, l, flen) CALL CHKIN2(ne, 108, 2, n, 0) CALL CHKIN2(ne, 108, 3, i, 8) CALL CHKST2(ne, 108, 4, fn, 'in2') C 109: GDALCO check CALL GDALCO(d, 'new11', 5, GD_F32) CALL CHKOK2(ne, 109, 2, d) CALL GDGECO(i, n, d, 'new11', 5) CALL CHKOK2(ne, 109, 2, d) CALL CHKIN2(ne, 109, 1, l, flen) CALL CHKIN2(ne, 109, 2, n, 0) CALL CHKIN2(ne, 109, 3, i, GD_F32) CALL GDGTCO(d, 'new11', 5, GD_F32, fl) CALL CHKOK2(ne, 109, 3, d) CALL CHKDBL(ne, 109, 1d0 * fl, 1d0 * (-8.1)) C 110: GDGENC check CALL GDGENC(n, d, 0) CALL CHKEOK(ne, 110, d) CALL CHKINT(ne, 110, n, GDE_UN) C 111: GDGEND check CALL GDGEND(n, d, 0) CALL CHKEOK(ne, 111, d) CALL CHKINT(ne, 111, n, GD_LE + GD_NA) C 112: GDNAME check l = plen CALL GDNAME(path, l, d, 0) CALL CHKEOK(ne, 112, d) CALL CHKINT(ne, 112, l, plen) CALL CHKEOS(ne, 112, path, fildir) C 113: GDPFRG check CALL GDPFRG(n, d, 1) CALL CHKEOK(ne, 113, d) CALL CHKINT(ne, 113, n, 0) C 114: GDAPRT check CALL GDAPRT(d, GDPR_D, 1) CALL CHKEOK(ne, 114, d) C 115: GDGPRT check CALL GDGPRT(n, d, 1) CALL CHKEOK(ne, 115, d) CALL CHKINT(ne, 115, n, GDPR_D) C 116: GDRWFN check l = plen CALL GDRWFN(path, l, d, "data", 4) CALL CHKEOK(ne, 116, d) CALL CHKINT(ne, 116, l, plen) CALL CHKEOS(ne, 116, path, fildir//DIRSEP//'data') C 117: GDREFE check l = slen CALL GDREFE(str, l, d, "new1", 4) CALL CHKEOK(ne, 117, d) CALL CHKINT(ne, 117, l, slen) CALL CHKSTR(ne, 117, str, 'new1') C 118: GDGEOF check CALL GDGEOF(n, d, 'lincom', 6) CALL CHKEOK(ne, 118, d) CALL CHKINT(ne, 118, n, 80) C 119: GDAENC check CALL GDAENC(d, GDE_TX, 1, 0) CALL CHKOK2(ne, 119, 1, d) CALL GDGENC(n, d, 1) CALL CHKOK2(ne, 119, 2, d) CALL CHKINT(ne, 119, n, GDE_TX) C 120: GDAEND check CALL GDAEND(d, GD_BE, 1, 0) CALL CHKOK2(ne, 120, 1, d) CALL GDGEND(n, d, 1) CALL CHKOK2(ne, 120, 2, d) CALL CHKINT(ne, 120, n, GD_BE) C 121: GDALSP check CALL GDALSP(d, 'new10 PHASE in1 3', 17, 0) CALL CHKOK2(ne, 121, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'new10', 5) CALL CHKOK2(ne, 121, 2, d) CALL CHKIN2(ne, 121, 1, l, flen) CALL CHKIN2(ne, 121, 2, n, 0) CALL CHKIN2(ne, 121, 3, i, 3) CALL CHKST2(ne, 121, 4, fn, 'in1') C 122: GDDELE check CALL GDDELE(d, 'new10', 5, 0) CALL CHKOK2(ne, 122, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'new10', 5) CALL CHKER2(ne, 122, 2, d, GD_EBC) C 123: GDMLSP check CALL GDMLSP(d, 'mnew10 PHASE in4 11', 19, 'data', 4, 0) CALL CHKOK2(ne, 123, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'data/mnew10', 11) CALL CHKOK2(ne, 123, 2, d) CALL CHKIN2(ne, 123, 1, l, flen) CALL CHKIN2(ne, 123, 2, n, 0) CALL CHKIN2(ne, 123, 3, i, 11) CALL CHKST2(ne, 123, 4, fn, 'in4') C 124: GDMOVE check CALL GDMOVE(d, 'new9', 4, 1, 0) CALL CHKOK2(ne, 124, 1, d) l = flen CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4) CALL CHKOK2(ne, 124, 2, d) CALL CHKIN2(ne, 124, 1, l, flen) CALL CHKIN2(ne, 124, 2, n, 1) CALL CHKST2(ne, 124, 3, fields(1), 'in6') CALL CHKST2(ne, 124, 4, fields(2), 'in4') C 125: GDRENM check CALL GDRENM(d, 'new9', 4, 'newer', 5, 0) CALL CHKOK2(ne, 125, 1, d) CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'new9', 4) CALL CHKER2(ne, 125, 2, d, GD_EBC) l = flen CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5) CALL CHKOK2(ne, 125, 3, d) CALL CHKIN2(ne, 125, 1, l, flen) CALL CHKIN2(ne, 125, 2, n, 1) CALL CHKST2(ne, 125, 3, fields(1), 'in6') CALL CHKST2(ne, 125, 4, fields(2), 'in4') C 126: GDUINC check CALL GDUINC(d, 1, 0) CALL CHKOK2(ne, 126, 1, d) CALL GDGEMT(fields(1), l, fields(2), l, n, d, 'newer', 5) CALL CHKER2(ne, 126, 2, d, GD_EBC) C 127: GDGFOF check CALL GDGFOF(n, d, 0) CALL CHKEOK(ne, 127, d) CALL CHKINT(ne, 127, n, 0) C 128: GDAFOF check CALL GDAFOF(d, 33, 0, 0) CALL CHKOK2(ne, 128, 1, d) CALL GDGFOF(n, d, 0) CALL CHKOK2(ne, 128, 2, d) CALL CHKINT(ne, 128, n, 33) C 129: GDNTYP check CALL GDNTYP(n, d, 'data', 4) CALL CHKEOK(ne, 129, d) CALL CHKINT(ne, 129, n, GD_I8) C 130: GDENFL check CALL GDENFL(n, d, 'polynom', 7) CALL CHKEOK(ne, 130, d) CALL CHKINT(ne, 130, n, GDE_CS + GDE_CA) C 131: GDVLDT check CALL GDVLDT(n, d, 'new7', 4) CALL CHKERR(ne, 131, d, GD_EBC) CALL CHKINT(ne, 131, n, -1) C 132: GDFNUM check l = slen CALL GDREFE(str, l, d, "data", 4) CALL GDFNUM(dp, d, 'INDEX', 5, 33.3d0) CALL CHKEOK(ne, 132, d) CALL CHKDBL(ne, 132, dp, 33.3D0) C 133: GDFNSS check CALL GDFNSS(dp, d, 'data', 4, 33.3d0, 6, 0) CALL CHKEOK(ne, 133, d) CALL CHKDBL(ne, 133, dp, 37.0375D0) C 134: GDGSCA check l = slen CALL GDGSCA(str, l, n, d, 'lincom', 6, 6) CALL CHKEOK(ne, 134, d) CALL CHKINT(ne, 134, n, -1) CALL CHKSTR(ne, 134, str, "const") C 135: GDASRW check CALL GDASRW(d, 'new135', 6, GD_F32, 0, 'carray', 6, 2, 0) CALL CHKOK2(ne, 135, 1, d) CALL GDGERW(l, i, n, d, 'new135', 6) CALL CHKOK2(ne, 135, 2, d) CALL CHKIN2(ne, 135, 3, n, 0) CALL CHKIN2(ne, 135, 4, l, 2) CALL CHKIN2(ne, 135, 5, i, GD_F32) l = slen CALL GDGSCA(str, l, n, d, 'new135', 6, 1) CALL CHKOK2(ne, 135, 6, d) CALL CHKST2(ne, 135, 7, str, "carray") CALL CHKIN2(ne, 135, 8, n, 2) C 140: GDASCA check CALL GDASCA(d, 'lincom', 6, 6, 'new11', 5, -1, 0) CALL CHKOK2(ne, 140, 1, d) l = slen CALL GDGSCA(str, l, n, d, 'lincom', 6, 6) CALL CHKOK2(ne, 140, 2, d) CALL CHKINT(ne, 140, n, -1) CALL CHKSTR(ne, 140, str, "new11") C 141: GDLSRW check CALL GDLSRW(d, 'new135', 6, GD_F64, 0, 'const', 5, -1, 0) CALL CHKOK2(d, 141, 1, d) CALL GDGERW(l, i, n, d, 'new135', 6) CALL CHKOK2(ne, 135, 2, d) CALL CHKIN2(ne, 135, 3, n, 0) CALL CHKIN2(ne, 135, 4, l, 10) CALL CHKIN2(ne, 135, 5, i, GD_F64) l = slen CALL GDGSCA(str, l, n, d, 'new135', 6, 1) CALL CHKOK2(ne, 135, 6, d) CALL CHKST2(ne, 135, 7, str, "const") CALL CHKIN2(ne, 135, 8, n, -1) C 142: GDGBOF check CALL GDGBOF(n, d, 'lincom', 6) CALL CHKEOK(ne, 142, d) CALL CHKINT(ne, 142, n, 264) C 143: GDGEDV check l = flen CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'div', 3) CALL CHKEOK(ne, 143, d) CALL CHKIN2(ne, 143, 1, l, flen) CALL CHKIN2(ne, 143, 2, n, 0) CALL CHKST2(ne, 143, 3, fields(1), 'mult') CALL CHKST2(ne, 143, 4, fields(2), 'bit') C 144: GDGERC check l = flen CALL GDGERC(fields(1), l, dp, n, d, 'recip', 5) CALL CHKEOK(ne, 144, d) CALL CHKIN2(ne, 144, 1, l, flen) CALL CHKIN2(ne, 144, 2, n, 0) CALL CHKST2(ne, 144, 3, fields(1), 'div') CALL CHKDB2(ne, 144, 4, dp, 6.5D0) C 145: GDGECR check l = flen CALL GDGECR(fields(1), l, dc, n, d, 'recip', 5) CALL CHKEOK(ne, 145, d) CALL CHKIN2(ne, 145, 1, l, flen) CALL CHKIN2(ne, 145, 2, n, 0) CALL CHKST2(ne, 145, 3, fields(1), 'div') CALL CHKCP2(ne, 145, 4, dc, dcmplx(6.5d0, 4.3d0)) C 146: GDADDV check CALL GDADDV(d, 'new14', 5, 'in1', 3, 'in2', 3, 0) CALL CHKOK2(ne, 146, 1, d) l = flen CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'new14', 5) CALL CHKOK2(ne, 146, 2, d) CALL CHKIN2(ne, 146, 1, l, flen) CALL CHKIN2(ne, 146, 2, n, 0) CALL CHKST2(ne, 146, 3, fields(1), 'in1') CALL CHKST2(ne, 146, 4, fields(2), 'in2') C 147: GDADRC check p(1) = 31.9 CALL GDADRC(d, 'new15', 5, 'in1', 3, p(1), 0) CALL CHKOK2(ne, 147, 1, d) l = flen CALL GDGERC(fields(1), l, dp, n, d, 'new15', 5) CALL CHKOK2(ne, 147, 2, d) CALL CHKIN2(ne, 147, 1, l, flen) CALL CHKIN2(ne, 147, 2, n, 0) CALL CHKST2(ne, 147, 3, fields(1), 'in1') CALL CHKDB2(ne, 147, 4, dp, p(1)) C 148: GDADCR check cp(1) = dcmplx(31.9d0, 38.2d0) CALL GDADCR(d, 'new16', 5, 'in1', 3, cp(1), 0) CALL CHKOK2(ne, 148, 1, d) l = flen CALL GDGECR(fields(1), l, dc, n, d, 'new16', 5) CALL CHKOK2(ne, 148, 2, d) CALL CHKIN2(ne, 148, 1, l, flen) CALL CHKIN2(ne, 148, 2, n, 0) CALL CHKST2(ne, 148, 3, fields(1), 'in1') CALL CHKCP2(ne, 148, 4, dc, cp(1)) C 149: GDMDDV check CALL GDMDDV(d, 'data', 4, 'new14', 5, 'in3', 3, 'in4', 3) CALL CHKOK2(ne, 149, 1, d) l = flen CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'data/new14', 10) CALL CHKOK2(ne, 149, 2, d) CALL CHKIN2(ne, 149, 1, l, flen) CALL CHKIN2(ne, 149, 2, n, 0) CALL CHKST2(ne, 149, 3, fields(1), 'in3') CALL CHKST2(ne, 149, 4, fields(2), 'in4') C 150: GDMDRC check p(1) = 95.5 CALL GDMDRC(d, 'data', 4, 'new15', 5, 'in0', 3, p(1)) CALL CHKOK2(ne, 150, 1, d) l = flen CALL GDGERC(fields(1), l, dp, n, d, 'data/new15', 10) CALL CHKOK2(ne, 150, 2, d) CALL CHKIN2(ne, 150, 1, l, flen) CALL CHKIN2(ne, 150, 2, n, 0) CALL CHKST2(ne, 150, 3, fields(1), 'in0') CALL CHKDB2(ne, 150, 4, dp, p(1)) C 151: GDADCR check cp(1) = dcmplx(8.47d0, 6.22d0) CALL GDMDCR(d,'data', 4, 'new16', 5, 'in3', 3, cp(1)) CALL CHKOK2(ne, 151, 1, d) l = flen CALL GDGECR(fields(1), l, dc, n, d, 'data/new16', 10) CALL CHKOK2(ne, 151, 2, d) CALL CHKIN2(ne, 151, 1, l, flen) CALL CHKIN2(ne, 151, 2, n, 0) CALL CHKST2(ne, 151, 3, fields(1), 'in3') CALL CHKCP2(ne, 151, 4, dc, cp(1)) C 152: GDALDV check CALL GDALDV(d, 'new14', 5, 'in6', 3, 'in4', 3) CALL CHKOK2(ne, 152, 1, d) l = flen CALL GDGEDV(fields(1), l, fields(2), l, n, d, 'new14', 5) CALL CHKOK2(ne, 152, 2, d) CALL CHKIN2(ne, 152, 1, l, flen) CALL CHKIN2(ne, 152, 2, n, 0) CALL CHKST2(ne, 152, 3, fields(1), 'in6') CALL CHKST2(ne, 152, 4, fields(2), 'in4') C 153: GDALRC check p(1) = 0.187 CALL GDALRC(d, 'new15', 5, 'in5', 3, p(1)) CALL CHKOK2(ne, 153, 1, d) l = flen CALL GDGERC(fields(1), l, dp, n, d, 'new15', 5) CALL CHKOK2(ne, 153, 2, d) CALL CHKIN2(ne, 153, 1, l, flen) CALL CHKIN2(ne, 153, 2, n, 0) CALL CHKST2(ne, 153, 3, fields(1), 'in5') CALL CHKDB2(ne, 153, 4, dp, p(1)) C 154: GDALCR check cp(1) = dcmplx(4.3d0, 81.81d0) CALL GDALCR(d, 'new16', 5, 'in6', 3, cp(1)) CALL CHKOK2(ne, 154, 1, d) l = flen CALL GDGECR(fields(1), l, dc, n, d, 'new16', 5) CALL CHKOK2(ne, 154, 2, d) CALL CHKIN2(ne, 154, 1, l, flen) CALL CHKIN2(ne, 154, 2, n, 0) CALL CHKST2(ne, 154, 3, fields(1), 'in6') CALL CHKCP2(ne, 154, 4, dc, cp(1)) C 155: GDRFRG check CALL GDRFRG(d, 0) CALL CHKEOK(ne, 155, d) C 156: GDINVD check CALL GDINVD(m) CALL CHKOK2(ne, 156, 1, m) CALL GDNFRG(n, m) CALL CHKER2(ne, 156, 2, m, GD_EBD) CALL GDCLOS(m) C 157: GDSTDV check n = GDSV_C CALL GDSTDV(n, d) CALL CHKOK2(ne, 157, 1, d) CALL CHKINT(ne, 157, n, GD_DSV) n = 0 CALL GDSTDV(n, d) CALL CHKER2(ne, 157, 2, d, GD_EAR) C 158: GDGTCA check CALL GDGTCA(d, 'carray', 6, GD_F64, p) CALL CHKEOK(ne, 158, d) DO 1580 i=1,6 CALL CHKDB2(ne, 158, i, p(i), 1.1d0 * i) 1580 CONTINUE C 159: GDGCAS check CALL GDGCAS(d, 'carray', 6, 3, 2, GD_F64, p) CALL CHKEOK(ne, 159, d) DO 1590 i=1,2 CALL CHKDB2(ne, 159, i, p(i), 2.2d0 + 1.1 * i) 1590 CONTINUE C 168: GDPTCA check p(1) = 9.6d0 p(2) = 8.5d0 p(3) = 7.4d0 p(4) = 6.3d0 p(5) = 5.2d0 p(6) = 4.1d0 CALL GDPTCA(d, 'carray', 6, GD_F64, p) CALL CHKOK2(ne, 168, 1, d) CALL GDGTCA(d, 'carray', 6, GD_F64, q) CALL CHKOK2(ne, 168, 2, d) DO 1680 i=1,6 CALL CHKDB2(ne, 168, i, q(i), 10.7d0 - 1.1d0 * i) 1680 CONTINUE C 169: GDGCAS check p(1) = 5.5d0 p(2) = 5.6d0 p(3) = 5.7d0 p(4) = 5.8d0 p(5) = 5.9d0 p(6) = 6.0d0 CALL GDPCAS(d, 'carray', 6, 3, 2, GD_F64, p) CALL CHKOK2(ne, 169, 1, d) CALL GDGTCA(d, 'carray', 6, GD_F64, q) CALL CHKOK2(ne, 169, 2, d) DO 1690 i=1,6 IF (i .eq. 3 .or. i .eq. 4) THEN dp = 5.2d0 + 0.1d0 * i ELSE dp = 10.7d0 - 1.1d0 * i ENDIF CALL CHKDB2(ne, 169, i, q(i), dp) 1690 CONTINUE C 177: GDARLN check CALL GDARLN(n, d, 'carray', 6) CALL CHKEOK(ne, 177, d) CALL CHKINT(ne, 177, n, 6) C 178: GDGECA check CALL GDGECA(i, l, n, d, 'carray', 6) CALL CHKEOK(ne, 178, d) CALL CHKIN2(ne, 178, 1, l, 6) CALL CHKIN2(ne, 178, 2, n, 0) CALL CHKIN2(ne, 178, 3, i, GD_F64) C 179: GDADCA check p(1) = 1.2d0 p(2) = 3.4d0 p(3) = 5.6d0 p(4) = 7.8d0 CALL GDADCA(d, 'new17', 5, GD_F64, 4, GD_F64, p, 0) CALL CHKOK2(ne, 179, 1, d) CALL GDGECA(i, l, n, d, 'new17', 5) CALL CHKOK2(ne, 179, 2, d) CALL CHKIN2(ne, 179, 1, n, 0) CALL CHKIN2(ne, 179, 2, i, GD_F64) CALL CHKIN2(ne, 179, 3, l, 4) CALL GDGTCA(d, 'new17', 5, GD_F64, q) CALL CHKOK2(ne, 179, 3, d) DO 1790 i=1,4 CALL CHKDB2(ne, 179, i, q(i), i * 2.2d0 - 1.0d0) 1790 CONTINUE C 180: GDMDCA check p(1) = 3.2d0 p(2) = 5.4d0 p(3) = 7.6d0 p(4) = 9.8d0 CALL GDMDCA(d, 'data', 4, 'new17', 5, GD_F64, 4, GD_F64, p) CALL CHKOK2(ne, 180, 1, d) CALL GDGECA(i, l, n, d, 'data/new17', 10) CALL CHKOK2(ne, 180, 2, d) CALL CHKIN2(ne, 180, 1, n, 0) CALL CHKIN2(ne, 180, 2, i, GD_F64) CALL CHKIN2(ne, 180, 3, l, 4) CALL GDGTCA(d, 'data/new17', 10, GD_F64, q) CALL CHKOK2(ne, 180, 3, d) DO 1800 i=1,4 CALL CHKDB2(ne, 180, i, q(i), 1.0d0 + i * 2.2d0) 1800 CONTINUE C 181: GDALCA check CALL GDALCA(d, 'new17', 5, GD_F32, 3) CALL CHKOK2(ne, 181, 1, d) CALL GDGECA(i, l, n, d, 'new17', 5) CALL CHKOK2(ne, 181, 2, d) CALL CHKIN2(ne, 181, 1, n, 0) CALL CHKIN2(ne, 181, 2, i, GD_F32) CALL CHKIN2(ne, 181, 3, l, 3) C 183: GDCONS check p(1) = 10.0d0 p(2) = -8.1 CALL GDNFDT(n, d, GD_COE) DO 1830 i = 1, n l = flen CALL GDCONS(fl, d, GD_F32, i) CALL CHKOK2(ne, 183, i, d) CALL CHKDB2(ne, 183, i, 1d0 * fl, p(i)) 1830 CONTINUE C 191: GDMCOS check p(1) = 3.3d0 p(2) = -8.1 * 1d0 CALL GDNMFT(n, d, "data", 4, GD_COE) DO 1910 i = 1, n l = flen CALL GDMCOS(fl, d, "data", 4, GD_F32, i) CALL CHKOK2(ne, 191, i, d) CALL CHKDB2(ne, 191, i, 1d0 * fl, p(i)) 1910 CONTINUE C 199: GDSTRS check strings(1) = "Lorem ipsum " strings(2) = "---string--- " strings(3) = "Arthur Dent " CALL GDNFDT(n, d, GD_STE) DO 1990 i = 1, n l = slen CALL GDSTRS(str, l, d, i) CALL CHKOK2(ne, 199, i, d) CALL CHKIN2(ne, 199, i, l, slen) CALL CHKST2(ne, 199, i, str, strings(i)) 1990 CONTINUE C 200: GDMSTS check strings(1) = 'This is a string constant.' strings(2) = 'kai su, technon; ' CALL GDNMFT(n, d, 'data', 4, GD_STE) DO 2000 i = 1, n l = slen CALL GDMSTS(str, l, d, "data", 4, i) CALL CHKOK2(ne, 200, i, d) CALL CHKIN2(ne, 200, i, l, slen) CALL CHKST2(ne, 200, i, str, strings(i)) 2000 CONTINUE C 201: GDSTRX check CALL GDSTRX(i, d) CALL CHKEOK(ne, 201, d) CALL CHKINT(ne, 201, i, 12) C 202: GDMSTX check CALL GDMSTX(i, d, 'data', 4) CALL CHKEOK(ne, 202, d) CALL CHKINT(ne, 202, i, slen) C 203: GDSEEK check CALL GDSEEK(n, d, 'data', 4, 35, 0, GDSK_S) CALL CHKOK2(ne, 203, 1, d) CALL CHKIN2(ne, 203, 1, n, 280) CALL GDGETD(m, d, 'data', 4, GD_HER, 0, 1, 0, GD_I8, c) CALL CHKOK2(ne, 203, 2, d) CALL CHKIN2(ne, 203, 2, m, 8) DO 2030 i = 1, 8 CALL CHKIN2(ne, 203, i, INT(c(i)), 16 + i) 2030 CONTINUE C 204: GDTELL check CALL GDTELL(n, d, 'data', 4) CALL CHKEOK(ne, 204, d) CALL CHKINT(ne, 204, n, 288) C 205: GDHIDE check CALL GDHIDE(d, 'data', 4) CALL CHKEOK(ne, 205, d) C 206: GDHIDN check CALL GDHIDN(n, d, 'data', 4) CALL CHKOK2(ne, 206, 1, d) CALL CHKIN2(ne, 206, 1, n, 1) CALL GDHIDN(n,d, 'lincom', 6) CALL CHKOK2(ne, 206, 2, d) CALL CHKIN2(ne, 206, 2, n, 0) C 207: GDUHID check CALL GDUHID(d, 'data', 4) CALL CHKOK2(ne, 206, 1, d) CALL GDHIDN(n, d, 'data', 4) CALL CHKOK2(ne, 206, 2, d) CALL CHKINT(ne, 206, n, 0) C 208: GDSYNC check CALL GDSYNC(d, 'data', 4) CALL CHKEOK(ne, 208, d) C 209: GDFLSH check CALL GDFLSH(d, 'data', 4) CALL CHKEOK(ne, 209, d) C 210: GDMFLS check CALL GDMFLS(d) CALL CHKEOK(ne, 210, d) C 211: GDGEWD check l = flen i = flen CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'window', +6) CALL CHKEOK(ne, 211, d) CALL CHKIN2(ne, 211, 1, i, flen) CALL CHKIN2(ne, 211, 2, l, flen) CALL CHKIN2(ne, 211, 3, n, 0) CALL CHKIN2(ne, 211, 4, m, GDW_LT) CALL CHKST2(ne, 211, 5, fields(1), 'linterp') CALL CHKST2(ne, 211, 6, fields(2), 'mult') CALL CHKDB2(ne, 211, 7, dp, 4.1D0) C 212: GDADWD check CALL GDADWD(d, 'new18', 5, 'in1', 3, 'in2', 3, GDW_NE, 32, 0) CALL CHKOK2(ne, 212, 1, d) l = flen i = flen CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new18', +5) CALL CHKOK2(ne, 212, 2, d) CALL CHKIN2(ne, 212, 1, i, flen) CALL CHKIN2(ne, 212, 2, l, flen) CALL CHKIN2(ne, 212, 3, n, 0) CALL CHKIN2(ne, 212, 4, m, GDW_NE) CALL CHKST2(ne, 212, 5, fields(1), 'in1') CALL CHKST2(ne, 212, 6, fields(2), 'in2') CALL CHKIN2(ne, 212, 7, j, 32) C 214: GDMDWD check CALL GDMDWD(d, 'data', 4, 'mnew18', 6, 'in2', 3, 'in3', 3, GDW_ST, +128, 0) CALL CHKOK2(ne, 214, 1, d) l = flen i = flen CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, +'data/mnew18', 11) CALL CHKOK2(ne, 214, 2, d) CALL CHKIN2(ne, 214, 1, i, flen) CALL CHKIN2(ne, 214, 2, l, flen) CALL CHKIN2(ne, 214, 3, n, 0) CALL CHKIN2(ne, 214, 4, m, GDW_ST) CALL CHKST2(ne, 214, 5, fields(1), 'in2') CALL CHKST2(ne, 214, 6, fields(2), 'in3') CALL CHKIN2(ne, 214, 7, j, 128) C 217: GDALWD check CALL GDALWD(d, 'new18', 5, 'in3', 3, 'in4', 3, GDW_GE, 32d3) CALL CHKOK2(ne, 217, 1, d) l = flen i = flen CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new18', +5) CALL CHKOK2(ne, 217, 2, d) CALL CHKIN2(ne, 217, 1, i, flen) CALL CHKIN2(ne, 217, 2, l, flen) CALL CHKIN2(ne, 217, 3, n, 0) CALL CHKIN2(ne, 217, 4, m, GDW_GE) CALL CHKST2(ne, 217, 5, fields(1), 'in3') CALL CHKST2(ne, 217, 6, fields(2), 'in4') CALL CHKDB2(ne, 217, 7, dp, 32d3) C 218: GDATRG check l = flen CALL GDATRG(fields(1), l, d, 'alias', 5) CALL CHKEOK(ne, 218, d) CALL CHKIN2(ne, 218, 1, l, flen) CALL CHKST2(ne, 218, 2, fields(1), 'data') C 219: GDADAL check CALL GDADAL(d, 'new20', 5, 'data', 4, 0) CALL CHKOK2(ne, 219, 1, d) l = flen CALL GDATRG(fields(1), l, d, 'new20', 5) CALL CHKOK2(ne, 219, 2, d) CALL CHKIN2(ne, 219, 1, l, flen) CALL CHKST2(ne, 219, 2, fields(1), 'data') C 220: GDMDAL check CALL GDMDAL(d, 'data', 4, 'mnew20', 6, 'data', 4) CALL CHKOK2(ne, 220, 1, d) l = flen CALL GDATRG(fields(1), l, d, 'data/mnew20', 11) CALL CHKOK2(ne, 220, 2, d) CALL CHKIN2(ne, 220, 1, l, flen) CALL CHKST2(ne, 220, 2, fields(1), 'data') C 221: GDNALS check CALL GDNALS(n, d, 'data', 4) CALL CHKEOK(ne, 221, d) CALL CHKINT(ne, 221, n, 4) C 222: GDALSS check fields(1) = 'data' fields(2) = 'alias' fields(3) = 'data/mnew20' fields(4) = 'new20' DO 2220 i = 1, n l = flen CALL GDALSS(fn, l, d, 'data', 4, i) CALL CHKOK2(ne, 222, i, d) CALL CHKIN2(ne, 222, i, l, flen) CALL CHKST2(ne, 222, i, fn, fields(i)) 2220 CONTINUE C 223: GDINCA check CALL GDINCA(d, 'format1', 7, 0, 'A', 1, 'Z', 1, GD_CR + GD_EX) CALL CHKEOK(ne, 223, d) C 226: GDFRAF check l = flen n = flen CALL GDFRAF(fields(1), l, fields(2), n, d, 1) CALL CHKEOK(ne, 226, d) CALL CHKIN2(ne, 226, 1, l, flen) CALL CHKIN2(ne, 226, 2, n, flen) CALL CHKST2(ne, 226, 3, fields(1), 'A') CALL CHKST2(ne, 226, 4, fields(2), 'Z') C 227: GDAAFX check CALL GDAAFX(d, 1, 'B', 1, '', 0) CALL CHKOK2(ne, 227, 1, d) l = flen n = flen CALL GDFRAF(fields(1), l, fields(2), n, d, 1) CALL CHKOK2(ne, 227, 2, d) CALL CHKIN2(ne, 227, 1, l, flen) CALL CHKIN2(ne, 227, 2, n, flen) CALL CHKST2(ne, 227, 3, fields(1), 'B') CALL CHKST2(ne, 227, 3, fields(2), '') C 228: GDGEMX check l = flen i = flen CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'mplex', 5) CALL CHKEOK(ne, 228, d) CALL CHKIN2(ne, 228, 1, i, flen) CALL CHKIN2(ne, 228, 2, l, flen) CALL CHKIN2(ne, 228, 3, n, 0) CALL CHKIN2(ne, 228, 4, m, 1) CALL CHKST2(ne, 228, 5, fields(1), 'data') CALL CHKST2(ne, 228, 6, fields(2), 'sbit') CALL CHKIN2(ne, 228, 7, j, 10) C 229: GDADMX check CALL GDADMX(d, 'new21', 5, 'in1', 3, 'in2', 3, 5, 6, 0) CALL CHKOK2(ne, 229, 1, d) l = flen i = flen CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new21', 5) CALL CHKOK2(ne, 229, 2, d) CALL CHKIN2(ne, 229, 1, i, flen) CALL CHKIN2(ne, 229, 2, l, flen) CALL CHKIN2(ne, 229, 3, n, 0) CALL CHKIN2(ne, 229, 4, m, 5) CALL CHKST2(ne, 229, 5, fields(1), 'in1') CALL CHKST2(ne, 229, 6, fields(2), 'in2') CALL CHKIN2(ne, 229, 7, j, 6) C 230: GDMDMX check CALL GDMDMX(d, 'data', 4, 'mnew21', 6, 'in2', 3, 'in3', 3, 0, 12) CALL CHKOK2(ne, 230, 1, d) l = flen i = flen CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'data/mnew21', +11) CALL CHKOK2(ne, 230, 2, d) CALL CHKIN2(ne, 230, 1, i, flen) CALL CHKIN2(ne, 230, 2, l, flen) CALL CHKIN2(ne, 230, 3, n, 0) CALL CHKIN2(ne, 230, 4, m, 0) CALL CHKST2(ne, 230, 5, fields(1), 'in2') CALL CHKST2(ne, 230, 6, fields(2), 'in3') CALL CHKIN2(ne, 230, 7, j, 12) C 231: GDALMX check CALL GDALMX(d, 'new21', 5, 'in3', 3, 'in4', 3, 7, -1) CALL CHKOK2(ne, 231, 1, d) l = flen i = flen CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new21', 5) CALL CHKOK2(ne, 231, 2, d) CALL CHKIN2(ne, 231, 1, i, flen) CALL CHKIN2(ne, 231, 2, l, flen) CALL CHKIN2(ne, 231, 3, n, 0) CALL CHKIN2(ne, 231, 4, m, 7) CALL CHKST2(ne, 231, 5, fields(1), 'in3') CALL CHKST2(ne, 231, 6, fields(2), 'in4') CALL CHKIN2(ne, 231, 7, j, 6) C 232: GDTOKE check l = slen CALL GDTOKE(str, l, d, +'"test1 test2" test3' // backslash // ' test4 test5', 32) CALL CHKOK2(ne, 232, 1, d) CALL CHKIN2(ne, 232, 2, l, slen) CALL CHKST2(ne, 232, 3, str, 'test1 test2') l = slen CALL GDTOKE(str, l, d, '', -1) CALL CHKOK2(ne, 232, 4, d) CALL CHKIN2(ne, 232, 5, l, slen) CALL CHKST2(ne, 232, 6, str, 'test3 test4') C 233: GDRCLO check CALL GDRCLO(d, 'data', 4) CALL CHKEOK(ne, 233, d) C 234: GDDSYN check CALL GDDSYN(n, d, 0) CALL CHKEOK(ne, 234, d) CALL CHKINT(ne, 234, n, 0) C 235: GDFLAG check CALL GDFLAG(n, d, GD_PP, 0) CALL CHKEOK(ne, 235, d) CALL CHKINT(ne, 235, n, GD_PP) C 236: GDVBPX check CALL GDVBPX(d, "big_test", 8) CALL CHKEOK(ne, 236, d) C 237: GDNENT check CALL GDNENT(n, d, "data", 4, GDEN_S, GDEN_H + GDEN_N) CALL CHKOK2(ne, 237, 1, d) CALL CHKIN2(ne, 237, 1, n, 5) CALL GDNENT(n, d, "", -1, GDEN_V, GDEN_H + GDEN_N) CALL CHKOK2(ne, 237, 2, d) CALL CHKIN2(ne, 237, 2, n, 27) C 238: GDENTX check CALL GDENTX(l, d, "", -1, GDEN_V, GDEN_H + GDEN_N) CALL CHKEOK(ne, 238, d) CALL CHKINT(ne, 238, l, 7) C 239: GDENTN check fields( 1) = "INDEX" fields( 2) = "bit" fields( 3) = "data" fields( 4) = "div" fields( 5) = "lincom" fields( 6) = "linterp" fields( 7) = "mplex" fields( 8) = "mult" fields( 9) = "new1" fields(10) = "new135" fields(11) = "new14" fields(12) = "new15" fields(13) = "new16" fields(14) = "new18" fields(15) = "new2" fields(16) = "new21" fields(17) = "new3" fields(18) = "new4" fields(19) = "new5" fields(20) = "new6" fields(21) = "new7" fields(22) = "new8" fields(23) = "phase" fields(24) = "polynom" fields(25) = "recip" fields(26) = "sbit" fields(27) = "window" DO 2390 i = 1, n l = flen CALL GDENTN(fn, l, d, "", -1, GDEN_V, GDEN_H + GDEN_N, i) CALL CHKOK2(ne, 239, i, d) CALL CHKIN2(ne, 239, i, l, flen) CALL CHKST2(ne, 239, i, fn, fields(i)) 2390 CONTINUE C 240: GDMXLB check CALL GDMXLB(d, GDLB_A) CALL CHKEOK(ne, 240, d) C 241: GDLTTN check l = plen CALL GDLTTN(path, l, d, "linterp", 7) CALL CHKEOK(ne, 241, d) CALL CHKINT(ne, 241, l, plen) CALL CHKEOS(ne, 241, path, fildir//DIRSEP//'lut') C 243: GDASLC check CALL GDASLC(d, 'new243', 6, 3, +'in1', 3, 1.1d0, '', -1, -1, 0d0, 'carray', 6, 3, +'in2', 3, 0d0, 'const', 5, -1, 0d0, 'carray', 6, 4, +'in3', 3, 1.4d0, '', -1, -1, 0d0, 'carray', 6, 5, 0) CALL CHKOK2(ne, 243, 1, d) CALL GDENFL(n, d, 'new243', 6) CALL CHKOK2(ne, 243, 2, d) CALL CHKIN2(ne, 243, 3, n, GDE_CA) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), +p(4), fields(3), l, p(5), p(6), n, d, 'new243', 6) CALL CHKOK2(ne, 243, 4, d) CALL CHKIN2(ne, 243, 5, l, flen) CALL CHKIN2(ne, 243, 6, i, 3) CALL CHKIN2(ne, 243, 7, n, 0) CALL CHKST2(ne, 243, 8, fields(1), 'in1') CALL CHKST2(ne, 243, 9, fields(2), 'in2') CALL CHKST2(ne, 243, 10, fields(3), 'in3') q(1) = 1.1d0 q(3) = 10d0 q(5) = 1.4d0 q(2) = 5.5 q(4) = 5.6d0 q(6) = 5.2d0 DO 2430 i=1,6 CALL CHKDB2(ne, 243, 10 + i, p(i), q(i)) 2430 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 1) CALL CHKOK2(ne, 243, 17, d) CALL CHKST2(ne, 243, 18, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 2) CALL CHKOK2(ne, 243, 19, d) CALL CHKST2(ne, 243, 20, str, "const") CALL CHKIN2(ne, 243, 21, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 3) CALL CHKOK2(ne, 243, 22, d) CALL CHKST2(ne, 243, 23, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 4) CALL CHKOK2(ne, 243, 24, d) CALL CHKST2(ne, 243, 25, str, "carray") CALL CHKIN2(ne, 243, 26, n, 3) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 5) CALL CHKOK2(ne, 243, 27, d) CALL CHKST2(ne, 243, 28, str, "carray") CALL CHKIN2(ne, 243, 29, n, 4) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 6) CALL CHKOK2(ne, 243, 30, d) CALL CHKST2(ne, 243, 31, str, "carray") CALL CHKIN2(ne, 243, 32, n, 5) C 244: GDASPN check CALL GDASPN(d, 'new244', 6, 3, 'in1', 3, 33d0, '', -1, -1, +44d0, '', -1, -1, 66d0, '', -1, -1, 0d0, 'carray', 6, 1, +0d0, '', -1, -1, 0d0, '', -1, -1, 0) CALL CHKOK2(ne, 244, 1, d) CALL GDENFL(n, d, 'new244', 6) CALL CHKOK2(ne, 244, 2, d) CALL CHKIN2(ne, 244, 3, n, GDE_CA) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), +n, d, 'new244', 6) CALL CHKOK2(ne, 244, 4, d) CALL CHKIN2(ne, 244, 5, l, flen) CALL CHKIN2(ne, 244, 6, i, 3) CALL CHKIN2(ne, 244, 7, n, 0) CALL CHKST2(ne, 244, 8, fn, 'in1') q(1) = 33d0 q(2) = 44d0 q(3) = 66d0 q(4) = 9.6d0 DO 2440 i=1,4 CALL CHKDB2(ne, 244, 8 + i, p(i), q(i)) 2440 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 1) CALL CHKOK2(ne, 244, 13, d) CALL CHKST2(ne, 244, 14, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 2) CALL CHKOK2(ne, 244, 15, d) CALL CHKST2(ne, 244, 16, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 3) CALL CHKOK2(ne, 244, 17, d) CALL CHKST2(ne, 244, 18, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 4) CALL CHKOK2(ne, 244, 19, d) CALL CHKST2(ne, 244, 20, str, "carray") CALL CHKIN2(ne, 244, 21, n, 1) C 246: GDASBT check CALL GDASBT(d, 'new246', 6, 'in1', 3, 11, '', -1, -1, 0, 'const', +5, 0, 0) CALL CHKOK2(ne, 246, 1, d) l = flen CALL GDGEBT(fn, l, m, i, n, d, 'new246', 6) CALL CHKOK2(ne, 246, 2, d) CALL CHKIN2(ne, 246, 3, l, flen) CALL CHKIN2(ne, 246, 4, n, 0) CALL CHKIN2(ne, 246, 5, m, 11) CALL CHKIN2(ne, 246, 6, i, 10) CALL CHKST2(ne, 246, 7, fn, 'in1') l = slen CALL GDGSCA(str, l, n, d, 'new246', 6, 1) CALL CHKOK2(ne, 246, 8, d) CALL CHKST2(ne, 246, 9, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new246', 6, 2) CALL CHKOK2(ne, 246, 10, d) CALL CHKST2(ne, 246, 11, str, "const") CALL CHKIN2(ne, 246, 12, n, -1) C 248: GDASPH check CALL GDASPH(d, 'new248', 6, 'in1', 3, 0, 'carray', 6, 3, 0) CALL CHKOK2(ne, 248, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'new248', 6) CALL CHKOK2(ne, 248, 2, d) CALL CHKIN2(ne, 248, 3, l, flen) CALL CHKIN2(ne, 248, 4, n, 0) CALL CHKIN2(ne, 248, 5, i, 5) CALL CHKST2(ne, 248, 6, fn, 'in1') l = slen CALL GDGSCA(str, l, n, d, 'new248', 6, 1) CALL CHKOK2(ne, 248, 7, d) CALL CHKST2(ne, 248, 8, str, "carray") CALL CHKIN2(ne, 248, 9, n, 3) C 251: GDASRC check CALL GDASRC(d, 'new251', 6, 'in1', 3, 0d0, 'carray', 6, 4, 0) CALL CHKOK2(ne, 251, 1, d) CALL GDENFL(n, d, 'new251', 6) CALL CHKOK2(ne, 251, 2, d) CALL CHKIN2(ne, 251, 3, n, GDE_CA) l = flen CALL GDGERC(fn, l, dp, n, d, 'new251', 6) CALL CHKOK2(ne, 251, 4, d) CALL CHKIN2(ne, 251, 5, l, flen) CALL CHKIN2(ne, 251, 6, n, 0) CALL CHKDB2(ne, 251, 7, dp, 5.6d0) CALL CHKST2(ne, 251, 8, fn, 'in1') l = slen CALL GDGSCA(str, l, n, d, 'new251', 6, 1) CALL CHKOK2(ne, 251, 9, d) CALL CHKST2(ne, 251, 10, str, "carray") CALL CHKIN2(ne, 251, 11, n, 4) C 253: GDASWD check CALL GDASWD(d, 'new253', 6, 'in2', 3, 'in3', 3, GDW_EQ, 0, +'const', 5, -1, 0) CALL CHKOK2(ne, 253, 1, d) l = flen i = flen CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new253', +6) CALL CHKOK2(ne, 253, 2, d) CALL CHKIN2(ne, 253, 3, i, flen) CALL CHKIN2(ne, 253, 4, l, flen) CALL CHKIN2(ne, 253, 5, n, 0) CALL CHKIN2(ne, 253, 6, m, GDW_EQ) CALL CHKST2(ne, 253, 7, fields(1), 'in2') CALL CHKST2(ne, 253, 8, fields(2), 'in3') CALL CHKIN2(ne, 253, 9, j, 10) l = slen CALL GDGSCA(str, l, n, d, 'new253', 6, 1) CALL CHKOK2(ne, 253, 10, d) CALL CHKST2(ne, 253, 11, str, "const") CALL CHKIN2(ne, 253, 12, n, -1) C 254: GDASMX check CALL GDASMX(d, 'new254', 6, 'in1', 3, 'in2', 3, 0, 'carray', 6, 3, +0, 'carray', 6, 4, 0) CALL CHKOK2(ne, 254, 1, d) l = flen i = flen CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new254', 6) CALL CHKOK2(ne, 254, 2, d) CALL CHKIN2(ne, 254, 3, i, flen) CALL CHKIN2(ne, 254, 4, l, flen) CALL CHKIN2(ne, 254, 5, n, 0) CALL CHKIN2(ne, 254, 6, m, 5) CALL CHKST2(ne, 254, 7, fields(1), 'in1') CALL CHKST2(ne, 254, 8, fields(2), 'in2') CALL CHKIN2(ne, 254, 9, j, 5) l = slen CALL GDGSCA(str, l, n, d, 'new254', 6, 1) CALL CHKOK2(ne, 254, 10, d) CALL CHKST2(ne, 254, 11, str, "carray") CALL CHKIN2(ne, 254, 12, n, 3) l = slen CALL GDGSCA(str, l, n, d, 'new254', 6, 2) CALL CHKOK2(ne, 254, 13, d) CALL CHKST2(ne, 254, 14, str, "carray") CALL CHKIN2(ne, 254, 15, n, 4) C 255: GDASCL check CALL GDASCL(d, 'new255', 6, 3, 'in1', 3, dcmplx(1.1d0, 1.2d0), +'', -1, -1, dcmplx(0, 0), 'carray', 6, 3, 'in2', 3, +dcmplx( 0, 0), 'const', 5, -1, dcmplx(0, 0), 'carray', 6, +4, 'in3', 3, dcmplx(1.3d0, 1.4d0), '', -1, -1, dcmplx(0, 0), +'carray', 6, 5, 0) CALL CHKOK2(ne, 255, 1, d) CALL GDENFL(n, d, 'new255', 6) CALL CHKOK2(ne, 255, 2, d) CALL CHKIN2(ne, 255, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new255', 6) CALL CHKOK2(ne, 255, 4, d) CALL CHKIN2(ne, 255, 5, l, flen) CALL CHKIN2(ne, 255, 6, i, 3) CALL CHKIN2(ne, 255, 7, n, 0) CALL CHKST2(ne, 255, 8, fields(1), 'in1') CALL CHKST2(ne, 255, 9, fields(2), 'in2') CALL CHKST2(ne, 255, 10, fields(3), 'in3') cq(1) = dcmplx(1.1d0, 1.2d0) cq(3) = dcmplx(10d0, 0d0) cq(5) = dcmplx(1.3d0, 1.4d0) cq(2) = dcmplx(5.5, 0d0) cq(4) = dcmplx(5.6d0, 0d0) cq(6) = dcmplx(5.2d0, 0d0) DO 2550 i=1,6 CALL CHKCP2(ne, 255, 10 + i, cp(i), cq(i)) 2550 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new255', 6, 1) CALL CHKOK2(ne, 255, 17, d) CALL CHKST2(ne, 255, 18, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new255', 6, 2) CALL CHKOK2(ne, 255, 19, d) CALL CHKST2(ne, 255, 20, str, "const") CALL CHKIN2(ne, 255, 21, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new255', 6, 3) CALL CHKOK2(ne, 255, 22, d) CALL CHKST2(ne, 255, 23, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new255', 6, 4) CALL CHKOK2(ne, 255, 24, d) CALL CHKST2(ne, 255, 25, str, "carray") CALL CHKIN2(ne, 255, 26, n, 3) l = slen CALL GDGSCA(str, l, n, d, 'new255', 6, 5) CALL CHKOK2(ne, 255, 27, d) CALL CHKST2(ne, 255, 28, str, "carray") CALL CHKIN2(ne, 255, 29, n, 4) l = slen CALL GDGSCA(str, l, n, d, 'new255', 6, 6) CALL CHKOK2(ne, 255, 30, d) CALL CHKST2(ne, 255, 31, str, "carray") CALL CHKIN2(ne, 255, 32, n, 5) C 256: GDASCP check CALL GDASCP(d, 'new256', 6, 3, 'in1', 3, dcmplx(22d0, 33d0), '', +-1, -1, dcmplx(44d0, 55d0), '', -1, -1, dcmplx(66d0, 77d0), '', +-1, -1, dcmplx(0, 0), 'carray', 6, 1, dcmplx(0, 0), '', -1, -1, +dcmplx(0, 0), '', -1, -1, 0) CALL CHKOK2(ne, 256, 1, d) CALL GDENFL(n, d, 'new256', 6) CALL CHKOK2(ne, 256, 2, d) CALL CHKIN2(ne, 256, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), +n, d, 'new256', 6) CALL CHKOK2(ne, 256, 4, d) CALL CHKIN2(ne, 256, 5, l, flen) CALL CHKIN2(ne, 256, 6, i, 3) CALL CHKIN2(ne, 256, 7, n, 0) CALL CHKST2(ne, 256, 8, fn, 'in1') cq(1) = dcmplx(22d0, 33d0) cq(2) = dcmplx(44d0, 55d0) cq(3) = dcmplx(66d0, 77d0) cq(4) = dcmplx(9.6d0, 0) DO 2560 i=1,4 CALL CHKCP2(ne, 256, 8 + i, cp(i), cq(i)) 2560 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new256', 6, 1) CALL CHKOK2(ne, 256, 13, d) CALL CHKST2(ne, 256, 14, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new256', 6, 2) CALL CHKOK2(ne, 256, 15, d) CALL CHKST2(ne, 256, 16, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new256', 6, 3) CALL CHKOK2(ne, 256, 17, d) CALL CHKST2(ne, 256, 18, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new256', 6, 4) CALL CHKOK2(ne, 256, 19, d) CALL CHKST2(ne, 256, 20, str, "carray") CALL CHKIN2(ne, 256, 21, n, 1) C 257: GDASCR check CALL GDASCR(d, 'new257', 6, 'in1', 3, 0d0, 'carray', 6, 4, 0) CALL CHKOK2(ne, 257, 1, d) CALL GDENFL(n, d, 'new257', 6) CALL CHKOK2(ne, 257, 2, d) CALL CHKIN2(ne, 257, 3, n, GDE_CA) l = flen CALL GDGECR(fn, l, dc, n, d, 'new257', 6) CALL CHKOK2(ne, 257, 4, d) CALL CHKIN2(ne, 257, 5, l, flen) CALL CHKIN2(ne, 257, 6, n, 0) CALL CHKCP2(ne, 257, 7, dc, dcmplx(5.6d0, 0)) CALL CHKST2(ne, 257, 8, fn, 'in1') l = slen CALL GDGSCA(str, l, n, d, 'new257', 6, 1) CALL CHKOK2(ne, 257, 9, d) CALL CHKST2(ne, 257, 10, str, "carray") CALL CHKIN2(ne, 257, 11, n, 4) C 258: GDASSB check CALL GDASSB(d, 'new258', 6, 'in1', 3, 11, '', -1, -1, 0, 'const', +5, 0, 0) CALL CHKOK2(ne, 258, 1, d) l = flen CALL GDGESB(fn, l, m, i, n, d, 'new258', 6) CALL CHKOK2(ne, 258, 2, d) CALL CHKIN2(ne, 258, 3, l, flen) CALL CHKIN2(ne, 258, 4, n, 0) CALL CHKIN2(ne, 258, 5, m, 11) CALL CHKIN2(ne, 258, 6, i, 10) CALL CHKST2(ne, 258, 7, fn, 'in1') l = slen CALL GDGSCA(str, l, n, d, 'new258', 6, 1) CALL CHKOK2(ne, 258, 8, d) CALL CHKST2(ne, 258, 9, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new258', 6, 2) CALL CHKOK2(ne, 258, 10, d) CALL CHKST2(ne, 258, 11, str, "const") CALL CHKIN2(ne, 258, 12, n, -1) C 259: GDLSLC check CALL GDLSLC(d, 'new243', 6, 3, +'', -1, 2.2d0, '', -1, 1, 0d0, 'carray', 6, 4, +'in4', 3, 0d0, '', 0, 0, 259d0, '', -1, 0, +'', -1, 0d0, 'const', 5, -1, 0d0, 'const', 5, -1) CALL CHKOK2(ne, 259, 1, d) CALL GDENFL(n, d, 'new243', 6) CALL CHKOK2(ne, 259, 2, d) CALL CHKIN2(ne, 259, 3, n, GDE_CA) l = flen CALL GDGELC(i, fields(1), l, p(1), p(2), fields(2), l, p(3), +p(4), fields(3), l, p(5), p(6), n, d, 'new243', 6) CALL CHKOK2(ne, 259, 4, d) CALL CHKIN2(ne, 259, 5, l, flen) CALL CHKIN2(ne, 259, 6, i, 3) CALL CHKIN2(ne, 259, 7, n, 0) CALL CHKST2(ne, 259, 8, fields(1), 'in1') CALL CHKST2(ne, 259, 9, fields(2), 'in4') CALL CHKST2(ne, 259, 10, fields(3), 'in3') q(1) = 2.2d0 q(3) = 10d0 q(5) = 10d0 q(2) = 5.6d0 q(4) = 259d0 q(6) = 10d0 DO 2590 i=1,6 CALL CHKDB2(ne, 259, 10 + i, p(i), q(i)) 2590 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 1) CALL CHKOK2(ne, 259, 17, d) CALL CHKST2(ne, 259, 18, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 2) CALL CHKOK2(ne, 259, 19, d) CALL CHKST2(ne, 259, 20, str, "const") CALL CHKIN2(ne, 259, 21, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 3) CALL CHKOK2(ne, 259, 22, d) CALL CHKST2(ne, 259, 23, str, "const") CALL CHKIN2(ne, 259, 24, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 4) CALL CHKOK2(ne, 259, 25, d) CALL CHKST2(ne, 259, 26, str, "carray") CALL CHKIN2(ne, 259, 27, n, 4) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 5) CALL CHKOK2(ne, 259, 28, d) CALL CHKST2(ne, 259, 29, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 6) CALL CHKOK2(ne, 259, 30, d) CALL CHKST2(ne, 259, 31, str, "const") CALL CHKIN2(ne, 259, 32, n, -1) C 260: GDLSLC check CALL GDLSCL(d, 'new243', 6, 3, +'', -1, dcmplx(9d0, 8d0), '', -1, 1, dcmplx(0, 0), 'carray', 6, 3, +'in4', 3, dcmplx(0, 0), '', 0, 0, dcmplx(260d0, 0), '', -1, 0, +'', -1, dcmplx(0, 0), '', 0, -1, dcmplx(0, 0), '', 0, -1) CALL CHKOK2(ne, 260, 1, d) CALL GDENFL(n, d, 'new243', 6) CALL CHKOK2(ne, 260, 2, d) CALL CHKIN2(ne, 260, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECL(i, fields(1), l, cp(1), cp(2), fields(2), l, cp(3), +cp(4), fields(3), l, cp(5), cp(6), n, d, 'new243', 6) CALL CHKOK2(ne, 260, 4, d) CALL CHKIN2(ne, 260, 5, l, flen) CALL CHKIN2(ne, 260, 6, i, 3) CALL CHKIN2(ne, 260, 7, n, 0) CALL CHKST2(ne, 260, 8, fields(1), 'in1') CALL CHKST2(ne, 260, 9, fields(2), 'in4') CALL CHKST2(ne, 260, 10, fields(3), 'in3') cq(1) = dcmplx(9d0, 8d0) cq(3) = dcmplx(10d0, 0) cq(5) = dcmplx(10d0, 0) cq(2) = dcmplx(5.5d0, 0) cq(4) = dcmplx(260d0, 0) cq(6) = dcmplx(10d0, 0) DO 2600 i=1,6 CALL CHKCP2(ne, 260, 10 + i, cp(i), cq(i)) 2600 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 1) CALL CHKOK2(ne, 260, 17, d) CALL CHKST2(ne, 260, 18, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 2) CALL CHKOK2(ne, 260, 19, d) CALL CHKST2(ne, 260, 20, str, "const") CALL CHKIN2(ne, 260, 21, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 3) CALL CHKOK2(ne, 260, 22, d) CALL CHKST2(ne, 260, 23, str, "const") CALL CHKIN2(ne, 260, 24, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 4) CALL CHKOK2(ne, 260, 25, d) CALL CHKST2(ne, 260, 26, str, "carray") CALL CHKIN2(ne, 260, 27, n, 3) l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 5) CALL CHKOK2(ne, 260, 28, d) CALL CHKST2(ne, 260, 29, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new243', 6, 6) CALL CHKOK2(ne, 260, 30, d) CALL CHKST2(ne, 260, 31, str, "const") CALL CHKIN2(ne, 260, 32, n, -1) C 261: GDLSPN check CALL GDLSPN(d, 'new244', 6, 3, 'in3', 3, 2d0, '', 0, 0, +6d0, '', 0, 0, 0d0, 'carray', 6, 5, 261d0, '', -1, 0, +0d0, '', -1, 0, 0d0, '', -1, 0) CALL CHKOK2(ne, 261, 1, d) CALL GDENFL(n, d, 'new244', 6) CALL CHKOK2(ne, 261, 2, d) CALL CHKIN2(ne, 261, 3, n, GDE_CA) l = flen CALL GDGEPN(i, fn, l, p(1), p(2), p(3), p(4), p(5), p(6), +n, d, 'new244', 6) CALL CHKOK2(ne, 261, 4, d) CALL CHKIN2(ne, 261, 5, l, flen) CALL CHKIN2(ne, 261, 6, i, 3) CALL CHKIN2(ne, 261, 7, n, 0) CALL CHKST2(ne, 261, 8, fn, 'in3') q(1) = 2d0 q(2) = 6d0 q(3) = 5.2d0 q(4) = 261d0 DO 2610 i=1,4 CALL CHKDB2(ne, 261, 8 + i, p(i), q(i)) 2610 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 1) CALL CHKOK2(ne, 261, 13, d) CALL CHKST2(ne, 261, 14, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 2) CALL CHKOK2(ne, 261, 15, d) CALL CHKST2(ne, 261, 16, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 3) CALL CHKOK2(ne, 261, 17, d) CALL CHKST2(ne, 261, 18, str, "carray") CALL CHKIN2(ne, 261, 19, n, 5) l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 4) CALL CHKOK2(ne, 261, 20, d) CALL CHKST2(ne, 261, 21, str, "") C 262: GDLSCP check CALL GDLSCP(d, 'new244', 6, 3, '', -1, +dcmplx(0, 0), 'const', 5, -1, dcmplx(0, 0), 'const', 5, -1, +dcmplx(262d0, 0d0), '', -1, 5, dcmplx(262d0, 0d0), '', 0, 0, +dcmplx(0d0, 0d0), '', -1, 0, dcmplx(0d0, 0d0), '', -1, 0) CALL CHKOK2(ne, 262, 1, d) CALL GDENFL(n, d, 'new244', 6) CALL CHKOK2(ne, 262, 2, d) CALL CHKIN2(ne, 262, 3, n, GDE_CA) l = flen CALL GDGECP(i, fn, l, cp(1), cp(2), cp(3), cp(4), cp(5), cp(6), +n, d, 'new244', 6) CALL CHKOK2(ne, 262, 4, d) CALL CHKIN2(ne, 262, 5, l, flen) CALL CHKIN2(ne, 262, 6, i, 3) CALL CHKIN2(ne, 262, 7, n, 0) CALL CHKST2(ne, 262, 8, fn, 'in3') cq(1) = dcmplx(10d0, 0) cq(2) = dcmplx(10d0, 0) cq(3) = dcmplx(262d0, 0) cq(4) = dcmplx(262d0, 0) DO 2620 i=1,4 CALL CHKCP2(ne, 262, 8 + i, cp(i), cq(i)) 2620 CONTINUE l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 1) CALL CHKOK2(ne, 262, 13, d) CALL CHKST2(ne, 262, 14, str, "const") CALL CHKIN2(ne, 262, 15, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 2) CALL CHKOK2(ne, 262, 16, d) CALL CHKST2(ne, 262, 17, str, "const") CALL CHKIN2(ne, 262, 18, n, -1) l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 3) CALL CHKOK2(ne, 262, 19, d) CALL CHKST2(ne, 262, 20, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new244', 6, 4) CALL CHKOK2(ne, 262, 21, d) CALL CHKST2(ne, 262, 22, str, "") C 263: GDLSBT check CALL GDLSBT(d, 'new246', 6, 'in0', 3, 0, 'carray', 6, 6, 0, +'', -1, -1) CALL CHKOK2(ne, 263, 1, d) l = flen CALL GDGEBT(fn, l, m, i, n, d, 'new246', 6) CALL CHKOK2(ne, 263, 2, d) CALL CHKIN2(ne, 263, 3, l, flen) CALL CHKIN2(ne, 263, 4, n, 0) CALL CHKIN2(ne, 263, 5, m, 4) CALL CHKIN2(ne, 263, 6, i, 10) CALL CHKST2(ne, 263, 7, fn, 'in0') l = slen CALL GDGSCA(str, l, n, d, 'new246', 6, 1) CALL CHKOK2(ne, 263, 8, d) CALL CHKST2(ne, 263, 9, str, "carray") CALL CHKIN2(ne, 263, 10, n, 6) l = slen CALL GDGSCA(str, l, n, d, 'new246', 6, 2) CALL CHKOK2(ne, 263, 11, d) CALL CHKST2(ne, 263, 12, str, "") C 264: GDLSSB check CALL GDLSSB(d, 'new258', 6, 'in2', 3, -1, '', -1, 0, 0, +'carray', 6, 5) CALL CHKOK2(ne, 264, 1, d) l = flen CALL GDGESB(fn, l, m, i, n, d, 'new258', 6) CALL CHKOK2(ne, 264, 2, d) CALL CHKIN2(ne, 264, 3, l, flen) CALL CHKIN2(ne, 264, 4, n, 0) CALL CHKIN2(ne, 264, 5, m, 11) CALL CHKIN2(ne, 264, 6, i, 5) CALL CHKST2(ne, 264, 7, fn, 'in2') l = slen CALL GDGSCA(str, l, n, d, 'new258', 6, 1) CALL CHKOK2(ne, 264, 8, d) CALL CHKST2(ne, 264, 9, str, "") l = slen CALL GDGSCA(str, l, n, d, 'new258', 6, 2) CALL CHKOK2(ne, 264, 10, d) CALL CHKST2(ne, 264, 11, str, "carray") CALL CHKIN2(ne, 264, 12, n, 5) C 265: GDLSPH check CALL GDLSPH(d, 'new248', 6, '', -1, -265, '', -1, -1) CALL CHKOK2(ne, 265, 1, d) l = flen CALL GDGEPH(fn, l, i, n, d, 'new248', 6) CALL CHKOK2(ne, 265, 2, d) CALL CHKIN2(ne, 265, 3, l, flen) CALL CHKIN2(ne, 265, 4, n, 0) CALL CHKIN2(ne, 265, 5, i, -265) CALL CHKST2(ne, 265, 6, fn, 'in1') l = slen CALL GDGSCA(str, l, n, d, 'new248', 6, 1) CALL CHKOK2(ne, 265, 7, d) CALL CHKST2(ne, 265, 8, str, "") C 266: GDLSRC check CALL GDLSRC(d, 'new251', 6, 'in5', 3, 0d0, 'carray', 6, 2) CALL CHKOK2(ne, 266, 1, d) CALL GDENFL(n, d, 'new251', 6) CALL CHKOK2(ne, 266, 2, d) CALL CHKIN2(ne, 266, 3, n, GDE_CA) l = flen CALL GDGERC(fn, l, dp, n, d, 'new251', 6) CALL CHKOK2(ne, 266, 4, d) CALL CHKIN2(ne, 266, 5, l, flen) CALL CHKIN2(ne, 266, 6, n, 0) CALL CHKDB2(ne, 266, 7, dp, 8.5d0) CALL CHKST2(ne, 266, 8, fn, 'in5') l = slen CALL GDGSCA(str, l, n, d, 'new251', 6, 1) CALL CHKOK2(ne, 266, 9, d) CALL CHKST2(ne, 266, 10, str, "carray") CALL CHKIN2(ne, 266, 11, n, 2) C 267: GDLSCR check CALL GDLSCR(d, 'new251', 6, 'in5', 3, dcmplx(12d0, 14d0), '', -1, +-1) CALL CHKOK2(ne, 267, 1, d) CALL GDENFL(n, d, 'new251', 6) CALL CHKOK2(ne, 267, 2, d) CALL CHKIN2(ne, 267, 3, n, GDE_CS + GDE_CA) l = flen CALL GDGECR(fn, l, dc, n, d, 'new251', 6) CALL CHKOK2(ne, 267, 4, d) CALL CHKIN2(ne, 267, 5, l, flen) CALL CHKIN2(ne, 267, 6, n, 0) CALL CHKCP2(ne, 267, 7, dc, dcmplx(12d0, 14d0)) CALL CHKST2(ne, 267, 8, fn, 'in5') l = slen CALL GDGSCA(str, l, n, d, 'new251', 6, 1) CALL CHKOK2(ne, 267, 9, d) CALL CHKST2(ne, 267, 10, str, "") C 268: GDLSWD check CALL GDLSWD(d, 'new253', 6, '', -1, 'in4', 3, GDW_LT, +0d0, 'carray', 6, 3) CALL CHKOK2(ne, 268, 1, d) l = flen i = flen CALL GDGEWD(fields(1), i, fields(2), l, m, j, dp, n, d, 'new253', +6) CALL CHKOK2(ne, 268, 2, d) CALL CHKIN2(ne, 268, 3, i, flen) CALL CHKIN2(ne, 268, 4, l, flen) CALL CHKIN2(ne, 268, 5, n, 0) CALL CHKIN2(ne, 268, 6, m, GDW_LT) CALL CHKST2(ne, 268, 7, fields(1), 'in2') CALL CHKST2(ne, 268, 8, fields(2), 'in4') CALL CHKDB2(ne, 268, 9, dp, 5.5d0) l = slen CALL GDGSCA(str, l, n, d, 'new253', 6, 1) CALL CHKOK2(ne, 268, 10, d) CALL CHKST2(ne, 268, 11, str, "carray") CALL CHKIN2(ne, 268, 12, n, 3) C 269: GDLSMX check CALL GDLSMX(d, 'new254', 6, 'in0', 3, '', -1, 0, '', 0, -1, +-1, '', -1, -1) CALL CHKOK2(ne, 269, 1, d) l = flen i = flen CALL GDGEMX(fields(1), i, fields(2), l, m, j, n, d, 'new254', 6) CALL CHKOK2(ne, 269, 2, d) CALL CHKIN2(ne, 269, 3, i, flen) CALL CHKIN2(ne, 269, 4, l, flen) CALL CHKIN2(ne, 269, 5, n, 0) CALL CHKIN2(ne, 269, 6, m, 5) CALL CHKST2(ne, 269, 7, fields(1), 'in0') CALL CHKST2(ne, 269, 8, fields(2), 'in2') CALL CHKIN2(ne, 269, 9, j, 5) l = slen CALL GDGSCA(str, l, n, d, 'new254', 6, 1) CALL CHKOK2(ne, 269, 10, d) CALL CHKST2(ne, 269, 11, str, "carray") CALL CHKIN2(ne, 269, 12, n, 3) l = slen CALL GDGSCA(str, l, n, d, 'new254', 6, 2) CALL CHKOK2(ne, 269, 13, d) CALL CHKST2(ne, 269, 14, str, "") C 271: GDENCS CALL GDENCS(n, GDE_SI); CALL CHKINT(ne, 271, n, GD_RW); C 272: NULL return from gd_reference CALL GDOPEN(m, fildir//DIRSEP//'empty', 18, GD_RW + GD_CR + GD_EX) CALL CHKOK2(ne, 272, 1, m) CALL GDREFE(str, l, m, "", -1) CALL CHKOK2(ne, 272, 2, m) CALL CHKINT(ne, 272, l, 0) CALL GDDSCD(m) C =============================================================== C Cleanup CALL GDDSCD(d) CALL SYSTEM ( 'rm -rf ' // fildir ) IF (ne .GT. 0) THEN WRITE(*, 9000) ne CALL EXIT(1) ENDIF 9000 FORMAT('ne = ', i8) STOP END libgetdata-0.9.0/bindings/f77/test/Makefile.in0000640000175000017500000006352612614323564021244 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ TESTS = gdcopn$(EXEEXT) big_test$(EXEEXT) $(am__EXEEXT_1) check_PROGRAMS = $(am__EXEEXT_2) subdir = bindings/f77/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/test_getdata.f.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = test_getdata.f CONFIG_CLEAN_VPATH_FILES = @MAKE_F95BINDINGS_TRUE@am__EXEEXT_1 = big_test95$(EXEEXT) am__EXEEXT_2 = gdcopn$(EXEEXT) big_test$(EXEEXT) $(am__EXEEXT_1) am_big_test_OBJECTS = big_test.$(OBJEXT) big_test_OBJECTS = $(am_big_test_OBJECTS) big_test_DEPENDENCIES = $(F77LDADD) 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_big_test95_OBJECTS = big_test95.$(OBJEXT) nodist_big_test95_OBJECTS = big_test95_OBJECTS = $(am_big_test95_OBJECTS) \ $(nodist_big_test95_OBJECTS) big_test95_DEPENDENCIES = $(F95LDADD) am_gdcopn_OBJECTS = gdcopn.$(OBJEXT) gdcopn_OBJECTS = $(am_gdcopn_OBJECTS) gdcopn_DEPENDENCIES = $(F77LDADD) 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)/src F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS) LTF77COMPILE = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS) AM_V_F77 = $(am__v_F77_@AM_V@) am__v_F77_ = $(am__v_F77_@AM_DEFAULT_V@) am__v_F77_0 = @echo " F77 " $@; am__v_F77_1 = F77LD = $(F77) F77LINK = $(LIBTOOL) $(AM_V_lt) --tag=F77 $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_F77LD = $(am__v_F77LD_@AM_V@) am__v_F77LD_ = $(am__v_F77LD_@AM_DEFAULT_V@) am__v_F77LD_0 = @echo " F77LD " $@; am__v_F77LD_1 = FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS) LTFCCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS) AM_V_FC = $(am__v_FC_@AM_V@) am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@) am__v_FC_0 = @echo " FC " $@; am__v_FC_1 = FCLD = $(FC) FCLINK = $(LIBTOOL) $(AM_V_lt) --tag=FC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_FCLD = $(am__v_FCLD_@AM_V@) am__v_FCLD_ = $(am__v_FCLD_@AM_DEFAULT_V@) am__v_FCLD_0 = @echo " FCLD " $@; am__v_FCLD_1 = 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 = $(big_test_SOURCES) $(big_test95_SOURCES) \ $(nodist_big_test95_SOURCES) $(gdcopn_SOURCES) DIST_SOURCES = $(big_test_SOURCES) $(big_test95_SOURCES) \ $(gdcopn_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ -I. -I.. $(GD_F77_WALL) $(GD_FC_WEXTRA) FFLAGS = @FFLAGS@ -I. -I.. $(GD_F77_WALL) $(GD_F77_WEXTRA) FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests @MAKE_F95BINDINGS_TRUE@F95TESTS = big_test95 BUILT_SOUCES = test_getdata.f F95LDADD = ../libf95getdata.la $(F77LDADD) F77LDADD = ../libfgetdata.la AM_LDFLAGS = -L.. gdcopn_SOURCES = gdcopn.f gdcopn_LDADD = $(F77LDADD) big_test_SOURCES = big_test.f big_test_LDADD = $(F77LDADD) big_test95_SOURCES = big_test95.f90 nodist_big_test95_SOURCES = ../getdata.mod big_test95_LDADD = $(F95LDADD) all: all-am .SUFFIXES: .SUFFIXES: .f .f90 .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 bindings/f77/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/f77/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: $(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): test_getdata.f: $(top_builddir)/config.status $(srcdir)/test_getdata.f.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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 big_test$(EXEEXT): $(big_test_OBJECTS) $(big_test_DEPENDENCIES) $(EXTRA_big_test_DEPENDENCIES) @rm -f big_test$(EXEEXT) $(AM_V_F77LD)$(F77LINK) $(big_test_OBJECTS) $(big_test_LDADD) $(LIBS) big_test95$(EXEEXT): $(big_test95_OBJECTS) $(big_test95_DEPENDENCIES) $(EXTRA_big_test95_DEPENDENCIES) @rm -f big_test95$(EXEEXT) $(AM_V_FCLD)$(FCLINK) $(big_test95_OBJECTS) $(big_test95_LDADD) $(LIBS) gdcopn$(EXEEXT): $(gdcopn_OBJECTS) $(gdcopn_DEPENDENCIES) $(EXTRA_gdcopn_DEPENDENCIES) @rm -f gdcopn$(EXEEXT) $(AM_V_F77LD)$(F77LINK) $(gdcopn_OBJECTS) $(gdcopn_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c .f.o: $(AM_V_F77)$(F77COMPILE) -c -o $@ $< .f.obj: $(AM_V_F77)$(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .f.lo: $(AM_V_F77)$(LTF77COMPILE) -c -o $@ $< .f90.o: $(AM_V_FC)$(FCCOMPILE) -c -o $@ $< .f90.obj: $(AM_V_FC)$(FCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .f90.lo: $(AM_V_FC)$(LTFCCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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" 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 check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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 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-checkPROGRAMS clean-generic clean-libtool clean-local \ mostlyclean-am distclean: distclean-am -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 -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 TAGS all all-am check check-TESTS check-am clean \ clean-checkPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am 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 tags-am uninstall uninstall-am clean-local: rm -rf test_dirfile rm -rf *~ # 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: libgetdata-0.9.0/bindings/f77/test/test_getdata.f.in0000640000175000017500000000010112614323564022377 0ustar alastairalastair CHARACTER*1 DIRSEP PARAMETER (DIRSEP="@GD_FDIRSEP@") libgetdata-0.9.0/bindings/f77/test/Makefile.am0000640000175000017500000000273212614323564021223 0ustar alastairalastair# Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests if MAKE_F95BINDINGS F95TESTS=big_test95 endif BUILT_SOUCES = test_getdata.f FFLAGS += -I. -I.. $(GD_F77_WALL) $(GD_F77_WEXTRA) FCFLAGS += -I. -I.. $(GD_F77_WALL) $(GD_FC_WEXTRA) F95LDADD=../libf95getdata.la $(F77LDADD) F77LDADD=../libfgetdata.la AM_LDFLAGS = -L.. TESTS=gdcopn big_test $(F95TESTS) gdcopn_SOURCES=gdcopn.f gdcopn_LDADD=$(F77LDADD) big_test_SOURCES=big_test.f big_test_LDADD=$(F77LDADD) big_test95_SOURCES=big_test95.f90 nodist_big_test95_SOURCES=../getdata.mod big_test95_LDADD=$(F95LDADD) check_PROGRAMS=$(TESTS) clean-local: rm -rf test_dirfile rm -rf *~ libgetdata-0.9.0/bindings/f77/test/big_test95.f900000640000175000017500000027641612614323564021501 0ustar alastairalastair! Copyright (C) 2009-2015 D. V. Wiebe ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! ! This file is part of the GetData project. ! ! GetData 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. ! ! GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., ! 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ! ! -*- F95 -*- ! General test ! ! This very large test checks almost every procedure defined by the F95 ! bindings. Procedures not tested include: fgd_cbopen fgd_metaflush ! fgd_flush fgd_close fgd_callback fgd_discard ! (although this last one is used) ! check functions subroutine check_err2(ne, t, i, d, v) use getdata integer, intent(inout) :: ne integer, intent(in) :: t, i, d, v integer :: e e = fgd_error(d) if (e .ne. v) then ne = ne + 1 write(*, 9006), i, t, e, v end if 9006 format('e(', i0, ')[', i0, '] = ', i0, ', expected ', i0) end subroutine subroutine check_err(ne, t, d, v) integer, intent(inout) :: ne integer, intent(in) :: t, d, v call check_err2(ne, t, 0, d, v) end subroutine subroutine check_int2(ne, t, i, n, v) integer, intent(inout) :: ne integer, intent(in) :: t, i, n, v if (n .ne. v) then ne = ne + 1 write(*, 9007), i, t, n, v end if 9007 format('n(', i0, ')[', i0, '] = ', i0, ', expected ', i0) end subroutine subroutine check_int(ne, t, n, v) integer, intent(inout) :: ne integer, intent(in) :: t, n, v call check_int2(ne, t, 0, n, v) end subroutine subroutine check_str2(ne, t, i, n, v) integer, intent(inout) :: ne integer, intent(in) :: t, i character (len=*), intent(in) :: n, v if (n .ne. v) then ne = ne + 1 write(*, 9008), i, t, n, v end if 9008 format('s(', i0, ')[', i0, '] = "', a, '", expected "', a, '"') end subroutine subroutine check_str(ne, t, n, v) integer, intent(inout) :: ne integer, intent(in) :: t character (len=*), intent(in) :: n, v call check_str2(ne, t, 0, n, v) end subroutine subroutine check_dbl2(ne, t, i, n, v) integer, intent(inout) :: ne integer, intent(in) :: t, i double precision, intent(in) :: n, v ! this is good to single precision if (abs(n - v) .gt. 1e-7) then ne = ne + 1 write(*, 9010), i, t, n, v end if 9010 format('r(', i0, ')[', i0, '] = ', d16.10, ', expected ', d16.10) end subroutine subroutine check_dbl(ne, t, n, v) integer, intent(inout) :: ne integer, intent(in) :: t double precision, intent(in) :: n, v call check_dbl2(ne, t, 0, n, v) end subroutine subroutine check_cpx2(ne, t, i, n, v) integer, intent(inout) :: ne integer, intent(in) :: t, i double complex, intent(in) :: n, v ! this is good to single precision if (abs(n - v) .gt. 1e-7) then ne = ne + 1 write(*, 9011), i, t, real(real(n)), real(aimag(n)), & real(real(v)), real(aimag(v)) end if 9011 format('x(', i0, ')[', i0, '] = ', d16.10, ';', d16.10, ', expected ', & d16.10, ';', d16.10) end subroutine subroutine check_cpx(ne, t, n, v) integer, intent(inout) :: ne integer, intent(in) :: t double complex, intent(in) :: n, v call check_cpx2(ne, t, 0, n, v) end subroutine subroutine check_ok2(ne, t, i, d) use getdata integer, intent(inout) :: ne integer, intent(in) :: t, d, i call check_err2(ne, t, i, d, GD_E_OK) end subroutine subroutine check_ok(ne, t, d) integer, intent(inout) :: ne integer, intent(in) :: t, d call check_ok2(ne, t, 0, d) end subroutine subroutine check_eos(ne, t, n, v) integer, intent(inout) :: ne integer, intent(in) :: t character (len=*), intent(in) :: n, v integer :: f f = index(n, v) if (f .eq. 0) then f = 1 end if call check_str(ne, t, n(f:), v) end subroutine program big_test use getdata implicit none include "test_getdata.f" character (len=*), parameter :: fildir = 'test95_dirfile' character (len=*), parameter :: frmat = 'test95_dirfile/format' character (len=*), parameter :: frm2 = 'test95_dirfile/form2' character (len=*), parameter :: dat = 'test95_dirfile/data' integer, parameter :: flen = 11 integer, parameter :: nfields = 17 integer, parameter :: slen = 26 character (len=slen), dimension(3) :: strings character (len=slen), dimension(3) :: st character (len=flen), dimension(nfields + 11) :: fields character (len=flen), dimension(nfields + 11) :: flist character (len=GD_FIELD_LEN) :: str character (len=4096) :: path integer(1), dimension(80) :: datadata integer :: i, d, n, l, ne real :: fl double precision :: dp double complex :: dc integer(8), dimension(6) :: iq double precision, dimension(6) :: q double complex, dimension(6) :: cq type(gd_entry) :: ent integer(1), dimension(8) :: ci1 integer(2), dimension(8) :: ci2 integer(4), dimension(8) :: ci4 integer(8), dimension(8) :: ci8 real, dimension(8) :: cr4 double precision, dimension(8) :: cr8 complex, dimension(8) :: cc8 double complex, dimension(8) :: cc16 do i=1,80 datadata(i) = int(i,1) end do call system ( 'rm -rf ' // fildir ) call system ( 'mkdir ' // fildir ) fields = (/ 'INDEX ', 'alias ', 'bit ', 'carray ', & 'const ', 'data ', 'div ', 'lincom ', 'linterp ', & 'mplex ', 'mult ', 'phase ', 'polynom ', 'recip ', & 'sbit ', 'string ', 'window ', ' ', ' ', & ' ', ' ', ' ', ' ', ' ', & ' ', ' ', ' ', ' ' /) open(1, file=frmat, status='new') write(1, *) '/ENDIAN little' write(1, *) 'data RAW INT8 8' write(1, *) 'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const' write(1, *) '/META data mstr STRING "This is a string constant."' write(1, *) '/META data mconst CONST COMPLEX128 3.3;4.4' write(1, *) '/META data mlut LINTERP DATA ./lut' write(1, *) 'const CONST FLOAT64 5.5' write(1, *) 'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6' write(1, *) 'linterp LINTERP data ./lut' write(1, *) 'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const' write(1, *) 'bit BIT data 3 4' write(1, *) 'sbit SBIT data 5 6' write(1, *) 'mplex MPLEX data sbit 1 10' write(1, *) 'mult MULTIPLY data sbit' write(1, *) 'phase PHASE data 11' write(1, *) 'div DIVIDE mult bit' write(1, *) 'recip RECIP div 6.5;4.3' write(1, *) 'window WINDOW linterp mult LT 4.1' write(1, *) '/ALIAS alias data' write(1, *) 'string STRING "Zaphod Beeblebrox"' close(1, status='keep') open(1, file=frm2, status='new') write(1, *) 'const2 CONST INT8 -19' close(1, status='keep') open(1, file=dat, form='unformatted', access='direct', recl=80, & status='new') write(1, rec=1) datadata close(1, status='keep') ne = 0 ! 1: fgd_error check d = fgd_open('x', GD_RDONLY) call check_err(ne, 1, d, GD_E_IO) call fgd_discard(d) ! 2: fgd_open check d = fgd_open(fildir, GD_RDWR) call check_ok(ne, 2, d) ! 3: fgd_getdata_i1 check n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1) call check_ok(ne, 3, d) call check_int(ne, 3, n, 8) do i=1,8 call check_int2(ne, 3, i, int(ci1(i)), 40 + i) end do ! 4: fgd_getdata_i2 check n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2) call check_ok(ne, 4, d) call check_int(ne, 4, n, 8) do i=1,8 call check_int2(ne, 4, i, int(ci2(i)), 40 + i) end do ! 5: fgd_getdata_i4 check n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4) call check_ok(ne, 5, d) call check_int(ne, 5, n, 8) do i=1,8 call check_int2(ne, 5, i, int(ci4(i)), 40 + i) end do ! 6: fgd_getdata_i8 check n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8) call check_ok(ne, 6, d) call check_int(ne, 6, n, 8) do i=1,8 call check_int2(ne, 6, i, int(ci8(i)), 40 + i) end do ! 7: fgd_getdata_r4 check n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4) call check_ok(ne, 7, d) call check_int(ne, 7, n, 8) do i=1,8 call check_dbl2(ne, 7, i, 1d0 * cr4(i), 40d0 + i) end do ! 8: fgd_getdata_r8 check n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8) call check_ok(ne, 8, d) call check_int(ne, 8, n, 8) do i=1,8 call check_dbl2(ne, 8, i, cr8(i), 40d0 + i) end do ! 9: fgd_getdata_c8 check n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8) call check_ok(ne, 9, d) call check_int(ne, 9, n, 8) do i=1,8 call check_cpx2(ne, 9, i, 1d0 * cc8(i), dcmplx(40 + i, 0)) end do ! 10: fgd_getdata_c16 check n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16) call check_ok(ne, 10, d) call check_int(ne, 10, n, 8) do i=1,8 call check_cpx2(ne, 10, i, cc16(i), dcmplx(40 + i, 0)) end do ! 11: fgd_getdata_n check n = fgd_getdata_n(d, 'data', 5, 0, 1, 0) call check_ok(ne, 11, d) call check_int(ne, 11, n, 8) ! 12: fgd_get_constant_i1 check call fgd_get_constant_i1(d, 'const', ci1(1)) call check_ok(ne, 12, d) call check_int(ne, 12, int(ci1(1)), 5) ! 13: fgd_get_constant_i2 check call fgd_get_constant_i2(d, 'const', ci2(1)) call check_ok(ne, 13, d) call check_int(ne, 13, int(ci2(1)), 5) ! 14: fgd_get_constant_i4 check call fgd_get_constant_i4(d, 'const', ci4(1)) call check_ok(ne, 14, d) call check_int(ne, 14, ci4(1), 5) ! 15: fgd_get_constant_i8 check call fgd_get_constant_i8(d, 'const', ci8(1)) call check_ok(ne, 15, d) call check_int(ne, 15, int(ci8(1)), 5) ! 16: fgd_get_constant_r4 check call fgd_get_constant_r4(d, 'const', cr4(1)) call check_ok(ne, 16, d) call check_dbl(ne, 16, 1d0 * cr4(1), 5.5d0) ! 17: fgd_get_constant_r8 check call fgd_get_constant_r8(d, 'const', cr8(1)) call check_ok(ne, 17, d) call check_dbl(ne, 17, cr8(1), 5.5d0) ! 18: fgd_get_constant_c8 check call fgd_get_constant_c8(d, 'const', cc8(1)) call check_ok(ne, 18, d) call check_cpx(ne, 18, 1d0 * cc8(1), dcmplx(5.5, 0)) ! 19: fgd_get_constant_c16 check call fgd_get_constant_c16(d, 'const', cc16(1)) call check_ok(ne, 19, d) call check_cpx(ne, 19, cc16(1), dcmplx(5.5, 0)) ! 20: fgd_get_constant_n check call fgd_get_constant_n(d, 'const') call check_ok(ne, 20, d) ! 21: fgd_field_name_max check i = fgd_field_name_max(d) call check_ok(ne, 21, d) call check_int(ne, 21, i, 7) ! 22: fgd_mfield_name_max check i = fgd_mfield_name_max(d, 'data') call check_ok(ne, 22, d) call check_int(ne, 22, i, 6) ! 23: fgd_nfields check n = fgd_nfields(d) call check_ok(ne, 23, d) call check_int(ne, 23, n, nfields) ! 25: fgd_field_list check l = flen call fgd_field_list(flist, d, l) call check_ok(ne, 25, d) call check_int(ne, 25, l, flen) do i = 1, n call check_str2(ne, 25, i, flist(i), fields(i)) end do ! 26: fgd_nmfields check n = fgd_nmfields(d, 'data') call check_ok(ne, 26, d) call check_int(ne, 26, n, 3) ! 27: fgd_mfield_list check fields(1) = 'mstr' fields(2) = 'mconst' fields(3) = 'mlut' l = flen call fgd_mfield_list(flist, d, 'data', l) call check_ok2(ne, 27, i, d) call check_int2(ne, 27, i, l, flen) DO i = 1, n call check_str2(ne, 27, i, flist(i), fields(i)) end do ! 28: fgd_nframes check n = fgd_nframes(d) call check_ok(ne, 28, d) call check_int(ne, 28, n, 10) ! 29: fgd_spf check n = fgd_spf(d, 'data') call check_ok(ne, 29, d) call check_int(ne, 29, n, 8) ! 30: fgd_putdata_i1 check ci1 = (/ 13_1, 14_1, 15_1, 16_1, 17_1, 18_1, 19_1, 90_1 /) n = fgd_putdata_i1(d, 'data', 5, 1, 0, 4, ci1) call check_ok(ne, 30, d) call check_int(ne, 30, n, 4) n = fgd_getdata_i1(d, 'data', 5, 0, 1, 0, ci1) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then n = 40 + i else n = 11 + i endif call check_int2(ne, 30, i, int(ci1(i)), n) end do ! 31: fgd_putdata_i2 check ci2 = (/ 23_2, 24_2, 25_2, 26_2, 27_2, 28_2, 29_2, 30_2 /) n = fgd_putdata_i2(d, 'data', 5, 1, 0, 4, ci2) call check_ok(ne, 31, d) call check_int(ne, 31, n, 4) n = fgd_getdata_i2(d, 'data', 5, 0, 1, 0, ci2) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then n = 40 + i else n = 21 + i endif call check_int2(ne, 31, i, int(ci2(i)), n) end do ! 32: fgd_putdata_i4 check ci4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /) n = fgd_putdata_i4(d, 'data', 5, 1, 0, 4, ci4) call check_ok(ne, 32, d) call check_int(ne, 32, n, 4) n = fgd_getdata_i4(d, 'data', 5, 0, 1, 0, ci4) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then n = 40 + i else n = 31 + i endif call check_int2(ne, 32, i, int(ci4(i)), n) end do ! 33: fgd_putdata_i8 check ci8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /) n = fgd_putdata_i8(d, 'data', 5, 1, 0, 4, ci8) call check_ok(ne, 33, d) call check_int(ne, 33, n, 4) n = fgd_getdata_i8(d, 'data', 5, 0, 1, 0, ci8) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then n = 40 + i else n = 41 + i endif call check_int2(ne, 33, i, int(ci8(i)), n) end do ! 34: fgd_putdata_r4 check cr4 = (/ 33, 34, 35, 36, 37, 38, 39, 40 /) n = fgd_putdata_r4(d, 'data', 5, 1, 0, 4, cr4) call check_ok(ne, 34, d) call check_int(ne, 34, n, 4) n = fgd_getdata_r4(d, 'data', 5, 0, 1, 0, cr4) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then dp = 40. + i else dp = 31. + i end if call check_dbl2(ne, 34, i, 1d0 * cr4(i), dp) end do ! 35: fgd_putdata_r8 check cr8 = (/ 43, 44, 45, 46, 47, 48, 49, 50 /) n = fgd_putdata_r8(d, 'data', 5, 1, 0, 4, cr8) call check_ok(ne, 35, d) call check_int(ne, 35, n, 4) n = fgd_getdata_r8(d, 'data', 5, 0, 1, 0, cr8) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then dp = 40. + i else dp = 41. + i end if call check_dbl2(ne, 35, i, cr8(i), dp) end do ! 36: fgd_putdata_c8 check cc8 = (/ 53, 54, 55, 56, 57, 58, 59, 60 /) n = fgd_putdata_c8(d, 'data', 5, 1, 0, 4, cc8) call check_ok(ne, 36, d) call check_int(ne, 36, n, 4) n = fgd_getdata_c8(d, 'data', 5, 0, 1, 0, cc8) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then dc = dcmplx(40d0 + i, 0d0) else dc = dcmplx(51d0 + i, 0d0) end if call check_cpx2(ne, 36, i, 1d0 * cc8(i), dc) end do ! 37: fgd_putdata_c16 check cc16 = (/ 63, 64, 65, 66, 67, 68, 69, 70 /) n = fgd_putdata_c16(d, 'data', 5, 1, 0, 4, cc16) call check_ok(ne, 37, d) call check_int(ne, 37, n, 4) n = fgd_getdata_c16(d, 'data', 5, 0, 1, 0, cc16) DO i = 1, 8 if (i .eq. 1 .or. i .gt. 5) then dc = dcmplx(40d0 + i, 0d0) else dc = dcmplx(61d0 + i, 0d0) end if call check_cpx2(ne, 37, i, cc16(i), dc) end do ! 38: fgd_error_string check n = fgd_getdata_n(d, 'x', 5, 0, 1, 0) call fgd_error_string(d, str, GD_FIELD_LEN) call check_str(ne, 38, str, 'Field not found: x') ! 39: fgd_entry_type check n = fgd_entry_type(d, 'data') call check_ok(ne, 39, d) call check_int(ne, 39, n, GD_RAW_ENTRY) ! 40: fgd_entry (raw) check n = fgd_entry(d, 'data', ent) call check_ok(ne, 40, d) call check_int2(ne, 40, 1, n, GD_RAW_ENTRY) call check_int2(ne, 40, 2, ent%fragment_index, 0) call check_int2(ne, 40, 3, ent%spf, 8) call check_int2(ne, 40, 4, ent%data_type, GD_INT8) ! 42: fgd_entry (lincom) check n = fgd_entry(d, 'lincom', ent) call check_ok(ne, 42, d) call check_int2(ne, 42, 1, n, GD_LINCOM_ENTRY) call check_int2(ne, 42, 2, ent%n_fields, 3) call check_int2(ne, 42, 3, ent%fragment_index, 0) call check_str2(ne, 42, 4, ent%field(1), 'data') call check_str2(ne, 42, 5 , ent%field(2), 'INDEX') call check_str2(ne, 42, 6, ent%field(3), 'linterp') call check_int2(ne, 42, 7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 42, 8, ent%scalar(1), '') call check_str2(ne, 42, 9, ent%scalar(2), '') call check_str2(ne, 42, 10, ent%scalar(3), 'const') call check_str2(ne, 42, 11, ent%scalar(4), '') call check_str2(ne, 42, 12, ent%scalar(5), '') call check_str2(ne, 42, 13, ent%scalar(6), 'const') call check_int2(ne, 42, 14, ent%scalar_ind(1), 1) call check_int2(ne, 42, 15, ent%scalar_ind(2), 1) call check_int2(ne, 42, 16, ent%scalar_ind(3), -1) call check_int2(ne, 42, 17, ent%scalar_ind(4), 1) call check_int2(ne, 42, 18, ent%scalar_ind(5), 1) call check_int2(ne, 42, 19, ent%scalar_ind(6), -1) cq(1) = dcmplx(1.1d0, 0.0d0) cq(2) = dcmplx(2.2d0, 0.0d0) cq(3) = dcmplx(2.2d0, 0.0d0) cq(4) = dcmplx(3.3d0, 4.4d0) cq(5) = dcmplx(5.5d0, 0.0d0) cq(6) = dcmplx(5.5d0, 0.0d0) DO i=1,3 call check_cpx2(ne, 42, i * 2 + 18, ent%cm(i), cq(i * 2 - 1)) call check_cpx2(ne, 42, i * 2 + 19, ent%cb(i), cq(i * 2)) end do ! 44: fgd_entry (polynom) check n = fgd_entry(d, 'polynom', ent) call check_ok(ne, 44, d) call check_int2(ne, 44, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 44, 2, ent%poly_ord, 5) call check_int2(ne, 44, 3, ent%fragment_index, 0) call check_str2(ne, 44, 4, ent%field(1), 'data') cq(1) = dcmplx(1.1d0, 0.0d0) cq(2) = dcmplx(2.2d0, 0.0d0) cq(3) = dcmplx(2.2d0, 0.0d0) cq(4) = dcmplx(3.3d0, 4.4d0) cq(5) = dcmplx(5.5d0, 0.0d0) cq(6) = dcmplx(5.5d0, 0.0d0) DO i=1,6 call check_cpx2(ne, 44, i, ent%ca(i), cq(i)) end do ! 45: fgd_entry (linterp) check n = fgd_entry(d, 'linterp', ent) call check_ok(ne, 45, d) call check_int2(ne, 45, 1, n, GD_LINTERP_ENTRY) call check_int2(ne, 45, 2, ent%fragment_index, 0) call check_str2(ne, 45, 3, ent%field(1), 'data') call check_str2(ne, 45, 4, ent%field(2), './lut') ! 46: fgd_entry (bit) check n = fgd_entry(d, 'bit', ent) call check_ok(ne, 46, d) call check_int2(ne, 46, 1, n, GD_BIT_ENTRY) call check_int2(ne, 46, 2, ent%fragment_index, 0) call check_int2(ne, 46, 3, ent%bitnum, 3) call check_int2(ne, 46, 4, ent%numbits, 4) call check_str2(ne, 46, 5, ent%field(1), 'data') ! 47: fgd_entry (Sbit) check n = fgd_entry(d, 'sbit', ent) call check_ok(ne, 47, d) call check_int2(ne, 47, 1, n, GD_SBIT_ENTRY) call check_int2(ne, 47, 2, ent%fragment_index, 0) call check_int2(ne, 47, 3, ent%numbits, 6) call check_int2(ne, 47, 4, ent%bitnum, 5) call check_str2(ne, 47, 5, ent%field(1), 'data') ! 48: fgd_entry (multiply) check n = fgd_entry(d, 'mult', ent) call check_ok(ne, 48, d) call check_int2(ne, 48, 1, n, GD_MULTIPLY_ENTRY) call check_int2(ne, 48, 2, ent%fragment_index, 0) call check_str2(ne, 48, 3, ent%field(1), 'data') call check_str2(ne, 48, 4, ent%field(2), 'sbit') ! 49: fgd_entry (phase) check n = fgd_entry(d, 'phase', ent) call check_ok(ne, 49, d) call check_int2(ne, 49, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 49, 2, ent%fragment_index, 0) call check_int2(ne, 49, 3, ent%shift, 11) call check_str2(ne, 49, 4, ent%field(1), 'data') ! 50: fgd_entry (const) check n = fgd_entry(d, 'const', ent) call check_ok(ne, 50, d) call check_int2(ne, 50, 1, n, GD_CONST_ENTRY) call check_int2(ne, 50, 2, ent%fragment_index, 0) call check_int2(ne, 50, 3, ent%data_type, GD_FLOAT64) ! 52: fgd_fragment_index check n = fgd_fragment_index(d, 'const') call check_ok(ne, 52, d) call check_int(ne, 52, n, 0) ! 53: fgd_add_raw check call fgd_add_raw(d, 'new1', GD_FLOAT64, 3, 0) call check_ok2(ne, 53, 1, d) n = fgd_entry(d, 'new1', ent) call check_ok2(ne, 53, 2, d) call check_int2(ne, 53, 3, ent%fragment_index, 0) call check_int2(ne, 53, 4, ent%spf, 3) call check_int2(ne, 53, 5, ent%data_type, GD_FLOAT64) call check_int2(ne, 53, 6, n, GD_RAW_ENTRY) ! 54: fgd_add_lincom check call fgd_add_lincom(d, 'new2', 2, 'in1', 9.9d0, 8.8d0, & 'in2', 7.7d0, 6.6d0, '', 0d0, 0d0, 0) call check_ok2(ne, 54, 1, d) n = fgd_entry(d, 'new2', ent) call check_ok2(ne, 54, 2, d) call check_int2(ne, 54, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 54, 4, ent%n_fields, 2) call check_int2(ne, 54, 5, ent%fragment_index, 0) call check_str2(ne, 54, 6, ent%field(1), 'in1') call check_str2(ne, 54, 7, ent%field(2), 'in2') call check_int2(ne, 54, 8, ent%flags, GD_EN_CALC) q = (/ 9.9d0, 8.8d0, 7.7d0, 6.6d0, 5.5d0, 5.5d0 /) do i=1,2 call check_dbl2(ne, 54, i * 2 - 1, ent%m(i), q(i * 2 - 1)) call check_dbl2(ne, 54, i * 2, ent%b(i), q(i * 2)) end do ! 55: fgd_add_clincom check cq(1) = dcmplx(1.1, 1.2) cq(2) = dcmplx(1.3, 1.4) cq(3) = dcmplx(1.4, 1.5) cq(4) = dcmplx(1.6, 1.7) call fgd_add_clincom(d, 'new3', 2, 'in1', cq(1), cq(2), & 'in2', cq(3), cq(4), '', cq(5), cq(6), 0) call check_ok2(ne, 55, 1, d) n = fgd_entry(d, 'new3', ent) call check_ok2(ne, 55, 2, d) call check_int2(ne, 55, 3, ent%n_fields, 2) call check_int2(ne, 55, 4, n, GD_LINCOM_ENTRY) call check_int2(ne, 55, 5, ent%fragment_index, 0) call check_str2(ne, 55, 6, ent%field(1), 'in1') call check_str2(ne, 55, 7, ent%field(2), 'in2') call check_int2(ne, 55, 8, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(1.1, 1.2) cq(2) = dcmplx(1.3, 1.4) cq(3) = dcmplx(1.4, 1.5) cq(4) = dcmplx(1.6, 1.7) do i=1,2 call check_cpx2(ne, 55, i * 2 + 7, ent%cm(i), cq(i * 2 - 1)) call check_cpx2(ne, 55, i * 2 + 8, ent%cb(i), cq(i * 2)) end do ! 56: fgd_add_polynom check call fgd_add_polynom(d, 'new4', 3, 'in1', 3d3, 4d4, 5d5, 6d6, 0d0, 0d0, & 0) call check_ok2(ne, 56, 1, d) n = fgd_entry(d, 'new4', ent) call check_ok2(ne, 56, 2, d) call check_int2(ne, 56, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 56, 2, ent%poly_ord, 3) call check_int2(ne, 56, 3, ent%fragment_index, 0) call check_str2(ne, 56, 4, ent%field(1), 'in1') call check_int2(ne, 56, 5, ent%flags, GD_EN_CALC) q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /) DO i=1,4 call check_dbl2(ne, 56, i, ent%a(i), q(i)) end do ! 57: fgd_add_cpolynom check cq(1) = dcmplx(3.1, 7.0) cq(2) = dcmplx(4.2, 8.0) cq(3) = dcmplx(5.2, 9.0) cq(4) = dcmplx(6.3, 4.4) call fgd_add_cpolynom(d, 'new5', 3, 'in1', cq(1), cq(2), cq(3), cq(4), & dcmplx(0d0,0d0), dcmplx(0d0,0d0), 0) call check_ok2(ne, 57, 1, d) n = fgd_entry(d, 'new5', ent) call check_ok2(ne, 57, 2, d) call check_int2(ne, 57, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 57, 2, ent%poly_ord, 3) call check_int2(ne, 57, 3, ent%fragment_index, 0) call check_str2(ne, 57, 4, ent%field(1), 'in1') call check_int2(ne, 57, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(3.1, 7.0) cq(2) = dcmplx(4.2, 8.0) cq(3) = dcmplx(5.2, 9.0) cq(4) = dcmplx(6.3, 4.4) DO i=1,4 call check_cpx2(ne, 57, i, ent%ca(i), cq(i)) end do ! 58: fgd_add_linterp check call fgd_add_linterp(d, "new6", "in", "./some/table", 0) call check_ok2(ne, 58, 1, d) n = fgd_entry(d, 'new6', ent) call check_ok2(ne, 58, 2, d) call check_int2(ne, 58, 1, n, GD_LINTERP_ENTRY) call check_int2(ne, 58, 2, ent%fragment_index, 0) call check_str2(ne, 58, 3, ent%field(1), 'in') call check_str2(ne, 58, 4, ent%field(2), './some/table') ! 59: fgd_add_bit check call fgd_add_bit(d, "new7", "in", 13, 12, 0) call check_ok2(ne, 59, 1, d) n = fgd_entry(d, 'new7', ent) call check_ok2(ne, 59, 2, d) call check_int2(ne, 59, 1, n, GD_BIT_ENTRY) call check_int2(ne, 59, 2, ent%fragment_index, 0) call check_int2(ne, 59, 3, ent%numbits, 12) call check_int2(ne, 59, 4, ent%bitnum, 13) call check_str2(ne, 59, 5, ent%field(1), 'in') ! 60: fgd_add_sbit check call fgd_add_sbit(d, "new8", "in", 13, 12, 0) call check_ok2(ne, 60, 1, d) n = fgd_entry(d, "new8", ent) call check_ok2(ne, 60, 2, d) call check_int2(ne, 60, 1, n, GD_SBIT_ENTRY) call check_int2(ne, 60, 2, ent%fragment_index, 0) call check_int2(ne, 60, 3, ent%numbits, 12) call check_int2(ne, 60, 4, ent%bitnum, 13) call check_str2(ne, 60, 5, ent%field(1), 'in') ! 61: fgd_add_multiply check call fgd_add_multiply(d, 'new9', 'in1', 'in2', 0) call check_ok2(ne, 61, 1, d) n = fgd_entry(d, 'new9', ent) call check_ok2(ne, 61, 2, d) call check_int2(ne, 61, 1, n, GD_MULTIPLY_ENTRY) call check_int2(ne, 61, 2, ent%fragment_index, 0) call check_str2(ne, 61, 3, ent%field(1), 'in1') call check_str2(ne, 61, 4, ent%field(2), 'in2') ! 62: fgd_add_phase check call fgd_add_phase(d, 'new10', 'in1', 22, 0) call check_ok2(ne, 62, 1, d) n = fgd_entry(d, 'new10', ent) call check_ok2(ne, 62, 2, d) call check_int2(ne, 62, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 62, 2, ent%fragment_index, 0) call check_int2(ne, 62, 3, ent%shift, 22) call check_str2(ne, 62, 4, ent%field(1), 'in1') ! 63: fgd_add_const check call fgd_add_const(d, 'new11', GD_FLOAT64, 0) call check_ok2(ne, 63, 1, d) n = fgd_entry(d, 'new11', ent) call check_ok2(ne, 63, 2, d) call check_int2(ne, 63, 1, n, GD_CONST_ENTRY) call check_int2(ne, 63, 2, ent%fragment_index, 0) call check_int2(ne, 63, 3, ent%data_type, GD_FLOAT64) call fgd_get_constant_r4(d, 'new11', fl) call check_ok2(ne, 63, 3, d) call check_dbl(ne, 63, 1d0 * fl, 0d0) ! 64: fgd_fragmentname check str = fgd_fragmentname(d, 0) call check_ok(ne, 64, d) call check_eos(ne, 64, str, fildir//DIRSEP//'format') ! 65: fgd_nfragments check n = fgd_nfragments(d) call check_ok(ne, 65, d) call check_int(ne, 65, n, 1) ! 66: fgd_include check call fgd_include(d, 'form2', 0, 0) call check_ok2(ne, 66, 3, d) call fgd_get_constant_i1(d, 'const2', ci1(1)) call check_ok2(ne, 66, 3, d) call check_int2(ne, 1, 66, int(ci1(1)), -19) ! 67: fgd_nfields_by_type check n = fgd_nfields_by_type(d, GD_LINCOM_ENTRY) call check_ok(ne, 67, d) call check_int(ne, 67, n, 3) ! 68: fgd_field_list_by_type check fields(1) = 'lincom' fields(2) = 'new2' fields(3) = 'new3' l = flen call fgd_field_list_by_type(flist, d, GD_LINCOM_ENTRY, l) call check_ok(ne, 68, d) call check_int(ne, 68, l, flen) do i = 1, n call check_str2(ne, 68, i, flist(i), fields(i)) end do ! 69: fgd_nvectors check n = fgd_nvectors(d) call check_ok(ne, 69, d) call check_int(ne, 69, n, 24) ! 70: fgd_vector_list check fields = (/ 'INDEX ', 'alias ', 'bit ', 'data ', & 'div ', 'lincom ', 'linterp ', 'mplex ', 'mult ', & 'new1 ', 'new10 ', 'new2 ', 'new3 ', 'new4 ', & 'new5 ', 'new6 ', 'new7 ', 'new8 ', 'new9 ', & 'phase ', 'polynom ', 'recip ', 'sbit ', 'window ', & ' ', ' ', ' ', ' ' /) l = flen call fgd_vector_list(flist, d, l) call check_ok(ne, 70, d) call check_int(ne, 70, l, flen) do i=1,n call check_str2(ne, 70, i, flist(i), fields(i)) end do ! 71: fgd_madd_lincom check call fgd_madd_lincom(d, 'data', 'mnew1', 2, 'in1', 9.9d0, 8.8d0, & 'in2', 7.7d0, 6.6d0, '', 0d0, 0d0) call check_ok2(ne, 71, 1, d) n = fgd_entry(d, 'data/mnew1', ent) call check_ok2(ne, 71, 2, d) call check_int2(ne, 71, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 71, 4, ent%n_fields, 2) call check_int2(ne, 71, 5, ent%fragment_index, 0) call check_str2(ne, 71, 6, ent%field(1), 'in1') call check_str2(ne, 71, 7, ent%field(2), 'in2') call check_int2(ne, 71, 8, ent%flags, GD_EN_CALC) q = (/ 9.9d0, 8.8d0, 7.7d0, 6.6d0, 5.5d0, 5.5d0 /) DO i=1,2 call check_dbl2(ne, 71, i * 2 - 1, ent%m(i), q(i * 2 - 1)) call check_dbl2(ne, 71, i * 2, ent%b(i), q(i * 2)) end do ! 72: fgd_madd_clincom check cq(1) = dcmplx(1.1, 1.2) cq(2) = dcmplx(1.3, 1.4) cq(3) = dcmplx(1.4, 1.5) cq(4) = dcmplx(1.6, 1.7) call fgd_madd_clincom(d, 'data', 'mnew2', 2, 'in1', cq(1), cq(2), & 'in2', cq(3), cq(4), '', cq(5), cq(6)) call check_ok2(ne, 72, 1, d) n = fgd_entry(d, 'data/mnew2', ent) call check_ok(ne, 72, d) call check_int2(ne, 72, 1, n, GD_LINCOM_ENTRY) call check_int2(ne, 72, 2, ent%n_fields, 2) call check_int2(ne, 72, 3, ent%fragment_index, 0) call check_str2(ne, 72, 4, ent%field(1), 'in1') call check_str2(ne, 72, 5, ent%field(2), 'in2') call check_int2(ne, 72, 6, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(1.1, 1.2) cq(2) = dcmplx(1.3, 1.4) cq(3) = dcmplx(1.4, 1.5) cq(4) = dcmplx(1.6, 1.7) DO i=1,2 call check_cpx2(ne, 72, i * 2 - 1, ent%cm(i), cq(i * 2 - 1)) call check_cpx2(ne, 72, i * 2, ent%cb(i), cq(i * 2)) end do ! 73: fgd_madd_polynom check call fgd_madd_polynom(d, 'data', 'mnew3', 3, 'in1', 3d3, 4d4, 5d5, & 6d6, 0d0, 0d0) call check_ok2(ne, 73, 1, d) n = fgd_entry(d, 'data/mnew3', ent) call check_ok2(ne, 73, 2, d) call check_int2(ne, 73, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 73, 2, ent%poly_ord, 3) call check_int2(ne, 73, 3, ent%fragment_index, 0) call check_str2(ne, 73, 4, ent%field(1), 'in1') q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /) DO i=1,4 call check_dbl2(ne, 73, i, ent%a(i), q(i)) end do ! 74: fgd_madd_cpolynom check cq(1) = dcmplx(1.1, 0.0) cq(2) = dcmplx(2.2, 0.0) cq(3) = dcmplx(2.2, 0.0) cq(4) = dcmplx(3.3, 4.4) call fgd_madd_cpolynom(d, 'data', 'mnew5', 3, 'in1', cq(1), cq(2), & cq(3), cq(4), dcmplx(0d0,0d0), dcmplx(0d0,0d0)) call check_ok2(ne, 74, 1, d) n = fgd_entry(d, 'data/mnew5', ent) call check_ok2(ne, 74, 2, d) call check_int2(ne, 74, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 74, 2, ent%poly_ord, 3) call check_int2(ne, 74, 3, ent%fragment_index, 0) call check_str2(ne, 74, 4, ent%field(1), 'in1') cq(1) = dcmplx(1.1, 0.0) cq(2) = dcmplx(2.2, 0.0) cq(3) = dcmplx(2.2, 0.0) cq(4) = dcmplx(3.3, 4.4) DO i=1,4 call check_cpx2(ne, 74, i, ent%ca(i), cq(i)) end do ! 75: fgd_madd_linterp check call fgd_madd_linterp(d, "data", "mnew6", "in", "./more/table") call check_ok2(ne, 75, 1, d) n = fgd_entry(d, 'data/mnew6', ent) call check_ok2(ne, 75, 2, d) call check_int2(ne, 75, 1, n, GD_LINTERP_ENTRY) call check_int2(ne, 75, 2, ent%fragment_index, 0) call check_str2(ne, 75, 3, ent%field(1), 'in') call check_str2(ne, 75, 4, ent%field(2), './more/table') ! 76: fgd_madd_bit check call fgd_madd_bit(d, "data", "mnew7", "in", 13, 12) call check_ok2(ne, 76, 1, d) n = fgd_entry(d, 'data/mnew7', ent) call check_ok2(ne, 76, 2, d) call check_int2(ne, 76, 1, n, GD_BIT_ENTRY) call check_int2(ne, 76, 2, ent%fragment_index, 0) call check_int2(ne, 76, 3, ent%numbits, 12) call check_int2(ne, 76, 4, ent%bitnum, 13) call check_str2(ne, 76, 5, ent%field(1), 'in') ! 77: fgd_madd_sbit check call fgd_madd_sbit(d, "data", "mnew8", "in", 13, 12) call check_ok2(ne, 77, 1, d) n = fgd_entry(d, 'data/mnew8', ent) call check_ok2(ne, 77, 2, d) call check_int2(ne, 77, 1, n, GD_SBIT_ENTRY) call check_int2(ne, 77, 2, ent%fragment_index, 0) call check_int2(ne, 77, 3, ent%numbits, 12) call check_int2(ne, 77, 4, ent%bitnum, 13) call check_str2(ne, 77, 5, ent%field(1), 'in') ! 78: fgd_madd_multiply check call fgd_madd_multiply(d, 'data', 'mnew9', 'in1', 'in2') call check_ok2(ne, 78, 1, d) n = fgd_entry(d, 'data/mnew9', ent) call check_ok2(ne, 78, 2, d) call check_int2(ne, 78, 1, n, GD_MULTIPLY_ENTRY) call check_int2(ne, 78, 2, ent%fragment_index, 0) call check_str2(ne, 78, 3, ent%field(1), 'in1') call check_str2(ne, 78, 4, ent%field(2), 'in2') ! 79: fgd_madd_phase check call fgd_madd_phase(d, 'data', 'mnew10', 'in1', 22) call check_ok2(ne, 79, 1, d) n = fgd_entry(d, 'data/mnew10', ent) call check_ok2(ne, 79, 2, d) call check_int2(ne, 79, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 79, 2, ent%fragment_index, 0) call check_int2(ne, 79, 3, ent%shift, 22) call check_str2(ne, 79, 4, ent%field(1), 'in1') ! 80: fgd_madd_const check call fgd_madd_const(d, 'data', 'mnew11', GD_FLOAT64) call check_ok2(ne, 80, 1, d) n = fgd_entry(d, 'data/mnew11', ent) call check_ok2(ne, 80, 2, d) call check_int2(ne, 80, 1, n, GD_CONST_ENTRY) call check_int2(ne, 80, 2, ent%fragment_index, 0) call check_int2(ne, 80, 3, ent%data_type, GD_FLOAT64) call fgd_get_constant_r4(d, 'data/mnew11', fl) call check_ok2(ne, 80, 3, d) call check_dbl(ne, 80, 1d0 * fl, 0d0) ! 81: fgd_get_string check n = fgd_get_string(d, 'string', GD_FIELD_LEN, str) call check_ok(ne, 81, d) call check_int(ne, 81, n, 17) call check_str(ne, 81, str, "Zaphod Beeblebrox") ! 82: fgd_add_string check call fgd_add_string(d, 'new12', 0) call check_ok2(ne, 82, 1, d) n = fgd_get_string(d, 'new12', GD_FIELD_LEN, str) call check_ok2(ne, 82, 2, d) call check_str(ne, 82, str, "") ! 83: fgd_madd_string check call fgd_madd_string(d, "data", 'mnew12') call check_ok2(ne, 83, 1, d) n = fgd_get_string(d, 'data/mnew12', GD_FIELD_LEN, str) call check_ok2(ne, 83, 2, d) call check_str(ne, 83, str, "") ! 84: fgd_add_spec check call fgd_add_spec(d, 'lorem STRING "Lorem ipsum"', 0) call check_ok2(ne, 84, 1, d) n = fgd_get_string(d, 'lorem', GD_FIELD_LEN, str) call check_ok2(ne, 84, 2, d) call check_str(ne, 84, str, "Lorem ipsum") ! 85: fgd_madd_spec check call fgd_madd_spec(d, 'ipsum STRING "dolor sit amet."', 'lorem') call check_ok2(ne, 85, 1, d) n = fgd_get_string(d, 'lorem/ipsum', GD_FIELD_LEN, str) call check_ok2(ne, 85, 2, d) call check_str(ne, 85, str, "dolor sit amet.") ! 86: fgd_put_constant_i1 check ci1(1) = 86 call fgd_put_constant_i1(d, 'const', ci1(1)) call check_ok2(ne, 86, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 86, 2, d) call check_dbl(ne, 86, 1d0 * fl, 86d0) ! 87: fgd_put_constant_i2 check ci2(1) = 87 call fgd_put_constant_i2(d, 'const', ci2(1)) call check_ok2(ne, 87, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 87, 2, d) call check_dbl(ne, 87, 1d0 * fl, 87d0) ! 88: fgd_put_constant_i4 check ci4(1) = 88 call fgd_put_constant_i4(d, 'const', ci4(1)) call check_ok2(ne, 88, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 88, 2, d) call check_dbl(ne, 88, 1d0 * fl, 88d0) ! 89: fgd_put_constant_i8 check ci8(1) = 89 call fgd_put_constant_i8(d, 'const', ci8(1)) call check_ok2(ne, 89, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 89, 2, d) call check_dbl(ne, 89, 1d0 * fl, 89d0) ! 90: fgd_put_constant_r4 check cr4(1) = -8.1 call fgd_put_constant_r4(d, 'new11', cr4(1)) call check_ok2(ne, 90, 1, d) call fgd_get_constant_r4(d, 'new11', fl) call check_ok2(ne, 90, 2, d) call check_dbl(ne, 90, 1d0 * fl, 1d0 * (-8.1)) ! 91: fgd_put_constant_r8 check cr8(1) = 91 call fgd_put_constant_r8(d, 'const', cr8(1)) call check_ok2(ne, 91, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 91, 2, d) call check_dbl(ne, 91, 1d0 * fl, 1d0 * 91.) ! 92: fgd_put_constant_c8 check cc8(1) = 92 call fgd_put_constant_c8(d, 'const', cc8(1)) call check_ok2(ne, 92, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 92, 2, d) call check_dbl(ne, 92, 1d0 * fl, 92d0) ! 93: fgd_put_constant_c16 check cc16(1) = 93 call fgd_put_constant_c16(d, 'const', cc16(1)) call check_ok2(ne, 93, 1, d) call fgd_get_constant_r4(d, 'const', fl) call check_ok2(ne, 93, 2, d) call check_dbl(ne, 93, 1d0 * fl, 93d0) ! 94: fgd_put_string check n = fgd_put_string(d, 'string', "Arthur Dent") call check_ok2(ne, 94, 1, d) call check_int(ne, 94, n, 11) n = fgd_get_string(d, 'string', GD_FIELD_LEN, str) call check_ok2(ne, 94, 2, d) call check_str(ne, 94, str, "Arthur Dent") ! 95: fgd_nmfields_by_type check n = fgd_nmfields_by_type(d, "data", GD_LINCOM_ENTRY) call check_ok(ne, 95, d) call check_int(ne, 95, n, 2) ! 96: fgd_mfield_list_by_type check fields(1) = 'mnew1' fields(2) = 'mnew2' l = flen call fgd_mfield_list_by_type(flist, d, "data", GD_LINCOM_ENTRY, l) call check_ok2(ne, 96, i, d) call check_int2(ne, 96, i, l, flen) do i = 1, n call check_str2(ne, 96, i, flist(i), fields(i)) end do ! 97: fgd_nmvectors check n = fgd_nmvectors(d, "data") call check_ok(ne, 97, d) call check_int(ne, 97, n, 10) ! 98: fgd_mvector_list check fields = (/ 'mlut ', 'mnew1 ', 'mnew2 ', 'mnew3 ', & 'mnew5 ', 'mnew6 ', 'mnew7 ', 'mnew8 ', 'mnew9 ', & 'mnew10 ', ' ', ' ', ' ', ' ', & ' ', ' ', ' ', ' ', ' ', & ' ', ' ', ' ', ' ', ' ', & ' ', ' ', ' ', ' ' /) l = flen call fgd_mvector_list(flist, d, "data", l) call check_ok2(ne, 98, i, d) call check_int2(ne, 98, i, l, flen) do i=1,n call check_str2(ne, 98, i, flist(i), fields(i)) end do ! 99: fgd_alter_raw check call fgd_alter_raw(d, 'new1', GD_INT32, 4, 0) call check_ok2(ne, 99, 1, d) n = fgd_entry(d, 'new1', ent) call check_ok2(ne, 99, 2, d) call check_int2(ne, 99, 3, ent%fragment_index, 0) call check_int2(ne, 99, 4, ent%spf, 4) call check_int2(ne, 99, 5, ent%data_type, GD_INT32) call check_int2(ne, 99, 6, n, GD_RAW_ENTRY) ! 100: fgd_alter_lincom check call fgd_alter_lincom(d, 'new2', 3, 'in4', 9.9d-1, 7.8d0, 'in5', & 1.1d1, 2.2d-2, 'in6', 1.96d0, 0d0) call check_ok2(ne, 100, 1, d) n = fgd_entry(d, 'new2', ent) call check_ok2(ne, 100, 2, d) call check_int2(ne, 100, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 100, 4, ent%n_fields, 3) call check_int2(ne, 100, 5, ent%fragment_index, 0) call check_str2(ne, 100, 6, ent%field(1), 'in4') call check_str2(ne, 100, 7, ent%field(2), 'in5') call check_str2(ne, 100, 8, ent%field(3), 'in6') call check_int2(ne, 100, 5, ent%flags, GD_EN_CALC) q = (/ 9.9d-1, 7.8d0, 1.1d1, 2.2d-2, 1.96d0, 0d0 /) DO i=1,3 call check_dbl2(ne, 100, i * 2 - 1, ent%m(i), q(i * 2 - 1)) call check_dbl2(ne, 100, i * 2, ent%b(i), q(i * 2)) end do ! 101: fgd_alter_clincom check cq(1) = dcmplx(0.1, 0.2) cq(2) = dcmplx(0.3, 0.4) cq(3) = dcmplx(0.4, 0.5) cq(4) = dcmplx(0.6, 0.7) call fgd_alter_clincom(d, 'new3', 2, 'in4', cq(1), cq(2), 'in3', & cq(3), cq(4), '', cq(5), cq(6)) call check_ok2(ne, 101, 1, d) n = fgd_entry(d, 'new3', ent) call check_ok(ne, 101, d) call check_int2(ne, 101, 1, n, GD_LINCOM_ENTRY) call check_int2(ne, 101, 2, ent%n_fields, 2) call check_int2(ne, 101, 3, ent%fragment_index, 0) call check_str2(ne, 101, 4, ent%field(1), 'in4') call check_str2(ne, 101, 5, ent%field(2), 'in3') call check_int2(ne, 101, 6, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(0.1, 0.2) cq(2) = dcmplx(0.3, 0.4) cq(3) = dcmplx(0.4, 0.5) cq(4) = dcmplx(0.6, 0.7) DO i=1,2 call check_cpx2(ne, 101, i * 2 - 1, ent%cm(i), cq(i * 2 - 1)) call check_cpx2(ne, 101, i * 2, ent%cb(i), cq(i * 2)) end do ! 102: fgd_alter_polynom check call fgd_alter_polynom(d, 'new4', 4, 'in1', 3d0, 4d0, 5d0, 6d0, 7d0, 0d0) call check_ok2(ne, 102, 1, d) n = fgd_entry(d, 'new4', ent) call check_ok2(ne, 102, 2, d) call check_int2(ne, 102, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 102, 2, ent%poly_ord, 4) call check_int2(ne, 102, 3, ent%fragment_index, 0) call check_str2(ne, 102, 4, ent%field(1), 'in1') q = (/ 3d0, 4d0, 5d0, 6d0, 7d0, 0d0 /) DO i=1,5 call check_dbl2(ne, 102, i, ent%a(i), q(i)) end do ! 103: fgd_alter_cpolynom check cq(1) = dcmplx(1.1, 5.0) cq(2) = dcmplx(1.2, 4.0) cq(3) = dcmplx(1.2, 3.0) cq(4) = dcmplx(1.3, 2.4) call fgd_alter_cpolynom(d, 'new5', 3, 'in1', cq(1), cq(2), cq(3), & cq(4), dcmplx(0d0,0d0), dcmplx(0d0,0d0)) call check_ok2(ne, 103, 1, d) n = fgd_entry(d, 'new5', ent) call check_ok2(ne, 103, 2, d) call check_int2(ne, 103, 1, n, GD_POLYNOM_ENTRY) call check_int2(ne, 103, 2, ent%poly_ord, 3) call check_int2(ne, 103, 3, ent%fragment_index, 0) call check_str2(ne, 103, 4, ent%field(1), 'in1') call check_int2(ne, 103, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) cq(1) = dcmplx(1.1, 5.0) cq(2) = dcmplx(1.2, 4.0) cq(3) = dcmplx(1.2, 3.0) cq(4) = dcmplx(1.3, 2.4) do i=1,4 call check_cpx2(ne, 103, i, ent%ca(i), cq(i)) end do ! 104: fgd_alter_linterp check call fgd_alter_linterp(d, "new6", "in3", "./other/table", 0) call check_ok2(ne, 104, 1, d) n = fgd_entry(d, 'new6', ent) call check_ok2(ne, 104, 2, d) call check_int2(ne, 104, 1, n, GD_LINTERP_ENTRY) call check_int2(ne, 104, 2, ent%fragment_index, 0) call check_str2(ne, 104, 3, ent%field(1), 'in3') call check_str2(ne, 104, 4, ent%field(2), './other/table') ! 105: fgd_alter_bit check call fgd_alter_bit(d, "new7", "in3", 3, 2) call check_ok2(ne, 105, 1, d) n = fgd_entry(d, 'new7', ent) call check_ok2(ne, 105, 2, d) call check_int2(ne, 105, 1, n, GD_BIT_ENTRY) call check_int2(ne, 105, 2, ent%fragment_index, 0) call check_int2(ne, 105, 3, ent%numbits, 2) call check_int2(ne, 105, 4, ent%bitnum, 3) call check_str2(ne, 105, 5, ent%field(1), 'in3') ! 106: fgd_alter_sbit check call fgd_alter_sbit(d, "new8", "out", 1, 22) call check_ok2(ne, 106, 1, d) n = fgd_entry(d, 'new8', ent) call check_ok2(ne, 106, 2, d) call check_int2(ne, 106, 1, n, GD_SBIT_ENTRY) call check_int2(ne, 106, 2, ent%fragment_index, 0) call check_int2(ne, 106, 3, ent%numbits, 22) call check_int2(ne, 106, 4, ent%bitnum, 1) call check_str2(ne, 106, 5, ent%field(1), 'out') ! 107: fgd_alter_multiply check call fgd_alter_multiply(d, 'new9', 'in6', 'in4') call check_ok2(ne, 107, 1, d) n = fgd_entry(d, 'new9', ent) call check_ok2(ne, 107, 2, d) call check_int2(ne, 107, 1, n, GD_MULTIPLY_ENTRY) call check_int2(ne, 107, 2, ent%fragment_index, 0) call check_str2(ne, 107, 3, ent%field(1), 'in6') call check_str2(ne, 107, 4, ent%field(2), 'in4') ! 108: fgd_alter_phase check call fgd_alter_phase(d, 'new10', 'in2', 8) call check_ok2(ne, 108, 1, d) n = fgd_entry(d, 'new10', ent) call check_ok2(ne, 108, 2, d) call check_int2(ne, 108, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 108, 2, ent%fragment_index, 0) call check_int2(ne, 108, 3, ent%shift, 8) call check_str2(ne, 108, 4, ent%field(1), 'in2') ! 109: fgd_alter_const check call fgd_alter_const(d, 'new11', GD_FLOAT32) call check_ok2(ne, 109, 1, d) n = fgd_entry(d, 'new11', ent) call check_ok2(ne, 109, 2, d) call check_int2(ne, 109, 1, n, GD_CONST_ENTRY) call check_int2(ne, 109, 2, ent%fragment_index, 0) call check_int2(ne, 109, 3, ent%data_type, GD_FLOAT32) call fgd_get_constant_r4(d, 'new11', fl) call check_ok2(ne, 109, 3, d) call check_dbl(ne, 109, 1d0 * fl, 1d0 * (-8.1)) ! 110: fgd_encoding check n = fgd_encoding(d, 0) call check_ok(ne, 110, d) call check_int(ne, 110, n, GD_UNENCODED) ! 111: fgd_endianness check n = fgd_endianness(d, 0) call check_ok(ne, 111, d) call check_int(ne, 111, n, (GD_LITTLE_ENDIAN + GD_NOT_ARM_ENDIAN)) ! 112: fgd_dirfilename check l = 4096 call fgd_dirfilename(path, l, d, 0) call check_ok(ne, 112, d) call check_int(ne, 112, l, 4096) call check_eos(ne, 112, path, fildir) ! 113: fgd_parent_fragment check n = fgd_parent_fragment(d, 1) call check_ok(ne, 113, d) call check_int(ne, 113, n, 0) ! 114: fgd_alter_protection check call fgd_alter_protection(d, GD_PROTECT_DATA, 1) call check_ok(ne, 114, d) ! 115: fgd_protection check n = fgd_protection(d, 1) call check_ok(ne, 115, d) call check_int(ne, 115, n, GD_PROTECT_DATA) ! 116: fgd_raw_filename check str = fgd_raw_filename(d, "data") call check_ok(ne, 116, d) call check_eos(ne, 116, str, fildir//DIRSEP//'data') ! 117: fgd_reference check str = fgd_reference(d, "new1") call check_ok(ne, 117, d) call check_str(ne, 117, str, 'new1') ! 118: fgd_eof check n = fgd_eof(d, 'lincom') call check_ok(ne, 118, d) call check_int(ne, 118, n, 80) ! 119: fgd_alter_encoding check call fgd_alter_encoding(d, GD_SLIM_ENCODED, 1, 0) call check_ok2(ne, 119, 1, d) n = fgd_encoding(d, 1) call check_ok2(ne, 119, 2, d) call check_int(ne, 119, n, GD_SLIM_ENCODED) ! 120: fgd_alter_endianness check call fgd_alter_endianness(d, GD_BIG_ENDIAN, 1, 0) call check_ok2(ne, 120, 1, d) n = fgd_endianness(d, 1) call check_ok2(ne, 120, 2, d) call check_int(ne, 120, n, GD_BIG_ENDIAN) ! 121: fgd_alter_spec check call fgd_alter_spec(d, 'new10 PHASE in1 3', 0) call check_ok2(ne, 121, 1, d) n = fgd_entry(d, 'new10', ent) call check_ok2(ne, 121, 2, d) call check_int2(ne, 121, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 121, 2, ent%fragment_index, 0) call check_int2(ne, 121, 3, ent%shift, 3) call check_str2(ne, 121, 4, ent%field(1), 'in1') ! 122: fgd_delete check call fgd_delete(d, 'new10', 0) call check_ok2(ne, 122, 1, d) n = fgd_entry(d, 'new10', ent) call check_err2(ne, 122, 2, d, GD_E_BAD_CODE) ! 123: fgd_malter_spec check call fgd_malter_spec(d, 'mnew10 PHASE in4 11', 'data', 0) call check_ok2(ne, 123, 1, d) n = fgd_entry(d, 'data/mnew10', ent) call check_ok2(ne, 123, 2, d) call check_int2(ne, 123, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 123, 2, ent%fragment_index, 0) call check_int2(ne, 123, 3, ent%shift, 11) call check_str2(ne, 123, 4, ent%field(1), 'in4') ! 124: fgd_move check call fgd_move(d, 'new9', 1, 0) call check_ok2(ne, 124, 1, d) n = fgd_entry(d, 'new9', ent) call check_ok2(ne, 124, 2, d) call check_int2(ne, 124, 1, n, GD_MULTIPLY_ENTRY) call check_int2(ne, 124, 2, ent%fragment_index, 1) call check_str2(ne, 124, 3, ent%field(1), 'in6') call check_str2(ne, 124, 4, ent%field(2), 'in4') ! 125: fgd_rename check call fgd_rename(d, 'new9', 'newer', 0) call check_ok2(ne, 125, 1, d) n = fgd_entry(d, 'new9', ent) call check_err2(ne, 125, 2, d, GD_E_BAD_CODE) n = fgd_entry(d, 'newer', ent) call check_ok2(ne, 125, 3, d) call check_int2(ne, 125, 1, n, GD_MULTIPLY_ENTRY) call check_int2(ne, 125, 2, ent%fragment_index, 1) call check_str2(ne, 125, 3, ent%field(1), 'in6') call check_str2(ne, 125, 4, ent%field(2), 'in4') ! 126: fgd_uninclude check call fgd_uninclude(d, 1, 0) call check_ok2(ne, 126, 1, d) n = fgd_entry(d, 'newer', ent) call check_err2(ne, 126, 2, d, GD_E_BAD_CODE) ! 127: fgd_frameoffset check n = fgd_frameoffset(d, 0) call check_ok(ne, 127, d) call check_int(ne, 127, n, 0) ! 128: fgd_alter_frameoffset check call fgd_alter_frameoffset(d, 33, 0, 0) call check_ok2(ne, 128, 1, d) n = fgd_frameoffset(d, 0) call check_ok2(ne, 128, 2, d) call check_int(ne, 128, n, 33) ! 129: fgd_native_type check n = fgd_native_type(d, 'data') call check_ok(ne, 129, d) call check_int(ne, 129, n, GD_INT8) ! 131: fgd_validate check n = fgd_validate(d, 'new7') call check_err(ne, 131, d, GD_E_BAD_CODE) call check_int(ne, 131, n, -1) ! 132: fgd_framenum check str = fgd_reference(d, "data") dp = fgd_framenum(d, 'INDEX', 33.3d0) call check_ok(ne, 132, d) call check_dbl(ne, 132, dp, 33.3d0) ! 133: fgd_framenum_subset check dp = fgd_framenum_subset(d, 'data', 33.3d0, 6, 0) call check_ok(ne, 133, d) call check_dbl(ne, 133, dp, 37.0375d0) ! 135: fgd_add raw ent%data_type = GD_FLOAT32 ent%fragment_index = 0 ent%spf = 0 ent%field_type = GD_RAW_ENTRY ent%scalar(1) = 'carray' ent%scalar_ind(1) = 2 call fgd_add(d, 'new135', ent) call check_ok2(ne, 135, 1, d) n = fgd_entry(d, 'new135', ent) call check_ok2(ne, 135, 2, d) call check_int2(ne, 135, 3, n, GD_RAW_ENTRY) call check_int2(ne, 135, 4, ent%fragment_index, 0) call check_int2(ne, 135, 5, ent%spf, 2) call check_int2(ne, 135, 6, ent%data_type, GD_FLOAT32) ! 136: fgd_madd check ent%shift = 33 ent%field(1) = 'data/mnew4' ent%fragment_index = 0 ent%field_type = GD_PHASE_ENTRY call fgd_madd(d, 'data', 'mnew136', ent) call check_ok2(ne, 136, 1, d) n = fgd_entry(d, 'data/mnew136', ent) call check_ok2(ne, 136, 2, d) call check_int2(ne, 136, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 136, 2, ent%fragment_index, 0) call check_int2(ne, 136, 3, ent%shift, 33) call check_str2(ne, 136, 4, ent%field(1), 'data/mnew4') ! 141: fgd_alter_entry RAW ent%field_type = GD_RAW_ENTRY ent%data_type = GD_FLOAT64 ent%scalar(1) = 'const' ent%scalar_ind(1) = -1 call fgd_alter_entry(d, 'new135', ent, 0, 0) call check_ok2(ne, 141, 1, d) n = fgd_entry(d, 'new135', ent) call check_ok2(ne, 141, 2, d) call check_int2(ne, 141, 3, n, GD_RAW_ENTRY) call check_int2(ne, 141, 4, ent%fragment_index, 0) call check_int2(ne, 141, 5, ent%spf, 93) call check_int2(ne, 141, 6, ent%data_type, GD_FLOAT64) call check_str2(ne, 141, 7, ent%scalar(1), 'const') call check_int2(ne, 141, 8, ent%scalar_ind(1), -1) ! 142: fgd_bof check n = fgd_bof(d, 'lincom') call check_ok(ne, 142, d) call check_int(ne, 142, n, 264) ! 143: fgd_entry (divide) check n = fgd_entry(d, 'div', ent) call check_ok(ne, 143, d) call check_int2(ne, 143, 1, n, GD_DIVIDE_ENTRY) call check_int2(ne, 143, 2, ent%fragment_index, 0) call check_str2(ne, 143, 3, ent%field(1), 'mult') call check_str2(ne, 143, 4, ent%field(2), 'bit') ! 145: fgd_entry (recip) check n = fgd_entry(d, 'recip', ent) call check_ok(ne, 145, d) call check_int2(ne, 145, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 145, 2, ent%fragment_index, 0) call check_int2(ne, 145, 3, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 145, 4, ent%field(1), 'div') call check_cpx2(ne, 145, 5, ent%cdividend, dcmplx(6.5d0, 4.3d0)) ! 146: fgd_add_divide check call fgd_add_divide(d, 'new14', 'in1', 'in2', 0) call check_ok2(ne, 146, 1, d) n = fgd_entry(d, 'new14', ent) call check_ok2(ne, 146, 2, d) call check_int2(ne, 146, 1, n, GD_DIVIDE_ENTRY) call check_int2(ne, 146, 2, ent%fragment_index, 0) call check_str2(ne, 146, 3, ent%field(1), 'in1') call check_str2(ne, 146, 4, ent%field(2), 'in2') ! 147: fgd_add_recip check call fgd_add_recip(d, 'new15', 'in1', 31.9d0, 0) call check_ok2(ne, 147, 1, d) n = fgd_entry(d, 'new15', ent) call check_ok2(ne, 147, 2, d) call check_int2(ne, 147, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 147, 2, ent%fragment_index, 0) call check_str2(ne, 147, 3, ent%field(1), 'in1') call check_int2(ne, 147, 4, ent%flags, GD_EN_CALC) call check_dbl2(ne, 147, 5, ent%dividend, 31.9d0) ! 148: fgd_add_recip check call fgd_add_crecip(d, 'new16', 'in1', dcmplx(31.9d0, 38.2d0), 0) call check_ok2(ne, 148, 1, d) n = fgd_entry(d, 'new16', ent) call check_ok2(ne, 148, 2, d) call check_int2(ne, 148, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 148, 2, ent%fragment_index, 0) call check_str2(ne, 148, 3, ent%field(1), 'in1') call check_int2(ne, 148, 4, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 148, 5, ent%cdividend, dcmplx(31.9d0, 38.2d0)) ! 149: fgd_madd_divide check call fgd_madd_divide(d, 'data', 'new14', 'in3', 'in4') call check_ok2(ne, 149, 1, d) n = fgd_entry(d, 'data/new14', ent) call check_ok2(ne, 149, 2, d) call check_int2(ne, 149, 1, n, GD_DIVIDE_ENTRY) call check_int2(ne, 149, 2, ent%fragment_index, 0) call check_str2(ne, 149, 3, ent%field(1), 'in3') call check_str2(ne, 149, 4, ent%field(2), 'in4') ! 150: fgd_madd_recip check call fgd_madd_recip(d, 'data', 'new15', 'in0', 95.5d0) call check_ok2(ne, 150, 1, d) n = fgd_entry(d, 'data/new15', ent) call check_ok2(ne, 150, 2, d) call check_int2(ne, 150, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 150, 2, ent%fragment_index, 0) call check_str2(ne, 150, 3, ent%field(1), 'in0') call check_int2(ne, 150, 4, ent%flags, GD_EN_CALC) call check_dbl2(ne, 150, 5, ent%dividend, 95.5d0) ! 151: fgd_madd_recip check call fgd_madd_crecip(d, 'data', 'new16', 'in3', dcmplx(8.47d0, 6.22d0)) call check_ok2(ne, 151, 1, d) n = fgd_entry(d, 'data/new16', ent) call check_ok2(ne, 151, 2, d) call check_int2(ne, 151, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 151, 2, ent%fragment_index, 0) call check_str2(ne, 151, 3, ent%field(1), 'in3') call check_int2(ne, 151, 4, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 151, 5, ent%cdividend, dcmplx(8.47d0, 6.22d0)) ! 152: fgd_alter_divide check call fgd_alter_divide(d, 'new14', 'in6', 'in4') call check_ok2(ne, 152, 1, d) n = fgd_entry(d, 'new14', ent) call check_ok2(ne, 152, 2, d) call check_int2(ne, 152, 1, n, GD_DIVIDE_ENTRY) call check_int2(ne, 152, 2, ent%fragment_index, 0) call check_str2(ne, 152, 3, ent%field(1), 'in6') call check_str2(ne, 152, 4, ent%field(2), 'in4') ! 153: fgd_alter_recip check call fgd_alter_recip(d, 'new15', 'in5', 0.187d0) call check_ok2(ne, 153, 1, d) n = fgd_entry(d, 'new15', ent) call check_ok2(ne, 153, 2, d) call check_int2(ne, 153, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 153, 2, ent%fragment_index, 0) call check_str2(ne, 153, 3, ent%field(1), 'in5') call check_dbl2(ne, 153, 4, ent%dividend, 0.187d0) ! 154: fgd_alter_crecip check call fgd_alter_crecip(d, 'new16', 'in2', dcmplx(4.3d0, 81.81d0)) call check_ok2(ne, 154, 1, d) n = fgd_entry(d, 'new16', ent) call check_ok2(ne, 154, 2, d) call check_int2(ne, 154, 1, n, GD_RECIP_ENTRY) call check_int2(ne, 154, 2, ent%fragment_index, 0) call check_str2(ne, 154, 3, ent%field(1), 'in2') call check_cpx2(ne, 154, 4, ent%cdividend, dcmplx(4.3d0, 81.81d0)) ! 155: fgd_rewrite_fragment check call fgd_rewrite_fragment(d, 0) call check_ok(ne, 155, d) ! 156: fgd_invalid_dirfile check l = fgd_invalid_dirfile() call check_ok2(ne, 98, 1, l) n = fgd_nfragments(l) call check_err2(ne, 98, 2, l, GD_E_BAD_DIRFILE) call fgd_close(l) ! 157: fgd_dirfile_standards n = fgd_dirfile_standards(d, GD_VERSION_CURRENT) call check_ok2(ne, 157, 1, d) call check_int(ne, 157, n, GD_DIRFILE_STANDARDS_VERSION) n = fgd_dirfile_standards(d, 0) call check_err2(ne, 157, 2, d, GD_E_ARGUMENT) ! 158: gd_get_carray_slice (INT8) call fgd_get_carray_i1(d, "carray", 0, 0, ci1) call check_ok(ne, 158, d) do i=1,6 call check_int2(ne, 158, i, int(ci1(i)), i) end do ! 159: gd_get_carray_slice (INT8) call fgd_get_carray_i1(d, "carray", 3, 2, ci1) call check_ok(ne, 159, d) do i=1,2 call check_int2(ne, 159, i, int(ci1(i)), i + 2) end do ! 160: gd_get_carray_slice (INT16) call fgd_get_carray_i2(d, "carray", 3, 2, ci2) call check_ok(ne, 160, d) do i=1,2 call check_int2(ne, 160, i, int(ci2(i)), i + 2) end do ! 161: gd_get_carray_slice (INT32) call fgd_get_carray_i4(d, "carray", 3, 2, ci4) call check_ok(ne, 161, d) do i=1,2 call check_int2(ne, 161, i, ci4(i), i + 2) end do ! 162: gd_get_carray_slice (INT64) call fgd_get_carray_i8(d, "carray", 3, 2, ci8) call check_ok(ne, 162, d) do i=1,2 call check_int2(ne, 162, i, int(ci8(i)), i + 2) end do ! 163: gd_get_carray_slice (FLOAT32) call fgd_get_carray_r4(d, "carray", 3, 2, cr4) call check_ok(ne, 163, d) do i=1,2 call check_dbl2(ne, 163, i, 1d0 * cr4(i), (2 + i) * 1.1d0) end do ! 164: gd_get_carray_slice (FLOAT64) call fgd_get_carray_r8(d, "carray", 3, 2, cr8) call check_ok(ne, 164, d) do i=1,2 call check_dbl2(ne, 164, i, cr8(i), (2 + i) * 1.1d0) end do ! 165: gd_get_carray_slice (COMPLEX64) call fgd_get_carray_c8(d, "carray", 3, 2, cc8) call check_ok(ne, 165, d) do i=1,2 call check_cpx2(ne, 165, i, 1d0 * cc8(i), dcmplx((2 + i) * 1.1d0, 0)) end do ! 166: gd_get_carray_slice (COMPLEX128) call fgd_get_carray_c16(d, "carray", 3, 2, cc16) call check_ok(ne, 166, d) do i=1,2 call check_cpx2(ne, 166, i, cc16(i), dcmplx((2 + i) * 1.1d0, 0)) end do ! 168: gd_put_carray ci1 = (/ 11_1, 12_1, 13_1, 14_1, 15_1, 16_1, 0_1, 0_1 /) call fgd_put_carray_i1(d, "carray", 0, 0, ci1) call check_ok2(ne, 168, 1, d) call fgd_get_carray_i1(d, "carray", 0, 0, ci1) call check_ok2(ne, 168, 2, d) do i=1,6 call check_int2(ne, 168, i, int(ci1(i)), i + 10) end do ! 169: gd_put_carray_slice (INT8) ci1 = (/ 72_1, 73_1, 0_1, 0_1, 0_1, 0_1, 0_1, 0_1 /) call fgd_put_carray_i1(d, "carray", 3, 2, ci1) call check_ok2(ne, 169, 1, d) call fgd_get_carray_i1(d, "carray", 0, 0, ci1) call check_ok2(ne, 169, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then n = 69 + i else n = 10 + i end if call check_int2(ne, 169, i, int(ci1(i)), n) end do ! 170: gd_put_carray_slice (INT16) ci2 = (/ 173_2, 174_2, 0_2, 0_2, 0_2, 0_2, 0_2, 0_2 /) call fgd_put_carray_i2(d, "carray", 3, 2, ci2) call check_ok2(ne, 170, 1, d) call fgd_get_carray_i2(d, "carray", 0, 0, ci2) call check_ok2(ne, 170, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then n = 170 + i else n = 10 + i end if call check_int2(ne, 170, i, int(ci2(i)), n) end do ! 171: gd_put_carray_slice (INT32) ci4 = (/ 174, 175, 0, 0, 0, 0, 0, 0 /) call fgd_put_carray_i4(d, "carray", 3, 2, ci4) call check_ok2(ne, 171, 1, d) call fgd_get_carray_i4(d, "carray", 0, 0, ci4) call check_ok2(ne, 171, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then n = 171 + i else n = 10 + i end if call check_int2(ne, 171, i, ci4(i), n) end do ! 172: gd_put_carray_slice (INT64) ci8 = (/ 175, 176, 0, 0, 0, 0, 0, 0 /) call fgd_put_carray_i8(d, "carray", 3, 2, ci8) call check_ok2(ne, 172, 1, d) call fgd_get_carray_i8(d, "carray", 0, 0, ci8) call check_ok2(ne, 172, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then n = 172 + i else n = 10 + i end if call check_int2(ne, 172, i, int(ci8(i)), n) end do ! 173: gd_put_carray_slice (FLOAT32) cr4 = (/ 176., 177., 0., 0., 0., 0., 0., 0. /) call fgd_put_carray_r4(d, "carray", 3, 2, cr4) call check_ok2(ne, 173, 1, d) call fgd_get_carray_r4(d, "carray", 0, 0, cr4) call check_ok2(ne, 173, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then dp = 173. + i else dp = 10 + i end if call check_dbl2(ne, 173, i, 1d0 * cr4(i), dp) end do ! 174: gd_put_carray_slice (FLOAT64) cr8 = (/ 177., 178., 0., 0., 0., 0., 0., 0. /) call fgd_put_carray_r8(d, "carray", 3, 2, cr8) call check_ok2(ne, 174, 1, d) call fgd_get_carray_r8(d, "carray", 0, 0, cr8) call check_ok2(ne, 174, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then dp = 174. + i else dp = 10 + i end if call check_dbl2(ne, 174, i, cr8(i), dp) end do ! 175: gd_put_carray_slice (COMPLEX64) cc8 = (/ 178., 179., 0., 0., 0., 0., 0., 0. /) call fgd_put_carray_c8(d, "carray", 3, 2, cc8) call check_ok2(ne, 175, 1, d) call fgd_get_carray_c8(d, "carray", 0, 0, cc8) call check_ok2(ne, 175, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then dc = dcmplx(175d0 + i, 0d0) else dc = dcmplx(10d0 + i, 0d0) end if call check_cpx2(ne, 175, i, 1d0 * cc8(i), dc) end do ! 176: gd_put_carray_slice (COMPLEX128) cc16 = (/ 179., 180., 0., 0., 0., 0., 0., 0. /) call fgd_put_carray_c16(d, "carray", 3, 2, cc16) call check_ok2(ne, 176, 1, d) call fgd_get_carray_c16(d, "carray", 0, 0, cc16) call check_ok2(ne, 176, 2, d) do i=1,6 if (i .eq. 3 .or. i .eq. 4) then dc = dcmplx(176d0 + i, 0d0) else dc = dcmplx(10d0 + i, 0d0) end if call check_cpx2(ne, 175, i, cc16(i), dc) end do ! 177: gd_array_len n = fgd_array_len(d, 'carray') call check_ok(ne, 177, d) call check_int(ne, 177, n, 6) ! 178: gd_entry (CARRAY) n = fgd_entry(d, 'carray', ent) call check_ok(ne, 178, d) call check_int2(ne, 178, 1, n, GD_CARRAY_ENTRY) call check_int2(ne, 178, 2, ent%fragment_index, 0) call check_int2(ne, 178, 3, ent%array_len, 6) call check_int2(ne, 178, 4, ent%data_type, GD_FLOAT64) ! 179: gd_add_carray call fgd_add_carray(d, 'new17', GD_FLOAT64, 4, 0) call check_ok2(ne, 179, 1, d) n = fgd_entry(d, 'new17', ent) call check_ok2(ne, 179, 2, d) call check_int2(ne, 179, 1, n, GD_CARRAY_ENTRY) call check_int2(ne, 179, 2, ent%fragment_index, 0) call check_int2(ne, 179, 3, ent%array_len, 4) call check_int2(ne, 179, 4, ent%data_type, GD_FLOAT64) call fgd_get_carray_r4(d, 'new17', 0, 0, cr4) call check_ok2(ne, 179, 3, d) do i=1,4 call check_dbl2(ne, 179, i, 1d0 * cr4(i), 0d0) end do ! 180: gd_madd_carray call fgd_madd_carray(d, 'data', 'new17', GD_FLOAT64, 4) call check_ok2(ne, 180, 1, d) n = fgd_entry(d, 'data/new17', ent) call check_ok2(ne, 180, 2, d) call check_int2(ne, 180, 1, n, GD_CARRAY_ENTRY) call check_int2(ne, 180, 2, ent%fragment_index, 0) call check_int2(ne, 180, 3, ent%array_len, 4) call check_int2(ne, 180, 4, ent%data_type, GD_FLOAT64) call fgd_get_carray_r4(d, 'data/new17', 0, 0, cr4) call check_ok2(ne, 180, 3, d) do i=1,4 call check_dbl2(ne, 180, i, 1d0 * cr4(i), 0d0) end do ! 181: gd_alter_carray call fgd_alter_carray(d, 'new17', GD_FLOAT32, 3) call check_ok2(ne, 181, 1, d) n = fgd_entry(d, 'new17', ent) call check_ok2(ne, 181, 2, d) call check_int2(ne, 181, 1, n, GD_CARRAY_ENTRY) call check_int2(ne, 181, 2, ent%fragment_index, 0) call check_int2(ne, 181, 3, ent%data_type, GD_FLOAT32) call check_int2(ne, 181, 4, ent%array_len, 3) ! 183: fgd_constants_i1 check iq(1) = 93 iq(2) = -8 n = fgd_nfields_by_type(d, GD_CONST_ENTRY) call fgd_constants_i1(ci1, d) call check_ok(ne, 183, d) do i = 1, n call check_int2(ne, 183, i, int(ci1(i)), int(iq(i))) end do ! 184: fgd_constants_i2 check iq(1) = 93 call fgd_constants_i2(ci2, d) call check_ok(ne, 184, d) do i = 1, n call check_int2(ne, 184, i, int(ci2(i)), int(iq(i))) end do ! 185: fgd_constants_i4 check call fgd_constants_i4(ci4, d) call check_ok(ne, 185, d) do i = 1, n call check_int2(ne, 185, i, ci4(i), int(iq(i))) end do ! 186: fgd_constants_i8 check call fgd_constants_i8(ci8, d) call check_ok(ne, 186, d) do i = 1, n call check_int2(ne, 186, i, int(ci8(i)), int(iq(i))) end do ! 187: fgd_constants_r4 check q(1) = 93. q(2) = -8.1 call fgd_constants_r4(cr4, d) call check_ok(ne, 187, d) do i = 1, n call check_dbl2(ne, 187, i, 1d0 * cr4(i), q(i)) end do ! 188: fgd_constants_r8 check call fgd_constants_r8(cr8, d) call check_ok(ne, 188, d) do i = 1, n call check_dbl2(ne, 188, i, cr8(i), q(i)) end do ! 189: fgd_constants_c8 check cq(1) = 93. cq(2) = -8.1 call fgd_constants_c8(cc8, d) call check_ok(ne, 189, d) do i = 1, n call check_cpx2(ne, 189, i, 1d0 * cc8(i), cq(i)) end do ! 190: fgd_constants_c16 check call fgd_constants_c16(cc16, d) call check_ok(ne, 190, d) do i = 1, n call check_cpx2(ne, 190, i, cc16(i), cq(i)) end do ! 191: fgd_mconstants_i1 check iq(1) = 3 iq(2) = 0 n = fgd_nmfields_by_type(d, 'data', GD_CONST_ENTRY) call fgd_mconstants_i1(ci1, d, 'data') call check_ok(ne, 191, d) do i = 1, n call check_int2(ne, 191, i, int(ci1(i)), int(iq(i))) end do ! 192: fgd_mconstants_i2 check call fgd_mconstants_i2(ci2, d, 'data') call check_ok(ne, 192, d) do i = 1, n call check_int2(ne, 192, i, int(ci2(i)), int(iq(i))) end do ! 193: fgd_mconstants_i4 check call fgd_mconstants_i4(ci4, d, 'data') call check_ok(ne, 193, d) do i = 1, n call check_int2(ne, 193, i, ci4(i), int(iq(i))) end do ! 194: fgd_mconstants_i8 check call fgd_mconstants_i8(ci8, d, 'data') call check_ok(ne, 194, d) do i = 1, n call check_int2(ne, 194, i, int(ci8(i)), int(iq(i))) end do ! 195: fgd_mconstants_r4 check q(1) = 3.3 q(2) = 0. call fgd_mconstants_r4(cr4, d, 'data') call check_ok(ne, 195, d) do i = 1, n call check_dbl2(ne, 195, i, 1d0 * cr4(i), q(i)) end do ! 196: fgd_mconstants_r8 check call fgd_mconstants_r8(cr8, d, 'data') call check_ok(ne, 196, d) do i = 1, n call check_dbl2(ne, 196, i, cr8(i), q(i)) end do ! 197: fgd_mconstants_c8 check cq(1) = dcmplx(3.3, 4.4) cq(2) = 0. call fgd_mconstants_c8(cc8, d, 'data') call check_ok(ne, 197, d) do i = 1, n call check_cpx2(ne, 197, i, 1d0 * cc8(i), cq(i)) end do ! 198: fgd_mconstants_c16 check call fgd_mconstants_c16(cc16, d, 'data') call check_ok(ne, 198, d) cq(1) = dcmplx(3.3d0, 4.4d0) do i = 1, n call check_cpx2(ne, 198, i, cc16(i), cq(i)) end do ! 199: fgd_strings check strings(1) = "Lorem ipsum" strings(2) = "" strings(3) = "Arthur Dent" n = fgd_nfields_by_type(d, GD_STRING_ENTRY) l = slen call fgd_strings(st, d, l) call check_ok(ne, 199, d) call check_int(ne, 199, l, slen) do i = 1, n call check_str2(ne, 199, i, st(i), strings(i)) end do ! 200: fgd_strings check strings(1) = "This is a string constant." strings(2) = "" n = fgd_nmfields_by_type(d, 'data', GD_STRING_ENTRY) l = slen call fgd_mstrings(st, d, 'data', l) call check_ok(ne, 200, d) call check_int(ne, 200, l, slen) do i = 1, n call check_str2(ne, 200, i, st(i), strings(i)) end do ! 201: fgd_string_value_max n = fgd_string_value_max(d) call check_int(ne, 201, n, 11) ! 202: fgd_mstring_value_max n = fgd_mstring_value_max(d, 'data') call check_int(ne, 202, n, 26) ! 203: fgd_seek check n = fgd_seek(d, 'data', 35, 0, GD_SEEK_SET) call check_ok(ne, 203, d) call check_int2(ne, 203, 1, n, 280) n = fgd_getdata_r8(d, 'data', GD_HERE, 0, 1, 0, cr8) call check_int2(ne, 203, 2, n, 8) do i=1,8 call check_dbl2(ne, 203, i, cr8(i), 16d0 + i) end do ! 204: fgd_tell check n = fgd_tell(d, 'data') call check_ok(ne, 204, d) call check_int(ne, 204, n, 288) ! 205: fgd_hide check call fgd_hide(d, 'data') call check_ok(ne, 205, d) ! 206: fgd_hidden check n = fgd_hidden(d, 'data') call check_ok2(ne, 206, 1, d) call check_int2(ne, 206, 1, n, 1) n = fgd_hidden(d, 'lincom') call check_ok2(ne, 206, 2, d) call check_int2(ne, 206, 2, n, 0) ! 207: fgd_unhide check call fgd_unhide(d, 'data') call check_ok2(ne, 206, 1, d) n = fgd_hidden(d, 'data') call check_ok2(ne, 206, 2, d) call check_int(ne, 206, n, 0) ! 208: fgd_sync check call fgd_sync(d, 'data') call check_ok(ne, 208, d) ! 209: fgd_flush check call fgd_flush(d, 'data') call check_ok(ne, 209, d) ! 210: fgd_metaflush check call fgd_metaflush(d) call check_ok(ne, 210, d) ! 211: fgd_entry (WINDOW) check n = fgd_entry(d, 'window', ent) call check_ok(ne, 211, d) call check_int2(ne, 211, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 211, 2, ent%fragment_index, 0) call check_int2(ne, 211, 3, ent%windop, GD_WINDOP_LT) call check_str2(ne, 211, 4, ent%field(1), 'linterp') call check_str2(ne, 211, 5, ent%field(2), 'mult') call check_dbl2(ne, 211, 6, ent%rthreshold, 4.1D0) ! 212: fgd_add_window_i check call fgd_add_window_i(d, 'new18', 'in1', 'in2', GD_WINDOP_NE, 32, 0) call check_ok2(ne, 212, 1, d) n = fgd_entry(d, 'new18', ent) call check_ok2(ne, 212, 2, d) call check_int2(ne, 212, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 212, 2, ent%fragment_index, 0) call check_int2(ne, 212, 3, ent%windop, GD_WINDOP_NE) call check_str2(ne, 212, 4, ent%field(1), 'in1') call check_str2(ne, 212, 5, ent%field(2), 'in2') call check_int2(ne, 212, 6, ent%ithreshold, 32) ! 213: fgd_add_window_r check call fgd_add_window_r(d, 'new19', 'in5', 'in4', GD_WINDOP_LE, 1d-4, 0) call check_ok2(ne, 213, 1, d) n = fgd_entry(d, 'new19', ent) call check_ok2(ne, 213, 2, d) call check_int2(ne, 213, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 213, 2, ent%fragment_index, 0) call check_int2(ne, 213, 3, ent%windop, GD_WINDOP_LE) call check_str2(ne, 213, 4, ent%field(1), 'in5') call check_str2(ne, 213, 5, ent%field(2), 'in4') call check_dbl2(ne, 213, 6, ent%rthreshold, 1d-4) ! 214: fgd_madd_window_i check call fgd_madd_window_i(d, 'data', 'mnew18', 'in2', 'in3', GD_WINDOP_SET, & 128) call check_ok2(ne, 214, 1, d) n = fgd_entry(d, 'data/mnew18', ent) call check_ok2(ne, 214, 2, d) call check_int2(ne, 214, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 214, 2, ent%fragment_index, 0) call check_int2(ne, 214, 3, ent%windop, GD_WINDOP_SET) call check_str2(ne, 214, 4, ent%field(1), 'in2') call check_str2(ne, 214, 5, ent%field(2), 'in3') call check_int2(ne, 214, 6, ent%ithreshold, 128) ! 215: fgd_madd_window_r check call fgd_madd_window_r(d, 'data', 'mnew19', 'in4', 'in1', GD_WINDOP_GT, & 0d0) call check_ok2(ne, 215, 1, d) n = fgd_entry(d, 'data/mnew19', ent) call check_ok2(ne, 215, 2, d) call check_int2(ne, 215, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 215, 2, ent%fragment_index, 0) call check_int2(ne, 215, 3, ent%windop, GD_WINDOP_GT) call check_str2(ne, 215, 4, ent%field(1), 'in4') call check_str2(ne, 215, 5, ent%field(2), 'in1') call check_dbl2(ne, 215, 6, ent%rthreshold, 0d0) ! 216: fgd_alter_window_i check call fgd_alter_window_i(d, 'new19', 'in3', 'in5', GD_WINDOP_CLR, 32) call check_ok2(ne, 216, 1, d) n = fgd_entry(d, 'new19', ent) call check_ok2(ne, 216, 2, d) call check_int2(ne, 216, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 216, 2, ent%fragment_index, 0) call check_int2(ne, 216, 3, ent%windop, GD_WINDOP_CLR) call check_str2(ne, 216, 4, ent%field(1), 'in3') call check_str2(ne, 216, 5, ent%field(2), 'in5') call check_int2(ne, 216, 6, ent%ithreshold, 32) ! 217: fgd_alter_window_r check call fgd_alter_window_r(d, 'new18', 'in3', 'in4', GD_WINDOP_GE, 32d3) call check_ok2(ne, 217, 1, d) n = fgd_entry(d, 'new18', ent) call check_ok2(ne, 217, 2, d) call check_int2(ne, 217, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 217, 2, ent%fragment_index, 0) call check_int2(ne, 217, 3, ent%windop, GD_WINDOP_GE) call check_str2(ne, 217, 4, ent%field(1), 'in3') call check_str2(ne, 217, 5, ent%field(2), 'in4') call check_dbl2(ne, 217, 6, ent%rthreshold, 32d3) ! 218: fgd_alias_target check str = fgd_alias_target(d, 'alias') call check_ok(ne, 218, d) call check_str(ne, 218, str, 'data') ! 219: fgd_add_alias check call fgd_add_alias(d, 'new20', 'data', 0) call check_ok2(ne, 219, 1, d) str = fgd_alias_target(d, 'new20') call check_ok2(ne, 219, 2, d) call check_str(ne, 219, str, 'data') ! 220: fgd_madd_alias check call fgd_madd_alias(d, 'data', 'mnew20', 'data') call check_ok2(ne, 220, 1, d) str = fgd_alias_target(d, 'data/mnew20') call check_ok2(ne, 220, 2, d) call check_str(ne, 220, str, 'data') ! 221: fgd_naliases check n = fgd_naliases(d, 'data') call check_ok(ne, 221, d) call check_int(ne, 221, n, 4) ! 222: GDALSS check fields(1) = 'data' fields(2) = 'alias' fields(3) = 'data/mnew20' fields(4) = 'new20' l = flen call fgd_aliases(flist, d, 'data', l) call check_ok(ne, 222, d) call check_int(ne, 222, l, flen) do i = 1, n call check_str2(ne, 222, i, flist(i), fields(i)) end do ! 223: fgd_include_affix check call fgd_include_affix(d, 'format1', 0, 'A', 'Z', GD_CREAT + GD_EXCL) call check_ok(ne, 223, d) ! 226: fgd_fragment_affixes check l = flen n = flen call fgd_fragment_affixes(fields(1), l, fields(2), n, d, 1) call check_ok(ne, 226, d) call check_int2(ne, 226, 1, l, flen) call check_str2(ne, 226, 2, fields(1), 'A') call check_int2(ne, 226, 3, n, flen) call check_str2(ne, 226, 4, fields(2), 'Z') ! 227: fgd_alter_affixes check call fgd_alter_affixes(d, 1, 'B', '') call check_ok2(ne, 227, 1, d) l = flen n = flen call fgd_fragment_affixes(fields(1), l, fields(2), n, d, 1) call check_ok2(ne, 227, 2, d) call check_int2(ne, 226, 3, l, flen) call check_str2(ne, 227, 4, fields(1), 'B') call check_int2(ne, 226, 5, n, flen) call check_str2(ne, 227, 6, fields(2), '') ! 228: fgd_entry (MPLEX) check n = fgd_entry(d, 'mplex', ent) call check_ok(ne, 228, d) call check_int2(ne, 228, 1, n, GD_MPLEX_ENTRY) call check_int2(ne, 228, 2, ent%fragment_index, 0) call check_int2(ne, 228, 3, ent%count_val, 1) call check_str2(ne, 228, 4, ent%field(1), 'data') call check_str2(ne, 228, 5, ent%field(2), 'sbit') call check_int2(ne, 228, 6, ent%period, 10) ! 229: fgd_add_mplex check call fgd_add_mplex(d, 'new21', 'in1', 'in2', 5, 6, 0) call check_ok2(ne, 229, 1, d) n = fgd_entry(d, 'new21', ent) call check_ok2(ne, 229, 2, d) call check_int2(ne, 229, 1, n, GD_MPLEX_ENTRY) call check_int2(ne, 229, 2, ent%fragment_index, 0) call check_int2(ne, 229, 3, ent%count_val, 5) call check_str2(ne, 229, 4, ent%field(1), 'in1') call check_str2(ne, 229, 5, ent%field(2), 'in2') call check_int2(ne, 229, 6, ent%period, 6) ! 230: fgd_madd_mplex check call fgd_madd_mplex(d, 'data', 'mnew21', 'in2', 'in3', 0, 12) call check_ok2(ne, 230, 1, d) n = fgd_entry(d, 'data/mnew21', ent) call check_ok2(ne, 230, 2, d) call check_int2(ne, 230, 1, n, GD_MPLEX_ENTRY) call check_int2(ne, 230, 2, ent%fragment_index, 0) call check_int2(ne, 230, 3, ent%count_val, 0) call check_str2(ne, 230, 4, ent%field(1), 'in2') call check_str2(ne, 230, 5, ent%field(2), 'in3') call check_int2(ne, 230, 6, ent%period, 12) ! 231: fgd_alter_mplex check call fgd_alter_mplex(d, 'new21', 'in3', 'in4', 7, -1) call check_ok2(ne, 231, 1, d) n = fgd_entry(d, 'new21', ent) call check_ok2(ne, 231, 2, d) call check_int2(ne, 231, 1, n, GD_MPLEX_ENTRY) call check_int2(ne, 231, 2, ent%fragment_index, 0) call check_int2(ne, 231, 3, ent%count_val, 7) call check_str2(ne, 231, 4, ent%field(1), 'in3') call check_str2(ne, 231, 5, ent%field(2), 'in4') call check_int2(ne, 231, 6, ent%period, 6) ! 232: fgd_strtok check l = slen call fgd_strtok(str, l, d, '"test1 test2" test3\ test4 test5') call check_ok2(ne, 232, 1, d) call check_int2(ne, 232, 2, l, slen) call check_str2(ne, 232, 3, str, 'test1 test2') l = slen call fgd_strtok(str, l, d, '') call check_ok2(ne, 232, 4, d) call check_int2(ne, 232, 5, l, slen) call check_str2(ne, 232, 6, str, 'test3 test4') ! 233: fgd_raw_close check call fgd_raw_close(d, 'data') call check_ok(ne, 233, d) ! 234: fgd_desync check n = fgd_desync(d, 0) call check_ok(ne, 234, d) call check_int(ne, 234, n, 0) ! 235: fgd_flags check n = fgd_flags(d, GD_PRETTY_PRINT, 0) call check_ok(ne, 235, d) call check_int(ne, 235, n, GD_PRETTY_PRINT) ! 236: fgd_verbose_prefix check call fgd_verbose_prefix(d, "big_test95") call check_ok(ne, 236, d) ! 237: fgd_nentries check n = fgd_nentries(d, "data", GD_SCALAR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, & GD_ENTRIES_NOALIAS)) call check_ok2(ne, 237, 1, d) call check_int2(ne, 237, 1, n, 5) n = fgd_nentries(d, "", GD_VECTOR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, & GD_ENTRIES_NOALIAS)) call check_ok2(ne, 237, 2, d) call check_int2(ne, 237, 2, n, 28) ! 238: fgd_field_name_max check i = fgd_entry_name_max(d, "", GD_VECTOR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, & GD_ENTRIES_NOALIAS)) call check_ok(ne, 238, d) call check_int(ne, 238, i, 7) ! 239: fgd_field_list check fields = (/ 'INDEX ', 'bit ', 'data ', 'div ', & 'lincom ', 'linterp ', 'mplex ', 'mult ', 'new1 ', & 'new135 ', 'new14 ', 'new15 ', 'new16 ', 'new18 ', & 'new19 ', 'new2 ', 'new21 ', 'new3 ', 'new4 ', & 'new5 ', 'new6 ', 'new7 ', 'new8 ', 'phase ', & 'polynom ', 'recip ', 'sbit ', 'window ' /) l = flen call fgd_entry_list(flist, d, "", GD_VECTOR_ENTRIES, IOR(GD_ENTRIES_HIDDEN, & GD_ENTRIES_NOALIAS), l) call check_ok(ne, 239, d) call check_int(ne, 239, l, flen) do i = 1, n call check_str2(ne, 239, i, flist(i), fields(i)) end do ! 240: fgd_mplex_lookback check call fgd_mplex_lookback(d, GD_LOOKBACK_ALL) call check_ok(ne, 240, d) ! 241: fgd_raw_filename check str = fgd_linterp_tablename(d, "linterp") call check_ok(ne, 241, d) call check_eos(ne, 241, str, fildir//DIRSEP//'lut') ! 243: fgd_add lincom ent%field_type = GD_LINCOM_ENTRY ent%fragment_index = 0 ent%n_fields = 3 ent%flags = 0 ent%field(1) = 'in1' ent%field(2) = 'in2' ent%field(3) = 'in3' ent%m(1) = 1.1d0 ent%m(3) = 1.4d0 ent%scalar(1) = '' ent%scalar(2) = 'const' ent%scalar_ind(2) = -1 ent%scalar(3) = '' ent%scalar(4) = 'carray' ent%scalar_ind(4) = 3 ent%scalar(5) = 'carray' ent%scalar_ind(5) = 4 ent%scalar(6) = 'carray' ent%scalar_ind(6) = 5 call fgd_add(d, 'new243', ent) call check_ok2(ne, 243, 1, d) n = fgd_entry(d, 'new243', ent) call check_ok2(ne, 243, 2, d) call check_int2(ne, 243, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 243, 4, ent%n_fields, 3) call check_int2(ne, 243, 5, ent%fragment_index, 0) call check_str2(ne, 243, 6, ent%field(1), 'in1') call check_str2(ne, 243, 7, ent%field(2), 'in2') call check_str2(ne, 243, 8, ent%field(3), 'in3') call check_int2(ne, 243, 9, ent%flags, GD_EN_CALC) call check_str2(ne, 243, 10, ent%scalar(1), '') call check_str2(ne, 243, 11, ent%scalar(2), 'const') call check_str2(ne, 243, 12, ent%scalar(3), '') call check_str2(ne, 243, 13, ent%scalar(4), 'carray') call check_str2(ne, 243, 14, ent%scalar(5), 'carray') call check_str2(ne, 243, 15, ent%scalar(6), 'carray') call check_int2(ne, 243, 16, ent%scalar_ind(2), -1) call check_int2(ne, 243, 17, ent%scalar_ind(4), 3) call check_int2(ne, 243, 18, ent%scalar_ind(5), 4) call check_int2(ne, 243, 19, ent%scalar_ind(6), 5) call check_dbl2(ne, 243, 20, ent%m(1), 1.1d0) call check_dbl2(ne, 243, 21, ent%m(2), 93d0) call check_dbl2(ne, 243, 22, ent%m(3), 1.4d0) call check_dbl2(ne, 243, 23, ent%b(1), 179d0) call check_dbl2(ne, 243, 24, ent%b(2), 180d0) call check_dbl2(ne, 243, 25, ent%b(3), 15d0) ! 244: fgd_add polynom ent%field_type = GD_POLYNOM_ENTRY ent%fragment_index = 0 ent%field(1) = 'in1' ent%flags = 0 ent%a(1) = 33d0 ent%a(2) = 44d0 ent%a(3) = 66d0 ent%poly_ord = 3 ent%scalar(1) = '' ent%scalar(2) = '' ent%scalar(3) = '' ent%scalar(4) = 'carray' ent%scalar_ind(4) = 1 call fgd_add(d, 'new244', ent) call check_ok2(ne, 244, 1, d) n = fgd_entry(d, 'new244', ent) call check_ok2(ne, 244, 2, d) call check_int2(ne, 244, 3, n, GD_POLYNOM_ENTRY) call check_int2(ne, 244, 4, ent%poly_ord, 3) call check_int2(ne, 244, 5, ent%fragment_index, 0) call check_str2(ne, 244, 6, ent%field(1), 'in1') call check_int2(ne, 244, 7, ent%flags, GD_EN_CALC) call check_dbl2(ne, 244, 8, ent%a(1), 33d0) call check_dbl2(ne, 244, 9, ent%a(2), 44d0) call check_dbl2(ne, 244, 10, ent%a(3), 66d0) call check_dbl2(ne, 244, 11, ent%a(4), 11d0) call check_str2(ne, 244, 12, ent%scalar(1), '') call check_str2(ne, 244, 13, ent%scalar(2), '') call check_str2(ne, 244, 14, ent%scalar(3), '') call check_str2(ne, 244, 15, ent%scalar(4), 'carray') call check_int2(ne, 244, 16, ent%scalar_ind(4), 1) ! 246: fgd_add bit ent%field_type = GD_BIT_ENTRY ent%fragment_index = 0 ent%field(1) = 'in1' ent%bitnum = 11 ent%scalar(1) = '' ent%scalar(2) = 'const' ent%scalar_ind(2) = 0 call fgd_add(d, 'new246', ent) call check_ok2(ne, 246, 1, d) n = fgd_entry(d, 'new246', ent) call check_ok2(ne, 246, 2, d) call check_int2(ne, 246, 3, n, GD_BIT_ENTRY) call check_int2(ne, 246, 4, ent%fragment_index, 0) call check_int2(ne, 246, 5, ent%numbits, 93) call check_int2(ne, 246, 6, ent%bitnum, 11) call check_str2(ne, 246, 7, ent%field(1), 'in1') call check_str2(ne, 246, 8, ent%scalar(1), '') call check_str2(ne, 246, 9, ent%scalar(2), 'const') call check_int2(ne, 246, 10, ent%scalar_ind(2), -1) ! 248: fgd_add phase ent%field(1) = 'new9' ent%fragment_index = 0 ent%field_type = GD_PHASE_ENTRY ent%scalar(1) = 'carray' ent%scalar_ind(1) = 2 call fgd_add(d, 'new248', ent) call check_ok2(ne, 248, 1, d) n = fgd_entry(d, 'new248', ent) call check_ok2(ne, 248, 2, d) call check_int2(ne, 248, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 248, 2, ent%fragment_index, 0) call check_int2(ne, 248, 3, ent%shift, 12) call check_str2(ne, 248, 4, ent%field(1), 'new9') call check_str2(ne, 248, 5, ent%scalar(1), 'carray') call check_int2(ne, 248, 6, ent%scalar_ind(1), 2) ! 251: fgd_add recip ent%field(1) = 'in1' ent%field_type = GD_RECIP_ENTRY ent%fragment_index = 0 ent%scalar(1) = 'carray' ent%flags = 0 ent%scalar_ind = 4 call fgd_add(d, 'new251', ent) call check_ok2(ne, 251, 1, d) n = fgd_entry(d, 'new251', ent) call check_ok2(ne, 251, 2, d) call check_int2(ne, 251, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 251, 4, ent%fragment_index, 0) call check_int2(ne, 251, 5, ent%flags, GD_EN_CALC) call check_str2(ne, 251, 6, ent%field(1), 'in1') call check_dbl2(ne, 251, 7, ent%dividend, 180d0) call check_str2(ne, 251, 8, ent%scalar(1), 'carray') call check_int2(ne, 251, 9, ent%scalar_ind(1), 4) ! 253: fgd_add window ent%field(1) = 'in2' ent%field(2) = 'in3' ent%field_type = GD_WINDOW_ENTRY ent%windop = GD_WINDOP_NE ent%fragment_index = 0 ent%scalar(1) = 'const' ent%scalar_ind(1) = -1 call fgd_add(d, 'new253', ent) call check_ok2(ne, 253, 1, d) n = fgd_entry(d, 'new253', ent) call check_ok2(ne, 253, 2, d) call check_int2(ne, 253, 1, n, GD_WINDOW_ENTRY) call check_int2(ne, 253, 2, ent%fragment_index, 0) call check_int2(ne, 253, 3, ent%windop, GD_WINDOP_NE) call check_str2(ne, 253, 4, ent%field(1), 'in2') call check_str2(ne, 253, 5, ent%field(2), 'in3') call check_int2(ne, 253, 6, ent%ithreshold, 93) call check_str2(ne, 253, 7, ent%scalar(1), 'const') call check_int2(ne, 253, 8, ent%scalar_ind(1), -1) ! 254: fgd_add mplex ent%field(1) = 'in1' ent%field(2) = 'in2' ent%field_type = GD_MPLEX_ENTRY ent%scalar(1) = 'carray' ent%scalar(2) = 'carray' ent%scalar_ind(1) = 3 ent%scalar_ind(2) = 4 call fgd_add(d, 'new254', ent) call check_ok2(ne, 254, 1, d) n = fgd_entry(d, 'new254', ent) call check_ok2(ne, 254, 1, d) call check_int2(ne, 254, 1, n, GD_MPLEX_ENTRY) call check_int2(ne, 254, 2, ent%fragment_index, 0) call check_int2(ne, 254, 3, ent%count_val, 179) call check_int2(ne, 254, 4, ent%period, 180) call check_str2(ne, 254, 5, ent%field(1), 'in1') call check_str2(ne, 254, 6, ent%field(2), 'in2') call check_str2(ne, 254, 7, ent%scalar(1), 'carray') call check_int2(ne, 254, 8, ent%scalar_ind(1), 3) call check_str2(ne, 254, 9, ent%scalar(2), 'carray') call check_int2(ne, 254, 10, ent%scalar_ind(2), 4) ! 255: fgd_add complex lincom ent%field_type = GD_LINCOM_ENTRY ent%fragment_index = 0 ent%n_fields = 3 ent%flags = GD_EN_COMPSCAL ent%field(1) = 'in1' ent%field(2) = 'in2' ent%field(3) = 'in3' ent%cm(1) = dcmplx(1.1d0, 1.2d0) ent%cm(3) = dcmplx(1.3d0, 1.4d0) ent%scalar(1) = '' ent%scalar(2) = 'const' ent%scalar_ind(2) = -1 ent%scalar(3) = '' ent%scalar(4) = 'carray' ent%scalar_ind(4) = 3 ent%scalar(5) = 'carray' ent%scalar_ind(5) = 4 ent%scalar(6) = 'carray' ent%scalar_ind(6) = 5 call fgd_add(d, 'new255', ent) call check_ok2(ne, 255, 1, d) n = fgd_entry(d, 'new255', ent) call check_ok2(ne, 255, 2, d) call check_int2(ne, 255, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 255, 4, ent%n_fields, 3) call check_int2(ne, 255, 5, ent%fragment_index, 0) call check_str2(ne, 255, 6, ent%field(1), 'in1') call check_str2(ne, 255, 7, ent%field(2), 'in2') call check_str2(ne, 255, 8, ent%field(3), 'in3') call check_int2(ne, 255, 9, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 255, 10, ent%scalar(1), '') call check_str2(ne, 255, 11, ent%scalar(2), 'const') call check_str2(ne, 255, 12, ent%scalar(3), '') call check_str2(ne, 255, 13, ent%scalar(4), 'carray') call check_str2(ne, 255, 14, ent%scalar(5), 'carray') call check_str2(ne, 255, 15, ent%scalar(6), 'carray') call check_int2(ne, 255, 16, ent%scalar_ind(2), -1) call check_int2(ne, 255, 17, ent%scalar_ind(4), 3) call check_int2(ne, 255, 18, ent%scalar_ind(5), 4) call check_int2(ne, 255, 19, ent%scalar_ind(6), 5) call check_cpx2(ne, 255, 20, ent%cm(1), dcmplx(1.1d0, 1.2d0)) call check_cpx2(ne, 255, 21, ent%cm(2), dcmplx(93d0, 0)) call check_cpx2(ne, 255, 22, ent%cm(3), dcmplx(1.3d0, 1.4d0)) call check_cpx2(ne, 255, 23, ent%cb(1), dcmplx(179d0, 0)) call check_cpx2(ne, 255, 24, ent%cb(2), dcmplx(180d0, 0)) ! 256: fgd_add polynom ent%field_type = GD_POLYNOM_ENTRY ent%fragment_index = 0 ent%field(1) = 'in1' ent%flags = GD_EN_COMPSCAL ent%ca(1) = dcmplx(22d0, 33d0) ent%ca(2) = dcmplx(44d0, 55d0) ent%ca(3) = dcmplx(66d0, 77d0) ent%poly_ord = 3 ent%scalar(1) = '' ent%scalar(2) = '' ent%scalar(3) = '' ent%scalar(4) = 'carray' ent%scalar_ind(4) = 1 call fgd_add(d, 'new256', ent) call check_ok2(ne, 256, 1, d) n = fgd_entry(d, 'new256', ent) call check_ok2(ne, 256, 2, d) call check_int2(ne, 256, 3, n, GD_POLYNOM_ENTRY) call check_int2(ne, 256, 4, ent%poly_ord, 3) call check_int2(ne, 256, 5, ent%fragment_index, 0) call check_str2(ne, 256, 6, ent%field(1), 'in1') call check_int2(ne, 256, 7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 256, 8, ent%ca(1), dcmplx(22d0, 33d0)) call check_cpx2(ne, 256, 9, ent%ca(2), dcmplx(44d0, 55d0)) call check_cpx2(ne, 256, 10, ent%ca(3), dcmplx(66d0, 77d0)) call check_cpx2(ne, 256, 11, ent%ca(4), dcmplx(11d0, 0)) call check_str2(ne, 256, 12, ent%scalar(1), '') call check_str2(ne, 256, 13, ent%scalar(2), '') call check_str2(ne, 256, 14, ent%scalar(3), '') call check_str2(ne, 256, 15, ent%scalar(4), 'carray') call check_int2(ne, 256, 16, ent%scalar_ind(4), 1) ! 257: fgd_add recip ent%field(1) = 'in1' ent%field_type = GD_RECIP_ENTRY ent%fragment_index = 0 ent%scalar(1) = 'carray' ent%flags = GD_EN_COMPSCAL ent%scalar_ind = 4 call fgd_add(d, 'new257', ent) call check_ok2(ne, 257, 1, d) n = fgd_entry(d, 'new257', ent) call check_ok2(ne, 257, 2, d) call check_int2(ne, 257, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 257, 4, ent%fragment_index, 0) call check_int2(ne, 257, 5, ent%flags, GD_EN_CALC) call check_str2(ne, 257, 6, ent%field(1), 'in1') call check_dbl2(ne, 257, 7, ent%dividend, 180d0) call check_str2(ne, 257, 8, ent%scalar(1), 'carray') ! 258: fgd_add sbit ent%field_type = GD_SBIT_ENTRY ent%fragment_index = 0 ent%field(1) = 'in1' ent%bitnum = 11 ent%scalar(1) = '' ent%scalar(2) = 'const' ent%scalar_ind(2) = 0 call fgd_add(d, 'new258', ent) call check_ok2(ne, 258, 1, d) n = fgd_entry(d, 'new258', ent) call check_ok2(ne, 258, 2, d) call check_int2(ne, 258, 3, n, GD_SBIT_ENTRY) call check_int2(ne, 258, 4, ent%fragment_index, 0) call check_int2(ne, 258, 5, ent%numbits, 93) call check_int2(ne, 258, 6, ent%bitnum, 11) call check_str2(ne, 258, 7, ent%field(1), 'in1') call check_str2(ne, 258, 8, ent%scalar(1), '') call check_str2(ne, 258, 9, ent%scalar(2), 'const') ! 259: fgd_alter_entry lincom ent%field_type = GD_LINCOM_ENTRY ent%field(2) = 'in4' ent%flags = 0 ent%m(1) = 2.2d0 ent%scalar(2) = '' ent%scalar(3) = 'const' ent%scalar(4) = 'carray' ent%scalar(6) = 'const' ent%scalar_ind(3) = -1 ent%scalar_ind(4) = 4 call fgd_alter_entry(d, 'new243', ent, 17, 0) call check_ok2(ne, 259, 1, d) n = fgd_entry(d, 'new243', ent) call check_ok2(ne, 259, 2, d) call check_int2(ne, 259, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 259, 4, ent%n_fields, 3) call check_int2(ne, 259, 5, ent%fragment_index, 0) call check_str2(ne, 259, 6, ent%field(1), 'in1') call check_str2(ne, 259, 7, ent%field(2), 'in4') call check_str2(ne, 259, 8, ent%field(3), 'in3') call check_int2(ne, 259, 9, ent%flags, GD_EN_CALC) call check_str2(ne, 259, 10, ent%scalar(1), '') call check_str2(ne, 259, 11, ent%scalar(2), 'const') call check_str2(ne, 259, 12, ent%scalar(3), 'const') call check_str2(ne, 259, 13, ent%scalar(4), 'carray') call check_str2(ne, 259, 14, ent%scalar(5), '') call check_str2(ne, 259, 15, ent%scalar(6), 'const') call check_int2(ne, 259, 16, ent%scalar_ind(2), -1) call check_int2(ne, 259, 16, ent%scalar_ind(3), -1) call check_int2(ne, 259, 17, ent%scalar_ind(4), 4) call check_int2(ne, 259, 19, ent%scalar_ind(6), -1) call check_dbl2(ne, 259, 20, ent%m(1), 2.2d0) call check_dbl2(ne, 259, 21, ent%m(2), 93d0) call check_dbl2(ne, 259, 22, ent%m(3), 93d0) call check_dbl2(ne, 259, 23, ent%b(1), 180d0) call check_dbl2(ne, 259, 24, ent%b(2), 180d0) call check_dbl2(ne, 259, 25, ent%b(3), 93d0) ! 260: fgd_alter_entry CLINCOM ent%field(1) = 'in1' ent%field(2) = 'in4' ent%field(3) = 'in3' ent%field_type = GD_LINCOM_ENTRY ent%flags = GD_EN_COMPSCAL ent%cm(1) = dcmplx(9d0, 8d0) ent%scalar(2) = '' ent%scalar(3) = '' ent%scalar(4) = 'carray' ent%scalar(6) = '' ent%scalar_ind(4) = 3 call fgd_alter_entry(d, 'new243', ent, 17, 0) call check_ok2(ne, 260, 1, d) n = fgd_entry(d, 'new243', ent) call check_ok2(ne, 260, 2, d) call check_int2(ne, 260, 3, n, GD_LINCOM_ENTRY) call check_int2(ne, 260, 4, ent%n_fields, 3) call check_int2(ne, 260, 5, ent%fragment_index, 0) call check_str2(ne, 260, 6, ent%field(1), 'in1') call check_str2(ne, 260, 7, ent%field(2), 'in4') call check_str2(ne, 260, 8, ent%field(3), 'in3') call check_int2(ne, 260, 9, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 260, 10, ent%scalar(1), '') call check_str2(ne, 260, 11, ent%scalar(2), 'const') call check_str2(ne, 260, 12, ent%scalar(3), 'const') call check_str2(ne, 260, 13, ent%scalar(4), 'carray') call check_str2(ne, 260, 14, ent%scalar(5), '') call check_str2(ne, 260, 15, ent%scalar(6), 'const') call check_int2(ne, 260, 16, ent%scalar_ind(2), -1) call check_int2(ne, 260, 16, ent%scalar_ind(3), -1) call check_int2(ne, 260, 17, ent%scalar_ind(4), 3) call check_int2(ne, 260, 19, ent%scalar_ind(6), -1) call check_cpx2(ne, 260, 20, ent%cm(1), dcmplx(9d0, 8d0)) call check_cpx2(ne, 260, 21, ent%cm(2), dcmplx(93d0, 0)) call check_cpx2(ne, 260, 22, ent%cm(3), dcmplx(93d0, 0)) call check_cpx2(ne, 260, 23, ent%cb(1), dcmplx(179d0, 0)) call check_cpx2(ne, 260, 24, ent%cb(2), dcmplx(180d0, 0)) call check_cpx2(ne, 260, 25, ent%cb(3), dcmplx(93d0, 0)) ! 261: fgd_alter_entry POLYNOM ent%field(1) = 'in3' ent%field_type = GD_POLYNOM_ENTRY ent%flags = 0 ent%a(1) = 2d0 ent%a(2) = 6d0 ent%scalar(1) = '' ent%scalar(2) = '' ent%scalar(3) = 'carray' ent%scalar_ind(3) = 5 call fgd_alter_entry(d, 'new244', ent, 8, 0) call check_ok2(ne, 261, 1, d) n = fgd_entry(d, 'new244', ent) call check_ok2(ne, 261, 2, d) call check_int2(ne, 261, 3, n, GD_POLYNOM_ENTRY) call check_int2(ne, 261, 4, ent%poly_ord, 3) call check_int2(ne, 261, 5, ent%fragment_index, 0) call check_str2(ne, 261, 6, ent%field(1), 'in3') call check_int2(ne, 261, 7, ent%flags, GD_EN_CALC) call check_dbl2(ne, 261, 8, ent%a(1), 2d0) call check_dbl2(ne, 261, 9, ent%a(2), 6d0) call check_dbl2(ne, 261, 10, ent%a(3), 15d0) call check_dbl2(ne, 261, 11, ent%a(4), 11d0) call check_str2(ne, 261, 12, ent%scalar(1), '') call check_str2(ne, 261, 13, ent%scalar(2), '') call check_str2(ne, 261, 14, ent%scalar(3), 'carray') call check_str2(ne, 261, 15, ent%scalar(4), '') call check_int2(ne, 261, 16, ent%scalar_ind(3), 5) ! 262: fgd_alter_entry CPOLYNOM ent%field_type = GD_POLYNOM_ENTRY ent%flags = GD_EN_COMPSCAL ent%ca(3) = dcmplx(26d0, 2d0) ent%scalar(1) = 'const' ent%scalar(2) = 'const' ent%scalar_ind(1) = -1 ent%scalar_ind(2) = -1 call fgd_alter_entry(d, 'new244', ent, 4, 0) call check_ok2(ne, 262, 1, d) n = fgd_entry(d, 'new244', ent) call check_ok2(ne, 262, 2, d) call check_int2(ne, 262, 3, n, GD_POLYNOM_ENTRY) call check_int2(ne, 262, 4, ent%poly_ord, 3) call check_int2(ne, 262, 5, ent%fragment_index, 0) call check_str2(ne, 262, 6, ent%field(1), 'in3') call check_int2(ne, 262, 7, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_cpx2(ne, 262, 8, ent%ca(1), dcmplx(93d0, 0)) call check_cpx2(ne, 262, 9, ent%ca(2), dcmplx(93d0, 0)) call check_cpx2(ne, 262, 10, ent%ca(3), dcmplx(26d0, 2d0)) call check_cpx2(ne, 262, 11, ent%ca(4), dcmplx(11d0, 0)) call check_str2(ne, 262, 12, ent%scalar(1), 'const') call check_str2(ne, 262, 13, ent%scalar(2), 'const') call check_str2(ne, 262, 14, ent%scalar(3), '') call check_str2(ne, 262, 15, ent%scalar(4), '') call check_int2(ne, 262, 16, ent%scalar_ind(1), -1) ! 263: fgd_alter_entry BIT ent%field_type = GD_BIT_ENTRY ent%scalar(1) = 'carray' ent%scalar_ind(1) = 6 call fgd_alter_entry(d, 'new246', ent, 2, 0) call check_ok2(ne, 263, 1, d) n = fgd_entry(d, 'new246', ent) call check_ok2(ne, 263, 2, d) call check_int2(ne, 263, 3, n, GD_BIT_ENTRY) call check_int2(ne, 263, 4, ent%fragment_index, 0) call check_int2(ne, 263, 5, ent%numbits, 93) call check_int2(ne, 263, 6, ent%bitnum, 16) call check_str2(ne, 263, 7, ent%field(1), 'in3') call check_str2(ne, 263, 8, ent%scalar(1), 'carray') call check_str2(ne, 263, 9, ent%scalar(2), '') ! 264: fgd_alter_entry SBIT ent%field_type = GD_SBIT_ENTRY ent%scalar(1) = 'carray' ent%scalar_ind(1) = 5 ent%numbits = 0 call fgd_alter_entry(d, 'new258', ent, 1, 0) call check_ok2(ne, 264, 1, d) n = fgd_entry(d, 'new258', ent) call check_ok2(ne, 264, 2, d) call check_int2(ne, 264, 3, n, GD_SBIT_ENTRY) call check_int2(ne, 264, 4, ent%fragment_index, 0) call check_int2(ne, 264, 5, ent%numbits, 93) call check_int2(ne, 264, 6, ent%bitnum, 16) call check_str2(ne, 264, 7, ent%field(1), 'in3') call check_str2(ne, 264, 8, ent%scalar(1), '') call check_str2(ne, 264, 9, ent%scalar(2), 'const') call check_int2(ne, 264, 10, ent%scalar_ind(2), -1) ! 265: fgd_alter_entry PHASE ent%field_type = GD_PHASE_ENTRY ent%field(1) = 'in2' ent%shift = -265 call fgd_alter_entry(d, 'new248', ent, 1, 0) call check_ok2(ne, 265, 1, d) n = fgd_entry(d, 'new248', ent) call check_ok2(ne, 265, 2, d) call check_int2(ne, 265, 1, n, GD_PHASE_ENTRY) call check_int2(ne, 265, 2, ent%fragment_index, 0) call check_int2(ne, 265, 3, ent%shift, -265) call check_str2(ne, 265, 4, ent%field(1), 'in2') call check_str2(ne, 265, 5, ent%scalar(1), '') ! 266: fgd_alter_entry RECIP ent%field_type = GD_RECIP_ENTRY ent%flags = 0 ent%field(1) = 'in5' ent%scalar(1) = 'carray' ent%scalar_ind(1) = 2 call fgd_alter_entry(d, 'new251', ent, 0, 0) call check_ok2(ne, 266, 1, d) n = fgd_entry(d, 'new251', ent) call check_ok2(ne, 266, 2, d) call check_int2(ne, 266, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 266, 4, ent%fragment_index, 0) call check_int2(ne, 266, 5, ent%flags, GD_EN_CALC) call check_str2(ne, 266, 6, ent%field(1), 'in5') call check_dbl2(ne, 266, 7, ent%dividend, 12d0) call check_str2(ne, 266, 8, ent%scalar(1), 'carray') call check_int2(ne, 266, 9, ent%scalar_ind(1), 2) ! 267: fgd_alter_entry CRECIP ent%field_type = GD_RECIP_ENTRY ent%field(1) = 'in4' ent%flags = GD_EN_COMPSCAL ent%cdividend = dcmplx(12d0, 14d0) call fgd_alter_entry(d, 'new251', ent, 15, 0) call check_ok2(ne, 267, 1, d) n = fgd_entry(d, 'new251', ent) call check_ok2(ne, 267, 2, d) call check_int2(ne, 267, 3, n, GD_RECIP_ENTRY) call check_int2(ne, 267, 4, ent%fragment_index, 0) call check_int2(ne, 267, 5, ent%flags, GD_EN_CALC + GD_EN_COMPSCAL) call check_str2(ne, 267, 6, ent%field(1), 'in4') call check_cpx2(ne, 267, 7, ent%cdividend, dcmplx(12d0, 14d0)) call check_str2(ne, 267, 8, ent%scalar(1), '') ! 268: fgd_alter_entry WINDOW ent%field_type = GD_WINDOW_ENTRY ent%field(1) = '' ent%field(2) = 'in4' ent%windop = GD_WINDOP_LT ent%scalar(1) = 'carray' ent%scalar_ind(1) = 3 call fgd_alter_entry(d, 'new253', ent, 0, 0) call check_ok2(ne, 268, 1, d) n = fgd_entry(d, 'new253', ent) call check_ok2(ne, 268, 2, d) call check_int2(ne, 268, 3, n, GD_WINDOW_ENTRY) call check_int2(ne, 268, 4, ent%fragment_index, 0) call check_int2(ne, 268, 5, ent%windop, GD_WINDOP_LT) call check_str2(ne, 268, 6, ent%field(1), 'in2') call check_str2(ne, 268, 7, ent%field(2), 'in4') call check_dbl2(ne, 268, 8, ent%rthreshold, 179d0) call check_str2(ne, 268, 9, ent%scalar(1), 'carray') call check_int2(ne, 268, 10, ent%scalar_ind(1), 3) ! 269: fgd_alter MPLEX ent%field_type = GD_MPLEX_ENTRY ent%field(1) = 'in0' ent%field(2) = '' ent%scalar(1) = '' ent%period = -1 call fgd_alter_entry(d, 'new254', ent, 2, 0) call check_ok2(ne, 269, 1, d) n = fgd_entry(d, 'new254', ent) call check_ok2(ne, 269, 2, d) call check_int2(ne, 269, 3, n, GD_MPLEX_ENTRY) call check_int2(ne, 269, 4, ent%fragment_index, 0) call check_int2(ne, 269, 5, ent%count_val, 179) call check_int2(ne, 269, 6, ent%period, 180) call check_str2(ne, 269, 7, ent%field(1), 'in0') call check_str2(ne, 269, 8, ent%field(2), 'in2') call check_str2(ne, 269, 9, ent%scalar(1), 'carray') call check_int2(ne, 269, 10, ent%scalar_ind(1), 3) call check_str2(ne, 269, 11, ent%scalar(2), '') ! 271: fgd_encoding_support n = fgd_encoding_support(GD_SIE_ENCODED) call check_int(ne, 271, n, GD_RDWR) ! 272: NULL return from gd_reference l = fgd_open(fildir//DIRSEP//'empty', GD_RDWR + GD_CREAT + GD_EXCL) call check_ok2(ne, 272, 1, l) str = fgd_reference(l, "") call check_ok2(ne, 272, 2, l) call check_str(ne, 272, str, '') call fgd_discard(l) !================================================================ call fgd_discard(d) call system ( 'rm -rf ' // fildir ) if (ne .GT. 0) then write(*, 9000) ne call exit(1) end if 9000 format('ne = ', i0) end program libgetdata-0.9.0/bindings/f77/test/gdcopn.f0000640000175000017500000000657512614323564020621 0ustar alastairalastairC Copyright (C) 2008, 2012, 2015 D. V. Wiebe C C CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC C C This file is part of the GetData project. C C GetData is free software; you can redistribute it and/or modify it under C the terms of the GNU Lesser General Public License as published by the C Free Software Foundation; either version 2.1 of the License, or (at your C option) any later version. C C GetData is distributed in the hope that it will be useful, but WITHOUT C ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or C FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public C License for more details. C C You should have received a copy of the GNU Lesser General Public License C along with GetData; if not, write to the Free Software Foundation, Inc., C 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA C C Callback test SUBROUTINE CALBCK(R, DUNIT, SUBERROR, LINE) INCLUDE "getdata.f" INTEGER R, DUNIT, SUBERROR CHARACTER*(GD_MLL) LINE C Tell the parser to ignore syntax errors R = GDSX_I END SUBROUTINE SUBROUTINE CALBK2(R, DUNIT, SUBERROR, LINE) INTEGER R C An invalid response R = 3333 END SUBROUTINE PROGRAM GETTST IMPLICIT NONE EXTERNAL CALBCK EXTERNAL CALBK2 INCLUDE "getdata.f" CHARACTER*12 fildir PARAMETER (fildir = 'test_dirfile') CHARACTER*19 frmat PARAMETER (frmat = 'test_dirfile/format') CHARACTER*20 frmat2 PARAMETER (frmat2 = 'test_dirfile/format2') CHARACTER*20 frmat3 PARAMETER (frmat3 = 'test_dirfile/format3') CHARACTER*17 dat PARAMETER (dat = 'test_dirfile/data') INTEGER*1 datdat(80) INTEGER*1 i INTEGER d INTEGER e1, e2, e3, e4 INTEGER r r = 0 CALL SYSTEM ( 'rm -rf ' // fildir ) CALL SYSTEM ( 'mkdir ' // fildir ) DO 20 i = 1, 80 datdat(i) = i 20 CONTINUE OPEN(1, FILE=frmat, STATUS='NEW') WRITE(1, *) "data RAW INT 8" WRITE(1, *) "bad line" CLOSE(1, STATUS='KEEP') OPEN(1, FILE=frmat2, STATUS='NEW') WRITE(1, *) "bad line2" CLOSE(1, STATUS='KEEP') OPEN(1, FILE=frmat3, STATUS='NEW') WRITE(1, *) "bad line3" CLOSE(1, STATUS='KEEP') OPEN(1, FILE=dat, FORM='UNFORMATTED', ACCESS='DIRECT', RECL=80, +STATUS='NEW') WRITE (1,REC=1) datdat CLOSE(1, STATUS='KEEP') CALL GDCOPN(d, fildir, 12, GD_RW, CALBCK) CALL GDEROR(e1, d) IF (e1 .NE. GD_EOK) THEN r = 1 WRITE(*, 9001) 1, e1, GD_EOK ENDIF CALL GDINCL(d, "format2", 7, 0, 0) CALL GDEROR(e2, d) IF (e2 .NE. GD_EOK) THEN r = 1 WRITE(*, 9001) 2, e2, GD_EOK ENDIF C Change callback CALL GDCLBK(d, CALBK2) CALL GDINCL(d, "format3", 7, 0, 0) CALL GDEROR(e3, d) IF (e3 .NE. GD_ECB) THEN r = 1 WRITE(*, 9001) 3, e3, GD_ECB ENDIF C Delete callback CALL GDNOCB(d) CALL GDINCL(d, "format3", 7, 0, 0) CALL GDEROR(e4, d) IF (e4 .NE. GD_EFO) THEN r = 1 WRITE(*, 9001) 3, e4, GD_EFO ENDIF CALL GDDSCD(d) CALL SYSTEM ( 'rm -rf ' // fildir ) IF (r .GT. 0) CALL ExIT(1) 9001 FORMAT('e[', i3, '] = ', i4, ', expected ', i4) STOP END libgetdata-0.9.0/bindings/f77/Makefile.am0000640000175000017500000000544412614323564020247 0ustar alastairalastair# Copyright (C) 2008-2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SED = @SED@ DIFF = @DIFF@ if MAKE_F95BINDINGS F95_INC=getdata.mod F95_LIB=libf95getdata.la endif FCFLAGS += $(GD_FC_WALL) $(GD_FC_WEXTRA) EXTRA_DIST=getdata.f.in getdata.f90.in SUBDIRS = test BUILT_SOURCES=getdata.f $(F95_INC) LIBS= nodist_include_HEADERS=getdata.f $(F95_INC) lib_LTLIBRARIES=libfgetdata.la $(F95_LIB) libfgetdata_la_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src libfgetdata_la_SOURCES = fgetdata.c fgetdata.h libfgetdata_la_LIBADD=../../src/libgetdata.la libfgetdata_la_LDFLAGS = -version-info @FGETDATA_VERSION@ nodist_libf95getdata_la_SOURCES=getdata.f90 libf95getdata_la_LIBADD=libfgetdata.la libf95getdata_la_LDFLAGS = -version-info @F95GETDATA_VERSION@ getdata.mod: getdata.o clean-local: rm -rf getdata.mod make_parameters.sed.in make_parameters.stamp \ make_parameters.sed getdata.f getdata.f90 getdata.mod rm -rf *~ make_parameters.sed.in: ../make_parameters ../../src/getdata.h ../make_parameters f > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters make_parameters.sed: make_parameters.stamp @if test ! -f $@; then \ rm -f make_parameters.stamp; \ $(MAKE) make_parameters.stamp; \ fi if HAVE_DIFF make_parameters.stamp: make_parameters.sed.in @if $(DIFF) make_parameters.sed make_parameters.sed.in >/dev/null 2>&1; then \ echo "make_parameters.sed is unchanged"; \ else \ rm -f make_parameters.sed; \ cp make_parameters.sed.in make_parameters.sed; \ fi; \ touch make_parameters.stamp else make_parameters.stamp: make_parameters.sed.in @rm -f make_parameters.sed; \ cp make_parameters.sed.in make_parameters.sed; \ touch make_parameters.stamp endif getdata.f: $(srcdir)/getdata.f.in make_parameters.sed rm -f $@ $(SED) -f make_parameters.sed $(srcdir)/getdata.f.in > $@ chmod a-w $@ getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed rm -f $@ $(SED) -f make_parameters.sed $(srcdir)/getdata.f90.in > $@ chmod a-w $@ libgetdata-0.9.0/bindings/f77/fgetdata.h0000640000175000017500000013453312614323564020145 0ustar alastairalastair/* Copyright (C) 2008, 2010, 2012-2014 D. V. Wiebe * ************************************************************************* * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef FGETDATA_H #define FGETDATA_H #include "internal.h" /* If F77_FUNC isn't defined, we have no knowledge of the F77 mangling scheme */ #ifndef F77_FUNC # error The F77_FUNC macro must be defined to build the F77 bindings #endif /* disable the "unspecified order" remark in ICC */ #ifdef __INTEL_COMPILER # pragma warning (disable : 981) #endif #define GDF_N_DIRFILES 1024 #endif #ifdef __cplusplus extern "C" { #endif typedef void(*_GDF_callback_t)(int32_t*, const int32_t*, const int32_t*, char*, const int32_t*, const char*); /* Forward declarations to keep icc happy */ void F77_FUNC(gdopen, GDOPEN) (int32_t *dirfile, const char *dirfilename, const int32_t *dirfilename_l, const int32_t *flags); void F77_FUNC(gdclos, GDCLOS) (const int32_t *dirfile); void F77_FUNC(gdflsh, GDFLSH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgetd, GDGETD) (int32_t *n_read, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *first_frame, const int32_t *first_sample, const int32_t *num_frames, const int32_t *num_samples, const int32_t *return_type, void *data_out); void F77_FUNC(gdfdnx, GDFDNX) (int32_t *max, const int32_t *dirfile); void F77_FUNC(gdfldn, GDFLDN) (char *name, int32_t *name_l, const int32_t *dirfile, const int32_t *field_num); void F77_FUNC(gdnfld, GDNFLD) (int32_t *nfields, const int32_t *dirfile); void F77_FUNC(gdnfrm, GDNFRM) (int32_t *nframes, const int32_t *dirfile); void F77_FUNC(gdgspf, GDGSPF) (int32_t *spf, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdputd, GDPUTD) (int32_t *n_wrote, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *first_frame, const int32_t *first_sample, const int32_t *num_frames, const int32_t *num_samples, const int32_t *data_type, const void *data_in); void F77_FUNC(gderor, GDEROR) (int32_t *error, const int32_t *dirfile); void F77_FUNC(gdestr, GDESTR) (const int32_t *dirfile, char *buffer, const int32_t *len); void F77_FUNC(gdenty, GDENTY) (int32_t *type, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgecl, GDGECL) (int32_t *nfields, char *infield1, int32_t *infield1_l, GD_DCOMPLEXP(m1), GD_DCOMPLEXP(b1), char *infield2, int32_t *infield2_l, GD_DCOMPLEXP(m2), GD_DCOMPLEXP(b2), char *infield3, int32_t *infield3_l, GD_DCOMPLEXP(m3), GD_DCOMPLEXP(b3), int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgecp, GDGECP) (int32_t *poly_ord, char *infield, int32_t *infield_l, GD_DCOMPLEXP(a0), GD_DCOMPLEXP(a1), GD_DCOMPLEXP(a2), GD_DCOMPLEXP(a3), GD_DCOMPLEXP(a4), GD_DCOMPLEXP(a5), int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgerw, GDGERW) (int32_t *spf, int32_t *dtype, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgelc, GDGELC) (int32_t *nfields, char *infield1, int32_t *infield1_l, double *m1, double *b1, char *infield2, int32_t *infield2_l, double *m2, double *b2, char *infield3, int32_t *infield3_l, double *m3, double *b3, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgepn, GDGEPN) (int32_t *nfields, char *infield, int32_t *infield_l, double *a0, double *a1, double *a2, double *a3, double *a4, double *a5, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgelt, GDGELT) (char *in_field, int32_t *in_field_l, char *table, int32_t *table_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgebt, GDGEBT) (char *in_field, int32_t *in_field_l, int32_t *bitnum, int32_t *numbits, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgesb, GDGESB) (char *in_field, int32_t *in_field_l, int32_t *bitnum, int32_t *numbits, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgemt, GDGEMT) (char *in_field1, int32_t *in_field1_l, char *in_field2, int32_t *in_field2_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgeph, GDGEPH) (char *in_field, int32_t *in_field_l, int32_t *shift, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdadrw, GDADRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const int32_t *fragment_index); void F77_FUNC(gdadlc, GDADLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const double *b1, const char *in_field2, const int32_t *in_field2_l, const double *m2, const double *b2, const char *in_field3, const int32_t *in_field3_l, const double *m3, const double *b3, const int32_t *fragment_index); void F77_FUNC(gdadpn, GDADPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const double *a1, const double *a2, const double *a3, const double *a4, const double *a5, const int32_t *fragment_index); void F77_FUNC(gdadlt, GDADLT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *table, const int32_t *table_l, const int32_t *fragment_index); void F77_FUNC(gdadbt, GDADBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits, const int32_t *fragment_index); void F77_FUNC(gdadmt, GDADMT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l, const int32_t *fragment_index); void F77_FUNC(gdadph, GDADPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift, const int32_t *fragment_index); void F77_FUNC(gdfrgn, GDFRGN) (char *filename, int32_t *filename_l, const int32_t *dirfile, const int32_t *index); void F77_FUNC(gdnfrg, GDNFRG) (int32_t *nformats, const int32_t *dirfile); void F77_FUNC(gdmfls, GDMFLS) (const int32_t *dirfile); void F77_FUNC(gdincl, GDINCL) (const int32_t *dirfile, const char *file, const int32_t *file_l, const int32_t *fragment_index, const int32_t *flags); void F77_FUNC(gdnfdt, GDNFDT) (int32_t *nfields, const int32_t *dirfile, const int32_t *type); void F77_FUNC(gdnvec, GDNVEC) (int32_t *nvectors, const int32_t *dirfile); void F77_FUNC(gdfdnt, GDFDNT) (char *name, int32_t *name_l, const int32_t *dirfile, const int32_t *type, const int32_t *field_num); void F77_FUNC(gdvecn, GDVECN) (char *name, int32_t *name_l, const int32_t *dirfile, const int32_t *field_num); void F77_FUNC(gdmdlc, GDMDLC) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const double *b1, const char *in_field2, const int32_t *in_field2_l, const double *m2, const double *b2, const char *in_field3, const int32_t *in_field3_l, const double *m3, const double *b3); void F77_FUNC(gdmdpn, GDMDPN) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const double *a1, const double *a2, const double *a3, const double *a4, const double *a5); void F77_FUNC(gdmdlt, GDMDLT) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *table, const int32_t *table_l); void F77_FUNC(gdmdbt, GDMDBT) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits); void F77_FUNC(gdmdsb, GDMDSB) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits); void F77_FUNC(gdmdmt, GDMDMT) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l); void F77_FUNC(gdmdph, GDMDPH) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift); void F77_FUNC(gdadco, GDADCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *data_type, const void *value, const int32_t *fragment_index); void F77_FUNC(gdmdco, GDMDCO) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *data_type, const void *value); void F77_FUNC(gdadst, GDADST) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *value, const int32_t *value_l, const int32_t *fragment_index); void F77_FUNC(gdmdst, GDMDST) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *value, const int32_t *value_l); void F77_FUNC(gdadsp, GDADSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const int32_t *fragment_index); void F77_FUNC(gdmdsp, GDMDSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const char *parent, const int32_t *parent_l); void F77_FUNC(gdfrgi, GDFRGI) (int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgtco, GDGTCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *return_type, void *data_out); void F77_FUNC(gdgtca, GDGTCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *return_type, void *data_out); void F77_FUNC(gdcaln, GDCALN) (int32_t *len, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgcas, GDGCAS) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *start, const int32_t *n, const int32_t *return_type, void *data_out); void F77_FUNC(gdgtst, GDGTST) (int32_t *size, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *len, char *data_out); void F77_FUNC(gdptco, GDPTCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const void *data_in); void F77_FUNC(gdptca, GDPTCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const void *data_in); void F77_FUNC(gdptst, GDPTST) (int32_t *n_read, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *len, const char *data_out); void F77_FUNC(gdnmfd, GDNMFD) (int32_t *nfields, const int32_t *dirfile, const char *parent, const int32_t *parent_l); void F77_FUNC(gdnmft, GDNMFT) (int32_t *nfields, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type); void F77_FUNC(gdnmve, GDNMVE) (int32_t *nvectors, const int32_t *dirfile, const char *parent, const int32_t *parent_l); void F77_FUNC(gdgeco, GDGECO) (int32_t *data_type, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdmfnx, GDMFNX) (int32_t *max, const int32_t *dirfile, const char *parent, const int32_t *parent_l); void F77_FUNC(gdmfdn, GDMFDN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *field_num); void F77_FUNC(gdmfdt, GDMFDT) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *field_num); void F77_FUNC(gdmven, GDMVEN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *field_num); void F77_FUNC(gddscd, GDDSCD) (const int32_t *dirfile); void F77_FUNC(gdcopn, GDCOPN) (int32_t *dirfile, const char *dirfilename, const int32_t *dirfilename_l, const int32_t *flags, const _GDF_callback_t callback); void F77_FUNC(gdclbk, GDCLBK) (const int32_t *dirfile, const _GDF_callback_t callback); void F77_FUNC(gdalbt, GDALBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits); void F77_FUNC(gdalco, GDALCO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type); void F77_FUNC(gdalca, GDALCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *array_len); void F77_FUNC(gdallc, GDALLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const double *b1, const char *in_field2, const int32_t *in_field2_l, const double *m2, const double *b2, const char *in_field3, const int32_t *in_field3_l, const double *m3, const double *b3); void F77_FUNC(gdalpn, GDALPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const double *a1, const double *a2, const double *a3, const double *a4, const double *a5); void F77_FUNC(gdalmt, GDALMT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l); void F77_FUNC(gdalph, GDALPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift); void F77_FUNC(gdgenc, GDGENC) (int32_t *encoding, const int32_t *dirfile, const int32_t *fragment); void F77_FUNC(gdgend, GDGEND) (int32_t *endianness, const int32_t *dirfile, const int32_t *fragment); void F77_FUNC(gdname, GDNAME) (char *name, int32_t *name_l, const int32_t *dirfile); void F77_FUNC(gdpfrg, GDPFRG) (int32_t *parent, const int32_t *dirfile, const int32_t *fragment); void F77_FUNC(gdprot, GDPROT) (const int32_t *dirfile, const int32_t *fragment, const int32_t *protection_level); void F77_FUNC(gdgprt, GDGPRT) (int32_t *protection_level, const int32_t *dirfile, const int32_t *fragment); void F77_FUNC(gdrwfn, GDRWFN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdrefe, GDREFE) (char *name, int32_t *name_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdaenc, GDAENC) (const int32_t *dirfile, const int32_t *encoding, const int32_t *fragment, const int32_t *recode); void F77_FUNC(gdaend, GDAEND) (const int32_t *dirfile, const int32_t *endianness, const int32_t *fragment, const int32_t *recode); void F77_FUNC(gdallt, GDALLT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *table, const int32_t *table_l, const int32_t *recode); void F77_FUNC(gdalrw, GDALRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const int32_t *recode); void F77_FUNC(gdalsp, GDALSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const int32_t *fragment_index); void F77_FUNC(gddele, GDDELE) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *flags); void F77_FUNC(gdmlsp, GDMLSP) (const int32_t *dirfile, const char *spec, const int32_t *spec_l, const char *parent, const int32_t *parent_l, const int32_t *recode); void F77_FUNC(gdmove, GDMOVE) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *new_fragment, const int32_t *move_data); void F77_FUNC(gdrenm, GDRENM) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *new_name, const int32_t *new_name_l, const int32_t *move_data); void F77_FUNC(gduinc, GDUINC) (const int32_t *dirfile, const int32_t *fragment, const int32_t *del); void F77_FUNC(gdafof, GDAFOF) (const int32_t *dirfile, const int32_t *offset, const int32_t *fragment, const int32_t *recode); void F77_FUNC(gdgfof, GDGFOF) (int32_t *offset, const int32_t *dirfile, const int32_t *fragment); void F77_FUNC(gdadcl, GDADCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3), const int32_t *fragment_index); void F77_FUNC(gdadcp, GDADCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1), const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5), const int32_t *fragment_index); void F77_FUNC(gdmdcl, GDMDCL) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3)); void F77_FUNC(gdmdcp, GDMDCP) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1), const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5)); void F77_FUNC(gdntyp, GDNTYP) (int32_t *type, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdalcl, GDALCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const GD_DCOMPLEXP(b1), const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const GD_DCOMPLEXP(b2), const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3)); void F77_FUNC(gdalcp, GDALCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const GD_DCOMPLEXP(a1), const GD_DCOMPLEXP(a2), const GD_DCOMPLEXP(a3), const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5)); void F77_FUNC(gdenfl, GDENFL) (int32_t *flags, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdvldt, GDVLDT) (int32_t *valid, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdfnum, GDFNUM) (double *framenum, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const double *value); void F77_FUNC(gdfnss, GDFNSS) (double *framenum, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const double *value, const int32_t *start, const int32_t *end); void F77_FUNC(gdgsca, GDGSCA) (char *scalar, int32_t *scalar_l, int32_t *scalar_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *index); void F77_FUNC(gdasca, GDASCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *index, const char *scalar, const int32_t *scalar_l, int32_t *scalar_index, int32_t *recode); void F77_FUNC(gdalsb, GDALSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits); void F77_FUNC(gdadsb, GDADSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const int32_t *numbits, const int32_t *fragment_index); void F77_FUNC(gdinvd, GDINVD) (int32_t *dirfile); void F77_FUNC(gdstdv, GDSTDV) (int32_t *vers, const int32_t *dirfile); void F77_FUNC(gdgbof, GDGBOF) (int32_t *bof, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgeof, GDGEOF) (int32_t *eof, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgedv, GDGEDV) (char *in_field1, int32_t *in_field1_l, char *in_field2, int32_t *in_field2_l, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgerc, GDGERC) (char *in_field, int32_t *in_field_l, double *dividend, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdgecr, GDGECR) (char *in_field, int32_t *in_field_l, GD_DCOMPLEXP(cdividend), int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdaddv, GDADDV) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l, const int32_t *fragment_index); void F77_FUNC(gdadrc, GDADRC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const int32_t *fragment_index); void F77_FUNC(gdadcr, GDADCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *cdividend, const int32_t *fragment_index); void F77_FUNC(gdmddv, GDMDDV) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l); void F77_FUNC(gdrfrg, GDRFRG) (const int32_t *dirfile, const int32_t *fragment); void F77_FUNC(gdmdrc, GDMDRC) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend); void F77_FUNC(gdmdcr, GDMDCR) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(cdividend)); void F77_FUNC(gdaldv, GDALDV) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const char *in_field2, const int32_t *in_field2_l); void F77_FUNC(gdalrc, GDALRC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const double *dividend); void F77_FUNC(gdalcr, GDALCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(cdividend)); void F77_FUNC(gdaprt, GDAPRT) (const int32_t *dirfile, const int32_t *protection_level, const int32_t *fragment); void F77_FUNC(gdgeca, GDGECA) (int32_t *data_type, int32_t *array_len, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdadca, GDADCA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, int32_t *array_len, const int32_t *data_type, const void *value, const int32_t *fragment_index); void F77_FUNC(gdmdca, GDMDCA) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const int32_t *const_type, const int32_t *array_len, const int32_t *data_type, const void *value); void F77_FUNC(gdpcas, GDPCAS) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *start, const int32_t *n, const int32_t *data_type, const void *data_in); void F77_FUNC(gdseek, GDSEEK) (int32_t *pos, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *frame_num, const int32_t *sample_num, const int32_t *flags); void F77_FUNC(gdtell, GDTELL) (int32_t *pos, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdcons, GDCONS) (void *value, const int32_t *dirfile, const int32_t *return_type, const int32_t *field_num); void F77_FUNC(gdmcos, GDMCOS) (void *value, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *return_type, const int32_t *field_num); void F77_FUNC(gdstrs, GDSTRS) (char *value, int32_t *value_l, const int32_t *dirfile, const int32_t *field_num); void F77_FUNC(gdmsts, GDMSTS) (void *value, int32_t *value_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *field_num); void F77_FUNC(gdstrx, GDSTRX) (int32_t *max, const int32_t *dirfile); void F77_FUNC(gdmstx, GDMSTX) (int32_t *max, const int32_t *dirfile, const char *parent, const int32_t *parent_l); void F77_FUNC(gdadwd, GDADWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold, const int32_t *fragment_index); void F77_FUNC(gdmdwd, GDMDWD) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold); void F77_FUNC(gdalwd, GDALWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold); void F77_FUNC(gdadmx, GDADMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const int32_t *period, const int32_t *fragment_index); void F77_FUNC(gdmdmx, GDMDMX) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const int32_t *period); void F77_FUNC(gdalmx, GDALMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const int32_t *period); void F77_FUNC(gdsync, GDSYNC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdrclo, GDRCLO) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdinca, GDINCA) (const int32_t *dirfile, const char *file, const int32_t *file_l, const int32_t *fragment_index, const char *prefix, const int32_t *prefix_l, const char *suffix, const int32_t *suffix_l, const int32_t *flags); void F77_FUNC(gdmova, GDMOVA) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *new_fragment); void F77_FUNC(gdmdal, GDMDAL) (const int32_t *dirfile, const char *parent, const int32_t *parent_l, const char *field_code, const int32_t *field_code_l, const char *target, const int32_t *target_l); void F77_FUNC(gduhid, GDUHID) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdhide, GDHIDE) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdhidn, GDHIDN) (int32_t *result, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdfraf, GDFRAF) (char *prefix, int32_t *prefix_l, char *suffix, int32_t *suffix_l, const int32_t *dirfile, const int32_t *index); void F77_FUNC(gdaafx, GDAAFX) (const int32_t *dirfile, const int32_t *index, const char *prefix, const int32_t *prefix_l, const char *suffix, const int32_t *suffix_l); void F77_FUNC(gdalss, GDALSS) (char *alias, int32_t *alias_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *num); void F77_FUNC(gdnals, GDNALS) (int32_t *nalias, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdalsx, GDALSX) (int32_t *max, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdatrg, GDATRG) (char *target, int32_t *target_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdadal, GDADAL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *target, const int32_t *target_l, const int32_t *fragment_index); void F77_FUNC(gdnocb, GDNOCB) (const int32_t *dirfile); void F77_FUNC(gddsyn, GDDSYN) (int32_t *desync, const int32_t *dirfile, const int32_t *flags); void F77_FUNC(gdflag, GDFLAG) (int32_t *flags, const int32_t *dirfile, const int32_t *set, const int32_t *reset); void F77_FUNC(gdvbpx, GDVBPX) (const int32_t *dirfile, const char *prefix, const int32_t *prefix_l); void F77_FUNC(gdmxlb, GDMXLB) (const int32_t *dirfile, const int32_t *lookback); void F77_FUNC(gdnent, GDNENT) (int32_t *nentries, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *flags); void F77_FUNC(gdentx, GDENTX) (int32_t *max, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *flags); void F77_FUNC(gdentn, GDENTN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *parent, const int32_t *parent_l, const int32_t *type, const int32_t *flags, const int32_t *field_num); void F77_FUNC(gdgewd, GDGEWD) (char *in_field, int32_t *in_field_l, char *check_field, int32_t *check_field_l, int32_t *windop, int32_t *ithreshold, double *rthreshold, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdecnt, GDECNT) (int32_t *error_count, const int32_t *dirfile); void F77_FUNC(gdtoke, GDTOKE) (char *toke, int32_t *toke_l, const int32_t *dirfile, const char *string, const int32_t *string_l); void F77_FUNC(gdgemx, GDGEMX) (char *in_field, int32_t *in_field_l, char *count_field, int32_t *count_field_l, int32_t *val, int32_t *period, int32_t *fragment_index, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdlttn, GDLTTN) (char *name, int32_t *name_l, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdasrw, GDASRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const char *spf_scalar, const int32_t *spf_scalar_l, const int32_t *spf_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdasbt, GDASBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdaslc, GDASLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1, const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const double *m2, const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2, const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const double *m3, const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3, const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdascl, GDASCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdasph, GDASPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift, const char *shift_scalar, const int32_t *shift_scalar_l, const int32_t *shift_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdaswd, GDASWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold, const char *threshold_scalar, const int32_t *threshold_scalar_l, const int32_t *threshold_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdasmx, GDASMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const char *val_scalar, const int32_t *val_scalar_l, const int32_t *val_scalar_ind, const int32_t *period, const char *period_scalar, const int32_t *period_scalar_l, const int32_t *period_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdasrc, GDASCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const char *dividend_scalar, const int32_t *dividend_scalar_l, const int32_t *dividend_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdlsrw, GDLSRW) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *data_type, const int32_t *spf, const char *spf_scalar, const int32_t *spf_scalar_l, const int32_t *spf_scalar_ind, const int32_t *recode); void F77_FUNC(gdlsbt, GDLSBT) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind); void F77_FUNC(gdlslc, GDLSLC) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const double *m1, const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const double *b1, const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const double *m2, const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const double *b2, const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const double *m3, const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const double *b3, const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind); void F77_FUNC(gdlscl, GDLSCL) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *n_fields, const char *in_field1, const int32_t *in_field1_l, const GD_DCOMPLEXP(m1), const char *m1_scalar, const int32_t *m1_scalar_l, const int32_t *m1_scalar_ind, const GD_DCOMPLEXP(b1), const char *b1_scalar, const int32_t *b1_scalar_l, const int32_t *b1_scalar_ind, const char *in_field2, const int32_t *in_field2_l, const GD_DCOMPLEXP(m2), const char *m2_scalar, const int32_t *m2_scalar_l, const int32_t *m2_scalar_ind, const GD_DCOMPLEXP(b2), const char *b2_scalar, const int32_t *b2_scalar_l, const int32_t *b2_scalar_ind, const char *in_field3, const int32_t *in_field3_l, const GD_DCOMPLEXP(m3), const char *m3_scalar, const int32_t *m3_scalar_l, const int32_t *m3_scalar_ind, const GD_DCOMPLEXP(b3), const char *b3_scalar, const int32_t *b3_scalar_l, const int32_t *b3_scalar_ind); void F77_FUNC(gdlsph, GDLSPH) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *shift, const char *shift_scalar, const int32_t *shift_scalar_l, const int32_t *shift_scalar_ind); void F77_FUNC(gdlswd, GDLSWD) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *check_field, const int32_t *check_field_l, const int32_t *windop, const void *threshold, const char *threshold_scalar, const int32_t *threshold_scalar_l, const int32_t *threshold_scalar_ind); void F77_FUNC(gdlsmx, GDLSMX) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const char *count_field, const int32_t *count_field_l, const int32_t *val, const char *val_scalar, const int32_t *val_scalar_l, const int32_t *val_scalar_ind, const int32_t *period, const char *period_scalar, const int32_t *period_scalar_l, const int32_t *period_scalar_ind); void F77_FUNC(gdlsrc, GDLSCR) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const double *dividend, const char *dividend_scalar, const int32_t *dividend_scalar_l, const int32_t *dividend_scalar_ind); void F77_FUNC(gdencs,GDENCS) (int32_t *ret, const int32_t *encoding); void F77_FUNC(gdarln, GDARLN) (int32_t *len, const int32_t *dirfile, const char *field_code, const int32_t *field_code_l); void F77_FUNC(gdaspn, GDASPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const double *a1, const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const double *a3, const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const double *a5, const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdascp, GDASCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdassb, GDASSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind, const int32_t *fragment_index); void F77_FUNC(gdlspn, GDLSPN) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const double *a0, const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const double *a1, const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const double *a2, const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const double *a3, const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const double *a4, const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const double *a5, const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind); void F77_FUNC(gdlscp, GDLSCP) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const int32_t *poly_ord, const char *in_field, const int32_t *in_field_l, const GD_DCOMPLEXP(a0), const char *a0_scalar, const int32_t *a0_scalar_l, const int32_t *a0_scalar_ind, const GD_DCOMPLEXP(a1), const char *a1_scalar, const int32_t *a1_scalar_l, const int32_t *a1_scalar_ind, const GD_DCOMPLEXP(a2), const char *a2_scalar, const int32_t *a2_scalar_l, const int32_t *a2_scalar_ind, const GD_DCOMPLEXP(a3), const char *a3_scalar, const int32_t *a3_scalar_l, const int32_t *a3_scalar_ind, const GD_DCOMPLEXP(a4), const char *a4_scalar, const int32_t *a4_scalar_l, const int32_t *a4_scalar_ind, const GD_DCOMPLEXP(a5), const char *a5_scalar, const int32_t *a5_scalar_l, const int32_t *a5_scalar_ind); void F77_FUNC(gdlssb, GDLSSB) (const int32_t *dirfile, const char *field_code, const int32_t *field_code_l, const char *in_field, const int32_t *in_field_l, const int32_t *bitnum, const char *bitnum_scalar, const int32_t *bitnum_scalar_l, const int32_t *bitnum_scalar_ind, const int32_t *numbits, const char *numbits_scalar, const int32_t *numbits_scalar_l, const int32_t *numbits_scalar_ind); #ifdef __cplusplus } #endif libgetdata-0.9.0/bindings/php/0000740000175000017500000000000012614323564016366 5ustar alastairalastairlibgetdata-0.9.0/bindings/php/Makefile.in0000640000175000017500000007104112614323564020440 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/php DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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)$(phpdir)" LTLIBRARIES = $(php_LTLIBRARIES) getdata_la_DEPENDENCIES = ../../src/libgetdata.la am_getdata_la_OBJECTS = getdata.lo nodist_getdata_la_OBJECTS = constants.lo getdata_la_OBJECTS = $(am_getdata_la_OBJECTS) \ $(nodist_getdata_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 = getdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(getdata_la_LDFLAGS) $(LDFLAGS) -o $@ 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)/src 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 = $(getdata_la_SOURCES) $(nodist_getdata_la_SOURCES) DIST_SOURCES = $(getdata_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2013, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # php_LTLIBRARIES = getdata.la AM_CFLAGS = ${WALL} ${WEXTRA} AM_CPPFLAGS = -I$(top_srcdir)/src ${CPPFLAGS} ${PHP_CPPFLAGS} getdata_la_LDFLAGS = -module -avoid-version -shared ${PHP_LDFLAGS} getdata_la_LIBADD = ${PHP_LIBS} ../../src/libgetdata.la getdata_la_SOURCES = getdata.c php_getdata.h nodist_getdata_la_SOURCES = constants.c BUILT_SOURCES = constants.c SUBDIRS = . test all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .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 bindings/php/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/php/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-phpLTLIBRARIES: $(php_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(php_LTLIBRARIES)'; test -n "$(phpdir)" || 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)$(phpdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(phpdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(phpdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(phpdir)"; \ } uninstall-phpLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(php_LTLIBRARIES)'; test -n "$(phpdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(phpdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(phpdir)/$$f"; \ done clean-phpLTLIBRARIES: -test -z "$(php_LTLIBRARIES)" || rm -f $(php_LTLIBRARIES) @list='$(php_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}; \ } getdata.la: $(getdata_la_OBJECTS) $(getdata_la_DEPENDENCIES) $(EXTRA_getdata_la_DEPENDENCIES) $(AM_V_CCLD)$(getdata_la_LINK) -rpath $(phpdir) $(getdata_la_OBJECTS) $(getdata_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constants.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdata.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 -o $@ $< .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 -o $@ `$(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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(phpdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool clean-local clean-phpLTLIBRARIES \ 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-phpLTLIBRARIES 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: uninstall-phpLTLIBRARIES .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool clean-local \ clean-phpLTLIBRARIES cscopelist-am ctags ctags-am 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-phpLTLIBRARIES 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-am uninstall uninstall-am uninstall-phpLTLIBRARIES constants.c: ../make_parameters ../../src/getdata.h ../make_parameters h > $@ ../make_parameters: ../make_parameters.c ../../src/gd_config.h cd .. && ${MAKE} make_parameters clean-local: rm -rf *~ ${BUILT_SOURCES} # 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: libgetdata-0.9.0/bindings/php/php_getdata.h0000640000175000017500000000333012614323564021020 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef PHP_GETDATA_H #define PHP_GETDATA_H #include "php.h" #include "php_ini.h" #include "ext/standard/info.h" /* undefine cruft */ #undef NDEBUG #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_URL #undef PACKAGE_VERSION #undef restrict #include "internal.h" extern zend_module_entry getdata_module_entry; #define phpext_getdata_ptr &getdata_module_entry #ifdef PHP_WIN32 # define PHP_GETDATA_API __declspec(dllexport) #elif defined(__GNUC__) && __GNUC__ >= 4 # define PHP_GETDATA_API __attribute__ ((visibility("default"))) #else # define PHP_GETDATA_API #endif #ifdef ZTS #include "TSRM.h" #endif #ifndef PHP_FE_END #define PHP_FE_END ZEND_FE_END #endif #ifndef ZEND_FE_END #define ZEND_FE_END { NULL, NULL, NULL, 0, 0 } #endif void gdphp_register_constants(int module_number); #endif libgetdata-0.9.0/bindings/php/test/0000740000175000017500000000000012614323564017345 5ustar alastairalastairlibgetdata-0.9.0/bindings/php/test/Makefile.in0000640000175000017500000005025112614323564021417 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/php/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2013, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests @TEST_PHP_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} \ @TEST_PHP_TRUE@ ${PHP} -n -d "output_handler=" -d "open_basedir=" -d "safe_mode=0" \ @TEST_PHP_TRUE@ -d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" \ @TEST_PHP_TRUE@ -d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" \ @TEST_PHP_TRUE@ -d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" \ @TEST_PHP_TRUE@ -d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" \ @TEST_PHP_TRUE@ -d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" \ @TEST_PHP_TRUE@ -d "auto_append_file=" -d "magic_quotes_runtime=0" \ @TEST_PHP_TRUE@ -d "ignore_repeated_errors=0" -d "precision=14" -d "memory_limit=128M" \ @TEST_PHP_TRUE@ -d "extension_dir=@top_builddir@/bindings/php/.libs" \ @TEST_PHP_TRUE@ -d "extension=getdata.so" -d "session.auto_start=0" -f @TEST_PHP_TRUE@phpTESTS = big_test.php @TEST_PHP_TRUE@TESTS = $(addprefix ${srcdir}/,$(phpTESTS)) EXTRA_DIST = ${phpTESTS} all: all-am .SUFFIXES: $(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 bindings/php/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/php/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: $(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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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-TESTS check-local 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 clean-local 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: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am check-local clean \ clean-generic clean-libtool clean-local cscopelist-am ctags-am \ 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 tags-am uninstall \ uninstall-am # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: echo rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ # 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: libgetdata-0.9.0/bindings/php/test/big_test.php0000640000175000017500000013702112614323564021664 0ustar alastairalastair 35., 0 => 33, 3 => array(36, 0), 4 => array(37, 0))); check_ok2(35, 1, $D); check_var2(35, 2, $v, 5); $v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8, TRUE); check_ok2(35, 3, $D); check_var2(35, 4, $v, array(41, 33, 0, 35, 36, 37, 47, 48)); # 37: putdata (complex) $v = gd_putdata($D, 'data', 5, 1, GD_COMPLEX128, array(53, 54., array(55., 0), array(56, 0))); check_ok2(37, 1, $D); check_var2(37, 2, $v, 4); $v = gd_getdata($D, 'data', 5, 0, 1, 0, GD_UINT8, TRUE); check_ok2(37, 3, $D); check_var2(37, 4, $v, array(41, 53, 54, 55, 56, 37, 47, 48)); # 38: error_string gd_getdata($D, 'x', 5, 0, 1, 0, GD_UINT8); check_error(38, $D, GD_E_BAD_CODE); check_var(38, gd_error_string($D), 'Field not found: x'); # 39: entry_type $v = gd_entry_type($D, 'data'); check_ok(39, $D); check_var(39, $v, GD_RAW_ENTRY); # 40: raw entry $v = gd_entry($D, 'data'); check_ok(40, $D); check_var(40, $v, array('field' => 'data', 'field_type' => GD_RAW_ENTRY, 'fragment_index' => 0, 'spf' => 8, 'data_type' => GD_INT8, 'scalar' => array())); # 42: lincom entry $v = gd_entry($D, 'lincom'); check_ok(42, $D); check_var(42, $v, array('field' => 'lincom', 'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 3, 'in_fields' => array('data', 'INDEX', 'linterp'), 'm' => array(1.1, 2.2, 5.5), 'b' => array(2.2, array(3.3, 4.4), 5.5), 'scalar' => array(2 => array('const', -1), 5 => array('const', -1)))); # 44: polynom entry $v = gd_entry($D, 'polynom'); check_ok(44, $D); check_var(44, $v, array('field' => 'polynom', 'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data'), 'poly_ord' => 5, 'a' => array(1.1, 2.2, 2.2, array(3.3, 4.4), 5.5, 5.5), 'scalar' => array(4 => array('const', -1), 5 => array('const', -1)))); # 45: linterp entry $v = gd_entry($D, 'linterp'); check_ok(45, $D); check_var(45, $v, array('field' => 'linterp', 'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data'), 'table' => './lut')); # 46: bit entry $v = gd_entry($D, 'bit'); check_ok(46, $D); check_var(46, $v, array('field' => 'bit', 'field_type' => GD_BIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data'), 'bitnum' => 3, 'numbits' => 4, 'scalar' => array())); # 47: sbit entry $v = gd_entry($D, 'sbit'); check_ok(47, $D); check_var(47, $v, array('field' => 'sbit', 'field_type' => GD_SBIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data'), 'bitnum' => 5, 'numbits' => 6, 'scalar' => array())); # 48: multiply entry $v = gd_entry($D, 'mult'); check_ok(48, $D); check_var(48, $v, array('field' => 'mult', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data', 'sbit'))); # 49: phase entry $v = gd_entry($D, 'phase'); check_ok(49, $D); check_var(49, $v, array('field' => 'phase', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data'), 'shift' => 11, 'scalar' => array())); # 50: const entry $v = gd_entry($D, 'const'); check_ok(50, $D); check_var(50, $v, array('field' => 'const', 'field_type' => GD_CONST_ENTRY, 'fragment_index' => 0, 'const_type' => GD_FLOAT64)); # 51: string entry $v = gd_entry($D, 'string'); check_ok(51, $D); check_var(51, $v, array('field' => 'string', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); # 52: fragment_index $v = gd_fragment_index($D, 'data'); check_ok(52, $D); check_var(52, $v, 0); # 53: add raw $v = gd_add_raw($D, 'new1', GD_FLOAT64, 3); check_ok2(53, 0, $D); check_var2(53, 1, $v, TRUE); $v = gd_entry($D, 'new1'); check_ok2(53, 2, $D); check_var2(53, 3, $v, array('field' => 'new1', 'field_type' => GD_RAW_ENTRY, 'fragment_index' => 0, 'spf' => 3, 'data_type' => GD_FLOAT64, 'scalar' => array())); # 55: add lincom $v = gd_add_lincom($D, 'new3', array('in1', 'in2'), array(array(1.1, 1.2), array(1.4, 1.5)), array(array(1.3, 1.4), 1.6)); check_ok2(55, 0, $D); check_var2(55, 1, $v, TRUE); $v = gd_entry($D, 'new3'); check_ok2(55, 2, $D); check_var2(55, 3, $v, array('field' => 'new3', 'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 2, 'in_fields' => array('in1', 'in2'), 'm' => array(array(1.1, 1.2), array(1.4, 1.5)), 'b' => array(array(1.3, 1.4), 1.6), 'scalar' => array())); # 56: add polynom $v = gd_add_polynom($D, 'new4', 'in2', array(3.9, 4.8, 5.7, 6.6)); check_ok2(56, 0, $D); check_var2(56, 1, $v, TRUE); $v = gd_entry($D, 'new4'); check_ok2(56, 2, $D); check_var2(56, 3, $v, array('field' => 'new4', 'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'poly_ord' => 3, 'a' => array(3.9, 4.8, 5.7, 6.6), 'scalar' => array())); # 58: add linterp $v = gd_add_linterp($D, 'new6', 'in', './some/table'); check_ok2(58, 0, $D); check_var2(58, 1, $v, TRUE); $v = gd_entry($D, 'new6'); check_ok2(58, 2, $D); check_var2(58, 3, $v, array('field' => 'new6', 'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in'), 'table' => './some/table')); # 59: add bit $v = gd_add_bit($D, 'new7', 'in1', 11, 22); check_ok2(59, 0, $D); check_var2(59, 1, $v, TRUE); $v = gd_entry($D, 'new7'); check_ok2(59, 2, $D); check_var2(59, 3, $v, array('field' => 'new7', 'field_type' => GD_BIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 11, 'numbits' => 22, 'scalar' => array())); # 60: add sbit $v = gd_add_sbit($D, 'new8', 'in2', 5, 10); check_ok2(60, 0, $D); check_var2(60, 1, $v, TRUE); $v = gd_entry($D, 'new8'); check_ok2(60, 2, $D); check_var2(60, 3, $v, array('field' => 'new8', 'field_type' => GD_SBIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'bitnum' => 5, 'numbits' => 10, 'scalar' => array())); # 61: add multiply $v = gd_add_multiply($D, 'new9', 'in2', 'in3'); check_ok2(61, 0, $D); check_var2(61, 1, $v, TRUE); $v = gd_entry($D, 'new9'); check_ok2(61, 2, $D); check_var2(61, 3, $v, array('field' => 'new9', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2', 'in3'))); # 62: add phase $v = gd_add_phase($D, 'new10', 'in6', 62); check_ok2(62, 0, $D); check_var2(62, 1, $v, TRUE); $v = gd_entry($D, 'new10'); check_ok2(62, 2, $D); check_var2(62, 3, $v, array('field' => 'new10', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in6'), 'shift' => 62, 'scalar' => array())); # 63: add const $v = gd_add_const($D, 'new11', GD_FLOAT64, 33.3); check_ok2(63, 0, $D); check_var2(63, 1, $v, TRUE); $v = gd_entry($D, 'new11'); check_ok2(63, 2, $D); check_var2(63, 3, $v, array('field' => 'new11', 'field_type' => GD_CONST_ENTRY, 'fragment_index' => 0, 'const_type' => GD_FLOAT64)); $v = gd_get_constant($D, 'new11', GD_FLOAT64); check_ok2(63, 4, $D); check_var2(63, 5, $v, 33.3); # 64: fragmentname $v = gd_fragmentname($D, 0); check_ok(64, $D); check_eostring(64, $v, "dirfile/format"); # 65: nfragments $v = gd_nfragments($D); check_ok(65, $D); check_var(65, $v, 1); # 66: gd_include $v = gd_include($D, 'form2', 0); check_ok2(66, 0, $D); check_var2(66, 1, $v, 1); $v = gd_get_constant($D, 'const2', GD_INT); check_ok2(66, 2, $D); check_var2(66, 3, $v, -19); # 67: nfields by type $v = gd_nfields_by_type($D, GD_LINCOM_ENTRY); check_ok(67, $D); check_var(67, $v, 2); # 68: field list by type $v = gd_field_list_by_type($D, GD_LINCOM_ENTRY); check_ok(68, $D); check_var(68, $v, array('lincom', 'new3')); # 69: nfields by type $v = gd_nvectors($D); check_ok(69, $D); check_var(69, $v, 22); # 70: field list by type $v = gd_vector_list($D); check_ok(70, $D); check_var(70, $v, array('INDEX', 'alias', 'bit', 'data', 'div', 'lincom', 'linterp', 'mplex', 'mult', 'new1', 'new10', 'new3', 'new4', 'new6', 'new7', 'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit', 'window')); # 72: madd lincom $v = gd_madd_lincom($D, 'data', 'mnew3', array('in1', 'in2'), array(array(1.1, 1.2), array(1.4, 1.5)), array(array(1.3, 1.4), 1.6)); check_ok2(72, 0, $D); check_var2(72, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew3'); check_ok2(72, 2, $D); check_var2(72, 3, $v, array('field' => 'data/mnew3', 'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 2, 'in_fields' => array('in1', 'in2'), 'm' => array(array(1.1, 1.2), array(1.4, 1.5)), 'b' => array(array(1.3, 1.4), 1.6), 'scalar' => array())); # 73: madd polynom $v = gd_madd_polynom($D, 'data', 'mnew4', 'in2', array(3.9, 4.8, 5.7, 6.6)); check_ok2(73, 0, $D); check_var2(73, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew4'); check_ok2(73, 2, $D); check_var2(73, 3, $v, array('field' => 'data/mnew4', 'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'poly_ord' => 3, 'a' => array(3.9, 4.8, 5.7, 6.6), 'scalar' => array())); # 75: madd linterp $v = gd_madd_linterp($D, 'data', 'mnew6', 'in', './some/table'); check_ok2(75, 0, $D); check_var2(75, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew6'); check_ok2(75, 2, $D); check_var2(75, 3, $v, array('field' => 'data/mnew6', 'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in'), 'table' => './some/table')); # 76: madd bit $v = gd_madd_bit($D, 'data', 'mnew7', 'in1', 11, 22); check_ok2(76, 0, $D); check_var2(76, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew7'); check_ok2(76, 2, $D); check_var2(76, 3, $v, array('field' => 'data/mnew7', 'field_type' => GD_BIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 11, 'numbits' => 22, 'scalar' => array())); # 77: madd sbit $v = gd_madd_sbit($D, 'data', 'mnew8', 'in2', 5, 10); check_ok2(77, 0, $D); check_var2(77, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew8'); check_ok2(77, 2, $D); check_var2(77, 3, $v, array('field' => 'data/mnew8', 'field_type' => GD_SBIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'bitnum' => 5, 'numbits' => 10, 'scalar' => array())); # 78: madd multiply $v = gd_madd_multiply($D, 'data', 'mnew9', 'in2', 'in3'); check_ok2(78, 0, $D); check_var2(78, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew9'); check_ok2(78, 2, $D); check_var2(78, 3, $v, array('field' => 'data/mnew9', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2', 'in3'))); # 79: madd phase $v = gd_madd_phase($D, 'data', 'mnew10', 'in6', 79); check_ok2(79, 1, $D); check_var2(79, 2, $v, TRUE); $v = gd_entry($D, 'data/mnew10'); check_ok2(79, 3, $D); check_var2(79, 4, $v, array('field' => 'data/mnew10', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in6'), 'shift' => 79, 'scalar' => array())); # 80: madd const $v = gd_madd_const($D, 'data', 'mnew11', GD_FLOAT64, 33.3); check_ok2(80, 0, $D); check_var2(80, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew11'); check_ok2(80, 2, $D); check_var2(80, 3, $v, array('field' => 'data/mnew11', 'field_type' => GD_CONST_ENTRY, 'fragment_index' => 0, 'const_type' => GD_FLOAT64)); $v = gd_get_constant($D, 'data/mnew11', GD_FLOAT64); check_ok2(80, 4, $D); check_var2(80, 5, $v, 33.3); # 81: get_string $v = gd_get_string($D, 'string'); check_ok(81, $D); check_var(81, $v, 'Zaphod Beeblebrox'); # 82: add string $v = gd_add_string($D, 'new12', 'a string'); check_ok2(82, 0, $D); check_var2(82, 1, $v, TRUE); $v = gd_entry($D, 'new12'); check_ok2(82, 2, $D); check_var2(82, 3, $v, array('field' => 'new12', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); $v = gd_get_string($D, 'new12'); check_ok2(82, 4, $D); check_var2(82, 5, $v, 'a string'); # 83: add string $v = gd_madd_string($D, 'data', 'mnew12', 'another string'); check_ok2(83, 0, $D); check_var2(83, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew12'); check_ok2(83, 2, $D); check_var2(83, 3, $v, array('field' => 'data/mnew12', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); $v = gd_get_string($D, 'data/mnew12'); check_ok2(83, 4, $D); check_var2(83, 5, $v, 'another string'); # 84: add spec $v = gd_add_spec($D, 'lorem STRING "Lorem ipsum"', 0); check_ok2(84, 0, $D); check_var2(84, 1, $v, TRUE); $v = gd_entry($D, 'lorem'); check_ok2(84, 2, $D); check_var2(84, 3, $v, array('field' => 'lorem', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); $v = gd_get_string($D, 'lorem'); check_ok2(84, 4, $D); check_var2(84, 5, $v, 'Lorem ipsum'); # 85: madd spec $v = gd_madd_spec($D, 'ipsum STRING "dolor sit amet."', 'lorem'); check_ok2(85, 0, $D); check_var2(85, 1, $v, TRUE); $v = gd_entry($D, 'lorem/ipsum'); check_ok2(85, 2, $D); check_var2(85, 3, $v, array('field' => 'lorem/ipsum', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); $v = gd_get_string($D, 'lorem/ipsum'); check_ok2(85, 4, $D); check_var2(85, 5, $v, 'dolor sit amet.'); # 86: put_constant (int) $v = gd_put_constant($D, 'const', 86); check_ok2(86, 0, $D); check_var2(86, 1, $v, TRUE); $v = gd_get_constant($D, 'const', GD_INT); check_ok2(86, 2, $D); # 91: put_constant (float) $v = gd_put_constant($D, 'const', 13.1); check_ok2(91, 0, $D); check_var2(91, 1, $v, TRUE); $v = gd_get_constant($D, 'const', GD_FLOAT); check_ok2(91, 2, $D); check_var2(91, 3, $v, 13.1); # 93: put_constant (complex) $v = gd_put_constant($D, 'const', array(93., 13.4)); check_ok2(93, 0, $D); check_var2(93, 1, $v, TRUE); $v = gd_get_constant($D, 'const', GD_COMPLEX128); check_ok2(93, 2, $D); check_var2(93, 3, $v, 93.); # 94: put string $v = gd_put_string($D, 'string', 'Arthur Dent'); check_ok2(94, 0, $D); check_var2(94, 1, $v, TRUE); $v = gd_get_string($D, 'string'); check_ok2(94, 2, $D); check_var2(94, 3, $v, 'Arthur Dent'); # 95: nmfields by type $v = gd_nmfields_by_type($D, 'data', GD_LINCOM_ENTRY); check_ok(95, $D); check_var(95, $v, 1); # 96: mfield list by type $v = gd_mfield_list_by_type($D, 'data', GD_LINCOM_ENTRY); check_ok(96, $D); check_var(96, $v, array('mnew3')); # 97: nmvectors $v = gd_nmvectors($D, 'data'); check_ok(97, $D); check_var(97, $v, 8); # 98: mvector list $v = gd_mvector_list($D, 'data'); check_ok(98, $D); check_var(98, $v, array('mlut', 'mnew3', 'mnew4', 'mnew6', 'mnew7', 'mnew8', 'mnew9', 'mnew10')); # 99: alter raw $v = gd_alter_raw($D, 'new1', GD_INT32, null); check_ok2(99, 0, $D); check_var2(99, 1, $v, TRUE); $v = gd_entry($D, 'new1'); check_ok2(99, 2, $D); check_var2(99, 3, $v, array('field' => 'new1', 'field_type' => GD_RAW_ENTRY, 'fragment_index' => 0, 'spf' => 3, 'data_type' => GD_INT32, 'scalar' => array())); # 101: alter lincom $v = gd_alter_lincom($D, 'new3', null, array('in3', 'in4'), array(3., array(4., 5.))); check_ok2(101, 0, $D); check_var2(101, 1, $v, TRUE); $v = gd_entry($D, 'new3'); check_ok2(101, 1, $D); check_var2(101, 2, $v, array('field' => 'new3', 'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 2, 'in_fields' => array('in3', 'in4'), 'm' => array(3., array(4., 5.)), 'b' => array(array(1.3, 1.4), 1.6), 'scalar' => array())); # 103: alter polynom $v = gd_alter_polynom($D, 'new4', 4, null, array(array(0, 1.), array(0, 2.), array(0, 3.), array(0, 4.), array(0, 5.))); check_ok2(103, 0, $D); check_var2(103, 1, $v, TRUE); $v = gd_entry($D, 'new4'); check_ok2(103, 2, $D); check_var2(103, 3, $v, array('field' => 'new4', 'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'poly_ord' => 4, 'a' => array(array(0., 1.), array(0., 2.), array(0., 3.), array(0., 4.), array(0., 5.)), 'scalar' => array())); # 104: alter linterp $v = gd_alter_linterp($D, 'new6', null, './other/table'); check_ok2(104, 0, $D); check_var2(104, 1, $v, TRUE); $v = gd_entry($D, 'new6'); check_ok2(104, 2, $D); check_var2(104, 3, $v, array('field' => 'new6', 'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in'), 'table' => './other/table')); # 105: alter_bit $v = gd_alter_bit($D, 'new7', 'in3', null, 8); check_ok2(105, 0, $D); check_var2(105, 1, $v, TRUE); $v = gd_entry($D, 'new7'); check_ok2(105, 2, $D); check_var2(105, 3, $v, array('field' => 'new7', 'field_type' => GD_BIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in3'), 'bitnum' => 11, 'numbits' => 8, 'scalar' => array())); # 106: alter_bit $v = gd_alter_sbit($D, 'new8', 'in1', 7); check_ok2(106, 0, $D); check_var2(106, 1, $v, TRUE); $v = gd_entry($D, 'new8'); check_ok2(106, 2, $D); check_var2(106, 3, $v, array('field' => 'new8', 'field_type' => GD_SBIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 7, 'numbits' => 10, 'scalar' => array())); # 107: alter_multiply $v = gd_alter_multiply($D, 'new9', 'in1'); check_ok2(107, 0, $D); check_var2(107, 1, $v, TRUE); $v = gd_entry($D, 'new9'); check_ok2(107, 2, $D); check_var2(107, 3, $v, array('field' => 'new9', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in3'))); # 108: alter_phase $v = gd_alter_phase($D, 'new10', 'in5'); check_ok2(108, 0, $D); check_var2(108, 1, $v, TRUE); $v = gd_entry($D, 'new10'); check_ok2(108, 2, $D); check_var2(108, 3, $v, array('field' => 'new10', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in5'), 'shift' => 62, 'scalar' => array())); # 109: alter_const $v = gd_alter_const($D, 'new11', GD_FLOAT32); check_ok2(109, 0, $D); check_var2(109, 1, $v, TRUE); $v = gd_entry($D, 'new11'); check_ok2(109, 2, $D); check_var2(109, 3, $v, array('field' => 'new11', 'field_type' => GD_CONST_ENTRY, 'fragment_index' => 0, 'const_type' => GD_FLOAT32)); # 110: encoding $v = gd_encoding($D, 0); check_ok(110, $D); check_var(110, $v, GD_UNENCODED); # 111: endianness $v = gd_endianness($D, 0); check_ok(111, $D); check_var(111, $v, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN); # 112: dirfilename $v = gd_dirfilename($D); check_ok(112, $D); check_eostring(112, $v, "dirfile"); # 113: parent fragment $v = gd_parent_fragment($D, 1); check_ok(113, $D); check_var(113, $v, 0); # 114: alter protection $v = gd_alter_protection($D, GD_PROTECT_DATA, 1); check_ok(114, $D); check_var(114, $v, TRUE); # 115: protection $v = gd_protection($D, 1); check_ok(115, $D); check_var(115, $v, GD_PROTECT_DATA); # 116: raw filename $v = gd_raw_filename($D, 'data'); check_ok(116, $D); check_eostring(116, $v, 'dirfile/data'); # 117: reference $v = gd_reference($D, 'new1'); check_ok(117, $D); check_var(117, $v, 'new1'); # 118: eof $v = gd_eof($D, 'lincom'); check_ok(118, $D); check_var(118, $v, 80); # 119: alter_encoding $v = gd_alter_encoding($D, GD_SLIM_ENCODED, 1); check_ok2(119, 0, $D); check_var2(119, 1, $v, TRUE); $v = gd_encoding($D, 1); check_ok2(119, 2, $D); check_var2(119, 3, $v, GD_SLIM_ENCODED); # 120: alter_encoding $v = gd_alter_endianness($D, GD_BIG_ENDIAN, 1); check_ok2(120, 0, $D); check_var2(120, 1, $v, TRUE); $v = gd_endianness($D, 1); check_ok2(120, 2, $D); check_var2(120, 3, $v, GD_BIG_ENDIAN | GD_NOT_ARM_ENDIAN); # 121: alter spec $v = gd_alter_spec($D, 'new10 PHASE in const'); check_ok2(121, 0, $D); check_var2(121, 1, $v, TRUE); $v = gd_entry($D, 'new10'); check_ok2(121, 2, $D); check_var2(121, 3, $v, array('field' => 'new10', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in'), 'shift' => 93, 'scalar' => array(array('const', -1)))); # 122: delete $v = gd_delete($D, 'new10'); check_ok2(122, 0, $D); check_var2(122, 1, $v, TRUE); $v = gd_entry($D, 'new10'); check_error2(122, 2, $D, GD_E_BAD_CODE); check_var2(122, 3, $v, FALSE); # 123: malter spec $v = gd_malter_spec($D, 'mnew10 PHASE in4 11', 'data'); check_ok2(123, 0, $D); check_var2(123, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew10'); check_ok2(123, 2, $D); check_var2(123, 3, $v, array('field' => 'data/mnew10', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in4'), 'shift' => 11, 'scalar' => array())); # 124: move $v = gd_move($D, 'new9', 1); check_ok2(124, 0, $D); check_var2(124, 1, $v, TRUE); $v = gd_entry($D, 'new9'); check_ok2(124, 2, $D); check_var2(124, 3, $v, array('field' => 'new9', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 1, 'in_fields' => array('in1', 'in3'))); # 125: rename $v = gd_rename($D, 'new9', 'newer'); check_ok2(125, 0, $D); check_var2(125, 1, $v, TRUE); $v = gd_entry($D, 'new9'); check_error2(125, 2, $D, GD_E_BAD_CODE); check_var2(125, 3, $v, FALSE); $v = gd_entry($D, 'newer'); check_ok2(125, 4, $D); check_var2(125, 5, $v, array('field' => 'newer', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 1, 'in_fields' => array('in1', 'in3'))); # 126: uninclude $v = gd_uninclude($D, 1); check_ok2(126, 0, $D); check_var2(126, 1, $v, TRUE); $v = gd_entry($D, 'newer'); check_error2(126, 2, $D, GD_E_BAD_CODE); check_var2(126, 3, $v, FALSE); # 127: frameoffset $v = gd_frameoffset($D, 0); check_ok(127, $D); check_var(127, $v, 0); # 128: alter frameoffset $v = gd_alter_frameoffset($D, 33, 0); check_ok2(128, 0, $D); check_var2(128, 1, $v, TRUE); $v = gd_frameoffset($D, 0); check_ok2(128, 2, $D); check_var2(128, 3, $v, 33); # 129: native type $v = gd_native_type($D, 'data'); check_ok(129, $D); check_var(129, $v, GD_INT8); # 131: validate $v = gd_validate($D, 'new7'); check_error(131, $D, GD_E_BAD_CODE); check_var(131, $v, FALSE); # 133: framenum_subset $v = gd_framenum($D, 'data', 33.3, 6); check_ok(133, $D); check_var(133, $v, 37.0375); # 135: gd_add $v = gd_add($D, array('field' => 'new135', 'field_type' => GD_RAW_ENTRY, 'fragment_index' => 0, 'data_type' => GD_FLOAT32, 'spf' => 5)); check_ok2(135, 0, $D); check_var2(135, 1, $v, TRUE); $v = gd_entry($D, 'new135'); check_ok2(135, 2, $D); check_var2(135, 3, $v, array('field' => 'new135', 'field_type' => GD_RAW_ENTRY, 'fragment_index' => 0, 'spf' => 5, 'data_type' => GD_FLOAT32, 'scalar' => array())); # 136: madd $v = gd_madd($D, array('field' => 'mnew136', 'field_type' => GD_PHASE_ENTRY, 'in_fields' => 'data', 'shift' => 23), 'data'); check_ok2(136, 0, $D); check_var2(136, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew136'); check_ok2(136, 2, $D); check_var2(136, 3, $v, array('field' => 'data/mnew136', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data'), 'shift' => 23, 'scalar' => array())); # 141: alter_entry $v = gd_alter_entry($D, 'new135', array('field_type' => GD_RAW_ENTRY, 'data_type' => GD_FLOAT64, 'spf' => 141)); check_ok2(141, 0, $D); check_var2(141, 1, $v, TRUE); $v = gd_entry($D, 'new135'); check_ok2(141, 2, $D); check_var2(141, 3, $v, array('field' => 'new135', 'field_type' => GD_RAW_ENTRY, 'fragment_index' => 0, 'spf' => 141, 'data_type' => GD_FLOAT64, 'scalar' => array())); # 142: bof $v = gd_bof($D, 'lincom'); check_ok(142, $D); check_var(142, $v, 264); # 143: divide entry $v = gd_entry($D, 'div'); check_ok(143, $D); check_var(143, $v, array('field' => 'div', 'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('mult', 'bit'))); # 145: recip entry $v = gd_entry($D, 'recip'); check_ok(145, $D); check_var(145, $v, array('field' => 'recip', 'field_type' => GD_RECIP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('div'), 'dividend' => array(6.5, 4.3), 'scalar' => array())); # 146: add divide $v = gd_add_divide($D, 'new14', 'in2', 'in3'); check_ok2(146, 0, $D); check_var2(146, 1, $v, TRUE); $v = gd_entry($D, 'new14'); check_ok2(146, 2, $D); check_var2(146, 3, $v, array('field' => 'new14', 'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2', 'in3'))); # 148: add recip $v = gd_add_recip($D, 'new16', 'in2', array(33.3, 44.4)); check_ok2(148, 0, $D); check_var2(148, 1, $v, TRUE); $v = gd_entry($D, 'new16'); check_ok2(148, 2, $D); check_var2(148, 3, $v, array('field' => 'new16', 'field_type' => GD_RECIP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'dividend' => array(33.3, 44.4), 'scalar' => array())); # 149: madd divide $v = gd_madd_divide($D, 'data', 'mnew14', 'in2', 'in3'); check_ok2(149, 0, $D); check_var2(149, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew14'); check_ok2(149, 2, $D); check_var2(149, 3, $v, array('field' => 'data/mnew14', 'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2', 'in3'))); # 151: madd recip $v = gd_madd_recip($D, 'data', 'mnew16', 'in2', 151); check_ok2(148, 0, $D); check_var2(148, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew16'); check_ok2(148, 2, $D); check_var2(148, 3, $v, array('field' => 'data/mnew16', 'field_type' => GD_RECIP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'dividend' => 151., 'scalar' => array())); # 152: alter_divide $v = gd_alter_divide($D, 'new14', 'in1'); check_ok2(152, 0, $D); check_var2(152, 1, $v, TRUE); $v = gd_entry($D, 'new14'); check_ok2(152, 2, $D); check_var2(152, 3, $v, array('field' => 'new14', 'field_type' => GD_DIVIDE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in3'))); # 154: alter recip $v = gd_alter_recip($D, 'new16', 'in6'); check_ok2(154, 0, $D); check_var2(154, 1, $v, TRUE); $v = gd_entry($D, 'new16'); check_ok2(154, 2, $D); check_var2(154, 3, $v, array('field' => 'new16', 'field_type' => GD_RECIP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in6'), 'dividend' => array(33.3, 44.4), 'scalar' => array())); # 155: rewrite fragment $v = gd_rewrite_fragment($D); check_ok(155, $D); check_var(155, $v, TRUE); # 156: invalid dirfile $v = gd_invalid_dirfile(); check_ok2(156, 0, $v); gd_nfragments($v); check_error(156, $v, GD_E_BAD_DIRFILE); gd_close($v); # 157: dirfile standards $v = gd_dirfile_standards($D); check_ok2(157, 0, $D); check_var2(157, 1, $v, GD_DIRFILE_STANDARDS_VERSION); $v = gd_dirfile_standards($D, 0); check_error2(157, 2, $D, GD_E_ARGUMENT); check_var2(157, 3, $v, FALSE); # 158: get carray $v = gd_get_carray($D, 'carray', GD_INT, null, null, TRUE); check_ok(158, $D); check_var(158, $v, array(1, 2, 3, 4, 5, 6)); # 159: get carray slice $v = gd_get_carray($D, 'carray', GD_INT8, 2, 2); check_ok(159, $D); check_var(159, $v, "\03\04"); # 167: gd_carrays $v = gd_carrays($D, GD_INT8, TRUE); check_ok(167, $D); check_var(167, $v, array(array(1, 2, 3, 4, 5, 6))); # 168: gd_put_carray $v = gd_put_carray($D, 'carray', array(9, 8, 7, 6, 5, 4)); check_ok2(168, 0, $D); check_var2(168, 1, $v, TRUE); $v = gd_get_carray($D, 'carray', GD_INT8); check_ok2(168, 2, $D); check_var2(168, 3, $v, "\011\010\07\06\05\04"); # 169: gd_put_carray_slice $v = gd_put_carray($D, 'carray', 2, array(169, 169)); check_ok2(169, 0, $D); check_var2(169, 1, $v, TRUE); $v = gd_get_carray($D, 'carray', GD_INT, null, null, TRUE); check_ok2(169, 2, $D); check_var2(169, 3, $v, array(9, 8, 169, 169, 5, 4)); # 177: array len $v = gd_array_len($D, 'carray'); check_ok(177, $D); check_var(177, $v, 6); # 178: carray entry $v = gd_entry($D, 'carray'); check_ok(178, $D); check_var(178, $v, array('field' => 'carray', 'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 6, 'const_type' => GD_FLOAT64)); # 179: add carray $v = gd_add_carray($D, 'new17', GD_INT32, GD_INT8, "\x1\x7\x9"); check_ok2(179, 0, $D); check_var2(179, 1, $v, TRUE); $v = gd_entry($D, 'new17'); check_ok2(179, 2, $D); check_var2(179, 3, $v, array('field' => 'new17', 'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 3, 'const_type' => GD_INT32)); $v = gd_get_carray($D, 'new17', GD_INT8); check_ok2(179, 4, $D); check_var2(179, 5, $v, "\x1\x7\x9"); # 180: madd carray $v = gd_madd_carray($D, 'data', 'mnew17', GD_COMPLEX128, array(array(1, 8), 18)); check_ok2(180, 0, $D); check_var2(180, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew17'); check_ok2(180, 2, $D); check_var2(180, 3, $v, array('field' => 'data/mnew17', 'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 2, 'const_type' => GD_COMPLEX128)); $v = gd_get_carray($D, 'data/mnew17', GD_COMPLEX128, null, null, TRUE); check_ok2(180, 4, $D); check_var2(180, 5, $v, array(array(1., 8.), 18.)); # 181: alter carray $v = gd_alter_carray($D, 'new17', null, 12); check_ok2(181, 0, $D); check_var2(181, 1, $v, TRUE); $v = gd_entry($D, 'new17'); check_ok2(181, 2, $D); check_var2(181, 3, $v, array('field' => 'new17', 'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 12, 'const_type' => GD_INT32)); # 183: constants $v = gd_constants($D, GD_FLOAT64, TRUE); check_ok(183, $D); check_var(183, $v, array(93., 33.3)); # 191: mconstants $v = gd_mconstants($D, 'data', GD_FLOAT64, TRUE); check_ok(191, $D); check_var(191, $v, array(3.3, 33.3)); # what's this weird obsession with three? # 199: strings $v = gd_strings($D); check_ok(199, $D); check_var(199, $v, array('Lorem ipsum', 'a string', 'Arthur Dent')); # 200: mstrings $v = gd_mstrings($D, 'data'); check_ok(200, $D); check_var(200, $v, array('This is a string constant.', 'another string')); # 203: seek $v = gd_seek($D, 'data', 35, 0, GD_SEEK_SET); check_ok2(203, 0, $D); check_var2(203, 1, $v, 280); $v = gd_getdata($D, 'data', GD_HERE, 0, 1, 0, GD_UINT8); check_ok2(203, 2, $D); check_var2(203, 3, $v, "\x11\x12\x13\x14\x15\x16\x17\x18"); # 204: tell $v = gd_tell($D, 'data'); check_ok(204, $D); check_var(204, $v, 288); # 205: hide $v = gd_hide($D, 'data'); check_ok(205, $D); check_var(205, $v, TRUE); # 206: hidden $v = gd_hidden($D, 'data'); check_ok(206, $D); check_var(206, $v, TRUE); # 207: unhide $v = gd_unhide($D, 'data'); check_ok2(207, 0, $D); check_var2(207, 1, $v, TRUE); $v = gd_hidden($D, 'data'); check_ok2(207, 2, $D); check_var2(207, 3, $v, FALSE); # 208: sync $v = gd_sync($D, 'data'); check_ok(208, $D); check_var(208, $v, TRUE); # 209: flush $v = gd_flush($D, 'data'); check_ok(209, $D); check_var(209, $v, TRUE); # 210: metaflush $v = gd_metaflush($D); check_ok(210, $D); check_var(210, $v, TRUE); # 211: window entry $v = gd_entry($D, 'window'); check_ok(211, $D); check_var(211, $v, array('field' => 'window', 'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0, 'in_fields' => array('linterp', 'mult'), 'windop' => GD_WINDOP_LT, 'threshold' => 4.1, 'scalar' => array())); # 212: add window $v = gd_add_window($D, 'new18', 'in1', 'in2', GD_WINDOP_NE, 32); check_ok2(212, 0, $D); check_var2(212, 1, $v, TRUE); $v = gd_entry($D, 'new18'); check_ok2(212, 2, $D); check_var2(212, 3, $v, array('field' => 'new18', 'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_NE, 'threshold' => 32, 'scalar' => array())); # 214: madd window $v = gd_madd_window($D, 'data', 'mnew18', 'in1', 'in2', GD_WINDOP_SET, 0x214); check_ok2(214, 0, $D); check_var2(214, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew18'); check_ok2(214, 2, $D); check_var2(214, 3, $v, array('field' => 'data/mnew18', 'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_SET, 'threshold' => 0x214, 'scalar' => array())); # 217: alter window $v = gd_alter_window($D, 'new18', 'in3', null, GD_WINDOP_EQ); check_ok2(217, 0, $D); check_var2(217, 1, $v, TRUE); $v = gd_entry($D, 'new18'); check_ok2(217, 2, $D); check_var2(217, 3, $v, array('field' => 'new18', 'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in3', 'in2'), 'windop' => GD_WINDOP_EQ, 'threshold' => 32, 'scalar' => array())); # 218: alias target $v = gd_alias_target($D, 'alias'); check_ok(218, $D); check_var(218, $v, 'data'); # 219: add alias $v = gd_add_alias($D, 'new20', 'data'); check_ok2(219, 0, $D); check_var2(219, 1, $v, TRUE); $v = gd_alias_target($D, 'new20'); check_ok2(219, 2, $D); check_var2(219, 3, $v, 'data'); # 220: add alias $v = gd_madd_alias($D, 'data', 'mnew20', 'data'); check_ok2(220, 0, $D); check_var2(220, 1, $v, TRUE); $v = gd_alias_target($D, 'data/mnew20'); check_ok2(220, 2, $D); check_var2(220, 3, $v, 'data'); # 221: naliases $v = gd_naliases($D, 'data'); check_ok(221, $D); check_var(221, $v, 4); # 222: aliases $v = gd_aliases($D, 'data'); check_ok(222, $D); check_var(222, $v, array('data', 'alias', 'data/mnew20', 'new20')); # 223: gd_include_affix $v = gd_include($D, 'format1', 0, GD_CREAT | GD_EXCL, 'A', 'Z'); check_ok2(223, 0, $D); check_var2(223, 1, $v, 1); # 226: fragment affixes $v = gd_fragment_affixes($D, 1); check_ok(226, $D); check_var(226, $v, array('A', 'Z')); # 227: alter affixes $v = gd_alter_affixes($D, 1, "B", ""); check_ok2(227, 0, $D); check_var2(227, 1, $v, TRUE); $v = gd_fragment_affixes($D, 1); check_ok2(227, 2, $D); check_var2(227, 3, $v, array('B', '')); # 228: mplex entry $v = gd_entry($D, 'mplex'); check_ok(228, $D); check_var(228, $v, array('field' => 'mplex', 'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0, 'in_fields' => array('data', 'sbit'), 'count_val' => 1, 'period' => 10, 'scalar' => array())); # 229: add mplex $v = gd_add_mplex($D, 'new21', 'in1', 'in2', 5, 6); check_ok2(229, 0, $D); check_var2(229, 1, $v, TRUE); $v = gd_entry($D, 'new21'); check_ok2(229, 2, $D); check_var2(229, 3, $v, array('field' => 'new21', 'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'count_val' => 5, 'period' => 6, 'scalar' => array())); # 230: add mplex $v = gd_madd_mplex($D, 'data', 'mnew21', 'in1', 'in2', 5, 6); check_ok2(230, 0, $D); check_var2(230, 1, $v, TRUE); $v = gd_entry($D, 'data/mnew21'); check_ok2(230, 2, $D); check_var2(230, 3, $v, array('field' => 'data/mnew21', 'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'count_val' => 5, 'period' => 6, 'scalar' => array())); # 231: alter mplex $v = gd_alter_mplex($D, 'new21', 'in3', null, null, null); check_ok2(231, 0, $D); check_var2(231, 1, $v, TRUE); $v = gd_entry($D, 'new21'); check_ok2(231, 2, $D); check_var2(231, 3, $v, array('field' => 'new21', 'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in3', 'in2'), 'count_val' => 5, 'period' => 6, 'scalar' => array())); # 232: strtok $v = gd_strtok($D, '"test1 test2" test3\ test4 test5'); check_ok(232, $D); check_var(232, $v, array('test1 test2', 'test3 test4', 'test5')); # 233: raw_close $v = gd_raw_close($D, 'data'); check_ok(233, $D); check_var(233, $v, TRUE); # 234: desync $v = gd_desync($D); check_ok(234, $D); check_var(234, $v, FALSE); # 235: flags $v = gd_flags($D, GD_PRETTY_PRINT); check_ok(235, $D); check_var(235, $v, GD_PRETTY_PRINT); # 236: verbose_prefix $v = gd_verbose_prefix($D, 'big_test: '); check_ok(236, $D); check_var(236, $v, TRUE); # 237: nentries $v = gd_nentries($D, 'data', GD_SCALAR_ENTRIES, GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS); check_ok(237, $D); check_var(237, $v, 6); # 239: entry_list $v = gd_entry_list($D, null, GD_VECTOR_ENTRIES, GD_ENTRIES_NOALIAS); check_ok(239, $D); check_var(239, $v, array('INDEX', 'bit', 'data', 'div', 'lincom', 'linterp', 'mplex', 'mult', 'new1', 'new135', 'new14', 'new16', 'new18', 'new21', 'new3', 'new4', 'new6', 'new7', 'new8', 'phase', 'polynom', 'recip', 'sbit', 'window')); # 240: mplex lookback $v = gd_mplex_lookback($D, GD_LOOKBACK_ALL); check_ok(240, $D); check_var(240, $v, true); # 241: linterp tablename $v = gd_linterp_tablename($D, 'linterp'); check_ok(241, $D); check_eostring(241, $v, 'dirfile/lut'); # 242: mcarrays $v = gd_mcarrays($D, 'data', GD_FLOAT64, TRUE); check_ok(242, $D); check_var(242, $v, array(array(1.9, 2.8, 3.7, 4.6, 5.5), array(1., 18.))); # 243: add lincom $v = gd_add($D, array('field' => 'new243', 'field_type' => GD_LINCOM_ENTRY, 'in_fields' => array('in1', 'in2', 'in3'), 'm' => array(1.1, 2 => 1.4), 'scalar' => array(1 => array('const'), null, array('carray', 3), array('carray', 4), array('carray', 5)), 'fragment_index' => 0)); check_ok2(243, 0, $D); check_var2(243, 1, $v, TRUE); $v = gd_entry($D, 'new243'); check_ok2(243, 2, $D); check_var2(243, 3, $v, array('field' => 'new243', 'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 3, 'in_fields' => array('in1', 'in2', 'in3'), 'm' => array(1.1, 93., 1.4), 'b' => array(169., 5., 4.), 'scalar' => array(1 => array('const', -1), 3 => array('carray', 3), array('carray', 4), array('carray', 5)))); # 244: add polynom $v = gd_add($D, array('field' => 'new244', 'in_fields' => 'in2', 'field_type' => GD_POLYNOM_ENTRY, 'a' => array(33., array(44., 55.), 66.), 'scalar' => array(3 => array('carray', 0)), 'fragment_index' => 0)); check_ok2(244, 0, $D); check_var2(244, 1, $v, TRUE); $v = gd_entry($D, 'new244'); check_ok2(244, 2, $D); check_var2(244, 3, $v, array('field' => 'new244', 'field_type' => GD_POLYNOM_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2'), 'poly_ord' => 3, 'a' => array(33., array(44., 55.), 66., 9.), 'scalar' => array(3 => array('carray', 0)))); # 245: add linterp $v = gd_add($D, array('field' => 'new245', 'field_type' => GD_LINTERP_ENTRY, 'in_fields' => 'in', 'table' => './some/table', 'fragment_index' => 0)); check_ok2(245, 0, $D); check_var2(245, 1, $v, TRUE); $v = gd_entry($D, 'new245'); check_ok2(245, 2, $D); check_var2(245, 3, $v, array('field' => 'new245', 'field_type' => GD_LINTERP_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in'), 'table' => './some/table')); # 246: add bit $v = gd_add($D, array('field' => 'new246', 'field_type' => GD_BIT_ENTRY, 'in_fields' => array('in1'), 'bitnum' => 11, 'fragment_index' => 0)); check_ok2(246, 0, $D); check_var2(246, 1, $v, TRUE); $v = gd_entry($D, 'new246'); check_ok2(246, 2, $D); check_var2(246, 3, $v, array('field' => 'new246', 'field_type' => GD_BIT_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1'), 'bitnum' => 11, 'numbits' => 1, 'scalar' => array())); # 247: add multiply $v = gd_add($D, array('field' => 'new247', 'fragment_index' => 0, 'field_type' => GD_MULTIPLY_ENTRY, 'in_fields' => array('in2', 'in3'))); check_ok2(247, 0, $D); check_var2(247, 1, $v, TRUE); $v = gd_entry($D, 'new247'); check_ok2(247, 2, $D); check_var2(247, 3, $v, array('field' => 'new247', 'field_type' => GD_MULTIPLY_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in2', 'in3'))); # 248: add phase $v = gd_add($D, array('field' => 'new248', 'in_fields' => 'in6', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'scalar' => array(array('carray', 1)))); check_ok2(248, 0, $D); check_var2(248, 1, $v, TRUE); $v = gd_entry($D, 'new248'); check_ok2(248, 2, $D); check_var2(248, 3, $v, array('field' => 'new248', 'field_type' => GD_PHASE_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in6'), 'shift' => 8, 'scalar' => array(array('carray', 1)))); # 249: add const $v = gd_add($D, array('field' => 'new249', 'field_type' => GD_CONST_ENTRY, 'fragment_index' => 0, 'const_type' => GD_UINT8)); check_ok2(249, 0, $D); check_var2(249, 1, $v, TRUE); $v = gd_entry($D, 'new249'); check_ok2(249, 2, $D); check_var2(249, 3, $v, array('field' => 'new249', 'field_type' => GD_CONST_ENTRY, 'fragment_index' => 0, 'const_type' => GD_UINT8)); $v = gd_get_constant($D, 'new249', GD_FLOAT64); check_ok2(249, 4, $D); check_var2(249, 5, $v, 0.); # 250: add string $v = gd_add($D, array('field' => 'new250', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); check_ok2(250, 0, $D); check_var2(250, 1, $v, TRUE); $v = gd_entry($D, 'new250'); check_ok2(250, 2, $D); check_var2(250, 3, $v, array('field' => 'new250', 'field_type' => GD_STRING_ENTRY, 'fragment_index' => 0)); $v = gd_get_string($D, 'new250'); check_ok2(250, 4, $D); check_var2(250, 5, $v, ''); # 251: add recip $v = gd_add($D, array('field' => 'Bnew251', 'field_type' => GD_RECIP_ENTRY, 'in_fields' => 'Bin2', 'dividend' => array(33.3, 44.4), 'fragment_index' => 1, 'scalar' => null)); check_ok2(251, 0, $D); check_var2(251, 1, $v, TRUE); $v = gd_entry($D, 'Bnew251'); check_ok2(251, 2, $D); check_var2(251, 3, $v, array('field' => 'Bnew251', 'field_type' => GD_RECIP_ENTRY, 'fragment_index' => 1, 'in_fields' => array('Bin2'), 'dividend' => array(33.3, 44.4), 'scalar' => array())); # 252: add carray $v = gd_add($D, array('field' => 'new252', 'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'const_type' => GD_INT32, 'array_len' => 5)); check_ok2(252, 0, $D); check_var2(252, 1, $v, TRUE); $v = gd_entry($D, 'new252'); check_ok2(252, 2, $D); check_var2(252, 3, $v, array('field' => 'new252', 'field_type' => GD_CARRAY_ENTRY, 'fragment_index' => 0, 'array_len' => 5, 'const_type' => GD_INT32)); $v = gd_get_carray($D, 'new252', GD_INT8); check_ok2(252, 4, $D); check_var2(252, 5, $v, "\0\0\0\0\0"); # 253: add window $v = gd_add($D, array('field' => 'new253', 'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_NE, 'threshold' => 32, 'fragment_index' => 0, 'field_type' => GD_WINDOW_ENTRY)); check_ok2(253, 0, $D); check_var2(253, 1, $v, TRUE); $v = gd_entry($D, 'new253'); check_ok2(253, 2, $D); check_var2(253, 3, $v, array('field' => 'new253', 'field_type' => GD_WINDOW_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'windop' => GD_WINDOP_NE, 'threshold' => 32, 'scalar' => array())); # 254: add mplex $v = gd_add($D, array('field' => 'new254', 'in_fields' => array('in1', 'in2'), 'fragment_index' => 0, 'field_type' => GD_MPLEX_ENTRY, 'count_val' => 5)); check_ok2(254, 0, $D); check_var2(254, 1, $v, TRUE); $v = gd_entry($D, 'new254'); check_ok2(254, 2, $D); check_var2(254, 3, $v, array('field' => 'new254', 'field_type' => GD_MPLEX_ENTRY, 'fragment_index' => 0, 'in_fields' => array('in1', 'in2'), 'count_val' => 5, 'period' => 0, 'scalar' => array())); # 259: alter_entry with scalar $v = gd_alter_entry($D, 'new243', array('field_type' => GD_LINCOM_ENTRY, 'scalar' => array(null, array(''), array('const'), array('carray', 4), null, array('const', -1)), 'fragment_index' => 0)); check_ok2(259, 0, $D); check_var2(259, 1, $v, TRUE); $v = gd_entry($D, 'new243'); check_ok2(259, 2, $D); check_var2(259, 3, $v, array('field' => 'new243', 'field_type' => GD_LINCOM_ENTRY, 'fragment_index' => 0, 'n_fields' => 3, 'in_fields' => array('in1', 'in2', 'in3'), 'm' => array(1.1, 93., 93.), 'b' => array(5., 5., 93.), 'scalar' => array(1 => array('const', -1), array('const', -1), array('carray', 4), 5 => array('const', -1)))); # 270: dirfilekey $v = gd_dirfilekey($D); check_ok(270, $D); check_var(270, $v, "dirfile\0extra"); # 271: encoding_support $v = gd_encoding_support(GD_SIE_ENCODED); check_var(271, $v, GD_RDWR); # 272: NULL return from gd_reference $D2 = gd_open('dirfile/empty', GD_RDWR | GD_CREAT | GD_EXCL); check_ok2(272, 1, $D2); $v = gd_reference($D2); check_ok2(272, 2, $D2); check_var(272, $v, null); gd_discard($D2); # =========================================== gd_discard($D); unlink('dirfile/empty/format'); rmdir('dirfile/empty'); unlink('dirfile/data'); unlink('dirfile/new1'); unlink('dirfile/new135'); unlink('dirfile/format'); unlink('dirfile/format1'); unlink('dirfile/form2'); rmdir('dirfile'); if ($ne > 0) { echo "ne = ", $ne, "\n"; exit(1); } exit(0); ?> libgetdata-0.9.0/bindings/php/test/Makefile.am0000640000175000017500000000365112614323564021410 0ustar alastairalastair# Copyright (C) 2013, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests if TEST_PHP TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} \ ${PHP} -n -d "output_handler=" -d "open_basedir=" -d "safe_mode=0" \ -d "disable_functions=" -d "output_buffering=Off" -d "error_reporting=32767" \ -d "display_errors=1" -d "display_startup_errors=1" -d "log_errors=0" \ -d "html_errors=0" -d "track_errors=1" -d "report_memleaks=1" \ -d "report_zend_debug=0" -d "docref_root=" -d "docref_ext=.html" \ -d "error_prepend_string=" -d "error_append_string=" -d "auto_prepend_file=" \ -d "auto_append_file=" -d "magic_quotes_runtime=0" \ -d "ignore_repeated_errors=0" -d "precision=14" -d "memory_limit=128M" \ -d "extension_dir=@top_builddir@/bindings/php/.libs" \ -d "extension=getdata.so" -d "session.auto_start=0" -f phpTESTS=big_test.php TESTS=$(addprefix ${srcdir}/,$(phpTESTS)) endif EXTRA_DIST=${phpTESTS} # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: echo rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ libgetdata-0.9.0/bindings/php/Makefile.am0000640000175000017500000000267712614323564020440 0ustar alastairalastair# Copyright (C) 2013, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # php_LTLIBRARIES = getdata.la AM_CFLAGS = ${WALL} ${WEXTRA} AM_CPPFLAGS = -I$(top_srcdir)/src ${CPPFLAGS} ${PHP_CPPFLAGS} getdata_la_LDFLAGS = -module -avoid-version -shared ${PHP_LDFLAGS} getdata_la_LIBADD = ${PHP_LIBS} ../../src/libgetdata.la getdata_la_SOURCES = getdata.c php_getdata.h nodist_getdata_la_SOURCES = constants.c BUILT_SOURCES=constants.c constants.c: ../make_parameters ../../src/getdata.h ../make_parameters h > $@ ../make_parameters: ../make_parameters.c ../../src/gd_config.h cd .. && ${MAKE} make_parameters clean-local: rm -rf *~ ${BUILT_SOURCES} SUBDIRS=. test libgetdata-0.9.0/bindings/php/getdata.c0000640000175000017500000031772012614323564020157 0ustar alastairalastair/* Copyright (C) 2013, 2014, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "php_getdata.h" #include "php_ini.h" /* corresponding type of the PHP integer */ #if SIZEOF_LONG == 4 #define GDPHP_LONG GD_INT32 typedef int32_t gdphp_long_t; #elif SIZEOF_LONG == 8 #define GDPHP_LONG GD_INT64 typedef int64_t gdphp_long_t; #endif /* PHP globals */ ZEND_BEGIN_MODULE_GLOBALS(getdata) zend_bool degrade_complex; zend_bool unpack; ZEND_END_MODULE_GLOBALS(getdata) ZEND_DECLARE_MODULE_GLOBALS(getdata) #ifdef ZTS # define GDPHP_G(v) TSRMG(getdata_globals_id, zend_getdata_globals *, v) # define dtracetsrm(fmt, ...) dtrace(fmt ", %p", __VA_ARGS__, tsrm_ls) #else # define GDPHP_G(v) (getdata_globals.v) # define dtracetsrm dtrace #endif /* PHP INI entries */ PHP_INI_BEGIN() STD_PHP_INI_ENTRY("getdata.degrade_complex", "true", PHP_INI_ALL, OnUpdateBool, degrade_complex, zend_getdata_globals, getdata_globals) STD_PHP_INI_ENTRY("getdata.unpack", "false", PHP_INI_ALL, OnUpdateBool, unpack, zend_getdata_globals, getdata_globals) PHP_INI_END() /* Common idioms */ #define GDPHP_FETCH_DIRFILE(r, z) do { \ r = (gdphp_dirfile*)zend_fetch_resource(&(z) TSRMLS_CC, -1, "Dirfile", NULL, \ 2, le_gdphp_dirfile, le_gdphp_dirfile_persist); \ if (!r) { GDPHP_RETURN_F; } \ } while(0) #define GDPHP_RETURN_T do { dreturn("%s", "TRUE"); RETURN_TRUE; } while(0) #define GDPHP_RETURN_F do { dreturn("%s", "FALSE"); RETURN_FALSE; } while(0) #define GDPHP_CHECK_ERROR(D) do { if (gd_error(D)) GDPHP_RETURN_F; } while(0) #define GDPHP_RETURN_ERROR(D) do { \ if (gd_error(D)) GDPHP_RETURN_F; \ else GDPHP_RETURN_T; \ } while(0) #define GDPHP_RETURN_BOOL(e) do { \ if (e) GDPHP_RETURN_F; else GDPHP_RETURN_T; } while (0) #define GDPHP_PARSE(...) do { \ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, __VA_ARGS__) \ != SUCCESS) { \ GDPHP_RETURN_F; \ } \ } while(0) #define GDPHP_PARSED(vars, ...) do { \ zval *gdphp_dirfile_zval; \ gdphp_dirfile *gdphp_dirfile_rsrc; \ GDPHP_PARSE("r" vars, &gdphp_dirfile_zval, __VA_ARGS__); \ GDPHP_FETCH_DIRFILE(gdphp_dirfile_rsrc, gdphp_dirfile_zval); \ D = gdphp_dirfile_rsrc->D; \ } while(0) #define GDPHP_PARSED_ONLY() do { \ zval *gdphp_dirfile_zval; \ gdphp_dirfile *gdphp_dirfile_rsrc; \ GDPHP_PARSE("r", &gdphp_dirfile_zval); \ GDPHP_FETCH_DIRFILE(gdphp_dirfile_rsrc, gdphp_dirfile_zval); \ D = gdphp_dirfile_rsrc->D; \ } while(0) #define dtracephp() dtrace("%i, %p, %p, %p, %i", ht, return_value, \ return_value_ptr, this_ptr, return_value_used) struct gdphp_din { void *data; gd_type_t type; int free_din; size_t ns; }; /* error reporting */ struct gdphp_context_t { int p; const char *k; int i; }; #define dtracectx(fmt, ...) dtrace(fmt " {%i,%s,%i}", __VA_ARGS__, ctx->p, \ ctx->k ? ctx->k : "-", ctx->i) #define GDPHP_CONTEXT(v) struct gdphp_context_t v = { 0, NULL, -1 }; #define GDPHP_CONTEXTp(v,p) struct gdphp_context_t v = { p, NULL, -1 }; #define GDPHP_DIE_BUFFER_LEN 1000 #define GDPHP_DIE(x,fmt) do { \ char gdphp_die_buffer[GDPHP_DIE_BUFFER_LEN]; \ zend_error(E_ERROR,fmt " in %s", gdphp_context(gdphp_die_buffer,x)); \ } while (0) #define GDPHP_DIE2(x,fmt,...) do { \ char gdphp_die_buffer[GDPHP_DIE_BUFFER_LEN]; \ zend_error(E_ERROR,fmt " in %s", __VA_ARGS__, \ gdphp_context(gdphp_die_buffer,x)); \ } while (0) /* report the context (for error messages) */ static char *gdphp_context(char *buffer, const struct gdphp_context_t *ctx) { dtrace("%p, %p", buffer, ctx); if (ctx->k) { if (ctx->i >= 0) snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element %i of '%s' of parameter %i", ctx->i, ctx->k, ctx->p + 1); else snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element '%s' of parameter %i", ctx->k, ctx->p + 1); } else if (ctx->i >= 0) snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "element %i of parameter %i", ctx->i, ctx->p + 1); else snprintf(buffer, GDPHP_DIE_BUFFER_LEN, "parameter %i", ctx->p + 1); dreturn("\"%s\"", buffer); return buffer; } /* the dirfile resource */ typedef struct _gdphp_dirfile { DIRFILE *D; char *callback; int callback_len; zval **callback_data; char *key; int key_len; } gdphp_dirfile; int le_gdphp_dirfile; int le_gdphp_dirfile_persist; static void gdphp_dirfile_dtor(zend_rsrc_list_entry *z TSRMLS_DC) { dtracetsrm("%p", z); gdphp_dirfile *r = (gdphp_dirfile*)(z->ptr); gd_discard(r->D); if (r->callback) efree(r->callback); if (r->callback_data && *(r->callback_data)) Z_DELREF_PP(r->callback_data); efree(r->key); efree(r); dreturnvoid(); } static void gdphp_dirfile_pdtor(zend_rsrc_list_entry *z TSRMLS_DC) { dtracetsrm("%p", z); gdphp_dirfile *r = (gdphp_dirfile*)(z->ptr); gd_discard(r->D); if (r->callback) pefree(r->callback, 1); if (r->callback_data) Z_DELREF_PP(r->callback_data); pefree(r->key, 1); pefree(r, 1); dreturnvoid(); } /* callback wrapper */ static int gdphp_callback(gd_parser_data_t *pdata, void *extra) { int sem = GD_SYNTAX_ABORT; int new_line = 0; char *ptr; gdphp_dirfile *r = (gdphp_dirfile*)extra; zval *response; zval *function_name; zval *zpdata; zval **params[2] = { &zpdata, r->callback_data }; dtrace("%p, %p", pdata, r->callback_data); if (r->callback == NULL) { /* nothing to do */ dreturn("%i", GD_SYNTAX_ABORT); return GD_SYNTAX_ABORT; } TSRMLS_FETCH(); /* make a zval for the function name */ ALLOC_INIT_ZVAL(function_name); ZVAL_STRINGL(function_name, r->callback, r->callback_len, 1); /* make a hashtable for the parser data */ ALLOC_INIT_ZVAL(zpdata); array_init(zpdata); add_assoc_long(zpdata, "suberror", pdata->suberror); add_assoc_long(zpdata, "linenum", pdata->linenum); add_assoc_string(zpdata, "line", pdata->line, 1); add_assoc_string(zpdata, "filename", (char*)pdata->filename, 1); /* call the callback */ if (call_user_function_ex(CG(function_table), NULL, function_name, &response, 2, params, 0, NULL TSRMLS_CC) != SUCCESS) { zend_error(E_ERROR, "Unable to execute GetData callback"); } zval_ptr_dtor(&function_name); /* interpret the response */ switch (Z_TYPE_P(response)) { case IS_LONG: sem = (int)Z_LVAL_P(response); break; case IS_STRING: /* this means rescan */ ptr = strdup(Z_STRVAL_P(response)); if (ptr == NULL) zend_error(E_ERROR, "Out of memory"); pdata->line = ptr; sem = GD_SYNTAX_RESCAN; new_line = 1; break; default: zend_error(E_ERROR, "Bad response from GetData callback"); } /* copy the line out of the zpdata hash, if necessary and possible */ if (sem == GD_SYNTAX_RESCAN && new_line == 0) { zval *line; if (zend_hash_find(Z_ARRVAL_P(zpdata), "line", sizeof("line"), (void**)&line) == SUCCESS) { if (Z_TYPE_P(line) == IS_STRING) { ptr = strdup(Z_STRVAL_P(response)); if (ptr == NULL) zend_error(E_ERROR, "Out of memory"); pdata->line = ptr; } } } zval_ptr_dtor(&zpdata); dreturn("%i", sem); return sem; } /* create a dirfile resource */ static gdphp_dirfile *gdphp_open(const char *dirfilename, int len, long flags, const char *callback, int callback_len, zval **callback_data, int persist) { gdphp_dirfile *r; DIRFILE *D; dtrace("\"%s\", %i, 0x%lX, \"%s\", %i, %p, %i", dirfilename, len, flags, callback, callback_len, callback_data, persist); /* create the resource */ r = pemalloc(sizeof(gdphp_dirfile), persist); memset(r, 0, sizeof(gdphp_dirfile)); r->callback_len = callback_len; if (callback) r->callback = pestrdup(callback, persist); r->key_len = len; if (len > 0) { r->key = pemalloc(len, persist); memcpy(r->key, dirfilename, len); } if (callback_data) { Z_ADDREF_PP(callback_data); r->callback_data = callback_data; } /* open */ if (callback) D = gd_cbopen(dirfilename, (unsigned)flags, gdphp_callback, r); else D = gd_open(dirfilename, (unsigned)flags); /* record the dirfile */ r->D = D; dreturn("%p", r); return r; } /* convert a complex pair to a 2-element array */ static zval *gdphp_from_complex(zval *z, double r, double i) { dtrace("%p, %g, %g", z, r, i); TSRMLS_FETCH(); if (z == NULL) ALLOC_INIT_ZVAL(z); if (i == 0 && GDPHP_G(degrade_complex)) { ZVAL_DOUBLE(z, r); } else { array_init(z); add_index_double(z, 0, r); add_index_double(z, 1, i); } dreturn("%p", z); return z; } /* add a complex scalar to a hash */ static void gdphp_add_assoc_complex(zval *z, const char *key, double r, double i) { dtrace("%p, \"%s\", %g, %g", z, key, r, i); add_assoc_zval(z, key, gdphp_from_complex(NULL, r, i)); dreturnvoid(); } /* add an array of complex data to a hash */ static void gdphp_add_assoc_cmparray(zval *z, const char *key, double *l, int n) { zval *a; int i; dtrace("%p, \"%s\", %p, %i", z, key, l, n); ALLOC_INIT_ZVAL(a); array_init(a); for (i = 0; i < n; ++i) add_index_zval(a, i, gdphp_from_complex(NULL, l[i * 2], l[i * 2 + 1])); add_assoc_zval(z, key, a); dreturnvoid(); } /* add an array of strings to a hash */ static void gdphp_add_assoc_string_arr(zval *z, const char *key, char **l, int n) { zval *a; int i; dtrace("%p, \"%s\", %p, %i", z, key, l, n); ALLOC_INIT_ZVAL(a); array_init(a); for (i = 0; i < n; ++i) add_index_string(a, i, l[i], 1); add_assoc_zval(z, key, a); dreturnvoid(); } /* add scalars to a entry hash */ static void gdphp_add_assoc_scalars(zval *z, gd_entry_t *E, unsigned mask) { int i; zval *scalar; zval *lm; dtrace("%p, %p, 0x%X", z, E, mask); ALLOC_INIT_ZVAL(scalar); array_init(scalar); for (i = 0; i <= GD_MAX_POLYORD; ++i) if (mask & (1 << i)) if (E->scalar[i]) { ALLOC_INIT_ZVAL(lm); array_init(lm); add_index_string(lm, 0, E->scalar[i], 1); add_index_long(lm, 1, E->scalar_ind[i]); add_index_zval(scalar, i, lm); } add_assoc_zval(z, "scalar", scalar); dreturnvoid(); } /* convert from a gd_entry_t to a hash */ static void gdphp_from_entry(zval *z, gd_entry_t *E) { dtrace("%p, %p", z, E); array_init(z); add_assoc_string(z, "field", E->field, 1); add_assoc_long(z, "field_type", E->field_type); add_assoc_long(z, "fragment_index", E->fragment_index); switch (E->field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); add_assoc_long(z, "bitnum", E->EN(bit,bitnum)); add_assoc_long(z, "numbits", E->EN(bit,numbits)); gdphp_add_assoc_scalars(z, E, 0x3); break; case GD_CARRAY_ENTRY: add_assoc_long(z, "array_len", E->EN(scalar,array_len)); /* fallthrough */ case GD_CONST_ENTRY: add_assoc_long(z, "const_type", E->EN(scalar,const_type)); break; case GD_LINCOM_ENTRY: add_assoc_long(z, "n_fields", E->EN(lincom,n_fields)); gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, E->EN(lincom,n_fields)); gdphp_add_assoc_cmparray(z, "m", (double*)E->EN(lincom,cm), E->EN(lincom,n_fields)); gdphp_add_assoc_cmparray(z, "b", (double*)E->EN(lincom,cb), E->EN(lincom,n_fields)); gdphp_add_assoc_scalars(z, E, ((1 << E->EN(lincom,n_fields)) - 1) * 9); break; case GD_LINTERP_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); add_assoc_string(z, "table", E->EN(linterp,table), 1); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2); break; case GD_PHASE_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); add_assoc_long(z, "shift", E->EN(phase,shift)); gdphp_add_assoc_scalars(z, E, 0x1); break; case GD_POLYNOM_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); add_assoc_long(z, "poly_ord", E->EN(polynom,poly_ord)); gdphp_add_assoc_cmparray(z, "a", (double*)E->EN(polynom,ca), E->EN(polynom,poly_ord) + 1); gdphp_add_assoc_scalars(z, E, (1 << (E->EN(polynom,poly_ord) + 1)) - 1); break; case GD_RECIP_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 1); gdphp_add_assoc_complex(z, "dividend", creal(E->EN(recip,cdividend)), cimag(E->EN(recip,cdividend))); gdphp_add_assoc_scalars(z, E, 0x1); break; case GD_RAW_ENTRY: add_assoc_long(z, "spf", E->EN(raw,spf)); add_assoc_long(z, "data_type", E->EN(raw,data_type)); gdphp_add_assoc_scalars(z, E, 0x1); break; case GD_WINDOW_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2); add_assoc_long(z, "windop", E->EN(window,windop)); switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: add_assoc_long(z, "threshold", E->EN(window,threshold.u)); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: add_assoc_long(z, "threshold", E->EN(window,threshold.i)); break; default: add_assoc_double(z, "threshold", E->EN(window,threshold.r)); break; } gdphp_add_assoc_scalars(z, E, 0x1); break; case GD_MPLEX_ENTRY: gdphp_add_assoc_string_arr(z, "in_fields", E->in_fields, 2); add_assoc_long(z, "count_val", E->EN(mplex,count_val)); add_assoc_long(z, "period", E->EN(mplex,period)); gdphp_add_assoc_scalars(z, E, 0x3); break; case GD_INDEX_ENTRY: case GD_STRING_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: break; } dreturnvoid(); } /* interpret a long as a gd_type_t symbol */ static gd_type_t gdphp_type_from_long(zval *z, struct gdphp_context_t *ctx) { gd_type_t t = GD_UNKNOWN; dtracectx("%p", z); if (Z_TYPE_P(z) != IS_LONG) GDPHP_DIE(ctx, "Bad type code"); switch (Z_LVAL_P(z)) { case GD_NULL: case GD_UINT8: case GD_INT8: case GD_UINT16: case GD_INT16: case GD_UINT32: case GD_INT32: case GD_UINT64: case GD_INT64: case GD_FLOAT32: case GD_FLOAT64: case GD_COMPLEX64: case GD_COMPLEX128: t = Z_LVAL_P(z); } dreturn("0x%X", t); return t; } static int gdphp_to_datum(void *dst, gd_type_t type, zval *src, int complain, struct gdphp_context_t *ctx); /* convert an array to a complex number -- z is known to be an array; returns * zero on success, non-zero (or doesn't return) on error */ static int gdphp_to_complex(double *r, double *i, zval *z, int complain, struct gdphp_context_t *ctx) { int n, converted = 0; dtracectx("%p, %p, %p, %i", r, i, z, complain); HashTable *a = Z_ARRVAL_P(z); n = zend_hash_num_elements(a); if (n == 2) { zval **d; if (zend_hash_index_find(a, 0, (void**)&d) == SUCCESS) if (gdphp_to_datum(r, GD_FLOAT64, *d, 0, ctx) == 0) converted++; if (zend_hash_index_find(a, 1, (void**)&d) == SUCCESS) if (gdphp_to_datum(i, GD_FLOAT64, *d, 0, ctx) == 0) converted++; } if (converted < 2) { if (complain) GDPHP_DIE(ctx, "Bad numeric data"); dreturn("%i", 1); return 1; } dreturn("%i (%g, %g)", 0, *r, *i); return 0; } /* return a GD type based on a PHP type */ static gd_type_t gdphp_get_type(zval *z, struct gdphp_context_t *ctx) { gd_type_t t = GD_UNKNOWN; double r, i; dtracectx("%p", z); switch (Z_TYPE_P(z)) { case IS_NULL: t = GD_NULL; break; case IS_LONG: case IS_BOOL: t = GD_INT64; break; case IS_DOUBLE: t = GD_FLOAT64; break; case IS_ARRAY: /* check for complex by tring to convert */ if (gdphp_to_complex(&r, &i, z, 0, ctx) == 0) t = GD_COMPLEX128; } dreturn("0x%X", t); return t; } #define CCONVERT_ZVAL(t) \ do { \ switch (Z_TYPE_P(src)) { \ double r, i; \ case IS_NULL: ((t*)dst)[0] = ((t*)dst)[1] = 0; break; \ case IS_LONG: case IS_BOOL: ((t*)dst)[0] = Z_LVAL_P(src); \ ((t*)dst)[1] = 0; break; \ case IS_DOUBLE: ((t*)dst)[0] = Z_DVAL_P(src); \ ((t*)dst)[1] = 0; break; \ case IS_ARRAY: gdphp_to_complex(&r, &i, src, 1, ctx); \ ((t*)dst)[0] = r; ((t*)dst)[1] = i; break; \ default: if (complain) GDPHP_DIE(ctx, "bad numeric type"); r = 1; \ } \ } while (0) #define CONVERT_ZVAL(t) \ do { \ switch (Z_TYPE_P(src)) { \ double r, i; \ case IS_LONG: case IS_BOOL: *((t*)dst) = Z_LVAL_P(src); break; \ case IS_DOUBLE: *((t*)dst) = Z_DVAL_P(src); break; \ case IS_ARRAY: gdphp_to_complex(&r, &i, src, 1, ctx); \ *((t*)dst) = r; break; \ default: if (complain) GDPHP_DIE(ctx, "bad numeric type"); r = 1; \ } \ } while (0) /* convert a zval to a C numeric type */ static int gdphp_to_datum(void *dst, gd_type_t type, zval *src, int complain, struct gdphp_context_t *ctx) { int r = 0; dtracectx("%p, 0x%X, %p, %i", dst, type, src, complain); switch (type) { case GD_NULL: case GD_UNKNOWN: break; case GD_UINT8: CONVERT_ZVAL( uint8_t); break; case GD_INT8: CONVERT_ZVAL( int8_t); break; case GD_UINT16: CONVERT_ZVAL(uint16_t); break; case GD_INT16: CONVERT_ZVAL( int16_t); break; case GD_UINT32: CONVERT_ZVAL(uint32_t); break; case GD_INT32: CONVERT_ZVAL( int32_t); break; case GD_UINT64: CONVERT_ZVAL(uint64_t); break; case GD_INT64: CONVERT_ZVAL( int64_t); break; case GD_FLOAT32: CONVERT_ZVAL( float); break; case GD_FLOAT64: CONVERT_ZVAL( double); break; case GD_COMPLEX64: CCONVERT_ZVAL( float); break; case GD_COMPLEX128: CCONVERT_ZVAL( double); break; } dreturn("%i", r); return r; } static gd_type_t gdphp_to_datum_and_type(void *datum, zval *z, struct gdphp_context_t *ctx) { gd_type_t t = GD_UNKNOWN; dtracectx("%p, %p", datum, z); switch (Z_TYPE_P(z)) { case IS_LONG: t = GDPHP_LONG; *((gdphp_long_t*)datum) = Z_LVAL_P(z); break; case IS_DOUBLE: t = GD_FLOAT64; *((double*)datum) = Z_DVAL_P(z); break; case IS_ARRAY: /* check if it is a complex array */ if (gdphp_to_complex(datum, ((double*)datum) + 1, z, 0, ctx) == 0) { t = GD_COMPLEX128; break; } /* FALLTHROUGH */ default: GDPHP_DIE(ctx, "expected numeric scalar"); } dreturn("0x%X", t); return t; } gd_static_inline_ char *gdphp_check_null_string(char *v) { dtrace("\"%s\"", v); if (v == NULL || v[0] == 0) { dreturn("%p", NULL); return NULL; } dreturn("\"%s\"", v); return v; } static void gdphp_to_threshold(gd_triplet_t *t, gd_windop_t windop, zval *z, struct gdphp_context_t *ctx) { dtracectx("%p, %i, %p", t, windop, z); switch (windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: gdphp_to_datum(&t->i, GD_INT64, z, 1, ctx); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: gdphp_to_datum(&t->u, GD_UINT64, z, 1, ctx); break; default: gdphp_to_datum(&t->r, GD_FLOAT64, z, 1, ctx); break; } dreturnvoid(); } /* doesn't return on error */ static void gdphp_validate_type(gd_type_t t, struct gdphp_context_t *ctx) { dtracectx("0x%X", t); if (GD_SIZE(t) == 0) GDPHP_DIE(ctx, "bad data type"); dreturnvoid(); } /* convert a PHP array ot an array of complex data; returns length */ static int gdphp_convert_cmparray(double *out, zval *z, int min, int max, unsigned mask, struct gdphp_context_t *ctx) { HashTable *a = Z_ARRVAL_P(z); HashPosition i; zval **d = NULL; int n = -1; unsigned key_len; char *key; long index; int *have; dtracectx("%p, %p, %i, %i, 0x%X", out, z, min, max, mask); /* remember which elements we've seen */ have = emalloc(sizeof(int) * max); memset(have, 0, sizeof(int) * max); for (index = 0; index < max; ++index) if (mask & (1 << index)) have[index] = 1; /* populate the C array */ for (zend_hash_internal_pointer_reset_ex(a, &i); zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; zend_hash_move_forward_ex(a, &i)) { /* check key */ if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i) == HASH_KEY_IS_STRING) { GDPHP_DIE(ctx, "cannot use associative array"); } else if (index < 0 || index >= max) GDPHP_DIE2(ctx, "bad array index (%li)", index); if (!have[index]) { gdphp_to_datum(out + index * 2, GD_COMPLEX128, *d, 1, ctx); have[index] = 1; } } /* check for holes and calculate n */ for (index = max - 1; index >= 0; --index) { if (have[index] == 0 && n != -1) GDPHP_DIE(ctx, "uninitialised data in numeric array"); else if (have[index] && n == -1) n = index + 1; } if (n < min || n > max) GDPHP_DIE(ctx, "bad array count"); efree(have); dreturn("%i", n); return n; } /* convert a PHP array to a bounded array of strings; returns the number of * elements */ static int gdphp_convert_nsarray(char **out, zval *z, int min, int max, struct gdphp_context_t *ctx) { HashTable *a = Z_ARRVAL_P(z); HashPosition i; zval **d = NULL; int n = -1; unsigned key_len; char *key; long index; dtracectx("%p, %p, %i, %i", out, z, min, max); /* santitise */ memset(out, 0, sizeof(char*) * max); /* populate the C array */ for (zend_hash_internal_pointer_reset_ex(a, &i); zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; zend_hash_move_forward_ex(a, &i)) { /* check key */ if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i) == HASH_KEY_IS_STRING) { GDPHP_DIE(ctx, "cannot use associative array"); } else if (index < 0 || index >= max) GDPHP_DIE2(ctx, "bad array index (%li)", index); if (Z_TYPE_PP(d) != IS_STRING) GDPHP_DIE(ctx, "string array required"); out[index] = Z_STRVAL_PP(d); } /* check for holes and calculate n */ for (index = max - 1; index >= 0; --index) { if (out[index] == NULL && n != -1) GDPHP_DIE(ctx, "uninitialised data in string array"); else if (out[index] && n == -1) n = index + 1; } if (n < min || n > max) GDPHP_DIE(ctx, "bad string array count"); dreturn("%i", n); return n; } /* convert an array to data */ static void gdphp_convert_array(struct gdphp_din *din, zval *zdata, struct gdphp_context_t *ctx) { HashTable *a = Z_ARRVAL_P(zdata); HashPosition i; zval **d = NULL; char *key; unsigned key_len; long index; dtracectx("%p, %p", din, zdata); din->ns = 0; /* pass 1: validate data and determine ns */ for (zend_hash_internal_pointer_reset_ex(a, &i); zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; zend_hash_move_forward_ex(a, &i)) { /* make sure this isn't an associative array */ if (zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i) == HASH_KEY_IS_STRING) { GDPHP_DIE(ctx, "cannot use associative arrays"); } else if (index < 0) /* does zend_hash_get_current_key_ex return ulong or a long? */ GDPHP_DIE(ctx, "bad array index"); if ((unsigned long)index + 1 > din->ns) din->ns = index + 1; if (din->type == GD_UNKNOWN) { din->type = gdphp_get_type(*d, ctx); if (din->type == GD_UNKNOWN) GDPHP_DIE(ctx, "bad numeric type"); else if (din->type == GD_NULL) din->type = GD_UNKNOWN; } } if (din->ns == 0 || din->type == GD_UNKNOWN) { din->type = GD_NULL; din->ns = 0; } else { /* allocate the buffer */ din->free_din = 1; din->data = emalloc(din->ns * GD_SIZE(din->type)); /* zero */ if (din->type == GD_FLOAT64 || din->type == GD_COMPLEX128) { size_t j, ns = din->ns; if (din->type == GD_COMPLEX128) ns *= 2; for (j = 0; j < ns; ++j) ((double*)(din->data))[j] = NAN; } else if (din->type == GD_FLOAT32 || din->type == GD_COMPLEX64) { size_t j, ns = din->ns; if (din->type == GD_COMPLEX128) ns *= 2; for (j = 0; j < ns; ++j) ((float*)(din->data))[j] = (float)NAN; } else memset(din->data, 0, din->ns * GD_SIZE(din->type)); /* pass 2: convert the data */ for (zend_hash_internal_pointer_reset_ex(a, &i); zend_hash_get_current_data_ex(a, (void*)&d, &i) == SUCCESS; zend_hash_move_forward_ex(a, &i)) { zend_hash_get_current_key_ex(a, &key, &key_len, (ulong*)&index, 0, &i); gdphp_to_datum(((char*)(din->data)) + index * GD_SIZE(din->type), din->type, *d, 1, ctx); } } dreturn("0x%X, %zu", din->type, din->ns); } /* convert input data */ static struct gdphp_din gdphp_convert_data(zval *zdata1, zval *zdata2, int p1, int p2) { struct gdphp_din din; dtrace("%p, %p, %i, %i", zdata1, zdata2, p1, p2); if (zdata2 == NULL) { GDPHP_CONTEXTp(ctx,p1); if (Z_TYPE_P(zdata1) == IS_ARRAY) { din.type = GD_UNKNOWN; gdphp_convert_array(&din, zdata1, &ctx); } else GDPHP_DIE(&ctx, "bad input data: expected array or type code"); } else { /* in the two argument case, the first argument is taken to be a type code */ GDPHP_CONTEXTp(ctx,p1); din.type = gdphp_type_from_long(zdata1, &ctx); /* doesn't return on error */ ctx.p = p2; switch (Z_TYPE_P(zdata2)) { case IS_STRING: /* packed data -- just use it in place */ din.data = Z_STRVAL_P(zdata2); din.ns = Z_STRLEN_P(zdata2) / GD_SIZE(din.type); din.free_din = 0; break; case IS_ARRAY: gdphp_convert_array(&din, zdata2, &ctx); break; default: GDPHP_DIE(&ctx, "bad input data: expected array or string"); } } dreturn("{%p, 0x%X, %i, %zu}", din.data, din.type, din.free_din, din.ns); return din; } static long gdphp_convert_long(zval *z, struct gdphp_context_t *ctx) { long l; dtracectx("%p", z); if (Z_TYPE_P(z) != IS_LONG && Z_TYPE_P(z) != IS_DOUBLE) GDPHP_DIE(ctx, "expected number"); convert_to_long(z); /* coerce */ l = Z_LVAL_P(z); dreturn("%li", l); return l; } static double gdphp_convert_double(zval *z, struct gdphp_context_t *ctx) { double d; dtracectx("%p", z); if (Z_TYPE_P(z) != IS_LONG && Z_TYPE_P(z) != IS_DOUBLE) GDPHP_DIE(ctx, "expected number"); convert_to_double(z); /* coerce */ d = Z_DVAL_P(z); dreturn("%g", d); return d; } /* convert PHP string with error checking */ static char *gdphp_convert_string(zval *z, struct gdphp_context_t *ctx) { char *s; dtracectx("%p", z); if (Z_TYPE_P(z) != IS_STRING) GDPHP_DIE(ctx, "expected string"); s = Z_STRVAL_P(z); dreturn("\"%s\"", s); return s; } static void gdphp_entry_complex(double *v, HashTable *a, const char *key, size_t len, int partial, struct gdphp_context_t *ctx) { zval **z; dtracectx("%p, %p, \"%s\", %zu, %i", v, a, key, len, partial); if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { ctx->k = key; gdphp_to_datum(v, GD_COMPLEX128, *z, 1, ctx); ctx->k = NULL; } else if (!partial) GDPHP_DIE2(ctx, "required key '%s' not found", key); dreturnvoid(); } static long gdphp_entry_long(HashTable *a, const char *key, size_t len, int *missing, int partial, struct gdphp_context_t *ctx) { long r = 0; zval **z; dtracectx("%p, \"%s\", %zu, %p, %i", a, key, len, missing, partial); if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { ctx->k = key; r = gdphp_convert_long(*z, ctx); ctx->k = NULL; if (missing != NULL) *missing = 0; } else if (missing != NULL) *missing = 1; else if (!partial) GDPHP_DIE2(ctx, "required key '%s' not found", key); dreturn("%li", r); return r; } static double gdphp_entry_double(HashTable *a, const char *key, size_t len, int partial, struct gdphp_context_t *ctx) { double r = 0; zval **z; dtracectx("%p, \"%s\", %zu, %i", a, key, len, partial); if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { ctx->k = key; r = gdphp_convert_double(*z, ctx); ctx->k = NULL; } else if (!partial) GDPHP_DIE2(ctx, "required key '%s' not found", key); dreturn("%g", r); return r; } static int gdphp_entry_infields(char **l, HashTable *a, int min, int max, int partial, struct gdphp_context_t *ctx) { zval **z; int n = 0; dtracectx("%p, %p, %i, %i, %i", l, a, min, max, partial); if (zend_hash_find(a, "in_fields", sizeof("in_fields"), (void**)&z) == SUCCESS) { ctx->k = "in_fields"; if (Z_TYPE_PP(z) == IS_ARRAY) n = gdphp_convert_nsarray(l, *z, min, max, ctx); else if (Z_TYPE_PP(z) == IS_STRING) { if (min > 1) GDPHP_DIE(ctx, "bad string array count"); n = 1; l[0] = gdphp_convert_string(*z, ctx); } else GDPHP_DIE(ctx, "expected string or string array"); ctx->k = NULL; } else if (!partial) GDPHP_DIE(ctx, "required key 'in_fields' not found"); dreturn("%i", n); return n; } static int gdphp_entry_cmparray(double *l, HashTable *a, char *key, size_t len, int min, int max, unsigned mask, int partial, struct gdphp_context_t *ctx) { zval **z; int n = 0; dtracectx("%p, %p, \"%s\", %zu, %i, %i, 0x%X", l, a, key, len, min, max, mask); if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { ctx->k = key; if (Z_TYPE_PP(z) == IS_ARRAY) n = gdphp_convert_cmparray(l, *z, min, max, mask, ctx); else if (Z_TYPE_PP(z) == IS_DOUBLE) { if (min > 1) GDPHP_DIE(ctx, "bad array count"); n = 1; l[0] = Z_DVAL_PP(z); } else GDPHP_DIE(ctx, "expected array or float"); ctx->k = NULL; } else if (!partial) GDPHP_DIE2(ctx, "required key '%s' not found", key); dreturn("%i", n); return n; } /* populate an entry from the scalar array in an entry array; returns a * bitmask of the elements set */ static unsigned gdphp_entry_scalars(char** scalar, int *scalar_ind, HashTable *a, unsigned mask, struct gdphp_context_t *ctx) { unsigned mask_out = 0; zval **z; int i; dtracectx("%p, %p, %p, 0x%X", scalar, scalar_ind, a, mask); /* find 'scalar' in the entry array */ if (zend_hash_find(a, "scalar", sizeof("scalar"), (void**)&z) != SUCCESS) { dreturn("%i", 0); return 0; } ctx->k = "scalar"; /* 'scalar' must be an array (or null) */ if (Z_TYPE_PP(z) == IS_NULL) { ctx->k = NULL; dreturn("%i", 0); return 0; } else if (Z_TYPE_PP(z) != IS_ARRAY) GDPHP_DIE(ctx, "expected array"); /* loop through the array of scalars */ a = Z_ARRVAL_PP(z); for (i = 0; i < 2 * GD_MAX_LINCOM; ++i) { if (!(mask & (1 << i))) continue; /* get the i'th scalar array element */ ctx->i = i; if (zend_hash_index_find(a, i, (void**)&z) == SUCCESS) { HashTable *sa; if (Z_TYPE_PP(z) == IS_NULL) continue; if (Z_TYPE_PP(z) != IS_ARRAY) GDPHP_DIE(ctx, "expected array"); sa = Z_ARRVAL_PP(z); /* element zero should be the name of a scalar field. */ if (zend_hash_index_find(sa, 0, (void**)&z) == SUCCESS) { if (Z_TYPE_PP(z) != IS_STRING) GDPHP_DIE(ctx, "expected scalar field name"); scalar[i] = Z_STRVAL_PP(z); } else GDPHP_DIE(ctx, "element zero of should be scalar field name"); mask_out |= 1 << i; /* element one should be the index; if missing zero is assumed */ if (zend_hash_index_find(sa, 1, (void**)&z) == SUCCESS) { convert_to_long(*z); /* coerce */ scalar_ind[i] = Z_LVAL_PP(z); } else scalar_ind[i] = 0; } } ctx->k = NULL; ctx->i = -1; dreturn("0x%02X", mask_out); return mask_out; } static char *gdphp_entry_string(HashTable *a, const char *key, size_t len, int partial, struct gdphp_context_t *ctx) { char *s = NULL; zval **z; dtracectx("%p, \"%s\", %zu, %i", a, key, len, partial); if (zend_hash_find(a, key, len, (void**)&z) == SUCCESS) { ctx->k = key; s = gdphp_convert_string(*z, ctx); ctx->k = NULL; } else if (!partial) GDPHP_DIE2(ctx, "required key '%s' not found", key); dreturn("\"%s\"", s); return s; } /* convert an entry array to a gd_entry_t; z is known to be an array */ static void gdphp_to_entry(gd_entry_t *E, zval *z, const gd_entry_t *old_E, int no_fragment, struct gdphp_context_t *ctx) { /* lincom scalar masks */ const unsigned lincom_mask[4] = { 0x00, 0x09, 0x1B, 0x3F }; const int partial = (old_E != NULL); int n, missing = 0, min = 0, max = 0; unsigned mask, tmask; HashTable *a = Z_ARRVAL_P(z); dtracectx("%p, %p, %p, %i", E, z, old_E, no_fragment); if (old_E) memcpy(E, old_E, sizeof(gd_entry_t)); else memset(E, 0, sizeof(gd_entry_t)); if (!partial) E->field = gdphp_entry_string(a, "field", sizeof("field"), partial, ctx); E->field_type = gdphp_entry_long(a, "field_type", sizeof("field_type"), NULL, partial, ctx); if (no_fragment) E->fragment_index = 0; else E->fragment_index = gdphp_entry_long(a, "fragment_index", sizeof("fragment_index"), NULL, partial, ctx); switch (E->field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 3, ctx); if (!(mask & 1)) E->EN(bit,bitnum) = gdphp_entry_long(a, "bitnum", sizeof("bitnum"), NULL, partial, ctx); if (!(mask & 2)) { E->EN(bit,numbits) = gdphp_entry_long(a, "numbits", sizeof("numbits"), &missing, partial, ctx); if (missing && !partial) E->EN(bit,numbits) = 1; } break; case GD_CARRAY_ENTRY: E->EN(scalar,array_len) = gdphp_entry_long(a, "array_len", sizeof("array_len"), NULL, partial, ctx); /* FALLTHROUGH */ case GD_CONST_ENTRY: E->EN(scalar,const_type) = gdphp_entry_long(a, "const_type", sizeof("const_type"), NULL, partial, ctx); break; case GD_LINCOM_ENTRY: /* honour n_fields, if given */ n = gdphp_entry_long(a, "n_fields", sizeof("n_fields"), &missing, partial, ctx); if (missing) { min = 1; max = GD_MAX_LINCOM; } else if (n < 1 || n > GD_MAX_LINCOM) { GDPHP_DIE2(ctx, "bad value for 'n_fields' (%i)", n); } else min = max = n; E->EN(lincom,n_fields) = gdphp_entry_infields((char**)E->in_fields, a, min, max, partial, ctx); if (E->EN(lincom,n_fields) != 0) min = max = E->EN(lincom,n_fields); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, lincom_mask[max], ctx); E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; if ((mask & tmask) != tmask) gdphp_entry_cmparray((double*)E->EN(lincom,cm), a, "m", sizeof("m"), min, max, mask, partial, ctx); if (((mask >> GD_MAX_LINCOM) & tmask) != tmask) gdphp_entry_cmparray((double*)E->EN(lincom,cb), a, "b", sizeof("m"), min, max, mask >> GD_MAX_LINCOM, partial, ctx); else E->EN(lincom,n_fields) = max; break; case GD_LINTERP_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); E->EN(linterp,table) = gdphp_entry_string(a, "table", sizeof("table"), partial, ctx); break; case GD_MPLEX_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 3, ctx); if (!(mask & 1)) E->EN(mplex,count_val) = gdphp_entry_long(a, "count_val", sizeof("count_val"), NULL, partial, ctx); if (!(mask & 2)) { E->EN(mplex,period) = gdphp_entry_long(a, "period", sizeof("period"), &missing, partial, ctx); if (missing) E->EN(mplex,period) = 0; } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx); break; case GD_PHASE_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); if (!(mask & 1)) E->EN(phase,shift) = gdphp_entry_long(a, "shift", sizeof("shift"), NULL, partial, ctx); break; case GD_POLYNOM_ENTRY: /* honour poly_ord, if given */ n = gdphp_entry_long(a, "poly_ord", sizeof("poly_ord"), &missing, partial, ctx); if (missing) { min = 2; max = GD_MAX_POLYORD + 1; } else if (n < 1 || n > GD_MAX_POLYORD) { GDPHP_DIE2(ctx, "bad value for 'poly_ord' (%i)", n); } else min = max = n + 1; gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, (1 << max) - 1, ctx); E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; if ((mask & tmask) != tmask) E->EN(polynom,poly_ord) = gdphp_entry_cmparray((double*)E->EN(polynom,ca), a, "a", sizeof("a"), min, max, mask, partial, ctx) - 1; else E->EN(polynom,poly_ord) = max - 1; break; case GD_RAW_ENTRY: E->EN(raw,data_type) = gdphp_entry_long(a, "data_type", sizeof("data_type"), NULL, partial, ctx); E->EN(raw,spf) = gdphp_entry_long(a, "spf", sizeof("spf"), NULL, partial, ctx); break; case GD_RECIP_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 1, 1, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); E->flags |= GD_EN_COMPSCAL; if (!(mask & 1)) gdphp_entry_complex((double*)gd_csp_(E->EN(recip,cdividend)), a, "dividend", sizeof("dividend"), partial, ctx); break; case GD_STRING_ENTRY: /* nothing to do */ break; case GD_WINDOW_ENTRY: gdphp_entry_infields((char**)E->in_fields, a, 2, 2, partial, ctx); mask = gdphp_entry_scalars(E->scalar, E->scalar_ind, a, 1, ctx); E->EN(window,windop) = gdphp_entry_long(a, "windop", sizeof("windop"), NULL, partial, ctx); if (!(mask & 1)) switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: E->EN(window,threshold.i) = gdphp_entry_long(a, "threshold", sizeof("threshold"), NULL, partial, ctx); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: E->EN(window,threshold.u) = gdphp_entry_long(a, "threshold", sizeof("threshold"), NULL, partial, ctx); break; default: E->EN(window,threshold.r) = gdphp_entry_double(a, "threshold", sizeof("threshold"), partial, ctx); break; } break; default: GDPHP_DIE2(ctx, "bad field type (%i)", E->field_type); } dreturnvoid(); } /* convert a C string list to a array of strings; if n is zero, the list is * NULL terminated */ static zval *gdphp_to_string_array(zval *z, const char **l, int n) { int i; dtrace("%p, %p, %i", z, l, n); if (z == NULL) ALLOC_INIT_ZVAL(z); array_init(z); for (i = 0; (l[i] && n == 0) || (n > 0 && i < n); ++i) if (l[i] == NULL) add_index_null(z, i); else add_index_string(z, i, l[i], 1); dreturn("%p", z); return z; } /* convert a datum to a PHP value */ static void gdphp_from_datum(zval *z, void *datum, gd_type_t type) { dtrace("%p, %p, 0x%X", z, datum, type); switch (type) { case GD_UINT8: ZVAL_LONG(z, *((uint8_t*)datum)); break; case GD_INT8: ZVAL_LONG(z, *((int8_t*)datum)); break; case GD_UINT16: ZVAL_LONG(z, *((uint16_t*)datum)); break; case GD_INT16: ZVAL_LONG(z, *((int16_t*)datum)); break; case GD_UINT32: ZVAL_LONG(z, *((uint32_t*)datum)); break; case GD_INT32: ZVAL_LONG(z, *((int32_t*)datum)); break; case GD_UINT64: ZVAL_LONG(z, *((uint64_t*)datum)); break; case GD_INT64: ZVAL_LONG(z, *((int64_t*)datum)); break; case GD_FLOAT32: ZVAL_DOUBLE(z, *((float*)datum)); break; case GD_FLOAT64: ZVAL_DOUBLE(z, *((double*)datum)); break; case GD_COMPLEX64: gdphp_from_complex(z, ((float*)datum)[0], ((float*)datum)[1]); break; case GD_COMPLEX128: gdphp_from_complex(z, ((double*)datum)[0], ((double*)datum)[1]); break; default: ZVAL_NULL(z); break; } dreturnvoid(); } /* convert a data vector to a PHP array -- must already be initialised as * an array */ static void gdphp_data_to_array(zval *a, const void *data, gd_type_t type, size_t n) { size_t i; dtrace("%p, %p, 0x%X, %zu", a, data, type, n); switch (type) { case GD_UINT8: for (i = 0; i < n; ++i) add_index_long(a, i, ((uint8_t*)(data))[i]); break; case GD_INT8: for (i = 0; i < n; ++i) add_index_long(a, i, ((int8_t*)(data))[i]); break; case GD_UINT16: for (i = 0; i < n; ++i) add_index_long(a, i, ((uint16_t*)(data))[i]); break; case GD_INT16: for (i = 0; i < n; ++i) add_index_long(a, i, ((int16_t*)(data))[i]); break; case GD_UINT32: for (i = 0; i < n; ++i) add_index_long(a, i, ((uint32_t*)(data))[i]); break; case GD_INT32: for (i = 0; i < n; ++i) add_index_long(a, i, ((int32_t*)(data))[i]); break; case GD_UINT64: for (i = 0; i < n; ++i) add_index_long(a, i, ((uint64_t*)(data))[i]); break; case GD_INT64: for (i = 0; i < n; ++i) add_index_long(a, i, ((int64_t*)(data))[i]); break; case GD_FLOAT32: for (i = 0; i < n; ++i) add_index_double(a, i, ((float*)(data))[i]); break; case GD_FLOAT64: for (i = 0; i < n; ++i) add_index_double(a, i, ((double*)(data))[i]); break; case GD_COMPLEX64: for (i = 0; i < n; ++i) add_index_zval(a, i, gdphp_from_complex(NULL, ((float*)(data))[i * 2], ((float*)(data))[i * 2 + 1])); break; case GD_COMPLEX128: for (i = 0; i < n; ++i) add_index_zval(a, i, gdphp_from_complex(NULL, ((double*)(data))[i * 2], ((double*)(data))[i * 2 + 1])); break; default: /* fill with nulls */ for (i = 0; i < n; ++i) add_index_null(a, i); break; } dreturnvoid(); } static zval *gdphp_from_data(zval *z, size_t n, gd_type_t data_type, void *data, int duplicate, int unpack) { dtrace("%p, %zu, 0x%X, %p, %i, %i", z, n, data_type, data, duplicate, unpack); if (z == NULL) ALLOC_INIT_ZVAL(z); if (unpack) { array_init(z); gdphp_data_to_array(z, data, data_type, n); if (!duplicate) efree(data); } else { /* packed data */ if (n == 0) { if (!duplicate) efree(data); ZVAL_EMPTY_STRING(z); } else { if (!duplicate) data = erealloc(data, n * GD_SIZE(data_type)); /* trim excess */ ZVAL_STRINGL(z, data, n * GD_SIZE(data_type), duplicate); } } dreturn("%p", z); return z; } /* convert a zval to a long, with null checking - unfortunately PHP * automatically converts nulls passed as longs into zero */ static int gdphp_long_from_zval_null(zval *z, long dflt) { long v = dflt; dtrace("%p, %li", z, dflt); if (z != NULL && Z_TYPE_P(z) != IS_NULL) { convert_to_long(z); /* coerce */ v = Z_LVAL_P(z); } dreturn("%li", v); return v; } /* get the unpack value */ static zend_bool gdphp_unpack(zval *z) { zend_bool unpack; dtrace("%p", z); TSRMLS_FETCH(); if (z != NULL && Z_TYPE_P(z) != IS_NULL) { convert_to_boolean(z); /* coerce */ unpack = Z_BVAL_P(z); } else unpack = GDPHP_G(unpack); dreturn("%i", unpack); return unpack; } static void gdphp_init_globals(zend_getdata_globals *g) { dtrace("%p", g); g->unpack = 0; g->degrade_complex = 1; dreturnvoid(); } /* module init function */ PHP_MINIT_FUNCTION(getdata) { dtracetsrm("%i, %i", type, module_number); /* initialise globals */ ZEND_INIT_MODULE_GLOBALS(getdata, gdphp_init_globals, NULL); /* INI entries */ REGISTER_INI_ENTRIES(); /* Register constants */ gdphp_register_constants(module_number); /* conveniences */ zend_register_long_constant(ZEND_STRS("GD_INT"), GDPHP_LONG, CONST_CS, module_number TSRMLS_CC); zend_register_long_constant(ZEND_STRS("GD_FLOAT"), GD_FLOAT64, CONST_CS, module_number TSRMLS_CC); /* dirfile resource */ le_gdphp_dirfile = zend_register_list_destructors_ex(gdphp_dirfile_dtor, NULL, "Dirfile", module_number); le_gdphp_dirfile_persist = zend_register_list_destructors_ex(NULL, gdphp_dirfile_pdtor, "Dirfile", module_number); dreturn("%i", 0); return 0; } PHP_MSHUTDOWN_FUNCTION(getdata) { dtracetsrm("%i, %i", type, module_number); UNREGISTER_INI_ENTRIES(); dreturn("%i", SUCCESS); return SUCCESS; } PHP_MINFO_FUNCTION(getdata) { dtracetsrm("%p", zend_module); php_info_print_table_start(); php_info_print_table_header(2, "GetData support", "enabled"); php_info_print_table_row(2, "Version", PACKAGE_VERSION); php_info_print_table_end(); dreturnvoid(); } /* BINDINGS */ PHP_FUNCTION(gd_add) { zval *z; gd_entry_t E; DIRFILE *D; GDPHP_CONTEXTp(ctx,2); dtracephp(); GDPHP_PARSED("a", &z); gdphp_to_entry(&E, z, NULL, 0, &ctx); /* no need to free entry strings */ GDPHP_RETURN_BOOL(gd_add(D, &E)); } PHP_FUNCTION(gd_add_alias) { char *field_code, *target; int field_code_len, target_len; long index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ss|l", &field_code, &field_code_len, &target, &target_len, &index); GDPHP_RETURN_BOOL(gd_add_alias(D, field_code, target, index)); } PHP_FUNCTION(gd_add_bit) { char *field_code, *in_field; int field_code_len, in_field_len; long bitnum, index = 0; zval *znumbits = NULL; int numbits; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssl|zl", &field_code, &field_code_len, &in_field, &in_field_len, &bitnum, &znumbits, &index); numbits = gdphp_long_from_zval_null(znumbits, 1); GDPHP_RETURN_BOOL(gd_add_bit(D, field_code, in_field, bitnum, numbits, index)); } PHP_FUNCTION(gd_add_carray) { char *field_code; int field_code_len; long data_type; zval *z1, *z2 = NULL, *z3 = NULL; DIRFILE *D; int r; struct gdphp_din din; int index = 0; dtracephp(); GDPHP_PARSED("slz|zz", &field_code, &field_code_len, &data_type, &z1, &z2, &z3); /* allowed types for the last three parameters: * * 1: anything: data * 2: array, anything: data, index * 3: other, anything: type, data * 4: other, anything, anything: type, data, index */ if (z2 == NULL) /* 1 */ din = gdphp_convert_data(z1, NULL, 3, 4); else if (Z_TYPE_P(z1) == IS_ARRAY) { /* 2 */ din = gdphp_convert_data(z1, NULL, 3, 3); convert_to_long(z2); /* coerce */ index = Z_LVAL_P(z2); } else if (z3 == NULL) /* 3 */ din = gdphp_convert_data(z1, z2, 3, 4); else { /* 4 */ din = gdphp_convert_data(z1, z2, 3, 4); convert_to_long(z3); /* coerce */ index = Z_LVAL_P(z3); } r = gd_add_carray(D, field_code, data_type, din.ns, din.type, din.data, index); if (din.free_din) efree(din.data); GDPHP_RETURN_BOOL(r); } PHP_FUNCTION(gd_add_const) { char *field_code; int field_code_len; long data_type, index = 0; zval *z; DIRFILE *D; char data[16]; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("slz|l", &field_code, &field_code_len, &data_type, &z, &index); /* might as well convert to the storage type now */ gdphp_to_datum(data, data_type, z, 1, &ctx); GDPHP_RETURN_BOOL(gd_add_const(D, field_code, data_type, data_type, data, index)); } PHP_FUNCTION(gd_add_divide) { char *field_code, *in1, *in2; int field_code_len, in1_len, in2_len; long index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &index); GDPHP_RETURN_BOOL(gd_add_divide(D, field_code, in1, in2, index)); } PHP_FUNCTION(gd_add_lincom) { char *field_code; int field_code_len; long index = 0; zval *zin, *zm, *zb; char *in[GD_MAX_LINCOM]; double m[GD_MAX_LINCOM * 2]; double b[GD_MAX_LINCOM * 2]; int n; DIRFILE *D; GDPHP_CONTEXT(ctx); dtracephp(); GDPHP_PARSED("saaa|l", &field_code, &field_code_len, &zin, &zm, &zb, &index); /* these don't return on error */ ctx.p = 2; n = gdphp_convert_nsarray((char**)in, zin, 1, GD_MAX_LINCOM, &ctx); ctx.p = 3; gdphp_convert_cmparray(m, zm, n, n, 0, &ctx); ctx.p = 4; gdphp_convert_cmparray(b, zb, n, n, 0, &ctx); GDPHP_RETURN_BOOL(gd_add_clincom(D, field_code, n, (const char**)in, (GD_DCOMPLEXP_t)m, (GD_DCOMPLEXP_t)b, index)); } PHP_FUNCTION(gd_add_linterp) { char *field_code, *in_field, *table; int field_code_len, in_field_len, table_len; long index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in_field, &in_field_len, &table, &table_len, &index); GDPHP_RETURN_BOOL(gd_add_linterp(D, field_code, in_field, table, index)); } PHP_FUNCTION(gd_add_mplex) { char *field_code, *in1, *in2; int field_code_len, in1_len, in2_len; long count, period = 0, index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sssl|ll", &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &count, &period, &index); GDPHP_RETURN_BOOL(gd_add_mplex(D, field_code, in1, in2, count, period, index)); } PHP_FUNCTION(gd_add_multiply) { char *field_code, *in1, *in2; int field_code_len, in1_len, in2_len; long index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sss|l", &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &index); GDPHP_RETURN_BOOL(gd_add_multiply(D, field_code, in1, in2, index)); } PHP_FUNCTION(gd_add_phase) { char *field_code, *in_field; int field_code_len, in_field_len; long shift, index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssl|l", &field_code, &field_code_len, &in_field, &in_field_len, &shift, &index); GDPHP_RETURN_BOOL(gd_add_phase(D, field_code, in_field, shift, index)); } PHP_FUNCTION(gd_add_polynom) { char *field_code, *in_field; int field_code_len, in_field_len; long index = 0; zval *za; double a[2 * (GD_MAX_POLYORD + 1)]; int o; DIRFILE *D; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("ssa|l", &field_code, &field_code_len, &in_field, &in_field_len, &za, &index); /* doesn't return on error */ o = gdphp_convert_cmparray(a, za, 2, GD_MAX_POLYORD + 1, 0, &ctx) - 1; GDPHP_RETURN_BOOL(gd_add_cpolynom(D, field_code, o, in_field, (GD_DCOMPLEXP_t)a, index)); } PHP_FUNCTION(gd_add_raw) { char *field_code; int field_code_len; long data_type, spf, index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sll|l", &field_code, &field_code_len, &data_type, &spf, &index); GDPHP_RETURN_BOOL(gd_add_raw(D, field_code, data_type, spf, index)); } PHP_FUNCTION(gd_add_recip) { char *field_code, *in_field; int field_code_len, in_field_len; zval *zdividend; long index = 0; double dividend[2]; DIRFILE *D; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("ssz|l", &field_code, &field_code_len, &in_field, &in_field_len, &zdividend, &index); gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx); GDPHP_RETURN_BOOL(gd_add_crecip89(D, field_code, in_field, dividend, index)); } PHP_FUNCTION(gd_add_sbit) { char *field_code, *in_field; int field_code_len, in_field_len; long bitnum, index = 0; zval *znumbits = NULL; int numbits; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssl|zl", &field_code, &field_code_len, &in_field, &in_field_len, &bitnum, &znumbits, &index); numbits = gdphp_long_from_zval_null(znumbits, 1); GDPHP_RETURN_BOOL(gd_add_sbit(D, field_code, in_field, bitnum, numbits, index)); } PHP_FUNCTION(gd_add_spec) { char *spec; int spec_len; long index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("s|l", &spec, &spec_len, &index); GDPHP_RETURN_BOOL(gd_add_spec(D, spec, index)); } PHP_FUNCTION(gd_add_string) { char *field_code, *value; int field_code_len, value_len; long index = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ss|l", &field_code, &field_code_len, &value, &value_len, &index); GDPHP_RETURN_BOOL(gd_add_string(D, field_code, value, index)); } PHP_FUNCTION(gd_add_window) { char *field_code, *in1, *in2; int field_code_len, in1_len, in2_len; long windop, index = 0; zval *zthreshold; gd_triplet_t threshold; DIRFILE *D; GDPHP_CONTEXTp(ctx,5); dtracephp(); GDPHP_PARSED("ssslz|l", &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &windop, &zthreshold, &index); gdphp_to_threshold(&threshold, windop, zthreshold, &ctx); GDPHP_RETURN_BOOL(gd_add_window(D, field_code, in1, in2, windop, threshold, index)); } PHP_FUNCTION(gd_alias_target) { char *field_code; int field_code_len; DIRFILE *D; const char *s; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); s = gd_alias_target(D, field_code); if (s == NULL) GDPHP_RETURN_F; dreturn("\"%s\"", s); RETURN_STRING(s, 1); } PHP_FUNCTION(gd_aliases) { char *field_code; int field_code_len; DIRFILE *D; const char **fl; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); fl = gd_aliases(D, field_code); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_alter_affixes) { zval *zprefix, *zsuffix; long index; char *prefix = NULL, *suffix = NULL; DIRFILE *D; dtracephp(); GDPHP_PARSED("lzz", &index, &zprefix, &zsuffix); if (Z_TYPE_P(zprefix) != IS_NULL) { convert_to_string(zprefix); /* coerce */ prefix = Z_STRVAL_P(zprefix); } if (Z_TYPE_P(zsuffix) != IS_NULL) { convert_to_string(zsuffix); /* coerce */ suffix = Z_STRVAL_P(zsuffix); } GDPHP_RETURN_BOOL(gd_alter_affixes(D, index, prefix, suffix)); } PHP_FUNCTION(gd_alter_bit) { char *field_code, *in_field = NULL; int field_code_len, in_field_len; long numbits = 0; zval *zbitnum = NULL; DIRFILE *D; char *in_fieldp; int bitnum; dtracephp(); GDPHP_PARSED("s|szl", &field_code, &field_code_len, &in_field, &in_field_len, &zbitnum, &numbits); in_fieldp = gdphp_check_null_string(in_field); bitnum = gdphp_long_from_zval_null(zbitnum, -1); GDPHP_RETURN_BOOL(gd_alter_bit(D, field_code, in_fieldp, bitnum, numbits)); } PHP_FUNCTION(gd_alter_carray) { char *field_code; int field_code_len; long type = GD_NULL, len = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("s|ll", &field_code, &field_code_len, &type, &len); GDPHP_RETURN_BOOL(gd_alter_carray(D, field_code, type, len)); } PHP_FUNCTION(gd_alter_const) { char *field_code; int field_code_len; long type = GD_NULL; DIRFILE *D; dtracephp(); GDPHP_PARSED("s|l", &field_code, &field_code_len, &type); GDPHP_RETURN_BOOL(gd_alter_const(D, field_code, type)); } PHP_FUNCTION(gd_alter_encoding) { long e, i; zend_bool recode = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ll|b", &e, &i, &recode); GDPHP_RETURN_BOOL(gd_alter_encoding(D, e, i, recode)); } PHP_FUNCTION(gd_alter_endianness) { long e, i; zend_bool recode = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ll|b", &e, &i, &recode); GDPHP_RETURN_BOOL(gd_alter_endianness(D, e, i, recode)); } PHP_FUNCTION(gd_alter_entry) { char *field_code; int field_code_len; zend_bool recode = 0; zval *z; gd_entry_t E, old_E; DIRFILE *D; GDPHP_CONTEXTp(ctx,2); dtracephp(); GDPHP_PARSED("sa|b", &field_code, &field_code_len, &z, &recode); /* find the old entry */ if (gd_entry(D, field_code, &old_E)) GDPHP_RETURN_F; gd_free_entry_strings(&old_E); /* don't need these */ gdphp_to_entry(&E, z, &old_E, 1, &ctx); GDPHP_RETURN_BOOL(gd_alter_entry(D, field_code, &E, recode)); } PHP_FUNCTION(gd_alter_frameoffset) { long i, o; zend_bool recode = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ll|b", &o, &i, &recode); GDPHP_RETURN_BOOL(gd_alter_frameoffset64(D, o, i, recode)); } PHP_FUNCTION(gd_alter_divide) { char *field_code, *in_field1 = NULL, *in_field2 = NULL; int field_code_len, in_field1_len, in_field2_len; DIRFILE *D; char *in_field1p, *in_field2p; dtracephp(); GDPHP_PARSED("s|ss", &field_code, &field_code_len, &in_field1, &in_field1_len, &in_field2, &in_field2_len); in_field1p = gdphp_check_null_string(in_field1); in_field2p = gdphp_check_null_string(in_field2); GDPHP_RETURN_BOOL(gd_alter_divide(D, field_code, in_field1p, in_field2p)); } PHP_FUNCTION(gd_alter_lincom) { char *field_code; int field_code_len; long n = 0; zval *zin = NULL, *zm = NULL, *zb = NULL; DIRFILE *D; int min, max, nout; const char *in_fields[GD_MAX_LINCOM]; const char **in_fieldsp = in_fields; double m[GD_MAX_LINCOM * 2]; double b[GD_MAX_LINCOM * 2]; GD_DCOMPLEXP_t mp = (GD_DCOMPLEXP_t)m; GD_DCOMPLEXP_t bp = (GD_DCOMPLEXP_t)b; GDPHP_CONTEXT(ctx); dtracephp(); GDPHP_PARSED("s|lzzz", &field_code, &field_code_len, &n, &zin, &zm, &zb); /* handle passed nulls */ if (n == 0) { min = 1; max = GD_MAX_LINCOM; } else min = max = n; if (zin == NULL || Z_TYPE_P(zin) == IS_NULL) { in_fieldsp = NULL; } else { int nout; min = n, max = n; ctx.p = 2; nout = gdphp_convert_nsarray((char**)in_fields, zin, 1, GD_MAX_LINCOM, &ctx); if (n == 0) min = max = n = nout; } if (zm == NULL || Z_TYPE_P(zm) == IS_NULL) mp = NULL; else { ctx.p = 3; nout = gdphp_convert_cmparray(m, zm, min, max, 0, &ctx); if (n == 0) min = max = n = nout; } if (zb == NULL || Z_TYPE_P(zb) == IS_NULL) bp = NULL; else { ctx.p = 4; nout = gdphp_convert_cmparray(b, zb, min, max, 0, &ctx); if (n == 0) n = nout; } GDPHP_RETURN_BOOL(gd_alter_clincom(D, field_code, n, in_fieldsp, mp, bp)); } PHP_FUNCTION(gd_alter_linterp) { char *field_code, *in_field = NULL, *table = NULL; int field_code_len, in_field_len, table_len; zend_bool rename = 0; DIRFILE *D; char *in_fieldp, *tablep; dtracephp(); GDPHP_PARSED("s|ssb", &field_code, &field_code_len, &in_field, &in_field_len, &table, &table_len, &rename); in_fieldp = gdphp_check_null_string(in_field); tablep = gdphp_check_null_string(table); GDPHP_RETURN_BOOL(gd_alter_linterp(D, field_code, in_fieldp, tablep, rename)); } PHP_FUNCTION(gd_alter_mplex) { char *field_code, *in_field1 = NULL, *in_field2 = NULL; int field_code_len, in_field1_len, in_field2_len; zval *zcount_val = NULL, *zperiod = NULL; DIRFILE *D; char *in_field1p, *in_field2p; int count_val, period; dtracephp(); GDPHP_PARSED("s|sszz", &field_code, &field_code_len, &in_field1, &in_field1_len, &in_field2, &in_field2_len, &zcount_val, &zperiod); in_field1p = gdphp_check_null_string(in_field1); in_field2p = gdphp_check_null_string(in_field2); period = gdphp_long_from_zval_null(zperiod, -1); /* there's no way to indicate no change to count_val in the C API */ if (zcount_val == NULL || Z_TYPE_P(zcount_val) == IS_NULL) { gd_entry_t E; if (gd_entry(D, field_code, &E)) GDPHP_RETURN_F; count_val = E.EN(mplex,count_val); gd_free_entry_strings(&E); } else { convert_to_long(zcount_val); /* coerce */ count_val = Z_LVAL_P(zcount_val); } GDPHP_RETURN_BOOL(gd_alter_mplex(D, field_code, in_field1p, in_field2p, count_val, period)); } PHP_FUNCTION(gd_alter_multiply) { char *field_code, *in_field1 = NULL, *in_field2 = NULL; int field_code_len, in_field1_len, in_field2_len; DIRFILE *D; char *in_field1p, *in_field2p; dtracephp(); GDPHP_PARSED("s|ss", &field_code, &field_code_len, &in_field1, &in_field1_len, &in_field2, &in_field2_len); in_field1p = gdphp_check_null_string(in_field1); in_field2p = gdphp_check_null_string(in_field2); GDPHP_RETURN_BOOL(gd_alter_multiply(D, field_code, in_field1p, in_field2p)); } PHP_FUNCTION(gd_alter_phase) { char *field_code, *in_field = NULL; int field_code_len, in_field_len; zval *zshift = NULL; DIRFILE *D; char *in_fieldp; gd_shift_t shift; dtracephp(); GDPHP_PARSED("s|sz", &field_code, &field_code_len, &in_field, &in_field_len, &zshift); /* handle null shift */ if (zshift == NULL || Z_TYPE_P(zshift) == IS_NULL) { /* there's no way to get specify no change in shift, so fetch the current * value */ gd_entry_t E; if (gd_entry(D, field_code, &E)) GDPHP_RETURN_F; shift = E.EN(phase,shift); gd_free_entry_strings(&E); } else { convert_to_long(zshift); /* coerce */ shift = Z_LVAL_P(zshift); } in_fieldp = gdphp_check_null_string(in_field); GDPHP_RETURN_BOOL(gd_alter_phase(D, field_code, in_fieldp, shift)); } PHP_FUNCTION(gd_alter_polynom) { char *field_code, *in_field = NULL; int field_code_len, in_field_len; long o = 0; zval *za = NULL; DIRFILE *D; int min, max, oout; char *in_fieldp; double a[(GD_MAX_POLYORD + 1) * 2]; GD_DCOMPLEXP_t ap = (GD_DCOMPLEXP_t)a; GDPHP_CONTEXTp(ctx,4); dtracephp(); GDPHP_PARSED("s|lsz", &field_code, &field_code_len, &o, &in_field, &in_field_len, &za); /* handle nulls */ in_fieldp = gdphp_check_null_string(in_field); if (o == 0) { min = 2; max = GD_MAX_POLYORD + 1; } else min = max = o + 1; if (za == NULL || Z_TYPE_P(za) == IS_NULL) ap = NULL; else { oout = gdphp_convert_cmparray(a, za, min, max, 0, &ctx); if (o == 0) o = oout; } GDPHP_RETURN_BOOL(gd_alter_cpolynom(D, field_code, o, in_fieldp, ap)); } PHP_FUNCTION(gd_alter_protection) { long p, i; DIRFILE *D; dtracephp(); GDPHP_PARSED("ll", &p, &i); GDPHP_RETURN_BOOL(gd_alter_protection(D, p, i)); } PHP_FUNCTION(gd_alter_raw) { char *field_code; int field_code_len; long type = GD_NULL, spf = 0; zend_bool recode = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("s|llb", &field_code, &field_code_len, &type, &spf, &recode); GDPHP_RETURN_BOOL(gd_alter_raw(D, field_code, type, spf, recode)); } PHP_FUNCTION(gd_alter_recip) { char *field_code, *in_field = NULL; int field_code_len, in_field_len; zval *zdividend = NULL; DIRFILE *D; char *in_fieldp; double dividend[2]; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("s|sz", &field_code, &field_code_len, &in_field, &in_field_len, &zdividend); /* handle nulls */ in_fieldp = gdphp_check_null_string(in_field); if (zdividend == NULL || Z_TYPE_P(zdividend) == IS_NULL) dividend[0] = dividend[1] = 0; else gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx); GDPHP_RETURN_BOOL(gd_alter_crecip89(D, field_code, in_fieldp, dividend)); } PHP_FUNCTION(gd_alter_sbit) { char *field_code, *in_field = NULL; int field_code_len, in_field_len; long numbits = 0; zval *zbitnum = NULL; DIRFILE *D; char *in_fieldp; int bitnum; dtracephp(); GDPHP_PARSED("s|szl", &field_code, &field_code_len, &in_field, &in_field_len, &zbitnum, &numbits); in_fieldp = gdphp_check_null_string(in_field); bitnum = gdphp_long_from_zval_null(zbitnum, -1); GDPHP_RETURN_BOOL(gd_alter_sbit(D, field_code, in_fieldp, bitnum, numbits)); } PHP_FUNCTION(gd_alter_spec) { char *spec; int spec_len; zend_bool recode = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("s|b", &spec, &spec_len, &recode); GDPHP_RETURN_BOOL(gd_alter_spec(D, spec, recode)); } PHP_FUNCTION(gd_alter_window) { char *field_code, *in1 = NULL, *in2 = NULL; int field_code_len, in1_len, in2_len; long windop; zval *zthreshold = NULL; gd_triplet_t threshold; char *in1p, *in2p; DIRFILE *D; GDPHP_CONTEXTp(ctx,5); dtracephp(); GDPHP_PARSED("s|sslz", &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &windop, &zthreshold); in1p = gdphp_check_null_string(in1); in2p = gdphp_check_null_string(in2); /* there is no way to specify no change to the threshold in the C API */ if (zthreshold == NULL || Z_TYPE_P(zthreshold) == IS_NULL) { gd_entry_t E; if (gd_entry(D, field_code, &E)) GDPHP_RETURN_F; memcpy(&threshold, &E.EN(window,threshold), sizeof(threshold)); gd_free_entry_strings(&E); } else gdphp_to_threshold(&threshold, windop, zthreshold, &ctx); GDPHP_RETURN_BOOL(gd_alter_window(D, field_code, in1p, in2p, windop, threshold)); } PHP_FUNCTION(gd_bof) { char *field_code; int field_code_len; DIRFILE *D; long bof; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); bof = (long)gd_bof64(D, field_code); if (bof < 0) GDPHP_RETURN_F; dreturn("%li", bof); RETURN_LONG(bof); } PHP_FUNCTION(gd_carray_len) { char *field_code; int field_code_len; DIRFILE *D; size_t n; dtracephp(); zend_error(E_DEPRECATED, "gd_carray_len() is deprecated. Use gd_array_len() instead."); GDPHP_PARSED("s", &field_code, &field_code_len); n = gd_array_len(D, field_code); if (n == 0) GDPHP_RETURN_F; dreturn("%zu", n); RETURN_LONG(n); } PHP_FUNCTION(gd_array_len) { char *field_code; int field_code_len; DIRFILE *D; size_t n; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); n = gd_array_len(D, field_code); if (n == 0) GDPHP_RETURN_F; dreturn("%zu", n); RETURN_LONG(n); } PHP_FUNCTION(gd_carrays) { zval *zunpack = NULL; long data_type; DIRFILE *D; int unpack, i; const gd_carray_t *c; dtracephp(); GDPHP_PARSED("l|z", &data_type, &zunpack); unpack = gdphp_unpack(zunpack); c = gd_carrays(D, data_type); if (c == NULL) GDPHP_RETURN_F; /* convert */ array_init(return_value); for (i = 0; c[i].n; ++i) add_index_zval(return_value, i, gdphp_from_data(NULL, c[i].n, data_type, c[i].d, 1, unpack)); dreturnvoid(); } PHP_FUNCTION(gd_close) { zval *z; gdphp_dirfile *r; dtracephp(); GDPHP_PARSE("r", &z); GDPHP_FETCH_DIRFILE(r, z); if (gd_close(r->D)) GDPHP_RETURN_F; /* delete the resource on success */ r->D = NULL; /* avoid double close */ zend_list_delete(Z_LVAL_P(z)); GDPHP_RETURN_T; } PHP_FUNCTION(gd_constants) { long data_type; zval *zunpack = NULL; void *data; unsigned n; DIRFILE *D; zend_bool unpack; GDPHP_CONTEXTp(ctx,2); dtracephp(); GDPHP_PARSED("l|z", &data_type, &zunpack); unpack = gdphp_unpack(zunpack); gdphp_validate_type(data_type, &ctx); data = (void*)gd_constants(D, data_type); GDPHP_CHECK_ERROR(D); n = gd_nfields_by_type(D, GD_CONST_ENTRY); GDPHP_CHECK_ERROR(D); gdphp_from_data(return_value, n, data_type, data, 1, unpack); dreturn("%i", n); } PHP_FUNCTION(gd_delete) { char *field_code; int field_code_len; long flags = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("s|l", &field_code, &field_code_len, &flags); GDPHP_RETURN_BOOL(gd_delete(D, field_code, flags)); } PHP_FUNCTION(gd_desync) { long flags = 0; int r; DIRFILE *D; dtracephp(); GDPHP_PARSED("|l", &flags); r = gd_desync(D, flags); if (r < 0) RETURN_NULL(); GDPHP_RETURN_BOOL(!r); } PHP_FUNCTION(gd_dirfile_standards) { zval *zversion = NULL; long version; DIRFILE *D; dtracephp(); GDPHP_PARSED("|z", &zversion); version = gdphp_long_from_zval_null(zversion, GD_VERSION_CURRENT); version = gd_dirfile_standards(D, version); if (version < 0) GDPHP_RETURN_F; dreturn("%li", version); RETURN_LONG(version); } PHP_FUNCTION(gd_dirfilekey) { zval *z; gdphp_dirfile *r; dtracephp(); GDPHP_PARSE("r", &z); GDPHP_FETCH_DIRFILE(r, z); dreturn("\"%s\"", r->key); RETURN_STRINGL(r->key, r->key_len, 1); } PHP_FUNCTION(gd_dirfilename) { const char *s; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); s = gd_dirfilename(D); dreturn("\"%s\"", s); RETURN_STRING(s, 1); } PHP_FUNCTION(gd_discard) { zval *z; gdphp_dirfile *r; dtracephp(); GDPHP_PARSE("r", &z); GDPHP_FETCH_DIRFILE(r, z); if (gd_discard(r->D)) GDPHP_RETURN_F; /* delete the resource on success */ r->D = NULL; /* avoid double close */ zend_list_delete(Z_LVAL_P(z)); GDPHP_RETURN_T; } PHP_FUNCTION(gd_encoding) { long i = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("|l", &i); i = gd_encoding(D, i); if (i == 0) GDPHP_RETURN_F; dreturn("%lx", i); RETURN_LONG(i); } PHP_FUNCTION(gd_endianness) { long i = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("|l", &i); i = gd_endianness(D, i); if (i == 0) GDPHP_RETURN_F; dreturn("%lx", i); RETURN_LONG(i); } PHP_FUNCTION(gd_entry) { char *field_code; int field_code_len; DIRFILE *D; gd_entry_t E; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); if (gd_entry(D, field_code, &E)) GDPHP_RETURN_F; gdphp_from_entry(return_value, &E); gd_free_entry_strings(&E); dreturn("%p", return_value); } PHP_FUNCTION(gd_entry_list) { char *parent; int parent_len; long type = 0, flags = 0; DIRFILE *D; const char **fl; char *parentp; dtracephp(); GDPHP_PARSED("|sll", &parent, &parent_len, &type, &flags); parentp = gdphp_check_null_string(parent); fl = gd_entry_list(D, parentp, type, flags); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_entry_type) { char *field_code; int field_code_len; DIRFILE *D; gd_entype_t entype; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); entype = gd_entry_type(D, field_code); if (entype == GD_NO_ENTRY) GDPHP_RETURN_F; dreturn("%i", entype); RETURN_LONG(entype); } PHP_FUNCTION(gd_eof) { char *field_code; int field_code_len; DIRFILE *D; long eof; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); eof = (long)gd_eof64(D, field_code); if (eof < 0) GDPHP_RETURN_F; dreturn("%li", eof); RETURN_LONG(eof); } PHP_FUNCTION(gd_error) { long e; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); e = gd_error(D); dreturn("%li", e); RETURN_LONG(e); } PHP_FUNCTION(gd_error_string) { char *s; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); s = gd_error_string(D, NULL, 0); if (s) { RETVAL_STRING(s, 1); dreturn("\"%s\"", s); free(s); } else GDPHP_RETURN_F; } PHP_FUNCTION(gd_field_list) { DIRFILE *D; const char **fl; dtracephp(); GDPHP_PARSED_ONLY(); fl = gd_field_list(D); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_field_list_by_type) { DIRFILE *D; const char **fl; long type; dtracephp(); GDPHP_PARSED("l", &type); fl = gd_field_list_by_type(D, type); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_flags) { long set = 0, reset = 0; unsigned long flags; DIRFILE *D; dtracephp(); GDPHP_PARSED("|ll", &set, &reset); flags = gd_flags(D, set, reset); dreturn("0x%lX", flags); RETURN_LONG(flags); } PHP_FUNCTION(gd_flush) { char *field_code = NULL; int field_code_len; char *field_codep; DIRFILE *D; dtracephp(); GDPHP_PARSED("|s", &field_code, &field_code_len); field_codep = gdphp_check_null_string(field_code); GDPHP_RETURN_BOOL(gd_flush(D, field_codep)); } PHP_FUNCTION(gd_fragment_affixes) { long index; DIRFILE *D; char *affixes[2] = {NULL, NULL}; dtracephp(); GDPHP_PARSED("l", &index); if (gd_fragment_affixes(D, index, affixes + 0, affixes + 1)) GDPHP_RETURN_F; gdphp_to_string_array(return_value, (const char**)affixes, 2); dreturn("{\"%s\", \"%s\"}", affixes[0], affixes[1]); free(affixes[0]); free(affixes[1]); } PHP_FUNCTION(gd_fragment_index) { char *field_code; int field_code_len; DIRFILE *D; int i; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); i = gd_fragment_index(D, field_code); if (i < 0) GDPHP_RETURN_F; dreturn("%i", i); RETURN_LONG(i); } PHP_FUNCTION(gd_fragmentname) { long i; const char *s; DIRFILE *D; dtracephp(); GDPHP_PARSED("l", &i); s = gd_fragmentname(D, i); dreturn("\"%s\"", s); RETURN_STRING(s, 1); } PHP_FUNCTION(gd_frameoffset) { long i = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("|l", &i); i = gd_frameoffset64(D, i); dreturn("%li", i); RETURN_LONG(i); } PHP_FUNCTION(gd_framenum) { char *field_code; int field_code_len; double value; long start = 0, stop = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sd|ll", &field_code, &field_code_len, &value, &start, &stop); value = gd_framenum_subset64(D, field_code, value, start, stop); /* check for NAN */ if (value != value) GDPHP_RETURN_F; dreturn("%g", value); RETURN_DOUBLE(value); } PHP_FUNCTION(gd_get_carray) { long data_type; char *field_code; int field_code_len; long start = 0; zval *zlen = NULL, *zunpack = NULL; long len; void *data = NULL; DIRFILE *D; zend_bool unpack; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("sl|lzz", &field_code, &field_code_len, &data_type, &start, &zlen, &zunpack); len = gdphp_long_from_zval_null(zlen, -1); unpack = gdphp_unpack(zunpack); if (len == -1) { len = gd_array_len(D, field_code) - start; if (len == 0) /* error */ GDPHP_RETURN_F; } if (len == 0) { /* explicit request for no data */ dreturnvoid(); if (unpack) { array_init(return_value); return; } else RETURN_EMPTY_STRING(); } gdphp_validate_type(data_type, &ctx); data = emalloc(len * GD_SIZE(data_type)); if (gd_get_carray_slice(D, field_code, start, len, data_type, data)) { efree(data); GDPHP_RETURN_F; } gdphp_from_data(return_value, len, data_type, data, 0, unpack); dreturn("%li", len); } PHP_FUNCTION(gd_get_constant) { long data_type; char *field_code; int field_code_len; char datum[16]; DIRFILE *D; dtracephp(); GDPHP_PARSED("sl", &field_code, &field_code_len, &data_type); if (gd_get_constant(D, field_code, data_type, datum)) GDPHP_RETURN_F; gdphp_from_datum(return_value, datum, data_type); dreturnvoid(); } PHP_FUNCTION(gd_get_string) { char *field_code; int field_code_len; char *s; size_t len; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); /* get length */ len = gd_get_string(D, field_code, 0, NULL); if (gd_error(D)) GDPHP_RETURN_F; else if (len == 0) { dreturn("%s", ""); RETURN_EMPTY_STRING(); } /* allocate a buffer and get the string */ s = emalloc(len); if (gd_get_string(D, field_code, len, s) != len) GDPHP_RETURN_F; dreturn("\"%s\"", s); RETURN_STRINGL(s, len - 1, 0); } PHP_FUNCTION(gd_getdata) { long first_frame, first_sample, num_frames, num_samples; char *field_code; int field_code_len; size_t ns; zval *zunpack = NULL; long data_type = GD_UNKNOWN; DIRFILE *D; zend_bool unpack; size_t n = 0; GDPHP_CONTEXTp(ctx,6); void *data; dtracephp(); GDPHP_PARSED("sllll|lz", &field_code, &field_code_len, &first_frame, &first_sample, &num_frames, &num_samples, &data_type, &zunpack); unpack = gdphp_unpack(zunpack); /* figure out how much data we have */ if (num_frames > 0) { unsigned spf = gd_spf(D, field_code); if (spf == 0) GDPHP_RETURN_F; ns = num_frames * spf + num_samples; } else ns = num_samples; /* get the type, if needed */ if (data_type == GD_UNKNOWN) data_type = gd_native_type(D, field_code); /* allocate a buffer */ gdphp_validate_type(data_type, &ctx); data = emalloc(ns * GD_SIZE(data_type)); n = gd_getdata(D, field_code, first_frame, first_sample, 0, ns, data_type, data); GDPHP_CHECK_ERROR(D); gdphp_from_data(return_value, n, data_type, data, 0, unpack); dreturn("%" PRNsize_t, n); } PHP_FUNCTION(gd_hidden) { char *field_code; int field_code_len; DIRFILE *D; int hidden; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); hidden = gd_hidden(D, field_code); if (hidden < 0) { dreturnvoid(); RETURN_NULL(); } GDPHP_RETURN_BOOL(!hidden); } PHP_FUNCTION(gd_hide) { char *field_code; int field_code_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); GDPHP_RETURN_BOOL(gd_hide(D, field_code)); } PHP_FUNCTION(gd_include) { char *path, *prefix = NULL, *suffix = NULL; int path_len, prefix_len, suffix_len; long i, parent, flags = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sl|lss", &path, &path_len, &parent, &flags, &prefix, &prefix_len, &suffix, &suffix_len); i = gd_include_affix(D, path, parent, prefix, suffix, flags); if (i < 0) GDPHP_RETURN_F; dreturn("%li", i); RETURN_LONG(i); } PHP_FUNCTION(gd_invalid_dirfile) { gdphp_dirfile *r; dtracephp(); if (zend_parse_parameters_none() != SUCCESS) { GDPHP_RETURN_F; } /* create the resource */ r = emalloc(sizeof(gdphp_dirfile)); memset(r, 0, sizeof(gdphp_dirfile)); r->D = gd_invalid_dirfile(); ZEND_REGISTER_RESOURCE(return_value, r, le_gdphp_dirfile); dreturn("%p", r); } PHP_FUNCTION(gd_linterp_tablename) { char *field_code; int field_code_len; DIRFILE *D; const char *s; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); if ((s = gd_linterp_tablename(D, field_code)) == NULL) GDPHP_RETURN_F; dreturn("\"%s\"", s); RETURN_STRING(s, 1); } PHP_FUNCTION(gd_madd) { char *parent; int parent_len; zval *z; gd_entry_t E; DIRFILE *D; GDPHP_CONTEXT(ctx); dtracephp(); GDPHP_PARSED("as", &z, &parent, &parent_len); ctx.p = 2; gdphp_to_entry(&E, z, NULL, 1, &ctx); /* no need to free entry strings */ GDPHP_RETURN_BOOL(gd_madd(D, &E, parent)); } PHP_FUNCTION(gd_madd_alias) { char *field_code, *target, *parent; int field_code_len, target_len, parent_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("sss", &parent, &parent_len, &field_code, &field_code_len, &target, &target_len); GDPHP_RETURN_BOOL(gd_madd_alias(D, parent, field_code, target)); } PHP_FUNCTION(gd_madd_bit) { char *field_code, *in_field, *parent; int field_code_len, in_field_len, parent_len; long bitnum, numbits = 1; DIRFILE *D; dtracephp(); GDPHP_PARSED("sssl|l", &parent, &parent_len, &field_code, &field_code_len, &in_field, &in_field_len, &bitnum, &numbits); GDPHP_RETURN_BOOL(gd_madd_bit(D, parent, field_code, in_field, bitnum, numbits)); } PHP_FUNCTION(gd_madd_carray) { char *field_code, *parent; int field_code_len, parent_len; long data_type; zval *zdata1, *zdata2 = NULL; DIRFILE *D; int r; struct gdphp_din din; dtracephp(); GDPHP_PARSED("sslz|z", &parent, &parent_len, &field_code, &field_code_len, &data_type, &zdata1, &zdata2); din = gdphp_convert_data(zdata1, zdata2, 4, 5); r = gd_madd_carray(D, parent, field_code, data_type, din.ns, din.type, din.data); if (din.free_din) efree(din.data); GDPHP_RETURN_BOOL(r); } PHP_FUNCTION(gd_madd_const) { char *field_code, *parent; int field_code_len, parent_len; long data_type; zval *z; DIRFILE *D; char data[16]; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("sslz", &parent, &parent_len, &field_code, &field_code_len, &data_type, &z); /* might as well convert to the storage type now */ gdphp_to_datum(data, data_type, z, 1, &ctx); GDPHP_RETURN_BOOL(gd_madd_const(D, parent, field_code, data_type, data_type, data)); } PHP_FUNCTION(gd_madd_divide) { char *field_code, *in1, *in2, *parent; int field_code_len, in1_len, in2_len, parent_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssss", &parent, &parent_len, &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len); GDPHP_RETURN_BOOL(gd_madd_divide(D, parent, field_code, in1, in2)); } PHP_FUNCTION(gd_madd_lincom) { char *field_code, *parent; int field_code_len, parent_len; zval *zin, *zm, *zb; char *in[GD_MAX_LINCOM]; double m[GD_MAX_LINCOM * 2]; double b[GD_MAX_LINCOM * 2]; int n; DIRFILE *D; GDPHP_CONTEXT(ctx); dtracephp(); GDPHP_PARSED("ssaaa", &parent, &parent_len, &field_code, &field_code_len, &zin, &zm, &zb); /* these don't return on error */ ctx.p = 2; n = gdphp_convert_nsarray((char**)in, zin, 1, GD_MAX_LINCOM, &ctx); ctx.p = 3; gdphp_convert_cmparray(m, zm, n, n, 0, &ctx); ctx.p = 4; gdphp_convert_cmparray(b, zb, n, n, 0, &ctx); GDPHP_RETURN_BOOL(gd_madd_clincom(D, parent, field_code, n, (const char**)in, (GD_DCOMPLEXP_t)m, (GD_DCOMPLEXP_t)b)); } PHP_FUNCTION(gd_madd_linterp) { char *field_code, *in_field, *table, *parent; int field_code_len, in_field_len, table_len, parent_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssss", &parent, &parent_len, &field_code, &field_code_len, &in_field, &in_field_len, &table, &table_len); GDPHP_RETURN_BOOL(gd_madd_linterp(D, parent, field_code, in_field, table)); } PHP_FUNCTION(gd_madd_mplex) { char *field_code, *in1, *in2, *parent; int field_code_len, in1_len, in2_len, parent_len; long count, period = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssssl|l", &parent, &parent_len, &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &count, &period); GDPHP_RETURN_BOOL(gd_madd_mplex(D, parent, field_code, in1, in2, count, period)); } PHP_FUNCTION(gd_madd_multiply) { char *field_code, *in1, *in2, *parent; int field_code_len, in1_len, in2_len, parent_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("ssss", &parent, &parent_len, &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len); GDPHP_RETURN_BOOL(gd_madd_multiply(D, parent, field_code, in1, in2)); } PHP_FUNCTION(gd_madd_phase) { char *field_code, *in_field, *parent; int field_code_len, in_field_len, parent_len; long shift; DIRFILE *D; dtracephp(); GDPHP_PARSED("sssl", &parent, &parent_len, &field_code, &field_code_len, &in_field, &in_field_len, &shift); GDPHP_RETURN_BOOL(gd_madd_phase(D, parent, field_code, in_field, shift)); } PHP_FUNCTION(gd_madd_polynom) { char *field_code, *in_field, *parent; int field_code_len, in_field_len, parent_len; zval *za; double a[2 * (GD_MAX_POLYORD + 1)]; int o; DIRFILE *D; GDPHP_CONTEXTp(ctx,3); dtracephp(); GDPHP_PARSED("sssa", &parent, &parent_len, &field_code, &field_code_len, &in_field, &in_field_len, &za); /* doesn't return on error */ o = gdphp_convert_cmparray(a, za, 2, GD_MAX_POLYORD + 1, 0, &ctx) - 1; GDPHP_RETURN_BOOL(gd_madd_cpolynom(D, parent, field_code, o, in_field, (GD_DCOMPLEXP_t)a)); } PHP_FUNCTION(gd_madd_recip) { char *field_code, *in_field, *parent; int field_code_len, in_field_len, parent_len; zval *zdividend; double dividend[2]; DIRFILE *D; GDPHP_CONTEXTp(ctx,4); dtracephp(); GDPHP_PARSED("sssz", &parent, &parent_len, &field_code, &field_code_len, &in_field, &in_field_len, &zdividend); gdphp_to_datum(dividend, GD_COMPLEX128, zdividend, 1, &ctx); GDPHP_RETURN_BOOL(gd_madd_crecip89(D, parent, field_code, in_field, dividend)); } PHP_FUNCTION(gd_madd_sbit) { char *field_code, *in_field, *parent; int field_code_len, in_field_len, parent_len; long bitnum, numbits = 1; DIRFILE *D; dtracephp(); GDPHP_PARSED("sssll", &parent, &parent_len, &field_code, &field_code_len, &in_field, &in_field_len, &bitnum, &numbits); GDPHP_RETURN_BOOL(gd_madd_sbit(D, parent, field_code, in_field, bitnum, numbits)); } PHP_FUNCTION(gd_madd_spec) { char *spec, *parent; int spec_len, parent_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("ss", &spec, &spec_len, &parent, &parent_len); GDPHP_RETURN_BOOL(gd_madd_spec(D, spec, parent)); } PHP_FUNCTION(gd_madd_string) { char *field_code, *value, *parent; int field_code_len, value_len, parent_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("sss", &parent, &parent_len, &field_code, &field_code_len, &value, &value_len); GDPHP_RETURN_BOOL(gd_madd_string(D, parent, field_code, value)); } PHP_FUNCTION(gd_madd_window) { char *field_code, *in1, *in2, *parent; int field_code_len, in1_len, in2_len, parent_len; long windop; zval *zthreshold; gd_triplet_t threshold; DIRFILE *D; GDPHP_CONTEXTp(ctx,6); dtracephp(); GDPHP_PARSED("sssslz", &parent, &parent_len, &field_code, &field_code_len, &in1, &in1_len, &in2, &in2_len, &windop, &zthreshold); gdphp_to_threshold(&threshold, windop, zthreshold, &ctx); GDPHP_RETURN_BOOL(gd_madd_window(D, parent, field_code, in1, in2, windop, threshold)); } PHP_FUNCTION(gd_malter_spec) { char *spec, *parent; int spec_len, parent_len; zend_bool recode = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ss|b", &spec, &spec_len, &parent, &parent_len, &recode); GDPHP_RETURN_BOOL(gd_malter_spec(D, spec, parent, recode)); } PHP_FUNCTION(gd_mcarrays) { char *parent; int parent_len; zval *zunpack = NULL; long data_type; DIRFILE *D; int unpack, i; const gd_carray_t *c; dtracephp(); GDPHP_PARSED("sl|z", &parent, &parent_len, &data_type, &zunpack); unpack = gdphp_unpack(zunpack); c = gd_mcarrays(D, parent, data_type); if (c == NULL) GDPHP_RETURN_F; /* convert */ array_init(return_value); for (i = 0; c[i].n; ++i) add_index_zval(return_value, i, gdphp_from_data(NULL, c[i].n, data_type, c[i].d, 1, unpack)); dreturnvoid(); } PHP_FUNCTION(gd_mconstants) { char *parent; int parent_len; long data_type; zval *zunpack = NULL; void *data; unsigned n; DIRFILE *D; zend_bool unpack; GDPHP_CONTEXTp(ctx,2); dtracephp(); GDPHP_PARSED("sl|z", &parent, &parent_len, &data_type, &zunpack); unpack = gdphp_unpack(zunpack); gdphp_validate_type(data_type, &ctx); data = (void*)gd_mconstants(D, parent, data_type); GDPHP_CHECK_ERROR(D); n = gd_nmfields_by_type(D, parent, GD_CONST_ENTRY); GDPHP_CHECK_ERROR(D); gdphp_from_data(return_value, n, data_type, data, 1, unpack); dreturn("%i", n); } PHP_FUNCTION(gd_metaflush) { DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); GDPHP_RETURN_BOOL(gd_metaflush(D)); } PHP_FUNCTION(gd_mfield_list) { char *field_code; int field_code_len; DIRFILE *D; const char **fl; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); fl = gd_mfield_list(D, field_code); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_mfield_list_by_type) { long type; char *field_code; int field_code_len; DIRFILE *D; const char **fl; dtracephp(); GDPHP_PARSED("sl", &field_code, &field_code_len, &type); fl = gd_mfield_list_by_type(D, field_code, type); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_move) { char *field_code; int field_code_len; long new_fragment; long flags = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("sl|l", &field_code, &field_code_len, &new_fragment, &flags); GDPHP_RETURN_BOOL(gd_move(D, field_code, new_fragment, flags)); } PHP_FUNCTION(gd_mplex_lookback) { long lookback; DIRFILE *D; dtracephp(); GDPHP_PARSED("l", &lookback); gd_mplex_lookback(D, lookback); GDPHP_RETURN_T; } PHP_FUNCTION(gd_mstrings) { char *field_code; int field_code_len; DIRFILE *D; const char **l; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); l = gd_mstrings(D, field_code); if (l == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, l, 0); dreturnvoid(); } PHP_FUNCTION(gd_mvector_list) { char *field_code; int field_code_len; DIRFILE *D; const char **fl; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); fl = gd_mvector_list(D, field_code); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_naliases) { char *field_code; int field_code_len; long n; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); n = gd_naliases(D, field_code); if (n == 0) GDPHP_RETURN_F; dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_native_type) { char *field_code; int field_code_len; DIRFILE *D; gd_type_t t; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); t = gd_native_type(D, field_code); if (t == GD_UNKNOWN) GDPHP_RETURN_F; dreturn("%u", t); RETURN_LONG(t); } PHP_FUNCTION(gd_nentries) { char *parent; int parent_len; long n, type = 0, flags = 0; DIRFILE *D; char *parentp; dtracephp(); GDPHP_PARSED("|sll", &parent, &parent_len, &type, &flags); parentp = gdphp_check_null_string(parent); n = gd_nentries(D, parentp, type, flags); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nfields) { long n; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); n = gd_nfields(D); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nfields_by_type) { long n, type; DIRFILE *D; dtracephp(); GDPHP_PARSED("l", &type); n = gd_nfields_by_type(D, type); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nfragments) { long n; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); n = gd_nfragments(D); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nframes) { long n; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); n = gd_nframes(D); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nmfields) { char *field_code; int field_code_len; long n; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); n = gd_nmfields(D, field_code); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nmfields_by_type) { char *field_code; int field_code_len; long n, type; DIRFILE *D; dtracephp(); GDPHP_PARSED("sl", &field_code, &field_code_len, &type); n = gd_nmfields_by_type(D, field_code, type); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nmvectors) { char *field_code; int field_code_len; long n; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); n = gd_nmvectors(D, field_code); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_nvectors) { long n; DIRFILE *D; dtracephp(); GDPHP_PARSED_ONLY(); n = gd_nvectors(D); GDPHP_CHECK_ERROR(D); dreturn("%li", n); RETURN_LONG(n); } PHP_FUNCTION(gd_open) { long flags = GD_RDONLY; char *dirfilename; int len; gdphp_dirfile *r; char *callback = NULL; int callback_len = -1; zval **callback_data = NULL; dtracephp(); /* parse input */ GDPHP_PARSE("s|lsZ", &dirfilename, &len, &flags, &callback, &callback_len, &callback_data); r = gdphp_open(dirfilename, len, flags, callback, callback_len, callback_data, 0); /* return */ ZEND_REGISTER_RESOURCE(return_value, r, le_gdphp_dirfile); dreturn("%p", r); } PHP_FUNCTION(gd_parent_fragment) { long i; DIRFILE *D; dtracephp(); GDPHP_PARSED("l", &i); i = gd_parent_fragment(D, i); if (i < 0) GDPHP_RETURN_F; dreturn("%lx", i); RETURN_LONG(i); } PHP_FUNCTION(gd_popen) { long flags = GD_RDONLY; char *dirfilename; int len; gdphp_dirfile *r; zend_rsrc_list_entry *le, new_le; char *callback = NULL; int callback_len; zval **callback_data = NULL; dtracephp(); /* parse input */ GDPHP_PARSE("s|lsz", &dirfilename, &len, &flags, &callback, &callback_len, &callback_data); /* look for an existing dirfile */ if (zend_hash_find(&EG(persistent_list), dirfilename, len, (void**)&le) == SUCCESS) { ZEND_REGISTER_RESOURCE(return_value, le->ptr, le_gdphp_dirfile_persist); dreturn("%p", le->ptr); return; } /* nope, open */ r = gdphp_open(dirfilename, len, flags, callback, callback_len, callback_data, 1); /* register and store */ ZEND_REGISTER_RESOURCE(return_value, r, le_gdphp_dirfile_persist); new_le.ptr = r; new_le.type = le_gdphp_dirfile_persist; zend_hash_add(&EG(persistent_list), dirfilename, len, &new_le, sizeof(zend_rsrc_list_entry), NULL); dreturn("%p", r); } PHP_FUNCTION(gd_protection) { long i; DIRFILE *D; dtracephp(); GDPHP_PARSED("l", &i); i = gd_protection(D, i); if (i == 0) GDPHP_RETURN_F; dreturn("%lx", i); RETURN_LONG(i); } PHP_FUNCTION(gd_put_carray) { char *field_code; int field_code_len; zval *z1, *z2 = NULL, *z3 = NULL; DIRFILE *D; int r; long start = 0; struct gdphp_din din = { NULL, GD_NULL, 0, 0}; dtracephp(); GDPHP_PARSED("sz|zz", &field_code, &field_code_len, &z1, &z2, &z3); /* allowed types for the last three parameters: * * 1: anything: just data * 2: long, string: just data * 3: long, other, [anything]: start and data * 4: null, anything, [anything]: just data * 5: other, anything, anything: forbidden * 6: other, anything: just data */ if (z2 == NULL) /* 1 */ din = gdphp_convert_data(z1, NULL, 2, 3); else if (Z_TYPE_P(z1) == IS_LONG) { if (z2 && Z_TYPE_P(z2) == IS_STRING && z3 == NULL) { /* 2 */ din = gdphp_convert_data(z1, z2, 2, 3); } else { /* 3 */ start = Z_LVAL_P(z1); din = gdphp_convert_data(z2, z3, 3, 4); } } else if (Z_TYPE_P(z1) == IS_NULL) /* 4 */ din = gdphp_convert_data(z2, z3, 3, 4); else if (z3) { /* 5 */ GDPHP_CONTEXTp(ctx, 2); GDPHP_DIE(&ctx, "expected starting index or input data"); } else /* 6 */ din = gdphp_convert_data(z1, z2, 2, 3); r = gd_put_carray_slice(D, field_code, start, din.ns, din.type, din.data); if (din.free_din) efree(din.data); GDPHP_RETURN_BOOL(r); } PHP_FUNCTION(gd_put_constant) { char *field_code; int field_code_len; zval *z; DIRFILE *D; char datum[16]; gd_type_t t; GDPHP_CONTEXTp(ctx, 2); dtracephp(); GDPHP_PARSED("sz", &field_code, &field_code_len, &z); t = gdphp_to_datum_and_type(datum, z, &ctx); GDPHP_RETURN_BOOL(gd_put_constant(D, field_code, t, datum)); } PHP_FUNCTION(gd_put_string) { char *field_code, *value; int field_code_len, value_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("ss", &field_code, &field_code_len, &value, &value_len); gd_put_string(D, field_code, value); GDPHP_RETURN_ERROR(D); } PHP_FUNCTION(gd_putdata) { char *field_code; int field_code_len; long first_frame, first_sample; zval *zdata1, *zdata2 = NULL; DIRFILE *D; size_t n; struct gdphp_din din; dtracephp(); GDPHP_PARSED("sllz|z", &field_code, &field_code_len, &first_frame, &first_sample, &zdata1, &zdata2); din = gdphp_convert_data(zdata1, zdata2, 4, 5); n = gd_putdata(D, field_code, first_frame, first_sample, 0, din.ns, din.type, din.data); if (din.free_din) efree(din.data); GDPHP_CHECK_ERROR(D); dreturn("%zu", n); RETURN_LONG(n); } PHP_FUNCTION(gd_raw_close) { char *field_code = NULL; int field_code_len; char *field_codep; DIRFILE *D; dtracephp(); GDPHP_PARSED("|s", &field_code, &field_code_len); field_codep = gdphp_check_null_string(field_code); GDPHP_RETURN_BOOL(gd_raw_close(D, field_codep)); } PHP_FUNCTION(gd_raw_filename) { char *field_code; int field_code_len; DIRFILE *D; const char *s; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); if ((s = gd_raw_filename(D, field_code)) == NULL) GDPHP_RETURN_F; dreturn("\"%s\"", s); RETURN_STRING(s, 1); } PHP_FUNCTION(gd_reference) { const char *field_code = NULL; int field_code_len; DIRFILE *D; const char *s; dtracephp(); GDPHP_PARSED("|s", &field_code, &field_code_len); s = gd_reference(D, field_code); GDPHP_CHECK_ERROR(D); dreturn("\"%s\"", s); if (s == NULL) RETURN_NULL(); RETURN_STRING(s, 1); } PHP_FUNCTION(gd_rename) { const char *old_code, *new_name; int old_code_len, new_name_len; long flags = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("ss|l", &old_code, &old_code_len, &new_name, &new_name_len, &flags); GDPHP_RETURN_BOOL(gd_rename(D, old_code, new_name, flags)); } PHP_FUNCTION(gd_rewrite_fragment) { zval *zi = NULL; long i; DIRFILE *D; dtracephp(); GDPHP_PARSED("|z", &zi); i = gdphp_long_from_zval_null(zi, GD_ALL_FRAGMENTS); GDPHP_RETURN_BOOL(gd_rewrite_fragment(D, i)); } PHP_FUNCTION(gd_seek) { char *field_code; int field_code_len; long frame_num, sample_num, flags = 0; DIRFILE *D; long pos; dtracephp(); GDPHP_PARSED("sll|l", &field_code, &field_code_len, &frame_num, &sample_num, &flags); pos = gd_seek(D, field_code, frame_num, sample_num, flags); if (pos < 0) GDPHP_RETURN_F; dreturn("%li", pos); RETURN_LONG(pos); } PHP_FUNCTION(gd_spf) { char *field_code; int field_code_len; DIRFILE *D; unsigned spf; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); spf = gd_spf(D, field_code); if (spf == 0) GDPHP_RETURN_F; dreturn("%u", spf); RETURN_LONG(spf); } PHP_FUNCTION(gd_strings) { DIRFILE *D; const char **l; dtracephp(); GDPHP_PARSED_ONLY(); l = gd_strings(D); if (l == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, l, 0); dreturnvoid(); } PHP_FUNCTION(gd_strtok) { char *s, *p; int slen, i = 0; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &s, &slen); array_init(return_value); for (p = gd_strtok(D, s); p; p = gd_strtok(D, NULL)) { add_index_string(return_value, i++, p, 1); free(p); } GDPHP_CHECK_ERROR(D); dreturn("%i", i); } PHP_FUNCTION(gd_sync) { char *field_code = NULL; int field_code_len; char *field_codep; DIRFILE *D; dtracephp(); GDPHP_PARSED("|s", &field_code, &field_code_len); field_codep = gdphp_check_null_string(field_code); GDPHP_RETURN_BOOL(gd_sync(D, field_codep)); } PHP_FUNCTION(gd_tell) { char *field_code; int field_code_len; DIRFILE *D; long pos; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); pos = gd_tell(D, field_code); if (pos < 0) GDPHP_RETURN_F; dreturn("%li", pos); RETURN_LONG(pos); } PHP_FUNCTION(gd_unhide) { char *field_code; int field_code_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); GDPHP_RETURN_BOOL(gd_unhide(D, field_code)); } PHP_FUNCTION(gd_uninclude) { DIRFILE *D; long i; zend_bool del = 0; dtracephp(); GDPHP_PARSED("l|b", &i, &del); GDPHP_RETURN_BOOL(gd_uninclude(D, i, del)); } PHP_FUNCTION(gd_validate) { char *field_code; int field_code_len; DIRFILE *D; dtracephp(); GDPHP_PARSED("s", &field_code, &field_code_len); GDPHP_RETURN_BOOL(gd_validate(D, field_code)); } PHP_FUNCTION(gd_vector_list) { DIRFILE *D; const char **fl; dtracephp(); GDPHP_PARSED_ONLY(); fl = gd_vector_list(D); if (fl == NULL) GDPHP_RETURN_F; gdphp_to_string_array(return_value, fl, 0); dreturnvoid(); } PHP_FUNCTION(gd_verbose_prefix) { char *prefix = NULL; int prefix_len; char *prefixp; DIRFILE *D; dtracephp(); GDPHP_PARSED("|s", &prefix, &prefix_len); prefixp = gdphp_check_null_string(prefix); GDPHP_RETURN_BOOL(gd_verbose_prefix(D, prefixp)); } PHP_FUNCTION(gd_encoding_support) { unsigned long e; long r; dtracephp(); GDPHP_PARSE("l", &e); r = gd_encoding_support(e); if (r == -1) GDPHP_RETURN_F; dreturn("%li", r); RETURN_LONG(r); } /* MODULE DECLARATIONS */ static const zend_function_entry getdata_functions[] = { PHP_FE(gd_add, NULL) PHP_FE(gd_add_alias, NULL) PHP_FE(gd_add_bit, NULL) PHP_FE(gd_add_carray, NULL) PHP_FE(gd_add_const, NULL) PHP_FE(gd_add_divide, NULL) PHP_FE(gd_add_lincom, NULL) PHP_FE(gd_add_linterp, NULL) PHP_FE(gd_add_mplex, NULL) PHP_FE(gd_add_multiply, NULL) PHP_FE(gd_add_phase, NULL) PHP_FE(gd_add_polynom, NULL) PHP_FE(gd_add_raw, NULL) PHP_FE(gd_add_recip, NULL) PHP_FE(gd_add_sbit, NULL) PHP_FE(gd_add_spec, NULL) PHP_FE(gd_add_string, NULL) PHP_FE(gd_add_window, NULL) PHP_FE(gd_alias_target, NULL) PHP_FE(gd_aliases, NULL) PHP_FE(gd_alter_affixes, NULL) PHP_FE(gd_alter_bit, NULL) PHP_FE(gd_alter_carray, NULL) PHP_FE(gd_alter_const, NULL) PHP_FE(gd_alter_divide, NULL) PHP_FE(gd_alter_encoding, NULL) PHP_FE(gd_alter_endianness, NULL) PHP_FE(gd_alter_entry, NULL) PHP_FE(gd_alter_frameoffset, NULL) PHP_FE(gd_alter_lincom, NULL) PHP_FE(gd_alter_linterp, NULL) PHP_FE(gd_alter_mplex, NULL) PHP_FE(gd_alter_multiply, NULL) PHP_FE(gd_alter_phase, NULL) PHP_FE(gd_alter_polynom, NULL) PHP_FE(gd_alter_protection, NULL) PHP_FE(gd_alter_raw, NULL) PHP_FE(gd_alter_recip, NULL) PHP_FE(gd_alter_sbit, NULL) PHP_FE(gd_alter_spec, NULL) PHP_FE(gd_alter_window, NULL) PHP_FE(gd_array_len, NULL) PHP_FE(gd_bof, NULL) PHP_FE(gd_carrays, NULL) PHP_FE(gd_carray_len, NULL) PHP_FE(gd_close, NULL) PHP_FE(gd_constants, NULL) PHP_FE(gd_delete, NULL) PHP_FE(gd_desync, NULL) PHP_FE(gd_dirfile_standards, NULL) PHP_FE(gd_dirfilekey, NULL) PHP_FE(gd_dirfilename, NULL) PHP_FE(gd_discard, NULL) PHP_FE(gd_encoding, NULL) PHP_FE(gd_encoding_support, NULL) PHP_FE(gd_endianness, NULL) PHP_FE(gd_entry, NULL) PHP_FE(gd_entry_list, NULL) PHP_FE(gd_entry_type, NULL) PHP_FE(gd_eof, NULL) PHP_FE(gd_error, NULL) PHP_FE(gd_error_string, NULL) PHP_FE(gd_field_list, NULL) PHP_FE(gd_field_list_by_type, NULL) PHP_FE(gd_flags, NULL) PHP_FE(gd_flush, NULL) PHP_FE(gd_fragment_affixes, NULL) PHP_FE(gd_fragment_index, NULL) PHP_FE(gd_fragmentname, NULL) PHP_FE(gd_framenum, NULL) PHP_FE(gd_frameoffset, NULL) PHP_FE(gd_get_carray, NULL) PHP_FE(gd_get_constant, NULL) PHP_FE(gd_get_string, NULL) PHP_FE(gd_getdata, NULL) PHP_FE(gd_hidden, NULL) PHP_FE(gd_hide, NULL) PHP_FE(gd_include, NULL) PHP_FE(gd_invalid_dirfile, NULL) PHP_FE(gd_linterp_tablename, NULL) PHP_FE(gd_madd, NULL) PHP_FE(gd_madd_alias, NULL) PHP_FE(gd_madd_bit, NULL) PHP_FE(gd_madd_carray, NULL) PHP_FE(gd_madd_const, NULL) PHP_FE(gd_madd_divide, NULL) PHP_FE(gd_madd_lincom, NULL) PHP_FE(gd_madd_linterp, NULL) PHP_FE(gd_madd_mplex, NULL) PHP_FE(gd_madd_multiply, NULL) PHP_FE(gd_madd_phase, NULL) PHP_FE(gd_madd_polynom, NULL) PHP_FE(gd_madd_recip, NULL) PHP_FE(gd_madd_sbit, NULL) PHP_FE(gd_madd_spec, NULL) PHP_FE(gd_madd_string, NULL) PHP_FE(gd_madd_window, NULL) PHP_FE(gd_malter_spec, NULL) PHP_FE(gd_mcarrays, NULL) PHP_FE(gd_mconstants, NULL) PHP_FE(gd_metaflush, NULL) PHP_FE(gd_mfield_list, NULL) PHP_FE(gd_mfield_list_by_type, NULL) PHP_FE(gd_move, NULL) PHP_FE(gd_mplex_lookback, NULL) PHP_FE(gd_mstrings, NULL) PHP_FE(gd_mvector_list, NULL) PHP_FE(gd_naliases, NULL) PHP_FE(gd_native_type, NULL) PHP_FE(gd_nentries, NULL) PHP_FE(gd_nfields, NULL) PHP_FE(gd_nfields_by_type, NULL) PHP_FE(gd_nfragments, NULL) PHP_FE(gd_nframes, NULL) PHP_FE(gd_nmfields, NULL) PHP_FE(gd_nmfields_by_type, NULL) PHP_FE(gd_nmvectors, NULL) PHP_FE(gd_nvectors, NULL) PHP_FE(gd_open, NULL) PHP_FE(gd_parent_fragment, NULL) PHP_FE(gd_popen, NULL) PHP_FE(gd_protection, NULL) PHP_FE(gd_put_carray, NULL) PHP_FE(gd_put_constant, NULL) PHP_FE(gd_put_string, NULL) PHP_FE(gd_putdata, NULL) PHP_FE(gd_raw_close, NULL) PHP_FE(gd_raw_filename, NULL) PHP_FE(gd_reference, NULL) PHP_FE(gd_rename, NULL) PHP_FE(gd_rewrite_fragment, NULL) PHP_FE(gd_seek, NULL) PHP_FE(gd_spf, NULL) PHP_FE(gd_strings, NULL) PHP_FE(gd_strtok, NULL) PHP_FE(gd_sync, NULL) PHP_FE(gd_tell, NULL) PHP_FE(gd_unhide, NULL) PHP_FE(gd_uninclude, NULL) PHP_FE(gd_validate, NULL) PHP_FE(gd_vector_list, NULL) PHP_FE(gd_verbose_prefix, NULL) PHP_FE_END }; zend_module_entry getdata_module_entry = { #if ZEND_MODULE_API_NO >= 20010901 STANDARD_MODULE_HEADER, #endif "GetData", getdata_functions, PHP_MINIT(getdata), PHP_MSHUTDOWN(getdata), NULL, NULL, PHP_MINFO(getdata), #if ZEND_MODULE_API_NO >= 20010901 PACKAGE_VERSION, #endif STANDARD_MODULE_PROPERTIES }; ZEND_GET_MODULE(getdata); libgetdata-0.9.0/bindings/idl/0000740000175000017500000000000012614323564016347 5ustar alastairalastairlibgetdata-0.9.0/bindings/idl/Makefile.in0000640000175000017500000007625612614323564020436 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/idl DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/makedlm.sh.in $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = makedlm.sh 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)$(idldir)" "$(DESTDIR)$(idldir)" LTLIBRARIES = $(idl_LTLIBRARIES) @GD_EXTERNAL_FALSE@am__DEPENDENCIES_1 = ../../src/libgetdata.la idl_getdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_idl_getdata_la_OBJECTS = getdata.lo nodist_idl_getdata_la_OBJECTS = constants.lo sublist.lo idl_getdata_la_OBJECTS = $(am_idl_getdata_la_OBJECTS) \ $(nodist_idl_getdata_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 = idl_getdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(idl_getdata_la_LDFLAGS) $(LDFLAGS) -o \ $@ 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)/src 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 = $(idl_getdata_la_SOURCES) $(nodist_idl_getdata_la_SOURCES) DIST_SOURCES = $(idl_getdata_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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 HEADERS = $(nodist_idl_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2009, 2010, 2011, 2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SUBDIRS = test @GD_EXTERNAL_FALSE@GDIDL_GETDATA_LIBS = ../../src/libgetdata.la @GD_EXTERNAL_TRUE@GDIDL_GETDATA_LIBS = $(GETDATA_LIBS) idl_LTLIBRARIES = idl_getdata.la nodist_idl_HEADERS = idl_getdata.dlm # idl makes heavy use of type punning, ergo -fno-strict-aliasing AM_CFLAGS = ${GD_CC_WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src BUILT_SOURCES = sublist.c constants.c idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \ -precious-files-regex 'idl_getdata\.dlm' $(IDL_LIBS) idl_getdata_la_LIBADD = $(GDIDL_GETDATA_LIBS) idl_getdata_la_SOURCES = getdata.c nodist_idl_getdata_la_SOURCES = constants.c sublist.c all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .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 bindings/idl/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/idl/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): makedlm.sh: $(top_builddir)/config.status $(srcdir)/makedlm.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-idlLTLIBRARIES: $(idl_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(idl_LTLIBRARIES)'; test -n "$(idldir)" || 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)$(idldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(idldir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(idldir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(idldir)"; \ } uninstall-idlLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(idl_LTLIBRARIES)'; test -n "$(idldir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(idldir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(idldir)/$$f"; \ done clean-idlLTLIBRARIES: -test -z "$(idl_LTLIBRARIES)" || rm -f $(idl_LTLIBRARIES) @list='$(idl_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}; \ } idl_getdata.la: $(idl_getdata_la_OBJECTS) $(idl_getdata_la_DEPENDENCIES) $(EXTRA_idl_getdata_la_DEPENDENCIES) $(AM_V_CCLD)$(idl_getdata_la_LINK) -rpath $(idldir) $(idl_getdata_la_OBJECTS) $(idl_getdata_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constants.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sublist.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 -o $@ $< .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 -o $@ `$(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 install-nodist_idlHEADERS: $(nodist_idl_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_idl_HEADERS)'; test -n "$(idldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(idldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(idldir)" || 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)$(idldir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(idldir)" || exit $$?; \ done uninstall-nodist_idlHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_idl_HEADERS)'; test -n "$(idldir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(idldir)'; $(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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(LTLIBRARIES) $(HEADERS) all-local installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(idldir)" "$(DESTDIR)$(idldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-idlLTLIBRARIES clean-libtool clean-local \ 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-idlLTLIBRARIES install-nodist_idlHEADERS 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: uninstall-idlLTLIBRARIES uninstall-nodist_idlHEADERS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am all-local \ check check-am clean clean-generic clean-idlLTLIBRARIES \ clean-libtool clean-local cscopelist-am ctags ctags-am \ 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-idlLTLIBRARIES install-info install-info-am \ install-man install-nodist_idlHEADERS 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-am uninstall uninstall-am \ uninstall-idlLTLIBRARIES uninstall-nodist_idlHEADERS sublist.c.in: getdata.c makedlm.sh ${SHELL} ./makedlm.sh -c $< > $@ sublist.c: sublist.stamp @if test ! -f $@; then \ rm -f $<; \ $(MAKE) $<; \ fi @HAVE_DIFF_TRUE@sublist.stamp: sublist.c.in @HAVE_DIFF_TRUE@ @if $(DIFF) sublist.c sublist.c.in >/dev/null 2>&1; then \ @HAVE_DIFF_TRUE@ echo "sublist.c is unchanged"; \ @HAVE_DIFF_TRUE@ else \ @HAVE_DIFF_TRUE@ rm -f sublist.c; \ @HAVE_DIFF_TRUE@ cp sublist.c.in sublist.c; \ @HAVE_DIFF_TRUE@ fi; \ @HAVE_DIFF_TRUE@ touch sublist.stamp @HAVE_DIFF_FALSE@sublist.stamp: sublist.c.in @HAVE_DIFF_FALSE@ @rm -f sublist.c; \ @HAVE_DIFF_FALSE@ cp sublist.c.in sublist.c; \ @HAVE_DIFF_FALSE@ touch sublist.stamp constants.c: ../make_parameters ../make_parameters i > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters idl_getdata.dlm: getdata.c makedlm.sh ${SHELL} ./makedlm.sh -d $< > $@ all-local: .libs/idl_getdata.dlm # This is required to properly run the test suite .libs/idl_getdata.dlm: idl_getdata.dlm if [ ! -e .libs ]; then mkdir -p .libs; fi cp $< .libs clean-local: rm -rf ${BUILT_SOURCES} *~ idl_getdata.dlm makedlm.sh sublist.c.in sublist.stamp # 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: libgetdata-0.9.0/bindings/idl/test/0000740000175000017500000000000012614323564017326 5ustar alastairalastairlibgetdata-0.9.0/bindings/idl/test/Makefile.in0000640000175000017500000004667512614323564021417 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/idl/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2009, 2010, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests @TEST_IDL_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} IDL_PATH="${srcdir}" IDL_DLM_PATH=../.libs ${IDL} @TEST_IDL_TRUE@idlTESTS = big_test.pro @TEST_IDL_TRUE@TESTS = $(addprefix ${srcdir}/,$(idlTESTS)) EXTRA_DIST = getdata_idl_test_routines.pro ${idlTESTS} all: all-am .SUFFIXES: $(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 bindings/idl/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/idl/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: $(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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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-TESTS check-local 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 clean-local 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: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am check-local clean \ clean-generic clean-libtool clean-local cscopelist-am ctags-am \ 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 tags-am uninstall \ uninstall-am # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ # 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: libgetdata-0.9.0/bindings/idl/test/big_test.pro0000640000175000017500000014702712614323564021665 0ustar alastairalastair; vim: ft=idlang ; ; Copyright (C) 2009-2015 D. V. Wiebe ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; This file is part of the GetData project. ; ; GetData 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. ; ; GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., ; 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ; Load the helper routines .r getdata_idl_test_routines ; If this IDL is running in timed demo mode, we can't perform this test, ; having neither DLM nor file functionality. if (LMGR(/DEMO)) then timed_demo_mode ; General test filedir = "test_dirfile" format = "test_dirfile/format" form2 = "test_dirfile/form2" data = "test_dirfile/data" flen = 11 nfields = 17 nume = 0 spawn, "rm -rf " + filedir file_mkdir, filedir datadata = bindgen(80) + 1 fields = [ 'INDEX', 'alias', 'bit', 'carray', 'const', 'data', 'div', $ 'lincom', 'linterp', 'mplex', 'mult', 'phase', 'polynom', 'recip', 'sbit', $ 'string', 'window' ] ; Write the test dirfile openw,1,format printf,1,'/ENDIAN little' printf,1,'data RAW INT8 8' printf,1,'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const' printf,1,'/META data mstr STRING "This is a string constant."' printf,1,'/META data mconst CONST COMPLEX128 3.3;4.4' printf,1,'/META data mlut LINTERP DATA ./lut' printf,1,'const CONST FLOAT64 5.5' printf,1,'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6' printf,1,'linterp LINTERP data ./lut' printf,1,'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const' printf,1,'bit BIT data 3 4' printf,1,'sbit SBIT data 5 6' printf,1,'mplex MPLEX data sbit 1 10' printf,1,'mult MULTIPLY data sbit' printf,1,'div DIVIDE mult bit' printf,1,'recip RECIP div 6.5;4.3' printf,1,'phase PHASE data 11' printf,1,'window WINDOW linterp mult LT 4.1' printf,1,'/ALIAS alias data' printf,1,'string STRING "Zaphod Beeblebrox"' close,1 openw,1,form2 printf,1,'const2 CONST INT8 -19' close,1 openw,1,data writeu,1,byte(datadata) close,1 ; 0: getdata_constants check defsysv, "!GD", getdata_constants() nume += check_simple(0, !GD.E_OK, 0) ; 1: gd_error check d = gd_open("x",error=error) nume += check_error(1, d, !GD.E_IO) nume += check_simple(1, error, !GD.E_IO) gd_close, d, /DISCARD ; 2: gd_open check d = gd_open(filedir, /RDWR) nume += check_ok(2, d) nume += check_simple(2, d, 1) ; 3: gd_getdata check n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1) nume += check_ok(3, d) nume += check_simple(3, n, INDGEN(8) + 41) ; 12: gd_get_constant check n = gd_get_constant(d, "const", type=!GD.FLOAT64) nume += check_ok(12, d) nume += check_simple(12, n, 5.5) ; 23: gd_nfields check n = gd_nfields(d) nume += check_ok(23, d) nume += check_simple(23, n, nfields) ; 25: gd_field_list check n = gd_field_list(d) nume += check_ok(25, d) nume += check_simple(25, n, fields) ; 26: gd_nmfields_check n = gd_nfields(d, parent="data") nume += check_ok(26, d) nume += check_simple(26, n, 3) ; 27: gd_mfield_list check n = gd_field_list(d, parent="data") nume += check_ok(27, d) nume += check_simple(27, n, [ "mstr", "mconst", "mlut" ]) ; 28: gd_nframes check n = gd_nframes(d) nume += check_ok(28, d) nume += check_simple(28, n, 10) ; 29: gd_spf check n = gd_spf(d, "data") nume += check_ok(29, d) nume += check_simple(29, n, 8) ; 30: gd_putdata check gd_putdata, d, "data", [13, 14, 15, 16], first_frame=5, first_sample=1 nume += check_ok2(30, 1, d) n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1) nume += check_ok2(30, 2, d) nume += check_simple(30, n, [ 41, 13, 14, 15, 16, 46, 47, 48]) ; 35: gd_putdata (float) check gd_putdata, d, "data", [23., 24., 25., 26.], first_frame=5, first_sample=1 nume += check_ok2(35, 1, d) n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1) nume += check_ok2(35, 2, d) nume += check_simple(35, n, [ 41, 23, 24, 25, 26, 46, 47, 48]) ; 37: gd_putdata (complex) check gd_putdata, d, "data", [COMPLEX(33,0), COMPLEX(34,0), COMPLEX(35,0), $ COMPLEX(36,0)], first_frame=5, first_sample=1 nume += check_ok2(37, 1, d) n = gd_getdata(d, "data", type=!GD.INT16, first_frame=5, num_frames=1) nume += check_ok2(37, 2, d) nume += check_simple(37, n, [ 41, 33, 34, 35, 36, 46, 47, 48]) ; 38: gd_error_string check n = gd_getdata(d, "x", num_frames=1, estring=estring) nume += check_error(38, d, !GD.E_BAD_CODE) nume += check_simple2(38, 1, gd_error_string(d), "Field not found: x") nume += check_simple2(38, 2, estring, "Field not found: x") ; 39: gd_entry_type check n = gd_entry_type(d, "data") nume += check_ok(39, d) nume += check_simple(39, n, !GD.RAW_ENTRY) ; 40: gd_entry (raw) n = gd_entry(d, "data") nume += check_ok(40, d) nume += check_simple2(40, 1, n.field_type, !GD.RAW_ENTRY) nume += check_simple2(40, 2, n.field, "data") nume += check_simple2(40, 3, n.fragment, 0) nume += check_simple2(40, 4, n.data_type, !GD.INT8) nume += check_simple2(40, 5, n.spf, 8) ; 42: gd_entry (lincom) n = gd_entry(d, "lincom") nume += check_ok(42, d) nume += check_simple2(42, 1, n.field_type, !GD.LINCOM_ENTRY) nume += check_simple2(42, 2, n.field, "lincom") nume += check_simple2(42, 3, n.fragment, 0) nume += check_simple2(42, 4, n.n_fields, 3) nume += check_simple2(42, 5, n.in_fields, [ "data", "INDEX", "linterp" ]) nume += check_simple2(42, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(42, 7, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $ DCOMPLEX(5.5D,0) ]) nume += check_simple2(42, 8, n.cb, [ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), $ DCOMPLEX(5.5D,0) ]) nume += check_simple2(42, 9, n.scalar, [ "", "", "const", "", "", "const" ]) ; 44: gd_entry (polynom) n = gd_entry(d, "polynom") nume += check_ok(44, d) nume += check_simple2(44, 1, n.field_type, !GD.POLYNOM_ENTRY) nume += check_simple2(44, 2, n.field, "polynom") nume += check_simple2(44, 3, n.fragment, 0) nume += check_simple2(44, 4, n.poly_ord, 5) nume += check_simple2(44, 5, n.in_fields, [ "data" ]) nume += check_simple2(44, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(44, 7, n.ca, [ DCOMPLEX(1.1D,0), DCOMPLEX(2.2D,0), $ DCOMPLEX(2.2D,0), DCOMPLEX(3.3D,4.4D), DCOMPLEX(5.5D,0), DCOMPLEX(5.5D,0) ]) nume += check_simple2(44, 8, n.scalar, [ "", "", "", "", "const", "const" ]) ; 45: gd_entry (linterp) n = gd_entry(d, "linterp") nume += check_ok(45, d) nume += check_simple2(45, 1, n.field_type, !GD.LINTERP_ENTRY) nume += check_simple2(45, 2, n.field, "linterp") nume += check_simple2(45, 3, n.fragment, 0) nume += check_simple2(45, 4, n.in_fields, [ "data" ]) nume += check_simple2(45, 5, n.table, "./lut") ; 46: gd_entry (bit) n = gd_entry(d, "bit") nume += check_ok(46, d) nume += check_simple2(46, 1, n.field_type, !GD.BIT_ENTRY) nume += check_simple2(46, 2, n.field, "bit") nume += check_simple2(46, 3, n.fragment, 0) nume += check_simple2(46, 4, n.in_fields, [ "data" ]) nume += check_simple2(46, 5, n.numbits, 4) nume += check_simple2(46, 6, n.bitnum, 3) ; 47: gd_entry (sbit) n = gd_entry(d, "sbit") nume += check_ok(47, d) nume += check_simple2(47, 1, n.field_type, !GD.SBIT_ENTRY) nume += check_simple2(47, 2, n.field, "sbit") nume += check_simple2(47, 3, n.fragment, 0) nume += check_simple2(47, 4, n.in_fields, [ "data" ]) nume += check_simple2(47, 5, n.numbits, 6) nume += check_simple2(47, 6, n.bitnum, 5) ; 48: gd_entry (multiply) n = gd_entry(d, "mult") nume += check_ok(48, d) nume += check_simple2(48, 1, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(48, 2, n.field, "mult") nume += check_simple2(48, 3, n.fragment, 0) nume += check_simple2(48, 4, n.in_fields, [ "data", "sbit" ]) ; 49: gd_entry (phase) n = gd_entry(d, "phase") nume += check_ok(49, d) nume += check_simple2(49, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(49, 2, n.field, "phase") nume += check_simple2(49, 3, n.fragment, 0) nume += check_simple2(49, 4, n.in_fields, [ "data" ]) nume += check_simple2(49, 5, n.shift, 11) ; 50: gd_entry (const) n = gd_entry(d, "const") nume += check_ok(50, d) nume += check_simple2(50, 1, n.field_type, !GD.CONST_ENTRY) nume += check_simple2(50, 2, n.field, "const") nume += check_simple2(50, 3, n.fragment, 0) nume += check_simple2(50, 4, n.data_type, !GD.FLOAT64) ; 51: gd_entry (string) n = gd_entry(d, "string") nume += check_ok(51, d) nume += check_simple2(51, 1, n.field_type, !GD.STRING_ENTRY) nume += check_simple2(51, 2, n.field, "string") nume += check_simple2(51, 3, n.fragment, 0) ; 52: gd_fragment_index check n = gd_fragment_index(d, "data") nume += check_ok(52, d) nume += check_simple(52, n, 0) ; 53: gd_add_raw check gd_add_raw, d, "new1", !GD.FLOAT64, spf=3 nume += check_ok2(53, 1, d) n = gd_entry(d, "new1") nume += check_ok2(53, 2, d) nume += check_simple2(53, 1, n.field_type, !GD.RAW_ENTRY) nume += check_simple2(53, 2, n.field, "new1") nume += check_simple2(53, 3, n.fragment, 0) nume += check_simple2(53, 4, n.data_type, !GD.FLOAT64) nume += check_simple2(53, 5, n.spf, 3) ; 55: gd_add_lincom gd_add_lincom, d, "new2", "in1", COMPLEX(1.1, 1.2), COMPLEX(1.3, 1.4), $ "in2", COMPLEX(1.4, 1.5), COMPLEX(1.6, 1.7) nume += check_ok2(55, 1, d) n = gd_entry(d, "new2") nume += check_ok2(55, 2, d) nume += check_simple2(55, 1, n.field_type, !GD.LINCOM_ENTRY) nume += check_simple2(55, 2, n.field, "new2") nume += check_simple2(55, 3, n.fragment, 0) nume += check_simple2(55, 4, n.n_fields, 2) nume += check_simple2(55, 5, n.in_fields, [ "in1", "in2" ]) nume += check_simple2(55, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(55, 7, n.cm, [ DCOMPLEX(1.1,1.2), DCOMPLEX(1.4,1.5) ]) nume += check_simple2(55, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ]) ; 57: gd_add_polynom gd_add_polynom, d, "new4", "in1", DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $ DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4) nume += check_ok2(57, 1, d) n = gd_entry(d, "new4") nume += check_ok2(57, 2, d) nume += check_simple2(57, 1, n.field_type, !GD.POLYNOM_ENTRY) nume += check_simple2(57, 2, n.field, "new4") nume += check_simple2(57, 3, n.fragment, 0) nume += check_simple2(57, 4, n.poly_ord, 3) nume += check_simple2(57, 5, n.in_fields, [ "in1" ]) nume += check_simple2(57, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(57, 7, n.ca, [ DCOMPLEX(3.1,7.0D), DCOMPLEX(4.2,8.0), $ DCOMPLEX(5.2,9.0), DCOMPLEX(6.3,4.4) ]) ; 58: gd_add_linterp gd_add_linterp, d, "new6", "in", "./some/table" nume += check_ok2(58, 1, d) n = gd_entry(d, "new6") nume += check_ok2(58, 2, d) nume += check_simple2(58, 1, n.field_type, !GD.LINTERP_ENTRY) nume += check_simple2(58, 2, n.field, "new6") nume += check_simple2(58, 3, n.fragment, 0) nume += check_simple2(58, 4, n.in_fields, [ "in" ]) nume += check_simple2(58, 5, n.table, "./some/table") ; 59: gd_add_bit gd_add_bit, d, "new7", "in1", bitnum=11, numbits=22 nume += check_ok2(59, 1, d) n = gd_entry(d, "new7") nume += check_ok2(59, 2, d) nume += check_simple2(59, 1, n.field_type, !GD.BIT_ENTRY) nume += check_simple2(59, 2, n.field, "new7") nume += check_simple2(59, 3, n.fragment, 0) nume += check_simple2(59, 4, n.in_fields, [ "in1" ]) nume += check_simple2(59, 5, n.numbits, 22) nume += check_simple2(59, 6, n.bitnum, 11) ; 60: gd_add_sbit gd_add_sbit, d, "new8", "in2", bitnum=5, numbits=10 nume += check_ok2(60, 1, d) n = gd_entry(d, "new8") nume += check_ok2(60, 2, d) nume += check_simple2(60, 1, n.field_type, !GD.SBIT_ENTRY) nume += check_simple2(60, 2, n.field, "new8") nume += check_simple2(60, 3, n.fragment, 0) nume += check_simple2(60, 4, n.in_fields, [ "in2" ]) nume += check_simple2(60, 5, n.numbits, 10) nume += check_simple2(60, 6, n.bitnum, 5) ; 61: gd_add_multiply gd_add_multiply, d, "new9", "in2", "in3" nume += check_ok2(61, 1, d) n = gd_entry(d, "new9") nume += check_ok(61, d) nume += check_simple2(61, 1, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(61, 2, n.field, "new9") nume += check_simple2(61, 3, n.fragment, 0) nume += check_simple2(61, 4, n.in_fields, [ "in2", "in3" ]) ; 62: gd_add_phase gd_add_phase, d, "new10", "in6", 42 nume += check_ok2(62, 1, d) n = gd_entry(d, "new10") nume += check_ok2(62, 2, d) nume += check_simple2(62, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(62, 2, n.field, "new10") nume += check_simple2(62, 3, n.fragment, 0) nume += check_simple2(62, 4, n.in_fields, [ "in6" ]) nume += check_simple2(62, 5, n.shift, 42) ; 63: gd_add_const gd_add_const, d, "new11", type=!GD.FLOAT64, value=4.3D nume += check_ok2(63, 1, d) n = gd_entry(d, "new11") nume += check_ok2(63, 2, d) nume += check_simple2(63, 1, n.field_type, !GD.CONST_ENTRY) nume += check_simple2(63, 2, n.field, "new11") nume += check_simple2(63, 3, n.fragment, 0) nume += check_simple2(63, 4, n.data_type, !GD.FLOAT64) n = gd_get_constant(d, "new11") nume += check_ok2(63, 3, d) nume += check_simple2(63, 5, n, 4.3D) ; 64: gd_fragmentname n = gd_fragmentname(d, 0) nume += check_ok(64, d) nume += check_eostring(64, n, "test_dirfile/format") ; 65: gd_nfragments n = gd_nfragments(d) nume += check_ok(65, d) nume += check_simple(65, n, 1) ; 66: gd_include gd_include, d, "form2" nume += check_ok2(66, 1, d) n = gd_get_constant(d, "const2", type=!GD.INT16) nume += check_ok2(66, 2, d) nume += check_simple(66, n, -19) ; 67: gd_nfields_by_type check n = gd_nfields(d,type=!GD.LINCOM_ENTRY) nume += check_ok(67, d) nume += check_simple(67, n, 2) ; 68: gd_field_list_by_type check n = gd_field_list(d, type=!GD.LINCOM_ENTRY) nume += check_ok(68, d) nume += check_simple(68, n, [ "lincom", "new2" ]) ; 69: gd_nvectors check n = gd_nvectors(d) nume += check_ok(69, d) nume += check_simple(69, n, 22) ; 70: gd_vector_list check n = gd_vector_list(d) nume += check_ok(70, d) nume += check_simple(70, n, [ 'INDEX', 'alias', 'bit', 'data', 'div', $ 'lincom', 'linterp', 'mplex', 'mult', 'new1', 'new10', 'new2', 'new4', $ 'new6', 'new7', 'new8', 'new9', 'phase', 'polynom', 'recip', 'sbit', $ 'window' ]) ; 71: gd_madd_lincom gd_add_lincom, d, "mnew2", "in1", 9.9D, 8.8D, "in2", 7.7D, 6.6D, $ parent="data" nume += check_ok2(71, 1, d) n = gd_entry(d, "data/mnew2") nume += check_ok2(71, 2, d) nume += check_simple2(71, 1, n.field_type, !GD.LINCOM_ENTRY) nume += check_simple2(71, 2, n.field, "data/mnew2") nume += check_simple2(71, 3, n.fragment, 0) nume += check_simple2(71, 4, n.n_fields, 2) nume += check_simple2(71, 5, n.in_fields, [ "in1", "in2" ]) nume += check_simple2(71, 6, n.flags, !GD.EN_CALC) nume += check_simple2(71, 7, n.m, [ 9.9D, 7.7D ]) nume += check_simple2(71, 8, n.b, [ 8.8D, 6.6D ]) ; 73: gd_madd_polynom gd_add_polynom, d, "mnew4", "in1", [ 3.3D, 4.4D, 5.5D, 6.6D ], $ parent="data" nume += check_ok2(73, 1, d) n = gd_entry(d, "data/mnew4") nume += check_ok2(73, 2, d) nume += check_simple2(73, 1, n.field_type, !GD.POLYNOM_ENTRY) nume += check_simple2(73, 2, n.field, "data/mnew4") nume += check_simple2(73, 3, n.fragment, 0) nume += check_simple2(73, 4, n.poly_ord, 3) nume += check_simple2(73, 5, n.in_fields, [ "in1" ]) nume += check_simple2(73, 6, n.flags, !GD.EN_CALC) nume += check_simple2(73, 7, n.a, [ 3.3D, 4.4D, 5.5D, 6.6D ]) ; 75: gd_madd_linterp gd_add_linterp, d, "mnew6", "in", "./more/table", parent="data" nume += check_ok2(75, 1, d) n = gd_entry(d, "data/mnew6") nume += check_ok2(75, 2, d) nume += check_simple2(75, 1, n.field_type, !GD.LINTERP_ENTRY) nume += check_simple2(75, 2, n.field, "data/mnew6") nume += check_simple2(75, 3, n.fragment, 0) nume += check_simple2(75, 4, n.in_fields, [ "in" ]) nume += check_simple2(75, 5, n.table, "./more/table") ; 76: gd_madd_bit gd_add_bit, d, "mnew7", "in1", bitnum=21, numbits=12, parent="data" nume += check_ok2(76, 1, d) n = gd_entry(d, "data/mnew7") nume += check_ok2(76, 2, d) nume += check_simple2(76, 1, n.field_type, !GD.BIT_ENTRY) nume += check_simple2(76, 2, n.field, "data/mnew7") nume += check_simple2(76, 3, n.fragment, 0) nume += check_simple2(76, 4, n.in_fields, [ "in1" ]) nume += check_simple2(76, 5, n.numbits, 12) nume += check_simple2(76, 6, n.bitnum, 21) ; 77: gd_madd_sbit gd_add_sbit, d, "mnew8", "in3", bitnum=2, numbits=14, parent="data" nume += check_ok2(77, 1, d) n = gd_entry(d, "data/mnew8") nume += check_ok2(77, 2, d) nume += check_simple2(77, 1, n.field_type, !GD.SBIT_ENTRY) nume += check_simple2(77, 2, n.field, "data/mnew8") nume += check_simple2(77, 3, n.fragment, 0) nume += check_simple2(77, 4, n.in_fields, [ "in3" ]) nume += check_simple2(77, 5, n.numbits, 14) nume += check_simple2(77, 6, n.bitnum, 2) ; 78: gd_madd_multiply gd_add_multiply, d, "mnew9", "in4", "in1", parent="data" nume += check_ok2(78, 1, d) n = gd_entry(d, "data/mnew9") nume += check_ok2(78, 2, d) nume += check_simple2(78, 1, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(78, 2, n.field, "data/mnew9") nume += check_simple2(78, 3, n.fragment, 0) nume += check_simple2(78, 4, n.in_fields, [ "in4", "in1" ]) ; 79: gd_madd_phase gd_add_phase, d, "mnew10", "in1", -4, parent="data" nume += check_ok2(79, 1, d) n = gd_entry(d, "data/mnew10") nume += check_ok2(79, 2, d) nume += check_simple2(79, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(79, 2, n.field, "data/mnew10") nume += check_simple2(79, 3, n.fragment, 0) nume += check_simple2(79, 4, n.in_fields, [ "in1" ]) nume += check_simple2(79, 5, n.shift, -4) ; 80: gd_madd_const gd_add_const, d, "mnew11", type=!GD.UINT64, parent="data" nume += check_ok2(80, 1, d) n = gd_entry(d, "data/mnew11") nume += check_ok2(80, 2, d) nume += check_simple2(80, 1, n.field_type, !GD.CONST_ENTRY) nume += check_simple2(80, 2, n.field, "data/mnew11") nume += check_simple2(80, 3, n.fragment, 0) nume += check_simple2(80, 4, n.data_type, !GD.UINT64) ; 81: gd_get_string n = gd_get_string(d, "string") nume += check_ok(81, d) nume += check_simple(81, n, "Zaphod Beeblebrox") ; 82: gd_add_string gd_add_string, d, "new12", value="a string" nume += check_ok2(82, 1, d) n = gd_entry(d, "new12") nume += check_ok2(82, 2, d) nume += check_simple2(82, 1, n.field_type, !GD.STRING_ENTRY) nume += check_simple2(82, 2, n.field, "new12") nume += check_simple2(82, 3, n.fragment, 0) n = gd_get_string(d, "new12") nume += check_ok2(82, 3, d) nume += check_simple2(82, 4, n, "a string") ; 83: gd_madd_string gd_add_string, d, "mnew12", value="another string", parent="data" nume += check_ok2(83, 1, d) n = gd_entry(d, "data/mnew12") nume += check_ok2(83, 2, d) nume += check_simple2(83, 1, n.field_type, !GD.STRING_ENTRY) nume += check_simple2(83, 2, n.field, "data/mnew12") nume += check_simple2(83, 3, n.fragment, 0) n = gd_get_string(d, "data/mnew12") nume += check_ok2(83, 3, d) nume += check_simple2(83, 4, n, "another string") ; 84: gd_add_spec gd_add_spec, d, 'lorem STRING "Lorem ipsum"' nume += check_ok2(84, 1, d) n = gd_entry(d, "lorem") nume += check_ok2(84, 2, d) nume += check_simple2(84, 1, n.field_type, !GD.STRING_ENTRY) nume += check_simple2(84, 2, n.field, "lorem") nume += check_simple2(84, 3, n.fragment, 0) n = gd_get_string(d, "lorem") nume += check_ok2(84, 3, d) nume += check_simple2(84, 4, n, "Lorem ipsum") ; 85: gd_madd_string gd_add_spec, d, 'ipsum STRING "dolor sit amet."', parent="lorem" nume += check_ok2(85, 1, d) n = gd_entry(d, "lorem/ipsum") nume += check_ok2(85, 2, d) nume += check_simple2(85, 1, n.field_type, !GD.STRING_ENTRY) nume += check_simple2(85, 2, n.field, "lorem/ipsum") nume += check_simple2(85, 3, n.fragment, 0) n = gd_get_string(d, "lorem/ipsum") nume += check_ok2(85, 3, d) nume += check_simple2(85, 4, n, "dolor sit amet.") ; 86: gd_put_constant gd_put_constant, d, "const", 86 nume += check_ok2(86, 1, d) n = gd_get_constant(d, "const", type=!GD.INT32) nume += check_ok2(86, 2, d) nume += check_simple(86, n, 86) ; 94: gd_put_string gd_put_string, d, "string", "Arthur Dent" nume += check_ok2(94, 1, d) n = gd_get_string(d, "string") nume += check_ok2(94, 2, d) nume += check_simple(94, n, "Arthur Dent") ; 95: gd_nmfields_by_type n = gd_nfields(d, parent="data", type=!GD.LINCOM_ENTRY) nume += check_ok(95, d) nume += check_simple(95, n, 1) ; 96: gd_mfield_list_by_type n = gd_field_list(d, parent="data", type=!GD.LINCOM_ENTRY) nume += check_ok(96, d) nume += check_simple(96, n, [ "mnew2" ]) ; 97: gd_nmvectors n = gd_nvectors(d, parent="data") nume += check_ok(97, d) nume += check_simple(97, n, 8) ; 98: gd_mvector_list check n = gd_vector_list(d, parent="data") nume += check_ok(98, d) nume += check_simple(98, n, [ 'mlut', 'mnew2', 'mnew4', 'mnew6', $ 'mnew7', 'mnew8', 'mnew9', 'mnew10' ]) ; 99: gd_alter_raw check gd_alter_raw, d, "new1", type=!GD.INT32 nume += check_ok2(99, 1, d) n = gd_entry(d, "new1") nume += check_ok2(99, 2, d) nume += check_simple2(99, 1, n.field_type, !GD.RAW_ENTRY) nume += check_simple2(99, 2, n.field, "new1") nume += check_simple2(99, 3, n.fragment, 0) nume += check_simple2(99, 4, n.data_type, !GD.INT32) nume += check_simple2(99, 5, n.spf, 3) ; 101: gd_alter_lincom gd_alter_lincom, d, "new2", in_fields=[ "in3", "in4" ], $ m=[ COMPLEX(2.3, 4.5), COMPLEX(6.7, 8.9) ] nume += check_ok2(101, 1, d) n = gd_entry(d, "new2") nume += check_ok2(101, 2, d) nume += check_simple2(101, 1, n.field_type, !GD.LINCOM_ENTRY) nume += check_simple2(101, 2, n.field, "new2") nume += check_simple2(101, 3, n.fragment, 0) nume += check_simple2(101, 4, n.n_fields, 2) nume += check_simple2(101, 5, n.in_fields, [ "in3", "in4" ]) nume += check_simple2(101, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(101, 7, n.cm, [ DCOMPLEX(2.3,4.5), DCOMPLEX(6.7,8.9) ]) nume += check_simple2(101, 8, n.cb, [ DCOMPLEX(1.3,1.4), DCOMPLEX(1.6,1.7) ]) ; 103: gd_alter_polynom gd_alter_polynom, d, "new4", poly_ord=4, a=[ DCOMPLEX(1.2,3.4), $ DCOMPLEX(5.6,7.8), DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ] nume += check_ok2(103, 1, d) n = gd_entry(d, "new4") nume += check_ok2(103, 2, d) nume += check_simple2(103, 1, n.field_type, !GD.POLYNOM_ENTRY) nume += check_simple2(103, 2, n.field, "new4") nume += check_simple2(103, 3, n.fragment, 0) nume += check_simple2(103, 4, n.poly_ord, 4) nume += check_simple2(103, 5, n.in_fields, [ "in1" ]) nume += check_simple2(103, 6, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(103, 7, n.ca, [ DCOMPLEX(1.2,3.4), DCOMPLEX(5.6,7.8), $ DCOMPLEX(9.0,1.2), DCOMPLEX(3.4,5.6), DCOMPLEX(7.8,9.0) ]) ; 104: gd_alter_linterp gd_alter_linterp, d, "new6", table="./other/table" nume += check_ok2(104, 1, d) n = gd_entry(d, "new6") nume += check_ok2(104, 2, d) nume += check_simple2(104, 1, n.field_type, !GD.LINTERP_ENTRY) nume += check_simple2(104, 2, n.field, "new6") nume += check_simple2(104, 3, n.fragment, 0) nume += check_simple2(104, 4, n.in_fields, [ "in" ]) nume += check_simple2(104, 5, n.table, "./other/table") ; 105: gd_alter_bit gd_alter_bit, d, "new7", in_field="in3", numbits=8 nume += check_ok2(105, 1, d) n = gd_entry(d, "new7") nume += check_ok2(105, 2, d) nume += check_simple2(105, 1, n.field_type, !GD.BIT_ENTRY) nume += check_simple2(105, 2, n.field, "new7") nume += check_simple2(105, 3, n.fragment, 0) nume += check_simple2(105, 4, n.in_fields, [ "in3" ]) nume += check_simple2(105, 5, n.numbits, 8) nume += check_simple2(105, 6, n.bitnum, 11) ; 106: gd_alter_sbit gd_alter_sbit, d, "new8", bitnum=15, numbits=1 nume += check_ok2(106, 1, d) n = gd_entry(d, "new8") nume += check_ok2(106, 2, d) nume += check_simple2(106, 1, n.field_type, !GD.SBIT_ENTRY) nume += check_simple2(106, 2, n.field, "new8") nume += check_simple2(106, 3, n.fragment, 0) nume += check_simple2(106, 4, n.in_fields, [ "in2" ]) nume += check_simple2(106, 5, n.numbits, 1) nume += check_simple2(106, 6, n.bitnum, 15) ; 107: gd_alter_multiply gd_alter_multiply, d, "new9", in_field1="in6" nume += check_ok2(107, 1, d) n = gd_entry(d, "new9") nume += check_ok(107, d) nume += check_simple2(107, 1, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(107, 2, n.field, "new9") nume += check_simple2(107, 3, n.fragment, 0) nume += check_simple2(107, 4, n.in_fields, [ "in6", "in3" ]) ; 108: gd_alter_phase gd_alter_phase, d, "new10", shift=108 nume += check_ok2(108, 1, d) n = gd_entry(d, "new10") nume += check_ok2(108, 2, d) nume += check_simple2(108, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(108, 2, n.field, "new10") nume += check_simple2(108, 3, n.fragment, 0) nume += check_simple2(108, 4, n.in_fields, [ "in6" ]) nume += check_simple2(108, 5, n.shift, 108) ; 109: gd_alter_const gd_alter_const, d, "new11", type=!GD.FLOAT32 nume += check_ok2(109, 1, d) n = gd_entry(d, "new11") nume += check_ok2(109, 2, d) nume += check_simple2(109, 1, n.field_type, !GD.CONST_ENTRY) nume += check_simple2(109, 2, n.field, "new11") nume += check_simple2(109, 3, n.fragment, 0) nume += check_simple2(109, 4, n.data_type, !GD.FLOAT32) ; 110: gd_encoding n = gd_encoding(d, fragment=0) nume += check_ok(110, d) nume += check_simple(110, n, !GD.UNENCODED) ; 111: gd_endianness n = gd_endianness(d, fragment=0) nume += check_ok(111, d) nume += check_simple(111, n, (!GD.LITTLE_ENDIAN + !GD.NOT_ARM_ENDIAN)) ; 112: dirfilename n = gd_dirfilename(d) nume += check_ok(112, d) nume += check_eostring(112, n, "test_dirfile") ; 113: gd_parent_fragment n = gd_parent_fragment(d, fragment=1) nume += check_ok(113, d) nume += check_simple(113, n, 0) ; 114: gd_alter_protection gd_alter_protection, d, !GD.PROTECT_DATA, fragment=1 nume += check_ok(114, d) ; 115: gd_protection n = gd_protection(d, fragment=1) nume += check_ok(115, d) nume += check_simple(115, n, !GD.PROTECT_DATA) ; 116: gd_raw_filename n = gd_raw_filename(d, 'data') nume += check_ok(116, d) nume += check_eostring(116, n, "test_dirfile/data") ; 117: gd_reference n = gd_reference(d, "new1") nume += check_ok(117, d) nume += check_simple(117, n, "new1"); ; 118: gd_eof n = gd_eof(d, "lincom") nume += check_ok(118,d) nume += check_simple(118,n,80) ; 119: gd_alter_encoding gd_alter_encoding, d, !GD.SLIM_ENCODED, fragment=1 nume += check_ok2(119, 1, d) n = gd_encoding(d, fragment=1) nume += check_ok2(119, 2, d) nume += check_simple(119, n, !GD.SLIM_ENCODED) ; 120: gd_alter_endianness gd_alter_endianness, d, /big_endian, fragment=1 nume += check_ok2(120, 1, d) n = gd_endianness(d, fragment=1) nume += check_ok2(120, 2, d) nume += check_simple(120, n, !GD.BIG_ENDIAN) ; 121: gd_alter_spec gd_alter_spec, d, "new10 PHASE in 3" nume += check_ok2(121, 1, d) n = gd_entry(d, "new10") nume += check_ok2(121, 2, d) nume += check_simple2(121, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(121, 2, n.field, "new10") nume += check_simple2(121, 3, n.fragment, 0) nume += check_simple2(121, 4, n.in_fields, [ "in" ]) nume += check_simple2(121, 5, n.shift, 3) ; 122: gd_delete gd_delete, d, "new10" nume += check_ok2(122, 1, d) n = gd_entry(d, "new10") nume += check_error2(122, 2, d, !GD.E_BAD_CODE) ; 123: gd_malter_spec gd_alter_spec, d, "mnew10 PHASE in4 11", parent="data" nume += check_ok2(123, 1, d) n = gd_entry(d, "data/mnew10") nume += check_ok2(123, 2, d) nume += check_simple2(123, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(123, 2, n.field, "data/mnew10") nume += check_simple2(123, 3, n.fragment, 0) nume += check_simple2(123, 4, n.in_fields, [ "in4" ]) nume += check_simple2(123, 5, n.shift, 11) ; 124: gd_move gd_move, d, "new9", 1 nume += check_ok2(124, 1, d) n = gd_entry(d, "new9") nume += check_ok2(124, 2, d) nume += check_simple2(124, 1, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(124, 2, n.field, "new9") nume += check_simple2(124, 3, n.fragment, 1) ; 125: gd_rename gd_rename, d, "new9", "newer" nume += check_ok2(125, 1, d) n = gd_entry(d, "new9") nume += check_error2(125, 2, d, !GD.E_BAD_CODE) n = gd_entry(d, "newer") nume += check_ok2(125, 3, d) nume += check_simple2(125, 1, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(125, 2, n.field, "newer") nume += check_simple2(125, 3, n.fragment, 1) ; 126: gd_uninclude gd_uninclude, d, 1 nume += check_ok2(126, 1, d) n = gd_entry(d, "newer") nume += check_error2(126, 2, d, !GD.E_BAD_CODE) ; 127: gd_frameoffset n = gd_frameoffset(d,fragment=0) nume += check_ok(127,d) nume += check_simple(127,n,0) ; 128: gd_alter_frameoffset gd_alter_frameoffset, d, 33, fragment=0 nume += check_ok2(128,1,d) n = gd_frameoffset(d,fragment=0) nume += check_ok(128,d) nume += check_simple(128,n,33) ; 129: gd_native_type n = gd_native_type(d, "data") nume += check_ok(129, d) nume += check_simple(129,n,!GD.INT8) ; 131: gd_validate n = gd_validate(d, "new7") nume += check_error(131,d,!GD.E_BAD_CODE) nume += check_simple(131,n,-1) ; 133: gd_framenum n = gd_framenum(d, "data", 33.3, field_start=6) nume += check_ok(133,d) nume += check_float(133, n, 37.037500D) ; 135: gd_add n = {field: "new135", field_type: !GD.RAW_ENTRY, fragment: 0, $ spf: 5U, data_type: !GD.FLOAT32} gd_add, d, n nume += check_ok2(135, 1, d) n = gd_entry(d, "new135") nume += check_ok2(135, 2, d) nume += check_simple2(135, 1, n.field_type, !GD.RAW_ENTRY) nume += check_simple2(135, 2, n.field, "new135") nume += check_simple2(135, 3, n.fragment, 0) nume += check_simple2(135, 4, n.data_type, !GD.FLOAT32) nume += check_simple2(135, 5, n.spf, 5) ; 136: gd_madd n = {field: "mnew136", field_type: !GD.PHASE_ENTRY, $ shift: 2L, in_fields: [ "in1" ], scalar: [ "" ], scalar_ind: [ 0 ]} gd_add, d, n, parent="data" nume += check_ok2(136, 1, d) n = gd_entry(d, "data/mnew136") nume += check_ok2(136, 2, d) nume += check_simple2(136, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(136, 2, n.field, "data/mnew136") nume += check_simple2(136, 3, n.fragment, 0) nume += check_simple2(136, 4, n.in_fields, [ "in1" ]) nume += check_simple2(136, 5, n.shift, 2) ; 141: gd_alter n = {field_type: !GD.RAW_ENTRY, data_type: !GD.FLOAT64} gd_alter_entry, d, "new135", n nume += check_ok2(141, 1, d) n = gd_entry(d, "new135") nume += check_ok2(141, 2, d) nume += check_simple2(141, 1, n.field_type, !GD.RAW_ENTRY) nume += check_simple2(141, 2, n.field, "new135") nume += check_simple2(141, 3, n.fragment, 0) nume += check_simple2(141, 4, n.data_type, !GD.FLOAT64) nume += check_simple2(141, 5, n.spf, 5) ; 142: gd_bof n = gd_bof(d, "lincom") nume += check_ok(142,d) nume += check_simple(142,n,264) ; 143: gd_entry (divide) n = gd_entry(d, "div") nume += check_ok(143, d) nume += check_simple2(143, 1, n.field_type, !GD.DIVIDE_ENTRY) nume += check_simple2(143, 2, n.field, "div") nume += check_simple2(143, 3, n.fragment, 0) nume += check_simple2(143, 4, n.in_fields, [ "mult", "bit" ]) ; 145: gd_entry (recip) n = gd_entry(d, "recip") nume += check_ok(145, d) nume += check_simple2(145, 1, n.field_type, !GD.RECIP_ENTRY) nume += check_simple2(145, 2, n.field, "recip") nume += check_simple2(145, 3, n.fragment, 0) nume += check_simple2(145, 4, n.in_fields, [ "div" ]) nume += check_simple2(145, 5, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(145, 6, n.cdividend, DCOMPLEX(6.5D,4.3D)) ; 146: gd_add_divide gd_add_divide, d, "new14", "in2", "in3" nume += check_ok2(146, 1, d) n = gd_entry(d, "new14") nume += check_ok(146, d) nume += check_simple2(146, 1, n.field_type, !GD.DIVIDE_ENTRY) nume += check_simple2(146, 2, n.field, "new14") nume += check_simple2(146, 3, n.fragment, 0) nume += check_simple2(146, 4, n.in_fields, [ "in2", "in3" ]) ; 148: gd_add_recip gd_add_recip, d, "new16", "in2", dividend=COMPLEX(33.3, 44.4) nume += check_ok2(148, 1, d) n = gd_entry(d, "new16") nume += check_ok(148, d) nume += check_simple2(148, 1, n.field_type, !GD.RECIP_ENTRY) nume += check_simple2(148, 2, n.field, "new16") nume += check_simple2(148, 3, n.fragment, 0) nume += check_simple2(148, 4, n.in_fields, [ "in2" ]) nume += check_simple2(148, 5, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(148, 6, n.cdividend, DCOMPLEX(33.3, 44.4)) ; 152: gd_alter_divide gd_alter_divide, d, "new14", in_field1="in6" nume += check_ok2(152, 1, d) n = gd_entry(d, "new14") nume += check_ok(152, d) nume += check_simple2(152, 1, n.field_type, !GD.DIVIDE_ENTRY) nume += check_simple2(152, 2, n.field, "new14") nume += check_simple2(152, 3, n.fragment, 0) nume += check_simple2(152, 4, n.in_fields, [ "in6", "in3" ]) ; 153: gd_alter_recip gd_alter_recip, d, "new16", dividend=1.01 nume += check_ok2(153, 1, d) n = gd_entry(d, "new16") nume += check_ok(153, d) nume += check_simple2(153, 1, n.field_type, !GD.RECIP_ENTRY) nume += check_simple2(153, 2, n.field, "new16") nume += check_simple2(153, 3, n.fragment, 0) nume += check_simple2(153, 5, n.flags, !GD.EN_CALC) nume += check_simple2(153, 4, n.in_fields, [ "in2" ]) nume += check_simple2(153, 6, n.dividend, 1.01) ; 155: gd_rewrite_fragment gd_rewrite_fragment, d, fragment=0 nume += check_ok(155, d) ; 156: gd_invalid_dirfile m = gd_invalid_dirfile() nume += check_ok2(156, 1, m) n = gd_nfragments(m) nume += check_error2(156, 2, m, !GD.E_BAD_DIRFILE) gd_close, m ; 157: gd_dirfile_standards n = gd_dirfile_standards(d, /CURRENT) nume += check_ok2(157, 1, d) nume += check_simple(157, n, !GD.DIRFILE_STANDARDS_VERSION) n = gd_dirfile_standards(d, 0) nume += check_error2(157, 2, d, !GD.E_ARGUMENT) ; 158: gd_get_carray n = gd_get_carray(d, "carray", type=!GD.FLOAT32) nume += check_ok(158, d) nume += check_simple(158, n, [ 1.1, 2.2, 3.3, 4.4, 5.5, 6.6 ]) ; 159: gd_get_carray_slice n = gd_get_carray(d, "carray", type=!GD.FLOAT32, len=2, start=2) nume += check_ok(159, d) nume += check_simple(159, n, [ 3.3, 4.4 ]) ; 168: gd_put_carray m = [ 9.8, 8.7, 7.6, 6.5, 5.4, 4.3 ] gd_put_carray, d, "carray", m nume += check_ok(168, d) n = gd_get_carray(d, "carray", type=!GD.FLOAT32) nume += check_ok(168, d) nume += check_simple(168, n, m) ; 169: gd_put_carray_slice gd_put_carray, d, "carray", [ 33, 34 ], start=2 nume += check_ok(169, d) n = gd_get_carray(d, "carray", type=!GD.FLOAT32) nume += check_ok(169, d) nume += check_simple(169, n, [ 9.8, 8.7, 33., 34., 5.4, 4.3 ]) ; 177: gd_array_len n = gd_array_len(d, "carray") nume += check_ok(177, d) nume += check_simple(177, n, 6) ; 178: gd_entry (CARRAY) n = gd_entry(d, "carray") nume += check_ok(178, d) nume += check_simple2(178, 1, n.field_type, !GD.CARRAY_ENTRY) nume += check_simple2(178, 2, n.field, "carray") nume += check_simple2(178, 3, n.fragment, 0) nume += check_simple2(178, 4, n.data_type, !GD.FLOAT64) nume += check_simple2(178, 5, n.array_len, 6) ; 179: gd_add_carray gd_add_carray, d, "new17", type=!GD.FLOAT64, value=[3.3D, 4.3D] nume += check_ok2(179, 1, d) n = gd_entry(d, "new17") nume += check_ok2(179, 2, d) nume += check_simple2(179, 1, n.field_type, !GD.CARRAY_ENTRY) nume += check_simple2(179, 2, n.field, "new17") nume += check_simple2(179, 3, n.fragment, 0) nume += check_simple2(179, 4, n.data_type, !GD.FLOAT64) nume += check_simple2(179, 5, n.array_len, 2) n = gd_get_carray(d, "new17") nume += check_ok2(179, 3, d) nume += check_simple2(179, 5, n, [3.3D, 4.3D]) ; 180: gd_madd_carray gd_add_carray, d, "mnew17", type=!GD.INT16, parent="data", value=[33, 43] nume += check_ok2(180, 1, d) n = gd_entry(d, "data/mnew17") nume += check_ok2(180, 2, d) nume += check_simple2(180, 1, n.field_type, !GD.CARRAY_ENTRY) nume += check_simple2(180, 2, n.field, "data/mnew17") nume += check_simple2(180, 3, n.fragment, 0) nume += check_simple2(180, 4, n.data_type, !GD.INT16) nume += check_simple2(180, 5, n.array_len, 2) n = gd_get_carray(d, "data/mnew17", type=!GD.INT16) nume += check_ok2(180, 3, d) nume += check_simple2(180, 6, n, [33, 43]) ; 181: gd_alter_carray gd_alter_carray, d, "new17", type=!GD.FLOAT32, len=3 nume += check_ok2(181, 1, d) n = gd_entry(d, "new17") nume += check_ok2(181, 2, d) nume += check_simple2(181, 1, n.field_type, !GD.CARRAY_ENTRY) nume += check_simple2(181, 2, n.field, "new17") nume += check_simple2(181, 3, n.fragment, 0) nume += check_simple2(181, 4, n.data_type, !GD.FLOAT32) nume += check_simple2(181, 5, n.array_len, 3) ; 183: gd_constants n = gd_constants(d, type=!GD.FLOAT32) nume += check_ok(183, d) ; 191: gd_mconstants n = gd_constants(d, parent="data", type=!GD.FLOAT32) nume += check_ok(191, d) nume += check_simple(191, n, [ 3.3, 0. ]) ; 199: gd_strings n = gd_strings(d) nume += check_ok(199, d) nume += check_simple(199, n, [ "Lorem ipsum", "a string", "Arthur Dent" ]) ; 200: gd_strings n = gd_strings(d, parent="data") nume += check_ok(200, d) nume += check_simple(200, n, [ "This is a string constant.", "another string" ]) ; 203: gd_seek n = gd_seek(d, "data", frame_num=35) nume += check_ok2(203, 0, d) m = gd_getdata(d, "data", type=!GD.INT16, num_frames=1) nume += check_ok2(203, 1, d) nume += check_simple2(203, 0, n, 280) nume += check_simple2(203, 1, m, INDGEN(8) + 17) ; 204: gd_tell n = gd_tell(d, "data") nume += check_ok(204, d) nume += check_simple(204, n, 288) ; 205: gd_hide check gd_hide, d, 'data' nume += check_ok(205, d) ; 206: gd_hidden check n = gd_hidden(d, 'data') nume += check_ok2(206, 1, d) nume += check_simple2(206, 1, n, 1) n = gd_hidden(d, 'lincom') nume += check_ok2(206, 2, d) nume += check_simple2(206, 2, n, 0) ; 207: gd_unhide check gd_unhide, d, 'data' nume += check_ok2(206, 1, d) n = gd_hidden(d, 'data') nume += check_ok2(206, 2, d) nume += check_simple(206, n, 0) ; 208: gd_sync check gd_flush, d, field_code='data', /noclose nume += check_ok(208, d) ; 209: gd_flush check gd_flush, d, field_code='data' nume += check_ok(209, d) ; 210: gd_metaflush check gd_metaflush, d nume += check_ok(210, d) ; 211: gd_entry (WINDOW) check n = gd_entry(d, 'window') nume += check_ok(211, d) nume += check_simple2(211, 1, n.field_type, !GD.WINDOW_ENTRY) nume += check_simple2(211, 2, n.fragment, 0) nume += check_simple2(211, 3, n.windop, !GD.WINDOP_LT) nume += check_simple2(211, 4, n.in_fields, [ 'linterp', 'mult' ]) nume += check_simple2(211, 6, n.rthreshold, 4.1D0) ; 212: gd_add_window check gd_add_window, d, 'new18', 'in1', 'in2', /NE, 32, fragment=0 nume += check_ok2(212, 1, d) n = gd_entry(d, 'new18') nume += check_ok2(212, 2, d) nume += check_simple2(212, 1, n.field_type, !GD.WINDOW_ENTRY) nume += check_simple2(212, 2, n.fragment, 0) nume += check_simple2(212, 3, n.windop, !GD.WINDOP_NE) nume += check_simple2(212, 4, n.in_fields, [ 'in1', 'in2' ]) nume += check_simple2(212, 6, n.ithreshold, 32) ; 214: gd_madd_window check gd_add_window, d, parent='data', 'mnew18', 'in2', 'in3', /SET, 128 nume += check_ok2(214, 1, d) n = gd_entry(d, 'data/mnew18') nume += check_ok2(214, 2, d) nume += check_simple2(214, 1, n.field_type, !GD.WINDOW_ENTRY) nume += check_simple2(214, 2, n.fragment, 0) nume += check_simple2(214, 3, n.windop, !GD.WINDOP_SET) nume += check_simple2(214, 4, n.in_fields, [ 'in2', 'in3' ]) nume += check_simple2(214, 6, n.uthreshold, 128) ; 217: gd_alter_window check gd_alter_window, d, 'new18', in_field='in3', check_field='in4', /GE, $ threshold=32e3 nume += check_ok2(217, 1, d) n = gd_entry(d, 'new18') nume += check_ok2(217, 2, d) nume += check_simple2(217, 1, n.field_type, !GD.WINDOW_ENTRY) nume += check_simple2(217, 2, n.fragment, 0) nume += check_simple2(217, 3, n.windop, !GD.WINDOP_GE) nume += check_simple2(217, 4, n.in_fields, [ 'in3', 'in4' ]) nume += check_simple2(217, 6, n.rthreshold, 32d3) ; 218: gd_alias_target check str = gd_alias_target(d, 'alias') nume += check_ok(218, d) nume += check_simple(218, str, 'data') ; 219: gd_add_alias check gd_add_alias, d, 'new20', 'data', fragment=0 nume += check_ok2(219, 1, d) str = gd_alias_target(d, 'new20') nume += check_ok2(219, 2, d) nume += check_simple(219, str, 'data') ; 220: gd_madd_alias check gd_add_alias, d, parent='data', 'mnew20', 'data' nume += check_ok2(220, 1, d) str = gd_alias_target(d, 'data/mnew20') nume += check_ok2(220, 2, d) nume += check_simple(220, str, 'data') ; 221: gd_naliases check n = gd_naliases(d, 'data') nume += check_ok(221, d) nume += check_simple(221, n, 4) ; 222: gd_alias check n = gd_aliases(d, 'data') nume += check_ok(222, d) nume += check_simple(222, n, [ 'data', 'alias', 'data/mnew20', 'new20' ]) ; 223: gd_include_affix check gd_include, d, 'format1', prefix='A', suffix='Z', /CREAT, /EXCL nume += check_ok(223, d) ; 226: gd_fragment_affixes check n = gd_fragment_affixes(d, fragment=1) nume += check_ok(226, d) nume += check_simple(226, n, [ "A", "Z" ]) ; 227: gd_alter_affixes check gd_alter_affixes, d, fragment=1, prefix='B', suffix='' nume += check_ok2(227, 1, d) n = gd_fragment_affixes(d, fragment=1) nume += check_ok2(227, 2, d) nume += check_simple(227, n, [ "B", "" ]) ; 228: gd_entry (MPLEX) check n = gd_entry(d, 'mplex') nume += check_ok(228, d) nume += check_simple2(228, 1, n.field_type, !GD.MPLEX_ENTRY) nume += check_simple2(228, 2, n.fragment, 0) nume += check_simple2(228, 3, n.count_val, 1) nume += check_simple2(228, 4, n.in_fields, [ 'data', 'sbit' ]) nume += check_simple2(228, 5, n.period, 10) ; 229: gd_add_mplex check gd_add_mplex, d, 'new21', 'in1', 'in2', 5, max=6 nume += check_ok2(229, 1, d) n = gd_entry(d, 'new21') nume += check_ok2(229, 2, d) nume += check_simple2(229, 1, n.field_type, !GD.MPLEX_ENTRY) nume += check_simple2(229, 2, n.fragment, 0) nume += check_simple2(229, 3, n.count_val, 5) nume += check_simple2(229, 4, n.in_fields, [ 'in1', 'in2' ]) nume += check_simple2(229, 5, n.period, 6) ; 230: gd_madd_mplex check gd_add_mplex, d, parent='data', 'mnew21', 'in2', 'in3', 0, max=12 nume += check_ok2(230, 1, d) n = gd_entry(d, 'data/mnew21') nume += check_ok2(230, 2, d) nume += check_simple2(230, 1, n.field_type, !GD.MPLEX_ENTRY) nume += check_simple2(230, 2, n.fragment, 0) nume += check_simple2(230, 3, n.count_val, 0) nume += check_simple2(230, 4, n.in_fields, [ 'in2', 'in3' ]) nume += check_simple2(230, 5, n.period, 12) ; 231: gd_alter_mplex check gd_alter_mplex, d, 'new21', in_field='in3', count_field='in4', count_val=2, $ period=7 nume += check_ok2(231, 1, d) n = gd_entry(d, 'new21') nume += check_ok2(231, 2, d) nume += check_simple2(231, 1, n.field_type, !GD.MPLEX_ENTRY) nume += check_simple2(231, 2, n.fragment, 0) nume += check_simple2(231, 3, n.count_val, 2) nume += check_simple2(231, 4, n.in_fields, [ 'in3', 'in4' ]) nume += check_simple2(231, 5, n.period, 7) ; 232: gd_strtok check str = gd_strtok(d, STRING='"test1 test2" test3\ test4') nume += check_ok2(232, 1 ,d) nume += check_simple2(232, 2, str, "test1 test2") str = gd_strtok(d) nume += check_ok2(232, 3 ,d) nume += check_simple2(232, 4, str, "test3 test4") ; 233: gd_raw_close check gd_flush, d, field_code='data', /nosync nume += check_ok(233, d) ; 234: gd_desync check n = gd_desync(d) nume += check_ok(234, d) nume += check_simple(234, n, 0) ; 235: gd_flags check n = gd_flags(d, /PRETTY_PRINT) nume += check_ok(235, d) nume += check_simple(235, n, !GD.PRETTY_PRINT) ; 236: gd_verbose_prefix gd_verbose_prefix, d, prefix="big_test" nume += check_ok(236, d) ; 237: gd_nentries check n = gd_nentries(d, parent="data", /SCALARS, /HIDDEN, /NOALIAS) nume += check_ok2(237, 1, d) nume += check_simple2(237, 1, n, 5) n = gd_nentries(d, /VECTORS, /HIDDEN, /NOALIAS) nume += check_ok2(237, 2, d) nume += check_simple2(237, 2, n, 24) ; 239: gd_entry_list check n = gd_entry_list(d, /VECTORS, /HIDDEN, /NOALIAS) nume += check_ok(239, d) nume += check_simple(239, n, ["INDEX", "bit", "data", "div", "lincom",$ "linterp", "mplex", "mult", "new1", "new135", "new14", "new16", "new18", $ "new2", "new21", "new4", "new6", "new7", "new8", "phase", "polynom", $ "recip", "sbit", "window"]) ; 240: gd_mplex_lookback check gd_mplex_lookback, d, /ALL nume += check_ok(240, d) ; 241: gd_linterp_tablename n = gd_linterp_tablename(d, 'linterp') nume += check_ok(241, d) nume += check_eostring(241, n, "test_dirfile/lut") ; 243: add lincom n = {field: 'new243', field_type: !GD.LINCOM_ENTRY, in_fields: [ "in1", "in2", $ "in3" ], m: [ DCOMPLEX(1.1D,0), DCOMPLEX(0,0), DCOMPLEX(1.4D,0) ], $ scalar: [ '', 'const', '', 'carray', 'carray', 'carray' ], $ scalar_ind: [ 0, -1, 0, 3, 4, 5 ], fragment: 0} gd_add, d, n nume += check_ok2(243, 1, d) n = gd_entry(d, "new243") nume += check_ok2(243, 2, d) nume += check_simple2(243, 3, n.field_type, !GD.LINCOM_ENTRY) nume += check_simple2(243, 4, n.field, "new243") nume += check_simple2(243, 5, n.fragment, 0) nume += check_simple2(243, 6, n.n_fields, 3) nume += check_simple2(243, 7, n.in_fields, [ "in1", "in2", "in3" ]) nume += check_simple2(243, 8, n.flags, !GD.EN_CALC) nume += check_simple2(243, 9, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(86D,0), $ DCOMPLEX(1.4D,0) ]) nume += check_simple2(243, 10, n.m, [ 1.1D, 86D, 1.4D ]) nume += check_simple2(243, 11, n.cb, [ DCOMPLEX(34D,0), DCOMPLEX(5.4,0), $ DCOMPLEX(4.3,0) ]) nume += check_simple2(243, 12, n.b, [ 34D, 5.4, 4.3 ]) nume += check_simple2(243, 13, n.scalar, [ "", "const", "", "carray", $ "carray", "carray" ]) nume += check_simple2(243, 14, n.scalar_ind, [ 0, -1, 0, 3, 4, 5 ]) ; 244: gd_add polynom n = {field: 'new244', field_type: !GD.POLYNOM_ENTRY, in_fields: 'in2', $ a: [ DCOMPLEX(33D, 0), DCOMPLEX(44D, 55D), DCOMPLEX(66D, 0) ], $ scalar: [ "", "", "", "carray" ], scalar_ind: [ 0, 0, 0 ], fragment: 0} gd_add, d, n nume += check_ok2(244, 1, d) n = gd_entry(d, "new244") nume += check_ok2(244, 2, d) nume += check_simple2(244, 3, n.field_type, !GD.POLYNOM_ENTRY) nume += check_simple2(244, 4, n.field, "new244") nume += check_simple2(244, 5, n.fragment, 0) nume += check_simple2(244, 6, n.poly_ord, 3) nume += check_simple2(244, 7, n.in_fields, [ "in2" ]) nume += check_simple2(244, 8, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(244, 9, n.ca, [ DCOMPLEX(33D, 0), DCOMPLEX(44D, 55D), $ DCOMPLEX(66D, 0) ]) nume += check_simple2(244, 10, n.a, [ 33D, 44D, 66D ]) nume += check_simple2(244, 11, n.scalar, [ "", "", "", "carray" ]) nume += check_simple2(244, 12, n.scalar_ind, [ 0, 0, 0, 0 ]) ; 245: gd_add linterp n = {field: "new245", field_type: !GD.LINTERP_ENTRY, fragment: 0, $ in_fields: "in", table: "./some/table"}; gd_add, d, n nume += check_ok2(245, 1, d) n = gd_entry(d, "new245") nume += check_ok2(21, 2, d) nume += check_simple2(21, 3, n.field_type, !GD.LINTERP_ENTRY) nume += check_simple2(21, 4, n.field, "new245") nume += check_simple2(21, 5, n.fragment, 0) nume += check_simple2(21, 6, n.in_fields, [ "in" ]) nume += check_simple2(21, 7, n.table, "./some/table") ; 246: gd_add bit n = {field: "new246", field_type: !GD.BIT_ENTRY, fragment: 0, bitnum: 11, $ in_fields: [ "in1" ]} gd_add, d, n nume += check_ok2(245, 1, d) n = gd_entry(d, "new246") nume += check_ok2(22, 2, d) nume += check_simple2(22, 3, n.field_type, !GD.BIT_ENTRY) nume += check_simple2(22, 4, n.field, "new246") nume += check_simple2(22, 5, n.fragment, 0) nume += check_simple2(22, 6, n.in_fields, [ "in1" ]) nume += check_simple2(22, 7, n.numbits, 1) nume += check_simple2(22, 8, n.bitnum, 11) ; 247: gd_add multiply n = {field: 'new247', field_type: !GD.MULTIPLY_ENTRY, fragment: 0, $ in_fields: [ "in2", "in3"]}; gd_add, d, n nume += check_ok2(247, 1, d) n = gd_entry(d, "new247") nume += check_ok2(247, 2, d) nume += check_simple2(247, 3, n.field_type, !GD.MULTIPLY_ENTRY) nume += check_simple2(247, 4, n.field, "new247") nume += check_simple2(247, 5, n.fragment, 0) nume += check_simple2(247, 6, n.in_fields, [ "in2", "in3" ]) ; 248: gd_add phase n = {field: "new248", field_type: !GD.PHASE_ENTRY, fragment: 0, $ shift: -88L, in_fields: [ "new9" ], scalar: [ "" ], scalar_ind: [ 0 ]} gd_add, d, n nume += check_ok2(248, 1, d) n = gd_entry(d, "new248") nume += check_ok2(248, 2, d) nume += check_simple2(248, 1, n.field_type, !GD.PHASE_ENTRY) nume += check_simple2(248, 2, n.field, "new248") nume += check_simple2(248, 3, n.fragment, 0) nume += check_simple2(248, 4, n.in_fields, [ "new9" ]) nume += check_simple2(248, 5, n.shift, -88) ; 249: gd_add const n = {field: 'new249', field_type: !GD.CONST_ENTRY, fragment: 0, $ data_type: !GD.FLOAT32} gd_add, d, n nume += check_ok2(249, 1, d) n = gd_entry(d, "new249") nume += check_ok2(249, 2, d) nume += check_simple2(249, 3, n.field_type, !GD.CONST_ENTRY) nume += check_simple2(249, 4, n.field, "new249") nume += check_simple2(249, 5, n.fragment, 0) nume += check_simple2(249, 6, n.data_type, !GD.FLOAT32) n = gd_get_constant(d, "new249") nume += check_ok2(249, 7, d) nume += check_simple2(249, 8, n, 0) ; 250: gd_add string n = {field: 'new250', field_type: !GD.STRING_ENTRY, fragment: 0, $ data_type: !GD.FLOAT32} gd_add, d, n nume += check_ok2(250, 1, d) n = gd_entry(d, "new250") nume += check_ok2(250, 2, d) nume += check_simple2(250, 3, n.field_type, !GD.STRING_ENTRY) nume += check_simple2(250, 4, n.field, "new250") nume += check_simple2(250, 5, n.fragment, 0) n = gd_get_string(d, "new250") nume += check_ok2(250, 6, d) nume += check_simple2(250, 7, n, 0) ; 251: gd_add recip n = {field: 'Bnew251', field_type: !GD.RECIP_ENTRY, fragment: 1, $ in_fields: 'Bin1', dividend: COMPLEX(33.3, 44.4)} gd_add, d, n nume += check_ok2(251, 1, d) n = gd_entry(d, "Bnew251") nume += check_ok2(145, 2, d) nume += check_simple2(145, 3, n.field_type, !GD.RECIP_ENTRY) nume += check_simple2(145, 4, n.field, "Bnew251") nume += check_simple2(145, 5, n.fragment, 1) nume += check_simple2(145, 6, n.in_fields, [ "Bin1" ]) nume += check_simple2(145, 7, n.flags, !GD.EN_COMPSCAL + !GD.EN_CALC) nume += check_simple2(145, 8, n.cdividend, DCOMPLEX(33.3, 44.4)) nume += check_simple2(145, 9, n.dividend, 33.3) ; 252: gd_add carray n = {field: 'new252', field_type: !GD.CARRAY_ENTRY, fragment: 0, $ data_type: !GD.FLOAT32, array_len: 5} gd_add, d, n nume += check_ok2(252, 1, d) n = gd_entry(d, "new252") nume += check_ok2(252, 2, d) nume += check_simple2(252, 3, n.field_type, !GD.CARRAY_ENTRY) nume += check_simple2(252, 4, n.field, "new252") nume += check_simple2(252, 5, n.fragment, 0) nume += check_simple2(252, 6, n.data_type, !GD.FLOAT32) nume += check_simple2(252, 7, n.array_len, 5) n = gd_get_constant(d, "new252") nume += check_ok2(252, 8, d) nume += check_simple2(252, 9, n, [0, 0, 0, 0, 0]) ; 253: gd_add window n = {field: 'new253', field_type: !GD.WINDOW_ENTRY, fragment: 0, $ windop: !GD.WINDOP_NE, threshold: 32, in_fields: [ "in1", "in2" ]} gd_add, d, n nume += check_ok2(253, 1, d) n = gd_entry(d, 'new253') nume += check_ok2(253, 2, d) nume += check_simple2(253, 3, n.field, "new253") nume += check_simple2(253, 4, n.field_type, !GD.WINDOW_ENTRY) nume += check_simple2(253, 5, n.fragment, 0) nume += check_simple2(253, 6, n.windop, !GD.WINDOP_NE) nume += check_simple2(253, 7, n.in_fields, [ 'in1', 'in2' ]) nume += check_simple2(253, 8, n.ithreshold, 32) ; 254: gd_add mplex n = {field: 'new254', field_type: !GD.MPLEX_ENTRY, fragment: 0, $ count_val: 5, in_fields: [ "in1", "in2" ]} gd_add, d, n nume += check_ok2(254, 1, d) n = gd_entry(d, 'new254') nume += check_ok2(229, 2, d) nume += check_simple2(253, 3, n.field, "new254") nume += check_simple2(229, 4, n.field_type, !GD.MPLEX_ENTRY) nume += check_simple2(229, 5, n.fragment, 0) nume += check_simple2(229, 6, n.count_val, 5) nume += check_simple2(229, 7, n.in_fields, [ 'in1', 'in2' ]) nume += check_simple2(229, 8, n.period, 0) ; 259: gd_alter_entry with scalar n = {field_type: !GD.LINCOM_ENTRY, scalar: [ "", "const", "const", "carray", $ "", "const" ], scalar_ind: [ 0, 0, 0, 4, 0, -1 ]} gd_alter_entry, d, 'new243', n n = gd_entry(d, "new243") nume += check_ok2(259, 2, d) nume += check_simple2(259, 3, n.field_type, !GD.LINCOM_ENTRY) nume += check_simple2(259, 4, n.field, "new243") nume += check_simple2(259, 5, n.fragment, 0) nume += check_simple2(259, 6, n.n_fields, 3) nume += check_simple2(259, 7, n.in_fields, [ "in1", "in2", "in3" ]) nume += check_simple2(259, 8, n.flags, !GD.EN_CALC) nume += check_simple2(259, 9, n.cm, [ DCOMPLEX(1.1D,0), DCOMPLEX(86D,0), $ DCOMPLEX(86D,0) ]) nume += check_simple2(259, 10, n.m, [ 1.1D, 86D, 86D ]) nume += check_simple2(259, 11, n.cb, [ DCOMPLEX(5.4,0), DCOMPLEX(5.4,0), $ DCOMPLEX(86D,0) ]) nume += check_simple2(259, 12, n.b, [ 5.4, 5.4, 86D ]) nume += check_simple2(259, 13, n.scalar, [ "", "const", "const", "carray", $ "", "const" ]) ; 271: gd_encoding_support n = gd_encoding_support(!GD.SIE_ENCODED) nume += check_simple(271, n, !GD.RDWR) ; =============================================================== ; Cleanup gd_close, d, /DISCARD spawn, "rm -rf " + filedir if (nume gt 0) then print, "nume=", nume if (nume gt 0) then exit, /status exit,status=0 libgetdata-0.9.0/bindings/idl/test/getdata_idl_test_routines.pro0000640000175000017500000000430712614323564025306 0ustar alastairalastair; vim: ft=idlang ; ; Copyright (C) 2009-2011 D. V. Wiebe ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; This file is part of the GetData project. ; ; GetData 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. ; ; GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., ; 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA pro timed_demo_mode print,"" print,"**********************************************" print,"* The GetData IDL bindings cannot be tested in" print,"* timed demo mode. All tests will be skipped." print,"**********************************************" print,"" exit,status=77 end function check_float, t, v, g if (abs(v - g) gt 1e-6) then begin print,"n[", t, "]=", v, ", expected ", g return,1 endif return,0 end function check_simple2, t, m, v, g if (total(v ne g)) then begin print,"n[", t, ",", m, "]=", v, ", expected ", g return,1 endif return,0 end function check_simple, t, v, g if (total(v ne g)) then begin print,"n[", t, "]=", v, ", expected ", g return,1 endif return,0 end function check_error, t, d, ce e = gd_error(d) if (e ne ce) then begin print,"e[", t, "]=", e, ", expected ", ce return,1 endif return,0 end function check_ok, t, d return, check_error(t,d,!GD.E_OK) end function check_error2, t, m, d, ce e = gd_error(d) if (e ne ce) then begin print,"e[", t, ",", m, "]=", e, ", expected ", ce return,1 endif return,0 end function check_ok2, t, m, d return, check_error2(t,m,d,!GD.E_OK) end function check_eostring, t, v, g f = strpos(v, g, /reverse_search) if (f EQ -1) THEN f = 0 return, check_simple(t, strmid(v, f), g) end libgetdata-0.9.0/bindings/idl/test/Makefile.am0000640000175000017500000000252412614323564021367 0ustar alastairalastair# Copyright (C) 2009, 2010, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests if TEST_IDL TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:${${DL_LIBRARY_PATH}} IDL_PATH="${srcdir}" IDL_DLM_PATH=../.libs ${IDL} idlTESTS=big_test.pro TESTS=$(addprefix ${srcdir}/,$(idlTESTS)) endif EXTRA_DIST=getdata_idl_test_routines.pro ${idlTESTS} # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ libgetdata-0.9.0/bindings/idl/Makefile.am0000640000175000017500000000503612614323564020411 0ustar alastairalastair# Copyright (C) 2009, 2010, 2011, 2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SUBDIRS=test if GD_EXTERNAL GDIDL_GETDATA_LIBS=$(GETDATA_LIBS) else GDIDL_GETDATA_LIBS=../../src/libgetdata.la endif idl_LTLIBRARIES = idl_getdata.la nodist_idl_HEADERS = idl_getdata.dlm # idl makes heavy use of type punning, ergo -fno-strict-aliasing AM_CFLAGS = ${GD_CC_WALL} $(IDL_CFLAGS) -fno-strict-aliasing $(GETDATA_CFLAGS) AM_CPPFLAGS = -I$(top_srcdir)/src BUILT_SOURCES=sublist.c constants.c idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \ -precious-files-regex 'idl_getdata\.dlm' $(IDL_LIBS) idl_getdata_la_LIBADD = $(GDIDL_GETDATA_LIBS) idl_getdata_la_SOURCES = getdata.c nodist_idl_getdata_la_SOURCES = constants.c sublist.c sublist.c.in: getdata.c makedlm.sh ${SHELL} ./makedlm.sh -c $< > $@ sublist.c: sublist.stamp @if test ! -f $@; then \ rm -f $<; \ $(MAKE) $<; \ fi if HAVE_DIFF sublist.stamp: sublist.c.in @if $(DIFF) sublist.c sublist.c.in >/dev/null 2>&1; then \ echo "sublist.c is unchanged"; \ else \ rm -f sublist.c; \ cp sublist.c.in sublist.c; \ fi; \ touch sublist.stamp else sublist.stamp: sublist.c.in @rm -f sublist.c; \ cp sublist.c.in sublist.c; \ touch sublist.stamp endif constants.c: ../make_parameters ../make_parameters i > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters idl_getdata.dlm: getdata.c makedlm.sh ${SHELL} ./makedlm.sh -d $< > $@ all-local: .libs/idl_getdata.dlm # This is required to properly run the test suite .libs/idl_getdata.dlm: idl_getdata.dlm if [ ! -e .libs ]; then mkdir -p .libs; fi cp $< .libs clean-local: rm -rf ${BUILT_SOURCES} *~ idl_getdata.dlm makedlm.sh sublist.c.in sublist.stamp libgetdata-0.9.0/bindings/idl/getdata.c0000640000175000017500000046071612614323564020144 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #define _LARGEFILE64_SOURCE 1 #include #include #include #define NO_GETDATA_LEGACY_API #undef _BSD_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #undef _SVID_SOURCE #ifdef HAVE_CONFIG_H # include "gd_config.h" #endif #ifdef GD_EXTERNAL # include # include # define dtracevoid() # define dtrace(...) # define dprintf(...) # define dreturnvoid() # define dreturn(...) # define dwatch(...) # define gd_colclear() # define GD_INT_TYPE ((gd_type_t)(SIZEOF_INT | GD_SIGNED)) # define GD_UINT_TYPE ((gd_type_t)(SIZEOF_UNSIGNED_INT)) # define gd_static_inline_ static inline #else # include "../../src/internal.h" #endif #define GDIDL_N_DIRFILES 1024 static DIRFILE* idldirfiles[GDIDL_N_DIRFILES]; static int idldirfiles_initialised = 0; static IDL_StructDefPtr gdidl_entry_def = NULL; IDL_StructDefPtr gdidl_const_def = NULL; #define GDIDL_ABORT(s) do { \ gd_colclear(); \ IDL_Message(IDL_M_GENERIC, IDL_MSG_LONGJMP, s); \ } while(0) #define GDIDL_ABORT2(fmt, ...) do { \ char gdidl_abort_buffer[1024]; \ sprintf(gdidl_abort_buffer, fmt, __VA_ARGS__); \ GDIDL_ABORT(gdidl_abort_buffer); \ } while(0) #define GDIDL_KW_ABORT(s) \ do { IDL_KW_FREE; GDIDL_ABORT(s); } while(0) #define dtraceidl() dtrace("%i, %p, %p", argc, argv, argk) /* Error reporting stuff */ #define GDIDL_KW_PAR_ERROR { "ERROR", 0, 0xffff, IDL_KW_OUT, 0, \ IDL_KW_OFFSETOF(error) } #define GDIDL_KW_PAR_ESTRING { "ESTRING", 0, 0xffff, IDL_KW_OUT, 0, \ IDL_KW_OFFSETOF(estr) } #define GDIDL_KW_RESULT_ERROR IDL_VPTR error, estr #define GDIDL_KW_INIT_ERROR kw.error = kw.estr = NULL; #define GDIDL_SET_ERROR(D) \ do { \ if (kw.error != NULL) { \ IDL_ALLTYPES a; \ a.i = gd_error(D); \ IDL_StoreScalar(kw.error, IDL_TYP_INT, &a); \ } \ if (kw.estr != NULL) { \ IDL_StoreScalarZero(kw.estr, IDL_TYP_INT); \ char buffer[GD_MAX_LINE_LENGTH]; \ kw.estr->type = IDL_TYP_STRING; \ IDL_StrStore((IDL_STRING*)&kw.estr->value.s, gd_error_string(D, buffer, \ GD_MAX_LINE_LENGTH)); \ } \ } while(0) #define GDIDL_KW_ONLY_ERROR \ typedef struct { \ IDL_KW_RESULT_FIRST_FIELD; \ GDIDL_KW_RESULT_ERROR; \ } KW_RESULT; \ KW_RESULT kw; \ GDIDL_KW_INIT_ERROR; \ static IDL_KW_PAR kw_pars[] = { \ GDIDL_KW_PAR_ERROR, \ GDIDL_KW_PAR_ESTRING, \ { NULL } }; \ argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); /* initialise the idldirfiles array */ static void gdidl_init_dirfile(void) { dtracevoid(); int i; for (i = 1; i < GDIDL_N_DIRFILES; ++i) idldirfiles[i] = NULL; /* we keep entry zero as a generic, invalid dirfile to return if * dirfile lookup fails */ idldirfiles[0] = gd_invalid_dirfile(); idldirfiles_initialised = 1; dreturnvoid(); } /* convert a new DIRFILE* into an int */ static long gdidl_set_dirfile(DIRFILE* D) { long i; dtrace("%p", D); if (!idldirfiles_initialised) gdidl_init_dirfile(); for (i = 1; i < GDIDL_N_DIRFILES; ++i) if (idldirfiles[i] == NULL) { idldirfiles[i] = D; dreturn("%li", i); return i; } /* out of idldirfiles space: complain and abort */ GDIDL_ABORT("DIRFILE space exhausted."); return 0; /* can't get here */ } /* convert an int to a DIRFILE* */ DIRFILE* gdidl_get_dirfile(IDL_LONG d) { dtrace("%i", (int)d); if (!idldirfiles_initialised) gdidl_init_dirfile(); if (idldirfiles[d] == NULL) { dreturn("%p [0]", idldirfiles[0]); return idldirfiles[0]; } dreturn("%p", idldirfiles[d]); return idldirfiles[d]; } /* delete the supplied dirfile */ static void gdidl_clear_dirfile(IDL_LONG d) { dtrace("%i", (int)d); if (d != 0) idldirfiles[d] = NULL; dreturnvoid(); } /* convert a GetData type code to an IDL type code */ gd_static_inline_ UCHAR gdidl_idl_type(gd_type_t t) { UCHAR it; dtrace("0x%X", t); switch (t) { case GD_UINT8: it = IDL_TYP_BYTE; break; case GD_UINT16: it = IDL_TYP_UINT; break; case GD_INT8: /* there is no signed 8-bit type in IDL - we type promote to INT */ case GD_INT16: it = IDL_TYP_INT; break; case GD_UINT32: it = IDL_TYP_ULONG; break; case GD_INT32: it = IDL_TYP_LONG; break; case GD_UINT64: it = IDL_TYP_ULONG64; break; case GD_INT64: it = IDL_TYP_LONG64; break; case GD_FLOAT32: it = IDL_TYP_FLOAT; break; case GD_FLOAT64: it = IDL_TYP_DOUBLE; break; case GD_COMPLEX64: it = IDL_TYP_COMPLEX; break; case GD_COMPLEX128: it = IDL_TYP_DCOMPLEX; break; default: it = IDL_TYP_UNDEF; } dreturn("%u", it); return it; } /* convert an IDL type code to a GetData type code */ gd_static_inline_ gd_type_t gdidl_gd_type(int t) { switch (t) { case IDL_TYP_BYTE: return GD_UINT8; case IDL_TYP_UINT: return GD_UINT16; case IDL_TYP_INT: return GD_INT16; case IDL_TYP_ULONG: return GD_UINT32; case IDL_TYP_LONG: return GD_INT32; case IDL_TYP_ULONG64: return GD_UINT64; case IDL_TYP_LONG64: return GD_INT64; case IDL_TYP_FLOAT: return GD_FLOAT32; case IDL_TYP_DOUBLE: return GD_FLOAT64; case IDL_TYP_COMPLEX: return GD_COMPLEX64; case IDL_TYP_DCOMPLEX: return GD_COMPLEX128; } return GD_UNKNOWN; } /* convert a datum (from a void*) to an IDL_ALLTYPES union */ gd_static_inline_ IDL_ALLTYPES gdidl_to_alltypes(gd_type_t t, void* d) { dtrace("%x, %p", t, d); float complex fc; double complex dc; IDL_ALLTYPES v; v.c = 0; switch (t) { case GD_UINT8: v.c = *(uint8_t*)d; break; case GD_INT8: /* there is no signed 8-bit type in IDL -- we type promote to INT */ v.i = *(int8_t*)d; break; case GD_UINT16: v.ui = *(uint16_t*)d; break; case GD_INT16: v.i = *(int16_t*)d; break; case GD_UINT32: v.ul = *(uint32_t*)d; break; case GD_INT32: v.l = *(int32_t*)d; break; case GD_UINT64: v.ul64 = *(uint64_t*)d; break; case GD_INT64: v.l64 = *(int64_t*)d; break; case GD_FLOAT32: v.f = *(float*)d; break; case GD_FLOAT64: v.d = *(double*)d; break; case GD_COMPLEX64: fc = *(float complex*)d; v.cmp.r = crealf(fc); v.cmp.i = cimagf(fc); break; case GD_COMPLEX128: dc = *(double complex*)d; v.cmp.r = creal(dc); v.cmp.i = cimag(dc); break; case GD_NULL: case GD_UNKNOWN: ; } dreturnvoid(); return v; } /* convert an ALLTYPES to a value suitable for GetData -- all we do is * reference the appropriate member */ gd_static_inline_ const void* gdidl_from_alltypes(UCHAR t, IDL_ALLTYPES* v) { static float complex fc; static double complex dc; switch(t) { case IDL_TYP_BYTE: return &(v->c); case IDL_TYP_UINT: return &(v->ui); case IDL_TYP_INT: return &(v->i); case IDL_TYP_ULONG: return &(v->ul); case IDL_TYP_LONG: return &(v->l); case IDL_TYP_ULONG64: return &(v->ul64); case IDL_TYP_LONG64: return &(v->l64); case IDL_TYP_FLOAT: return &(v->f); case IDL_TYP_DOUBLE: return &(v->d); case IDL_TYP_COMPLEX: fc = v->cmp.r + _Complex_I * v->cmp.i; return &fc; case IDL_TYP_DCOMPLEX: dc = v->dcmp.r + _Complex_I * v->dcmp.i; return &dc; } return NULL; } /* copy (and convert) an array of complex values */ gd_static_inline_ void gdidl_cmp_to_c99(double complex* dest, IDL_COMPLEX* src, size_t n) { dtrace("%p, %p, %zi", dest, src, n); size_t i; for (i = 0; i < n; ++i) dest[i] = src[i].r + _Complex_I * src[i].i; dreturnvoid(); } /* copy (and convert) an array of complex values */ gd_static_inline_ void gdidl_dcmp_to_c99(double complex* dest, IDL_DCOMPLEX* src, size_t n) { dtrace("%p, %p, %zi", dest, src, n); size_t i; for (i = 0; i < n; ++i) dest[i] = src[i].r + _Complex_I * src[i].i; dreturnvoid(); } /* copy (and convert) an array of complex values */ gd_static_inline_ void gdidl_c99_to_dcmp(IDL_DCOMPLEX* dest, const double complex* src, size_t n) { dtrace("%p, %p, %zi", dest, src, n); size_t i; for (i = 0; i < n; ++i) { dest[i].r = creal(src[i]); dest[i].i = cimag(src[i]); } dreturnvoid(); } static double complex gdidl_dcomplexScalar(IDL_VPTR obj) { double r = 0, i = 0; dtrace("%p", obj); /* accept either a scalar or a single element array */ if (obj->flags & IDL_V_ARR) { if (obj->value.arr->n_dim != 1 || obj->value.arr->dim[0] != 1) GDIDL_ABORT("Scalar or single element array expected where multiple " "element array found"); if (obj->type == IDL_TYP_DCOMPLEX) { r = ((IDL_DCOMPLEX *)obj->value.arr->data)[0].r; i = ((IDL_DCOMPLEX *)obj->value.arr->data)[0].i; } else if (obj->type == IDL_TYP_COMPLEX) { r = ((IDL_COMPLEX *)obj->value.arr->data)[0].r; i = ((IDL_COMPLEX *)obj->value.arr->data)[0].i; } else GDIDL_ABORT("complex value expected"); } else { IDL_ENSURE_SCALAR(obj); if (obj->type == IDL_TYP_DCOMPLEX) { r = obj->value.dcmp.r; i = obj->value.dcmp.i; } else if (obj->type == IDL_TYP_COMPLEX) { r = obj->value.cmp.r; i = obj->value.cmp.i; } else GDIDL_ABORT("complex value expected"); } dreturn("%g; %g", r, i); return r + _Complex_I * i; } /* convert a gd_entry_t to an IDL GD_ENTRY struct in a temporary variable */ IDL_VPTR gdidl_make_idl_entry(const gd_entry_t* E) { dtrace("%p", E); int i; IDL_MEMINT dims[] = { 1 }; IDL_VPTR r; void* data = IDL_MakeTempStruct(gdidl_entry_def, 1, dims, &r, IDL_TRUE); /* Here we make labourious calls to StructTagInfoByName becuase we don't * want to assume anything about the structure packing details of the IDL */ IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "FIELD", IDL_MSG_LONGJMP, NULL)), E->field); *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "FIELD_TYPE", IDL_MSG_LONGJMP, NULL)) = E->field_type; *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "FRAGMENT", IDL_MSG_LONGJMP, NULL)) = E->fragment_index; /* the common IN_FIELDS case */ if (E->field_type == GD_BIT_ENTRY || E->field_type == GD_LINTERP_ENTRY || E->field_type == GD_MULTIPLY_ENTRY || E->field_type == GD_PHASE_ENTRY || E->field_type == GD_SBIT_ENTRY || E->field_type == GD_POLYNOM_ENTRY || E->field_type == GD_DIVIDE_ENTRY || E->field_type == GD_RECIP_ENTRY || E->field_type == GD_WINDOW_ENTRY || E->field_type == GD_MPLEX_ENTRY) { IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS", IDL_MSG_LONGJMP, NULL)), E->in_fields[0]); } *(IDL_UINT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "FLAGS", IDL_MSG_LONGJMP, NULL)) = E->flags; switch (E->field_type) { case GD_RAW_ENTRY: *(IDL_UINT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SPF", IDL_MSG_LONGJMP, NULL)) = E->spf; *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE", IDL_MSG_LONGJMP, NULL)) = E->data_type; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); *(int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)) = (int16_t)E->scalar_ind[0]; break; case GD_LINCOM_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "N_FIELDS", IDL_MSG_LONGJMP, NULL)) = E->n_fields; for (i = 0; i < E->n_fields; ++i) { IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + i, E->in_fields[i]); IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)) + i, E->scalar[i]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[i] = (int16_t)E->scalar_ind[i]; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)) + i + GD_MAX_LINCOM, E->scalar[i + GD_MAX_LINCOM]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[i + GD_MAX_LINCOM] = (int16_t)E->scalar_ind[i + GD_MAX_LINCOM]; } gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "CM", IDL_MSG_LONGJMP, NULL)), E->cm, E->n_fields); gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "CB", IDL_MSG_LONGJMP, NULL)), E->cb, E->n_fields); memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "M", IDL_MSG_LONGJMP, NULL), E->m, E->n_fields * sizeof(double)); memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "B", IDL_MSG_LONGJMP, NULL), E->b, E->n_fields * sizeof(double)); break; case GD_LINTERP_ENTRY: IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "TABLE", IDL_MSG_LONGJMP, NULL)), E->table); break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "BITNUM", IDL_MSG_LONGJMP, NULL)) = E->bitnum; *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "NUMBITS", IDL_MSG_LONGJMP, NULL)) = E->numbits; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0]; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)) + 1, E->scalar[1]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[1] = (int16_t)E->scalar_ind[1]; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]); break; case GD_RECIP_ENTRY: IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0]; gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "CDIVIDEND", IDL_MSG_LONGJMP, NULL)), &E->cdividend, 1); *(double*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DIVIDEND", IDL_MSG_LONGJMP, NULL)) = E->dividend; break; case GD_PHASE_ENTRY: *(IDL_LONG*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SHIFT", IDL_MSG_LONGJMP, NULL)) = E->shift; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0]; break; case GD_POLYNOM_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "POLY_ORD", IDL_MSG_LONGJMP, NULL)) = E->poly_ord; for (i = 0; i <= E->poly_ord; ++i) { IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)) + i, E->scalar[i]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[i] = (int16_t)E->scalar_ind[i]; } gdidl_c99_to_dcmp((IDL_DCOMPLEX*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "CA", IDL_MSG_LONGJMP, NULL)), E->ca, E->poly_ord + 1); memcpy(data + IDL_StructTagInfoByName(gdidl_entry_def, "A", IDL_MSG_LONGJMP, NULL), E->a, (E->poly_ord + 1) * sizeof(double)); break; case GD_WINDOW_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "WINDOP", IDL_MSG_LONGJMP, NULL)) = E->windop; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]); switch (E->windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: *(IDL_LONG64*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "ITHRESHOLD", IDL_MSG_LONGJMP, NULL)) = E->threshold.i; break; case GD_WINDOP_SET: case GD_WINDOP_CLR: *(IDL_ULONG*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "UTHRESHOLD", IDL_MSG_LONGJMP, NULL)) = E->threshold.u; break; default: *(double*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "RTHRESHOLD", IDL_MSG_LONGJMP, NULL)) = E->threshold.r; break; } IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0]; break; case GD_MPLEX_ENTRY: IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "IN_FIELDS", IDL_MSG_LONGJMP, NULL)) + 1, E->in_fields[1]); *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "COUNT_VAL", IDL_MSG_LONGJMP, NULL)) = E->count_val; *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "PERIOD", IDL_MSG_LONGJMP, NULL)) = E->period; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)), E->scalar[0]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[0] = (int16_t)E->scalar_ind[0]; IDL_StrStore((IDL_STRING*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR", IDL_MSG_LONGJMP, NULL)) + 1, E->scalar[1]); ((int16_t*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "SCALAR_IND", IDL_MSG_LONGJMP, NULL)))[1] = (int16_t)E->scalar_ind[1]; break; case GD_CARRAY_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "ARRAY_LEN", IDL_MSG_LONGJMP, NULL)) = E->array_len; *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE", IDL_MSG_LONGJMP, NULL)) = E->const_type; break; case GD_CONST_ENTRY: *(IDL_INT*)(data + IDL_StructTagInfoByName(gdidl_entry_def, "DATA_TYPE", IDL_MSG_LONGJMP, NULL)) = E->const_type; break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_INDEX_ENTRY: case GD_STRING_ENTRY: break; } dreturn("%p", r); return r; } #define GDIDL_GET_TAG(v,tag,miss_ok,d) \ IDL_StructTagInfoByName((v)->value.s.sdef, tag, \ (miss_ok) ? IDL_MSG_RET | IDL_MSG_ATTR_NOPRINT : IDL_MSG_LONGJMP, &(d)) #define GDIDL_CCONVERT_ENTRY_ELEMENT(dstp,src,key,offset,type) \ do { \ switch (type) { \ case IDL_TYP_BYTE: (dstp)[0] = (( int8_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_UINT: (dstp)[0] = ((uint16_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_INT: (dstp)[0] = (( int16_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_ULONG: (dstp)[0] = ((uint32_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_LONG: (dstp)[0] = (( int32_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_ULONG64: (dstp)[0] = ((uint64_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_LONG64: (dstp)[0] = (( int64_t*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_FLOAT: (dstp)[0] = (( float*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_DOUBLE: (dstp)[0] = (( double*)(src))[offset]; \ (dstp)[1] = 0; break; \ case IDL_TYP_COMPLEX: (dstp)[0] = (( IDL_COMPLEX*)(src))[offset].r; \ (dstp)[1] = (( IDL_COMPLEX*)(src))[offset].i; \ break; \ case IDL_TYP_DCOMPLEX: (dstp)[0] = ((IDL_DCOMPLEX*)(src))[offset].r; \ (dstp)[1] = ((IDL_DCOMPLEX*)(src))[offset].i; \ break; \ default: GDIDL_ABORT2("GD_ENTRY element %s must be of numeric type", \ key); \ } \ } while(0) #define GDIDL_CONVERT_ENTRY_ELEMENT(dst,src,key,offset,type) \ do { \ switch (type) { \ case IDL_TYP_BYTE: (dst) = (( int8_t*)(src))[offset]; break; \ case IDL_TYP_UINT: (dst) = ((uint16_t*)(src))[offset]; break; \ case IDL_TYP_INT: (dst) = (( int16_t*)(src))[offset]; break; \ case IDL_TYP_ULONG: (dst) = ((uint32_t*)(src))[offset]; break; \ case IDL_TYP_LONG: (dst) = (( int32_t*)(src))[offset]; break; \ case IDL_TYP_ULONG64: (dst) = ((uint64_t*)(src))[offset]; break; \ case IDL_TYP_LONG64: (dst) = (( int64_t*)(src))[offset]; break; \ case IDL_TYP_FLOAT: (dst) = (( float*)(src))[offset]; break; \ case IDL_TYP_DOUBLE: (dst) = (( double*)(src))[offset]; break; \ case IDL_TYP_COMPLEX: (dst) = (( IDL_COMPLEX*)(src))[offset].r; break; \ case IDL_TYP_DCOMPLEX: (dst) = ((IDL_DCOMPLEX*)(src))[offset].r; break; \ default: GDIDL_ABORT2("GD_ENTRY element %s must be of numeric type",key);\ } \ } while(0) /* convert structure data */ static void gdidl_convert_entry_num(void *dst, gd_type_t dtype, const char *key, const unsigned char *src, int offset, int stype) { dtrace("%p, 0x%X, \"%s\", %p, %i, %i", dst, dtype, key, src, offset, stype); switch (dtype) { case GD_NULL: case GD_UNKNOWN: break; case GD_UINT8: GDIDL_CONVERT_ENTRY_ELEMENT(*(( uint8_t*)dst), src, key, offset, stype); break; case GD_INT8: GDIDL_CONVERT_ENTRY_ELEMENT(*(( int8_t*)dst), src, key, offset, stype); break; case GD_UINT16: GDIDL_CONVERT_ENTRY_ELEMENT(*((uint16_t*)dst), src, key, offset, stype); break; case GD_INT16: GDIDL_CONVERT_ENTRY_ELEMENT(*(( int16_t*)dst), src, key, offset, stype); break; case GD_UINT32: GDIDL_CONVERT_ENTRY_ELEMENT(*((uint32_t*)dst), src, key, offset, stype); break; case GD_INT32: GDIDL_CONVERT_ENTRY_ELEMENT(*(( int32_t*)dst), src, key, offset, stype); break; case GD_UINT64: GDIDL_CONVERT_ENTRY_ELEMENT(*((uint64_t*)dst), src, key, offset, stype); break; case GD_INT64: GDIDL_CONVERT_ENTRY_ELEMENT(*(( int64_t*)dst), src, key, offset, stype); break; case GD_FLOAT32: GDIDL_CONVERT_ENTRY_ELEMENT(*(( float*)dst), src, key, offset, stype); break; case GD_FLOAT64: GDIDL_CONVERT_ENTRY_ELEMENT(*(( double*)dst), src, key, offset, stype); break; case GD_COMPLEX64: GDIDL_CCONVERT_ENTRY_ELEMENT( (float*)dst, src, key, offset, stype); break; case GD_COMPLEX128: GDIDL_CCONVERT_ENTRY_ELEMENT( (double*)dst, src, key, offset, stype); break; } dreturnvoid(); } /* get a scalar */ static int gdidl_get_entry_num(void *dst, gd_type_t type, IDL_VPTR v, char *key, int miss_ok) { IDL_VPTR d; dtrace("%p, 0x%X, %p, \"%s\", %i", dst, type, v, key, miss_ok); const unsigned char* data = v->value.s.arr->data; IDL_MEMINT o = GDIDL_GET_TAG(v, key, miss_ok, d); if (o == -1) { dreturn("%i", 0); return 0; } /* filter out bad things */ if (d->flags & IDL_V_ARR) { IDL_ARRAY* arr = (IDL_ARRAY*)(data + o); if (arr->n_elts > 1) GDIDL_ABORT2("GD_ENTRY element %s must be of scalar type", key); } gdidl_convert_entry_num(dst, type, key, data + o, 0, d->type); dreturn("%i", 1); return 1; } /* convert the entry scalar and scalar_ind arrays */ static unsigned gdidl_get_entry_scalars(gd_entry_t *E, unsigned mask, IDL_VPTR v) { int i, n_scalar, n_scalar_ind; unsigned mask_out = 0; IDL_MEMINT o_scalar, o_scalar_ind; IDL_VPTR d_scalar, d_scalar_ind; unsigned char* data = v->value.s.arr->data; dtrace("%p, 0x%X, %p", E, mask, v); /* find the data */ o_scalar = GDIDL_GET_TAG(v, "SCALAR", 1, d_scalar); if (o_scalar == -1) { dreturn("%i", 0); return 0; } else if (d_scalar->type != IDL_TYP_STRING) GDIDL_ABORT("GD_ENTRY element SCALAR must be an array of strings"); if (d_scalar->flags & IDL_V_ARR) { n_scalar = d_scalar->value.arr->n_elts; if (n_scalar > GD_MAX_POLYORD + 1) n_scalar = GD_MAX_POLYORD + 1; } else n_scalar = 1; o_scalar_ind = GDIDL_GET_TAG(v, "SCALAR_IND", 1, d_scalar_ind); if (o_scalar_ind != -1) { if (d_scalar_ind->flags & IDL_V_ARR) n_scalar_ind = d_scalar_ind->value.arr->n_elts; else n_scalar_ind = 1; } else n_scalar_ind = 0; for (i = 0; i < n_scalar; ++i) { if (!(mask & (1 << i))) continue; E->scalar[i] = IDL_STRING_STR((IDL_STRING*)(data + o_scalar) + i); if (E->scalar[i] && E->scalar[i][0] == '\0') { E->scalar[i] = NULL; continue; } if (i < n_scalar_ind) gdidl_convert_entry_num(E->scalar_ind + i, GD_INT_TYPE, "SCALAR_IND", data + o_scalar_ind, i, d_scalar_ind->type); mask_out |= (1 << i); } dreturn("0x%X", mask_out); return mask_out; } static int gdidl_get_in_fields(char **in_fields, IDL_VPTR v, int min, int max, int miss_ok) { int i, n; IDL_MEMINT o; IDL_VPTR d; unsigned char* data = v->value.s.arr->data; dtrace("%p, %p, %i, %i, %i", in_fields, v, min, max, miss_ok); o = GDIDL_GET_TAG(v, "IN_FIELDS", miss_ok, d); if (o == -1) { dreturn("%i", 0); return 0; } IDL_ENSURE_STRING(d); if (d->flags & IDL_V_ARR) n = d->value.arr->n_elts; else n = 1; if (n < min || n > max) GDIDL_ABORT2("Bad length (%i) for IN_FIELDS in GD_ENTRY", n); for (i = 0; i < n; ++i) in_fields[i] = IDL_STRING_STR((IDL_STRING*)(data + o) + i); dreturn("%i", n); return n; } static int gdidl_get_entry_cmparr(double complex *c, IDL_VPTR v, char key, int min, int max, unsigned mask, int miss_ok) { int n, i; IDL_MEMINT o; IDL_VPTR d; unsigned char* data = v->value.s.arr->data; char ckey[3] = { 'C', key, 0 }; dtrace("%p, %p, '%c', %i, %i, 0x%X, %i", c, v, key, min, max, mask, miss_ok); /* try key "" before key "C" */ o = GDIDL_GET_TAG(v, ckey + 1, 1, d); if (o == -1) { o = GDIDL_GET_TAG(v, ckey, miss_ok, d); if (o == -1) { dreturn("%i", 0); return 0; } } if (d->flags & IDL_V_ARR) n = d->value.arr->n_elts; else n = 1; for (i = 0; i < n; ++i) gdidl_convert_entry_num(c + i, GD_COMPLEX128, ckey + 1, data + o, i, d->type); /* add trailing named scalars */ for (; n < GD_MAX_POLYORD + 1; ++n) if (!(mask & (1 << n))) break; if (n < min || n > max) GDIDL_ABORT2("Bad length (%i) for %c in GD_ENTRY", n, key); dreturn("%i", n); return n; } /* convert an IDL structure into an gd_entry_t */ static void gdidl_read_idl_entry(gd_entry_t *E, IDL_VPTR v, int no_fragment, const gd_entry_t *old_E) { /* this function is fairly agnostic about the structure it's given: so * long as it gets a structure with the fields it wants (of the right type) * it's happy */ dtrace("%p, %p, %i, %p", E, v, no_fragment, old_E); IDL_VPTR d; IDL_MEMINT o; int n = 0, min, max; const int miss_ok = (old_E != NULL); unsigned mask, tmask; if (old_E) memcpy(E, old_E, sizeof(gd_entry_t)); else memset(E, 0, sizeof(gd_entry_t)); unsigned char* data = v->value.s.arr->data; if (!miss_ok) { /* field */ o = GDIDL_GET_TAG(v, "FIELD", 0, d); IDL_ENSURE_STRING(d); E->field = IDL_STRING_STR((IDL_STRING*)(data + o)); } if (!no_fragment) /* fragment_index */ gdidl_get_entry_num(&E->fragment_index, GD_INT_TYPE, v, "FRAGMENT", 0); /* field_type */ gdidl_get_entry_num(&E->field_type, GD_INT_TYPE, v, "FIELD_TYPE", 0); switch (E->field_type) { case GD_RAW_ENTRY: gdidl_get_entry_num(&E->data_type, GD_INT_TYPE, v, "DATA_TYPE", miss_ok); mask = gdidl_get_entry_scalars(E, 1, v); if (!(mask & 1)) gdidl_get_entry_num(&E->spf, GD_UINT_TYPE, v, "SPF", miss_ok); break; case GD_LINCOM_ENTRY: if (gdidl_get_entry_num(&n, GD_INT_TYPE, v, "N_FIELDS", 1)) min = max = n; else { min = 1; max = GD_MAX_LINCOM; } E->n_fields = gdidl_get_in_fields((char**)E->in_fields, v, min, max, miss_ok); if (E->n_fields > 0) min = max = E->n_fields; E->flags |= GD_EN_COMPSCAL; tmask = (1 << max) - 1; mask = gdidl_get_entry_scalars(E, 9 * tmask, v); if ((mask & tmask) != tmask) { E->n_fields = gdidl_get_entry_cmparr(E->cm, v, 'M', min, max, mask & tmask, miss_ok); if (E->n_fields > 0) min = max = E->n_fields; } if (((mask >> GD_MAX_LINCOM) & tmask) != tmask) E->n_fields = gdidl_get_entry_cmparr(E->cb, v, 'B', min, max, (mask >> GD_MAX_LINCOM) & tmask, miss_ok); else E->n_fields = max; break; case GD_LINTERP_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok); o = GDIDL_GET_TAG(v, "TABLE", miss_ok, d); if (o != -1) { IDL_ENSURE_STRING(d); E->table = IDL_STRING_STR((IDL_STRING*)(data + o)); } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok); mask = gdidl_get_entry_scalars(E, 0x3, v); if (!(mask & 0x1)) gdidl_get_entry_num(&E->bitnum, GD_INT_TYPE, v, "BITNUM", miss_ok); if (!(mask & 0x3)) { if (!gdidl_get_entry_num(&E->numbits, GD_INT_TYPE, v, "NUMBITS", 1)) if (!miss_ok) E->numbits = 1; } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 2, 2, miss_ok); break; case GD_RECIP_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok); E->flags |= GD_EN_COMPSCAL; mask = gdidl_get_entry_scalars(E, 0x1, v); if (!(mask & 1)) if (gdidl_get_entry_num(&E->cdividend, GD_COMPLEX128, v, "CDIVIDEND", 1) == 0) { gdidl_get_entry_num(&E->cdividend, GD_COMPLEX128, v, "DIVIDEND", miss_ok); } break; case GD_PHASE_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok); mask = gdidl_get_entry_scalars(E, 0x1, v); if (!(mask & 1)) gdidl_get_entry_num(&E->shift, GD_INT64, v, "SHIFT", miss_ok); break; case GD_POLYNOM_ENTRY: if (gdidl_get_entry_num(&n, GD_INT_TYPE, v, "POLY_ORD", 1)) min = max = n + 1; else { min = 2; max = GD_MAX_POLYORD + 1; } gdidl_get_in_fields((char**)E->in_fields, v, 1, 1, miss_ok); tmask = (1 << max) - 1; mask = gdidl_get_entry_scalars(E, tmask, v); E->flags |= GD_EN_COMPSCAL; if ((mask & tmask) != tmask) E->poly_ord = gdidl_get_entry_cmparr(E->ca, v, 'A', min, max, mask, miss_ok) - 1; else E->poly_ord = max - 1; break; case GD_WINDOW_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 2, 2, miss_ok); gdidl_get_entry_num(&E->windop, GD_INT_TYPE, v, "WINDOP", miss_ok); mask = gdidl_get_entry_scalars(E, 0x1, v); if (!(mask & 1)) switch (E->windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: if (gdidl_get_entry_num(&E->threshold.i, GD_INT64, v, "ITHRESHOLD", 1) == 0) { gdidl_get_entry_num(&E->threshold.i, GD_INT64, v, "THRESHOLD", miss_ok); } break; case GD_WINDOP_SET: case GD_WINDOP_CLR: if (gdidl_get_entry_num(&E->threshold.u, GD_UINT64, v, "UTHRESHOLD", 1) == 0) { gdidl_get_entry_num(&E->threshold.u, GD_UINT64, v, "THRESHOLD", miss_ok); } break; default: if (gdidl_get_entry_num(&E->threshold.r, GD_FLOAT64, v, "RTHRESHOLD", 1) == 0) { gdidl_get_entry_num(&E->threshold.r, GD_FLOAT64, v, "THRESHOLD", miss_ok); } break; } break; case GD_MPLEX_ENTRY: gdidl_get_in_fields((char**)E->in_fields, v, 2, 2, miss_ok); mask = gdidl_get_entry_scalars(E, 0x3, v); if (!(mask & 1)) gdidl_get_entry_num(&E->count_val, GD_INT_TYPE, v, "COUNT_VAL", miss_ok); if (!(mask & 3)) gdidl_get_entry_num(&E->period, GD_INT_TYPE, v, "PERIOD", 1); break; case GD_CARRAY_ENTRY: gdidl_get_entry_num(&E->array_len, GD_INT_TYPE, v, "ARRAY_LEN", miss_ok); gdidl_get_entry_num(&E->const_type, GD_INT_TYPE, v, "DATA_TYPE", miss_ok); break; case GD_CONST_ENTRY: gdidl_get_entry_num(&E->const_type, GD_INT_TYPE, v, "DATA_TYPE", miss_ok); break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_INDEX_ENTRY: case GD_STRING_ENTRY: break; } dreturnvoid(); } /* convert an IDL string or numerical encoding key to a GetData flag */ unsigned long gdidl_convert_encoding(IDL_VPTR idl_enc) { dtrace("%p", idl_enc); unsigned long encoding = 0; IDL_ENSURE_SIMPLE(idl_enc); if (idl_enc->type == IDL_TYP_STRING) { const char* enc = IDL_VarGetString(idl_enc); if (strcasecmp(enc, "BZIP2")) encoding = GD_BZIP2_ENCODED; else if (strcasecmp(enc, "GZIP")) encoding = GD_GZIP_ENCODED; else if (strcasecmp(enc, "FLAC")) encoding = GD_FLAC_ENCODED; else if (strcasecmp(enc, "LZMA")) encoding = GD_LZMA_ENCODED; else if (strcasecmp(enc, "SLIM")) encoding = GD_SLIM_ENCODED; else if (strcasecmp(enc, "SIE")) encoding = GD_SIE_ENCODED; else if (strcasecmp(enc, "TEXT")) encoding = GD_TEXT_ENCODED; else if (strcasecmp(enc, "ZZIP")) encoding = GD_ZZIP_ENCODED; else if (strcasecmp(enc, "ZZSLIM")) encoding = GD_ZZSLIM_ENCODED; else if (strcasecmp(enc, "NONE")) encoding = GD_UNENCODED; else if (strcasecmp(enc, "RAW")) encoding = GD_UNENCODED; else if (strcasecmp(enc, "UNENCODED")) encoding = GD_UNENCODED; else if (strcasecmp(enc, "AUTO")) encoding = GD_AUTO_ENCODED; else GDIDL_ABORT("Unknown encoding type."); } else encoding = IDL_LongScalar(idl_enc); dreturn("%lx", encoding); return encoding; } /* The public subroutines begin here. The `DLM' lines are magical. */ /* @@DLM: F gdidl_dirfilename GD_DIRFILENAME 1 1 KEYWORDS */ IDL_VPTR gdidl_dirfilename(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* name = gd_dirfilename(D); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_StrToSTRING((char*)name); dreturn("%p", r); return r; } /* @@DLM: P gdidl_add GD_ADD 2 2 KEYWORDS */ void gdidl_add(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gd_entry_t E; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); IDL_ENSURE_STRUCTURE(argv[1]); gdidl_read_idl_entry(&E, argv[1], kw.parent_x, NULL); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd(D, &E, parent); } else gd_add(D, &E); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_bit GD_ADD_BIT 3 3 KEYWORDS */ void gdidl_add_bit(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int bitnum; int numbits; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.bitnum = kw.fragment_index = 0; kw.parent_x = 0; kw.numbits = 1; static IDL_KW_PAR kw_pars[] = { { "BITNUM", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(bitnum) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_bit(D, parent, field_code, in_field, kw.bitnum, kw.numbits); } else gd_add_bit(D, field_code, in_field, kw.bitnum, kw.numbits, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_const GD_ADD_CONST 2 2 KEYWORDS */ void gdidl_add_const(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); double zero = 0; gd_type_t data_type = GD_FLOAT64; const void *data = &zero; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int const_type; IDL_VPTR value; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.value = NULL; kw.fragment_index = 0; kw.parent_x = 0; kw.const_type = GD_FLOAT64; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { "VALUE", 0, 1, IDL_KW_VIN, 0, IDL_KW_OFFSETOF(value) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.value) { data = gdidl_from_alltypes(kw.value->type, &kw.value->value); data_type = gdidl_gd_type(kw.value->type); } if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_const(D, parent, field_code, kw.const_type, data_type, data); } else gd_add_const(D, field_code, kw.const_type, data_type, data, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_carray GD_ADD_CARRAY 2 2 KEYWORDS */ void gdidl_add_carray(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gd_type_t data_type = GD_INT8; void *data = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int const_type; int n; IDL_VPTR value; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.value = NULL; kw.fragment_index = kw.n = 0; kw.parent_x = 0; kw.const_type = GD_FLOAT64; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "LENGTH", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(n) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { "VALUE", 0, 1, IDL_KW_VIN, 0, IDL_KW_OFFSETOF(value) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.value) { IDL_ENSURE_ARRAY(kw.value); if (kw.value->value.arr->n_dim != 1) GDIDL_KW_ABORT("VALUE must be a vector, not a multidimensional array"); data = (void *)kw.value->value.arr->data; data_type = gdidl_gd_type(kw.value->type); kw.n = kw.value->value.arr->n_elts; } else if (kw.n) { data = malloc(kw.n); memset(data, 0, kw.n); } else GDIDL_KW_ABORT("either LENGTH or VALUE must be specified"); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_carray(D, parent, field_code, kw.const_type, kw.n, data_type, data); } else gd_add_carray(D, field_code, kw.const_type, kw.n, data_type, data, kw.fragment_index); if (!kw.value) free(data); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_lincom GD_ADD_LINCOM 5 11 KEYWORDS */ void gdidl_add_lincom(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; int i, comp_scal = 0; const char* in_field[3]; double m[3]; double b[3]; double complex cm[3]; double complex cb[3]; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); int n_fields = (argc - 2) / 3; /* IDL's runtime check on # of args should ensure this is 1, 2, or 3. */ for (i = 0; i < n_fields; ++i) { in_field[i] = IDL_VarGetString(argv[2 + i * 3]); if (argv[3 + i * 3]->type == IDL_TYP_DCOMPLEX || argv[3 + i * 3]->type == IDL_TYP_COMPLEX) { comp_scal = 1; m[i] = cm[i] = gdidl_dcomplexScalar(argv[3 + i * 3]); } else cm[i] = m[i] = IDL_DoubleScalar(argv[3 + i * 3]); if (argv[4 + i * 3]->type == IDL_TYP_DCOMPLEX || argv[4 + i * 3]->type == IDL_TYP_COMPLEX) { comp_scal = 1; b[i] = cb[i] = gdidl_dcomplexScalar(argv[4 + i * 3]); } else cb[i] = b[i] = IDL_DoubleScalar(argv[4 + i * 3]); } if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); if (comp_scal) gd_madd_clincom(D, parent, field_code, n_fields, in_field, cm, cb); else gd_madd_lincom(D, parent, field_code, n_fields, in_field, m, b); } else if (comp_scal) gd_add_clincom(D, field_code, n_fields, in_field, cm, cb, kw.fragment_index); else gd_add_lincom(D, field_code, n_fields, in_field, m, b, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_linterp GD_ADD_LINTERP 4 4 KEYWORDS */ void gdidl_add_linterp(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); const char* table = IDL_VarGetString(argv[3]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_linterp(D, parent, field_code, in_field, table); } else gd_add_linterp(D, field_code, in_field, table, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } static void gdidl_add_yoke_(gd_type_t type, int argc, IDL_VPTR argv[], char *argk) { dtrace("0x%X, %i, %p, %p", type, argc, argv, argk); gd_entry_t E; memset(&E, 0, sizeof(E)); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); E.field = IDL_VarGetString(argv[1]); E.field_type = type; E.in_fields[0] = IDL_VarGetString(argv[2]); E.in_fields[1] = IDL_VarGetString(argv[3]); E.fragment_index = kw.fragment_index; if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd(D, &E, parent); } else gd_add(D, &E); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_multiply GD_ADD_MULTIPLY 4 4 KEYWORDS */ void gdidl_add_multiply(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gdidl_add_yoke_(GD_MULTIPLY_ENTRY, argc, argv, argk); dreturnvoid(); } /* @@DLM: P gdidl_add_divide GD_ADD_DIVIDE 4 4 KEYWORDS */ void gdidl_add_divide(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gdidl_add_yoke_(GD_DIVIDE_ENTRY, argc, argv, argk); dreturnvoid(); } /* @@DLM: P gdidl_add_recip GD_ADD_RECIP 3 3 KEYWORDS */ void gdidl_add_recip(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int comp_scal = 0; double complex cdividend = 0; double dividend = 1; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_VPTR dividend; int dividend_x; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = kw.dividend_x = 0; kw.dividend = NULL; static IDL_KW_PAR kw_pars[] = { { "DIVIDEND", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(dividend_x), IDL_KW_OFFSETOF(dividend) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field1 = IDL_VarGetString(argv[2]); if (kw.dividend_x) { if (kw.dividend->type == IDL_TYP_DCOMPLEX || kw.dividend->type == IDL_TYP_COMPLEX) { comp_scal = 1; cdividend = gdidl_dcomplexScalar(kw.dividend); } else dividend = IDL_DoubleScalar(kw.dividend); } if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); if (comp_scal) gd_madd_crecip(D, parent, field_code, in_field1, cdividend); else gd_madd_recip(D, parent, field_code, in_field1, dividend); } else if (comp_scal) gd_add_crecip(D, field_code, in_field1, cdividend, kw.fragment_index); else gd_add_recip(D, field_code, in_field1, dividend, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_phase GD_ADD_PHASE 4 4 KEYWORDS */ void gdidl_add_phase(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; kw.fragment_index = 0; kw.parent_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); long shift = IDL_LongScalar(argv[3]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_phase(D, parent, field_code, in_field, shift); } else gd_add_phase(D, field_code, in_field, shift, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_polynom GD_ADD_POLYNOM 4 9 KEYWORDS */ void gdidl_add_polynom(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; int i, comp_scal = 0; double a[GD_MAX_POLYORD + 1]; double complex ca[GD_MAX_POLYORD + 1]; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); int poly_ord; if (argv[3]->flags & IDL_V_ARR) { if (argv[3]->value.arr->n_dim != 1) GDIDL_KW_ABORT("The array of coeffecients may only have a single " "dimension"); poly_ord = argv[3]->value.arr->dim[0] - 1; if (poly_ord < 1) GDIDL_KW_ABORT("The array of coeffecients must have at least two " "elements"); if (poly_ord > GD_MAX_POLYORD) poly_ord = GD_MAX_POLYORD; for (i = 0; i <= poly_ord; ++i) { switch(argv[3]->type) { case IDL_TYP_BYTE: ca[i] = a[i] = ((UCHAR*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_INT: ca[i] = a[i] = ((IDL_INT*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_LONG: ca[i] = a[i] = ((IDL_LONG*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_FLOAT: ca[i] = a[i] = ((float*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_DOUBLE: ca[i] = a[i] = ((double*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_UINT: ca[i] = a[i] = ((IDL_UINT*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_ULONG: ca[i] = a[i] = ((IDL_ULONG*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_LONG64: ca[i] = a[i] = ((IDL_LONG64*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_ULONG64: ca[i] = a[i] = ((IDL_ULONG64*)(argv[3]->value.arr->data))[i]; break; case IDL_TYP_COMPLEX: comp_scal = 1; ca[i] = ((IDL_COMPLEX*)(argv[3]->value.arr->data))[i].r + _Complex_I * ((IDL_COMPLEX*)(argv[3]->value.arr->data))[i].i; break; case IDL_TYP_DCOMPLEX: comp_scal = 1; ca[i] = ((IDL_DCOMPLEX*)(argv[3]->value.arr->data))[i].r + _Complex_I * ((IDL_DCOMPLEX*)(argv[3]->value.arr->data))[i].i; break; default: GDIDL_KW_ABORT("The coeffecients must be of scalar type"); } } } else { poly_ord = argc - 4; for (i = 0; i <= poly_ord; ++i) if (argv[i + 3]->type == IDL_TYP_COMPLEX) { comp_scal = 1; ca[i] = argv[i + 3]->value.cmp.r + _Complex_I * argv[i + 3]->value.cmp.i; } else if (argv[i + 3]->type == IDL_TYP_DCOMPLEX) { comp_scal = 1; ca[i] = argv[i + 3]->value.dcmp.r + _Complex_I * argv[i + 3]->value.dcmp.i; } else ca[i] = a[i] = IDL_DoubleScalar(argv[i + 3]); } if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); if (comp_scal) gd_madd_cpolynom(D, parent, field_code, poly_ord, in_field, ca); else gd_madd_polynom(D, parent, field_code, poly_ord, in_field, a); } else if (comp_scal) gd_add_cpolynom(D, field_code, poly_ord, in_field, ca, kw.fragment_index); else gd_add_polynom(D, field_code, poly_ord, in_field, a, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_raw GD_ADD_RAW 3 3 KEYWORDS */ void gdidl_add_raw(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; unsigned int spf; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.spf = 1; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "SPF", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(spf) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_add_raw(D, field_code, IDL_LongScalar(argv[2]), kw.spf, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_sbit GD_ADD_SBIT 3 3 KEYWORDS */ void gdidl_add_sbit(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int bitnum; int numbits; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.bitnum = kw.fragment_index = 0; kw.parent_x = 0; kw.numbits = 1; static IDL_KW_PAR kw_pars[] = { { "BITNUM", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(bitnum) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_sbit(D, parent, field_code, in_field, kw.bitnum, kw.numbits); } else gd_add_sbit(D, field_code, in_field, kw.bitnum, kw.numbits, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_spec GD_ADD_SPEC 2 2 KEYWORDS */ void gdidl_add_spec(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* line = IDL_VarGetString(argv[1]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_spec(D, line, parent); } else gd_add_spec(D, line, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_string GD_ADD_STRING 2 2 KEYWORDS */ void gdidl_add_string(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* str = ""; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING value; int value_x; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.value_x = 0; kw.parent_x = 0; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "VALUE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(value_x), IDL_KW_OFFSETOF(value) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.value_x) str = IDL_STRING_STR(&kw.value); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_string(D, parent, field_code, str); } else gd_add_string(D, field_code, str, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_bit GD_ALTER_BIT 2 2 KEYWORDS */ void gdidl_alter_bit(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* in_field = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int bitnum; int bitnum_x; int numbits; IDL_STRING in_field; int in_field_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.bitnum = 0; kw.bitnum_x = 0; kw.numbits = 0; kw.in_field_x = 0; static IDL_KW_PAR kw_pars[] = { { "BITNUM", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(bitnum_x), IDL_KW_OFFSETOF(bitnum) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (!kw.bitnum_x) kw.bitnum = -1; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.in_field_x) in_field = IDL_STRING_STR(&kw.in_field); gd_alter_bit(D, field_code, in_field, kw.bitnum, kw.numbits); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_const GD_ALTER_CONST 2 2 KEYWORDS */ void gdidl_alter_const(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int const_type; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.const_type = GD_NULL; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_alter_const(D, field_code, kw.const_type); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_carray GD_ALTER_CARRAY 2 2 KEYWORDS */ void gdidl_alter_carray(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int len; int const_type; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.const_type = GD_NULL; kw.len = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "LENGTH", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(len) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_alter_carray(D, field_code, kw.const_type, (size_t)kw.len); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_encoding GD_ALTER_ENCODING 2 2 KEYWORDS */ void gdidl_alter_encoding(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; int fragment_index_x; int recode; } KW_RESULT; KW_RESULT kw; kw.recode = 0; kw.fragment_index = 0; kw.fragment_index_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x), IDL_KW_OFFSETOF(fragment_index) }, { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (!kw.fragment_index_x) kw.fragment_index = GD_ALL_FRAGMENTS; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_alter_encoding(D, gdidl_convert_encoding(argv[1]), kw.fragment_index, kw.recode); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_endianness GD_ALTER_ENDIANNESS 1 1 KEYWORDS */ void gdidl_alter_endianness(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int arm_end; int big_end; int fragment_index; int fragment_index_x; int little_end; int not_arm_end; int recode; } KW_RESULT; KW_RESULT kw; kw.recode = 0; kw.fragment_index = 0; kw.fragment_index_x = 0; kw.arm_end = kw.big_end = kw.little_end = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(arm_end) }, { "BIG_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(big_end) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x), IDL_KW_OFFSETOF(fragment_index) }, { "LITTLE_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(little_end) }, { "NOT_ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(not_arm_end) }, { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (!kw.fragment_index_x) kw.fragment_index = GD_ALL_FRAGMENTS; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_alter_endianness(D, (kw.big_end ? GD_BIG_ENDIAN : 0) | (kw.little_end ? GD_LITTLE_ENDIAN : 0) | (kw.arm_end ? GD_ARM_ENDIAN : 0) | (kw.not_arm_end ? GD_NOT_ARM_ENDIAN : 0), kw.fragment_index, kw.recode); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_entry GD_ALTER_ENTRY 3 3 KEYWORDS */ void gdidl_alter_entry(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int recode; } KW_RESULT; KW_RESULT kw; gd_entry_t E, old_E; kw.recode = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); IDL_ENSURE_STRUCTURE(argv[2]); gd_entry(D, field_code, &old_E); gd_free_entry_strings(&old_E); GDIDL_SET_ERROR(D); gdidl_read_idl_entry(&E, argv[2], 1, &old_E); gd_alter_entry(D, field_code, &E, kw.recode); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_frameoffset GD_ALTER_FRAMEOFFSET 2 2 KEYWORDS */ void gdidl_alter_frameoffset(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; int fragment_index_x; int recode; } KW_RESULT; KW_RESULT kw; kw.recode = 0; kw.fragment_index = 0; kw.fragment_index_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x), IDL_KW_OFFSETOF(fragment_index) }, { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (!kw.fragment_index_x) kw.fragment_index = GD_ALL_FRAGMENTS; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_alter_frameoffset64(D, IDL_Long64Scalar(argv[1]), kw.fragment_index, kw.recode); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_lincom GD_ALTER_LINCOM 2 2 KEYWORDS */ void gdidl_alter_lincom(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_VPTR in_field; int in_field_x; IDL_VPTR m; int m_x; IDL_VPTR b; int b_x; int n_fields; } KW_RESULT; KW_RESULT kw; int i; const char* local_in_field[3]; double* m = NULL; double* b = NULL; double complex* cm = NULL; double complex* cb = NULL; const char** in_field = NULL; IDL_VPTR tmp_m = NULL; IDL_VPTR tmp_b = NULL; int comp_scal = 1; GDIDL_KW_INIT_ERROR; kw.in_field = kw.m = kw.b = NULL; kw.in_field_x = kw.m_x = kw.b_x = kw.n_fields = 0; static IDL_KW_PAR kw_pars[] = { { "B", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(b_x), IDL_KW_OFFSETOF(b) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELDS", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "M", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(m_x), IDL_KW_OFFSETOF(m) }, { "N_FIELDS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(n_fields) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); /* check keywords */ if (kw.in_field_x) { IDL_ENSURE_ARRAY(kw.in_field); IDL_ENSURE_STRING(kw.in_field); if (kw.in_field->value.arr->n_dim != 1) GDIDL_KW_ABORT("IN_FIELDS must be a vector"); if (kw.n_fields == 0) { kw.n_fields = kw.in_field->value.arr->dim[0]; if (kw.n_fields > GD_MAX_LINCOM) kw.n_fields = GD_MAX_LINCOM; } else if (kw.in_field->value.arr->dim[0] < kw.n_fields) GDIDL_KW_ABORT("Insufficient number of elements in IN_FIELDS"); for (i = 0; i < kw.n_fields; ++i) local_in_field[i] = IDL_STRING_STR((IDL_STRING*)(kw.in_field->value.arr->data) + i); in_field = local_in_field; } if (kw.m_x) { IDL_ENSURE_ARRAY(kw.m); if (kw.n_fields == 0) { kw.n_fields = kw.in_field->value.arr->dim[0]; if (kw.n_fields > GD_MAX_LINCOM) kw.n_fields = GD_MAX_LINCOM; } else if (kw.m->value.arr->dim[0] < kw.n_fields) GDIDL_KW_ABORT("Insufficient number of elements in M"); if (kw.m->type == IDL_TYP_COMPLEX || kw.m->type == IDL_TYP_DCOMPLEX) { comp_scal = 1; cm = malloc(sizeof(double complex) * kw.n_fields); if (kw.m->type == IDL_TYP_DCOMPLEX) gdidl_dcmp_to_c99(cm, (IDL_DCOMPLEX*)kw.m->value.arr->data, kw.n_fields); else gdidl_cmp_to_c99(cm, (IDL_COMPLEX*)kw.m->value.arr->data, kw.n_fields); } else { tmp_m = IDL_CvtDbl(1, &kw.m); m = (double*)tmp_m->value.arr->data; } } if (kw.b_x) { IDL_ENSURE_ARRAY(kw.b); if (kw.n_fields == 0) { kw.n_fields = kw.in_field->value.arr->dim[0]; if (kw.n_fields > GD_MAX_LINCOM) kw.n_fields = GD_MAX_LINCOM; } else if (kw.b->value.arr->dim[0] < kw.n_fields) GDIDL_KW_ABORT("Insufficient number of elements in B"); if (kw.b->type == IDL_TYP_COMPLEX || kw.b->type == IDL_TYP_DCOMPLEX) { comp_scal = 1; cb = malloc(sizeof(double complex) * kw.n_fields); if (kw.b->type == IDL_TYP_DCOMPLEX) gdidl_dcmp_to_c99(cb, (IDL_DCOMPLEX*)kw.b->value.arr->data, kw.n_fields); else gdidl_cmp_to_c99(cb, (IDL_COMPLEX*)kw.b->value.arr->data, kw.n_fields); } else { tmp_b = IDL_CvtDbl(1, &kw.b); b = (double*)tmp_b->value.arr->data; } } if (comp_scal) gd_alter_clincom(D, field_code, kw.n_fields, in_field, cm, cb); else gd_alter_lincom(D, field_code, kw.n_fields, in_field, m, b); GDIDL_SET_ERROR(D); IDL_KW_FREE; if (tmp_m != NULL && kw.m->type != IDL_TYP_DOUBLE) IDL_Deltmp(tmp_m); if (tmp_b != NULL && kw.b->type != IDL_TYP_DOUBLE) IDL_Deltmp(tmp_b); free(cm); free(cb); dreturnvoid(); } /* @@DLM: P gdidl_alter_linterp GD_ALTER_LINTERP 2 2 KEYWORDS */ void gdidl_alter_linterp(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* in_field = NULL; const char* table = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING table; int table_x; IDL_STRING in_field; int in_field_x; int rename; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.table_x = 0; kw.rename = 0; kw.in_field_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "RENAME_TABLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(rename) }, { "TABLE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(table_x), IDL_KW_OFFSETOF(table) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.in_field_x) in_field = IDL_STRING_STR(&kw.in_field); if (kw.table_x) table = IDL_STRING_STR(&kw.table); gd_alter_linterp(D, field_code, in_field, table, kw.rename); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } void gdidl_alter_yoke_(gd_type_t type, int argc, IDL_VPTR argv[], char *argk) { dtrace("0x%X, %i, %p, %p", type, argc, argv, argk); gd_entry_t E; E.in_fields[0] = E.in_fields[1] = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING in_field1; int in_field1_x; IDL_STRING in_field2; int in_field2_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.in_field1_x = 0; kw.in_field2_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD1", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x), IDL_KW_OFFSETOF(in_field1) }, { "IN_FIELD2", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x), IDL_KW_OFFSETOF(in_field2) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); E.field = IDL_VarGetString(argv[1]); E.field_type = type; if (kw.in_field1_x) E.in_fields[0] = IDL_STRING_STR(&kw.in_field1); if (kw.in_field2_x) E.in_fields[1] = IDL_STRING_STR(&kw.in_field2); gd_alter_entry(D, E.field, &E, 0); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_multiply GD_ALTER_MULTIPLY 2 2 KEYWORDS */ void gdidl_alter_multiply(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gdidl_alter_yoke_(GD_MULTIPLY_ENTRY, argc, argv, argk); dreturnvoid(); } /* @@DLM: P gdidl_alter_divide GD_ALTER_DIVIDE 2 2 KEYWORDS */ void gdidl_alter_divide(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gdidl_alter_yoke_(GD_DIVIDE_ENTRY, argc, argv, argk); dreturnvoid(); } /* @@DLM: P gdidl_alter_recip GD_ALTER_RECIP 2 2 KEYWORDS */ void gdidl_alter_recip(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* in_field = NULL; int comp_scal = 0; double dividend = 0; complex double cdividend = 0; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_VPTR dividend; int dividend_x; IDL_STRING in_field; int in_field_x; } KW_RESULT; KW_RESULT kw; kw.dividend_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "DIVIDEND", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(dividend_x), IDL_KW_OFFSETOF(dividend) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.in_field_x) in_field = IDL_STRING_STR(&kw.in_field); if (kw.dividend_x) { if (kw.dividend->type == IDL_TYP_DCOMPLEX || kw.dividend->type == IDL_TYP_COMPLEX) { comp_scal = 1; cdividend = gdidl_dcomplexScalar(kw.dividend); } else dividend = IDL_DoubleScalar(kw.dividend); } if (comp_scal) gd_alter_crecip(D, field_code, in_field, cdividend); else gd_alter_recip(D, field_code, in_field, dividend); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_phase GD_ALTER_PHASE 2 2 KEYWORDS */ void gdidl_alter_phase(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* in_field = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int shift; IDL_STRING in_field; int in_field_x; } KW_RESULT; KW_RESULT kw; kw.shift = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "SHIFT", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(shift) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.in_field_x) in_field = IDL_STRING_STR(&kw.in_field); gd_alter_phase(D, field_code, in_field, kw.shift); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_polynom GD_ALTER_POLYNOM 2 2 KEYWORDS */ void gdidl_alter_polynom(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_VPTR in_field; int in_field_x; IDL_VPTR a; int a_x; int poly_ord; } KW_RESULT; KW_RESULT kw; int comp_scal = 1; double* a = NULL; double complex* ca = NULL; const char* in_field = NULL; IDL_VPTR tmp_a = NULL; GDIDL_KW_INIT_ERROR; kw.in_field_x = kw.a_x = kw.poly_ord = 0; static IDL_KW_PAR kw_pars[] = { { "A", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(a_x), IDL_KW_OFFSETOF(a) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "POLY_ORD", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(poly_ord) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.a_x) { IDL_ENSURE_ARRAY(kw.a); if (kw.poly_ord == 0) { kw.poly_ord = kw.in_field->value.arr->dim[0] - 1; if (kw.poly_ord > GD_MAX_POLYORD) kw.poly_ord = GD_MAX_POLYORD; } else if (kw.a->value.arr->dim[0] < kw.poly_ord + 1) GDIDL_KW_ABORT("Insufficient number of elements in A"); if (kw.a->type == IDL_TYP_COMPLEX || kw.a->type == IDL_TYP_DCOMPLEX) { comp_scal = 1; ca = malloc(sizeof(double complex) * (kw.poly_ord + 1)); if (kw.a->type == IDL_TYP_DCOMPLEX) gdidl_dcmp_to_c99(ca, (IDL_DCOMPLEX*)kw.a->value.arr->data, kw.poly_ord + 1); else gdidl_cmp_to_c99(ca, (IDL_COMPLEX*)kw.a->value.arr->data, kw.poly_ord + 1); } else { tmp_a = IDL_CvtDbl(1, &kw.a); a = (double*)tmp_a->value.arr->data; } } if (comp_scal) gd_alter_cpolynom(D, field_code, kw.poly_ord, in_field, ca); else gd_alter_polynom(D, field_code, kw.poly_ord, in_field, a); GDIDL_SET_ERROR(D); IDL_KW_FREE; /* If no type conversion is needed IDL_CvtDbl returns its input, * so we must check the input type to determine whether we need to delete * the temporary variable */ if (tmp_a != NULL && kw.a->type != IDL_TYP_DOUBLE) IDL_Deltmp(tmp_a); free(ca); dreturnvoid(); } /* @@DLM: P gdidl_alter_raw GD_ALTER_RAW 2 2 KEYWORDS */ void gdidl_alter_raw(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; unsigned int spf; gd_type_t type; int recode; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.recode = 0; kw.spf = 0; kw.type = GD_NULL; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) }, { "SPF", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(spf) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_alter_raw(D, field_code, IDL_LongScalar(argv[2]), kw.spf, kw.recode); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_sbit GD_ALTER_SBIT 2 2 KEYWORDS */ void gdidl_alter_sbit(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* in_field = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int bitnum; int bitnum_x; int numbits; IDL_STRING in_field; int in_field_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.bitnum = kw.bitnum_x = 0; kw.numbits = 0; kw.in_field_x = 0; static IDL_KW_PAR kw_pars[] = { { "BITNUM", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(bitnum_x), IDL_KW_OFFSETOF(bitnum) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "NUMBITS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(numbits) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (!kw.bitnum_x) kw.bitnum = -1; if (kw.in_field_x) in_field = IDL_STRING_STR(&kw.in_field); gd_alter_sbit(D, field_code, in_field, kw.bitnum, kw.numbits); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_spec GD_ALTER_SPEC 2 2 KEYWORDS */ void gdidl_alter_spec(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int recode; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.parent_x = 0; kw.recode = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "RECODE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(recode) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* line = IDL_VarGetString(argv[1]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_malter_spec(D, line, parent, kw.recode); } else gd_alter_spec(D, line, kw.recode); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_close GD_CLOSE 1 1 KEYWORDS */ void gdidl_close(int argc, IDL_VPTR argv[], char *argk) { int ret = 0; DIRFILE* D = NULL; dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int discard; } KW_RESULT; KW_RESULT kw; kw.discard = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "DISCARD", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(discard) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); IDL_LONG d = IDL_LongScalar(argv[0]); if (d != 0) { D = gdidl_get_dirfile(d); if (kw.discard) ret = gd_discard(D); else ret = gd_close(D); } if (ret) GDIDL_SET_ERROR(D); else { if (kw.error != NULL) IDL_StoreScalarZero(kw.error, IDL_TYP_INT); if (kw.estr != NULL) { IDL_StoreScalarZero(kw.estr, IDL_TYP_INT); /* free dynamic memory */ kw.estr->type = IDL_TYP_STRING; IDL_StrStore((IDL_STRING*)&kw.estr->value.s, "Success"); } if (d != 0) gdidl_clear_dirfile(d); } IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_delete GD_DELETE 2 2 KEYWORDS */ void gdidl_delete(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int data; int deref; int force; int meta; } KW_RESULT; KW_RESULT kw; kw.data = kw.deref = kw.force = kw.meta = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "DEL_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(data) }, { "DEREF", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(deref) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) }, { "META", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(meta) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_delete(D, field_code, (kw.data ? GD_DEL_DATA : 0) | (kw.deref ? GD_DEL_DEREF : 0) | (kw.force ? GD_DEL_FORCE : 0) | (kw.meta ? GD_DEL_META : 0)); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_flush GD_FLUSH 1 1 KEYWORDS */ void gdidl_flush(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING field_code; int field_code_x; int noclose; int nosync; } KW_RESULT; KW_RESULT kw; const char* field_code = NULL; GDIDL_KW_INIT_ERROR; kw.field_code_x = 0; kw.noclose = kw.nosync = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FIELD_CODE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(field_code_x), IDL_KW_OFFSETOF(field_code) }, { "NOCLOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noclose) }, { "NOSYNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(nosync) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.field_code_x) field_code = IDL_STRING_STR(&kw.field_code); if (kw.noclose && kw.nosync) GDIDL_KW_ABORT("nothing to do"); else if (kw.noclose) gd_sync(D, field_code); else if (kw.nosync) gd_raw_close(D, field_code); else gd_flush(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_include GD_INCLUDE 2 2 KEYWORDS */ void gdidl_include(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char *prefix = NULL; char *suffix = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int arm_end; int big_end; int creat; int excl; int force_enc; int force_end; int ignore_dups; int ignore_refs; int little_end; int not_arm_end; int pedantic; int permissive; int trunc; int enc_x; IDL_VPTR enc; IDL_VPTR index; int fragment_index; int index_x; IDL_STRING prefix; int prefix_x; IDL_STRING suffix; int suffix_x; } KW_RESULT; KW_RESULT kw; kw.big_end = kw.creat = kw.excl = kw.force_enc = kw.force_end = kw.ignore_dups = kw.ignore_refs = kw.little_end = kw.pedantic = kw.trunc = kw.enc_x = kw.index_x = kw.fragment_index = kw.arm_end = kw.not_arm_end = kw.prefix_x = kw.suffix_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { IDL_KW_FAST_SCAN, { "ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(arm_end) }, { "BIG_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(big_end) }, { "CREAT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(creat) }, { "ENCODING", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(enc_x), IDL_KW_OFFSETOF(enc) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "EXCL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(excl) }, { "FORCE_ENCODING", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_enc) }, { "FORCE_ENDIANNESS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_end) }, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "INDEX", 0, 1, IDL_KW_OUT, IDL_KW_OFFSETOF(index_x), IDL_KW_OFFSETOF(index) }, { "IGNORE_DUPS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_dups) }, { "IGNORE_REFS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_dups) }, { "LITTLE_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(little_end) }, { "NOT_ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(not_arm_end) }, { "PEDANTIC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pedantic) }, { "PERMISSIVE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(permissive) }, { "PREFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(prefix_x), IDL_KW_OFFSETOF(prefix) }, { "SUFFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(suffix_x), IDL_KW_OFFSETOF(suffix) }, { "TRUNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(trunc) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); /* check writability before doing anything */ if (kw.index_x) IDL_StoreScalarZero(kw.index, IDL_TYP_INT); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char *file = IDL_VarGetString(argv[1]); unsigned long flags = (kw.arm_end ? GD_ARM_ENDIAN : 0) | (kw.big_end ? GD_BIG_ENDIAN : 0) | (kw.creat ? GD_CREAT : 0) | (kw.excl ? GD_EXCL : 0) | (kw.force_enc ? GD_FORCE_ENCODING : 0) | (kw.force_end ? GD_FORCE_ENDIAN : 0) | (kw.ignore_dups ? GD_IGNORE_DUPS : 0) | (kw.ignore_refs ? GD_IGNORE_REFS : 0) | (kw.little_end ? GD_LITTLE_ENDIAN : 0) | (kw.not_arm_end ? GD_NOT_ARM_ENDIAN : 0) | (kw.pedantic ? GD_PEDANTIC : 0) | (kw.permissive ? GD_PERMISSIVE : 0) | (kw.trunc ? GD_TRUNC : 0); if (kw.enc_x) flags |= gdidl_convert_encoding(kw.enc); if (kw.prefix_x) prefix = IDL_STRING_STR(&kw.prefix); if (kw.suffix_x) suffix = IDL_STRING_STR(&kw.suffix); int index = (int16_t)gd_include_affix(D, file, kw.fragment_index, prefix, suffix, flags); if (kw.index_x) { IDL_ALLTYPES v; v.i = index; IDL_StoreScalar(kw.index, IDL_TYP_INT, &v); } GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_metaflush GD_METAFLUSH 1 1 KEYWORDS */ void gdidl_metaflush(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_metaflush(D); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_rewrite_fragment GD_REWRITE_FRAGMENT 1 1 KEYWORDS */ void gdidl_rewrite_fragment(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; int fragment_index_x; } KW_RESULT; KW_RESULT kw; kw.fragment_index = 0; kw.fragment_index_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x), IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (!kw.fragment_index_x) kw.fragment_index = GD_ALL_FRAGMENTS; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_rewrite_fragment(D, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_move GD_MOVE 3 3 KEYWORDS */ void gdidl_move(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int dangle, force, move_data, updatedb; } KW_RESULT; KW_RESULT kw; kw.dangle = kw.force = kw.move_data = kw.updatedb = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "DANGLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(dangle) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) }, { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) }, { "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_move(D, field_code, IDL_LongScalar(argv[2]), (kw.dangle ? GD_REN_DANGLE : 0) | (kw.force ? GD_REN_FORCE : 0) | (kw.move_data ? GD_REN_DATA : 0) | (kw.updatedb ? GD_REN_UPDB : 0)); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_open GD_OPEN 1 1 KEYWORDS */ IDL_VPTR gdidl_open(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char* name = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int rdwr; int arm_end; int big_end; int creat; int excl; int force_enc; int force_end; int ignore_dups; int ignore_refs; int little_end; int not_arm_end; int pedantic; int permissive; int pretty_print; int trunc; int truncsub; int verbose; int enc_x; IDL_VPTR enc; } KW_RESULT; KW_RESULT kw; kw.rdwr = kw.big_end = kw.creat = kw.excl = kw.force_enc = kw.force_end = kw.ignore_dups = kw.little_end = kw.pedantic = kw.trunc = kw.verbose = kw.enc_x = kw.arm_end = kw.not_arm_end = kw.pretty_print = kw.truncsub = kw.ignore_refs = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { IDL_KW_FAST_SCAN, { "ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(arm_end) }, { "BIG_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(big_end) }, { "CREAT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(creat) }, { "ENCODING", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(enc_x), IDL_KW_OFFSETOF(enc) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "EXCL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(excl) }, { "FORCE_ENCODING", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_enc) }, { "FORCE_ENDIANNESS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force_end) }, { "IGNORE_DUPS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_dups) }, { "IGNORE_REFS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ignore_refs) }, { "LITTLE_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(little_end) }, { "NOT_ARM_ENDIAN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(not_arm_end) }, { "PEDANTIC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pedantic) }, { "PERMISSIVE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(permissive) }, { "PRETTY_PRINT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pretty_print) }, { "RDWR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(rdwr) }, { "TRUNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(trunc) }, { "TRUNCSUB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(truncsub) }, { "VERBOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(verbose) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); name = IDL_VarGetString(argv[0]); unsigned long flags = (kw.rdwr ? GD_RDWR : GD_RDONLY) | (kw.arm_end ? GD_ARM_ENDIAN : 0) | (kw.big_end ? GD_BIG_ENDIAN : 0) | (kw.creat ? GD_CREAT : 0) | (kw.excl ? GD_EXCL : 0) | (kw.force_enc ? GD_FORCE_ENCODING : 0) | (kw.force_end ? GD_FORCE_ENDIAN : 0) | (kw.ignore_dups ? GD_IGNORE_DUPS : 0) | (kw.ignore_refs ? GD_IGNORE_REFS : 0) | (kw.little_end ? GD_LITTLE_ENDIAN : 0) | (kw.not_arm_end ? GD_NOT_ARM_ENDIAN : 0) | (kw.pedantic ? GD_PEDANTIC : 0) | (kw.permissive ? GD_PERMISSIVE : 0) | (kw.pretty_print ? GD_PRETTY_PRINT : 0) | (kw.trunc ? GD_TRUNC : 0) | (kw.truncsub ? GD_TRUNCSUB : 0) | (kw.verbose ? GD_VERBOSE : 0); if (kw.enc_x) flags |= gdidl_convert_encoding(kw.enc); DIRFILE* D = gd_open(name, flags); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(gdidl_set_dirfile(D)); dreturn("%p", r); return r; } /* @@DLM: P gdidl_alter_protection GD_ALTER_PROTECTION 2 2 KEYWORDS */ void gdidl_alter_protection(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; int fragment_index_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.fragment_index_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(fragment_index_x), IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (!kw.fragment_index_x) kw.fragment_index = GD_ALL_FRAGMENTS; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_alter_protection(D, IDL_LongScalar(argv[1]), kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_reference GD_REFERENCE 1 2 KEYWORDS */ IDL_VPTR gdidl_reference(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char *field_code = NULL; IDL_VPTR r; GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (argc > 1) field_code = IDL_VarGetString(argv[1]); field_code = gd_reference(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; if (field_code) r = IDL_StrToSTRING((char*)field_code); else r = IDL_StrToSTRING(""); dreturn("%p", r); return r; } /* @@DLM: P gdidl_rename GD_RENAME 3 3 KEYWORDS */ void gdidl_rename(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int dangle, force, move_data, updatedb; } KW_RESULT; KW_RESULT kw; kw.dangle = kw.force = kw.move_data = kw.updatedb = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "DANGLE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(dangle) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FORCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(force) }, { "MOVE_DATA", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(move_data) }, { "UPDATEDB", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(updatedb) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* new_code = IDL_VarGetString(argv[2]); gd_rename(D, field_code, new_code, (kw.dangle ? GD_REN_DANGLE : 0) | (kw.force ? GD_REN_FORCE : 0) | (kw.move_data ? GD_REN_DATA : 0) | (kw.updatedb ? GD_REN_UPDB : 0)); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_uninclude GD_UNINCLUDE 2 2 KEYWORDS */ void gdidl_uninclude(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int del; } KW_RESULT; KW_RESULT kw; kw.del = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "DELETE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(del) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_uninclude(D, IDL_LongScalar(argv[1]), kw.del); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_validate GD_VALIDATE 2 2 KEYWORDS */ IDL_VPTR gdidl_validate(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); int v = gd_validate(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(v); dreturn("%p", r); return r; } /* @@DLM: F gdidl_getdata GD_GETDATA 2 2 KEYWORDS */ IDL_VPTR gdidl_getdata(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_LONG64 first_frame; IDL_LONG64 first_sample; IDL_LONG n_frames; IDL_LONG n_samples; int first_frame_x, first_sample_x; gd_type_t return_type; } KW_RESULT; KW_RESULT kw; size_t n; IDL_VPTR r; kw.first_frame = kw.first_sample = kw.n_frames = kw.n_samples = 0; kw.first_frame_x = kw.first_sample_x = 0; kw.return_type = GD_FLOAT64; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_frame_x), IDL_KW_OFFSETOF(first_frame) }, { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x), IDL_KW_OFFSETOF(first_sample) }, { "NUM_FRAMES", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(n_frames) }, { "NUM_SAMPLES", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(n_samples) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(return_type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); /* check for metadata */ unsigned int spf = 1; if (!gd_error(D) && kw.n_frames > 0) spf = gd_spf(D, field_code); if (gd_error(D) || (kw.n_frames == 0 && kw.n_samples == 0)) { r = IDL_GettmpInt(0); } else { if (kw.first_frame_x == 0 && kw.first_sample_x == 0) { kw.first_frame = GD_HERE; kw.first_sample = 0; } kw.n_samples += kw.n_frames * spf; /* no signed 8-bit type in IDL */ if (kw.return_type == GD_INT8) GDIDL_KW_ABORT("Cannot return data as a signed 8-bit integer."); void* data = malloc(kw.n_samples * GD_SIZE(kw.return_type)); n = gd_getdata64(D, field_code, kw.first_frame, kw.first_sample, 0, kw.n_samples, kw.return_type, data); if (n == 0) { free(data); r = IDL_GettmpInt(0); } else { IDL_MEMINT dim[] = { n }; r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.return_type), data, (IDL_ARRAY_FREE_CB)free, NULL); } } GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_bof GD_BOF 2 2 KEYWORDS */ IDL_VPTR gdidl_get_bof(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char *field_code = IDL_VarGetString(argv[1]); gd_off64_t bof = gd_bof64(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_LONG64; r->value.l64 = (IDL_LONG64)bof; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_constant GD_GET_CONSTANT 2 2 KEYWORDS */ IDL_VPTR gdidl_get_constant(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int const_type; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.const_type = GD_FLOAT64; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); void* data = malloc(16); int ret = gd_get_constant(D, field_code, kw.const_type, data); IDL_VPTR r; if (!ret) { r = IDL_Gettmp(); r->value = gdidl_to_alltypes(kw.const_type, data); r->type = gdidl_idl_type(kw.const_type); } else { GDIDL_SET_ERROR(D); r = IDL_GettmpInt(0); } free(data); IDL_KW_FREE; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_carray GD_GET_CARRAY 2 2 KEYWORDS */ IDL_VPTR gdidl_get_carray(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int ret = 1; void *data = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; unsigned int start; unsigned int n; int const_type; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.const_type = GD_FLOAT64; kw.start = kw.n = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "LENGTH", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(n) }, { "START", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(start) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.n == 0) { kw.n = gd_array_len(D, field_code); if (kw.n > kw.start) kw.n -= kw.start; else kw.n = 0; } data = malloc(16 * kw.n); ret = gd_get_carray_slice(D, field_code, kw.start, kw.n, kw.const_type, data); IDL_VPTR r; if (!ret) { IDL_MEMINT dim[] = { kw.n }; r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.const_type), data, (IDL_ARRAY_FREE_CB)free, NULL); } else { free(data); GDIDL_SET_ERROR(D); r = IDL_GettmpInt(0); } IDL_KW_FREE; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_constants GD_CONSTANTS 1 1 KEYWORDS */ IDL_VPTR gdidl_get_constants(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int const_type; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; unsigned int nconst; const void* consts; GDIDL_KW_INIT_ERROR; kw.parent_x = 0; kw.const_type = GD_FLOAT64; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(const_type) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); /* no signed 8-bit type in IDL */ if (kw.const_type == GD_INT8) GDIDL_KW_ABORT("Cannot return data as a signed 8-bit integer."); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); nconst = gd_nmfields_by_type(D, parent, GD_CONST_ENTRY); consts = gd_mconstants(D, parent, kw.const_type); } else { nconst = gd_nfields_by_type(D, GD_CONST_ENTRY); consts = gd_constants(D, kw.const_type); } IDL_VPTR r; if (consts != NULL) { void* data = malloc(GD_SIZE(kw.const_type) * nconst); memcpy(data, consts, GD_SIZE(kw.const_type) * nconst); IDL_MEMINT dim[IDL_MAX_ARRAY_DIM] = { nconst }; r = IDL_ImportArray(1, dim, gdidl_idl_type(kw.const_type), data, (IDL_ARRAY_FREE_CB)free, NULL); } else IDL_MakeTempVector(IDL_TYP_INT, 0, IDL_ARR_INI_ZERO, &r); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_encoding GD_ENCODING 1 1 KEYWORDS */ IDL_VPTR gdidl_get_encoding(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); unsigned long enc = gd_encoding(D, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(enc); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_endianness GD_ENDIANNESS 1 1 KEYWORDS */ IDL_VPTR gdidl_get_endianness(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); unsigned long end = gd_endianness(D, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(end); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_entry GD_ENTRY 2 2 KEYWORDS */ IDL_VPTR gdidl_get_entry(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_entry_t E; int ret = gd_entry(D, field_code, &E); IDL_VPTR r = NULL; if (ret) { GDIDL_SET_ERROR(D); r = IDL_GettmpInt(0); } else { r = gdidl_make_idl_entry(&E); gd_free_entry_strings(&E); } IDL_KW_FREE; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_entry_type GD_ENTRY_TYPE 2 2 KEYWORDS */ IDL_VPTR gdidl_get_entry_type(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_entype_t type = gd_entry_type(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(type); dreturn("%p", r); return r; } /* @@DLM: F gdidl_error GD_ERROR 1 1 */ IDL_VPTR gdidl_error(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int err = gd_error(gdidl_get_dirfile(IDL_LongScalar(argv[0]))); IDL_VPTR r = IDL_GettmpInt(err); dreturn("%p", r); return r; } /* @@DLM: F gdidl_error_count GD_ERROR_COUNT 1 1 */ IDL_VPTR gdidl_error_count(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int err = gd_error_count(gdidl_get_dirfile(IDL_LongScalar(argv[0]))); IDL_VPTR r = IDL_GettmpInt(err); dreturn("%p", r); return r; } /* @@DLM: F gdidl_error_string GD_ERROR_STRING 1 1 */ IDL_VPTR gdidl_error_string(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char buffer[GD_MAX_LINE_LENGTH]; gd_error_string(gdidl_get_dirfile(IDL_LongScalar(argv[0])), buffer, GD_MAX_LINE_LENGTH); IDL_VPTR r = IDL_StrToSTRING(buffer); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_eof GD_EOF 2 2 KEYWORDS */ IDL_VPTR gdidl_get_eof(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char *field_code = IDL_VarGetString(argv[1]); gd_off64_t eof = gd_eof64(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_LONG64; r->value.l64 = (IDL_LONG64)eof; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_field_list GD_ENTRY_LIST 1 1 KEYWORDS */ /* the following alias is needed for backwards compatibility */ /* @@DLM: F gdidl_get_field_list GD_FIELD_LIST 1 1 KEYWORDS */ IDL_VPTR gdidl_get_field_list(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); unsigned int i, nentries, flags = 0; const char **list; const char *parent = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int type; IDL_STRING parent; int parent_x; int hidden, noalias, scalars, vectors, aliases; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.type = 0; kw.hidden = kw.noalias = kw.scalars = kw.vectors = kw.aliases = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { { "ALIASES", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(aliases) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "HIDDEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(hidden) }, { "NOALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noalias) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "SCALARS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(scalars) }, { "TYPE", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(type) }, { "VECTORS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(vectors) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.parent_x) parent = IDL_STRING_STR(&kw.parent); if (kw.hidden) flags |= GD_ENTRIES_HIDDEN; if (kw.noalias) flags |= GD_ENTRIES_NOALIAS; if (kw.type == 0) { if (kw.vectors) kw.type = GD_VECTOR_ENTRIES; else if (kw.scalars) kw.type = GD_SCALAR_ENTRIES; else if (kw.aliases) kw.type = GD_ALIAS_ENTRIES; } nentries = gd_nentries(D, parent, kw.type, flags); list = gd_entry_list(D, parent, kw.type, flags); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r; IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nentries, IDL_ARR_INI_ZERO, &r); for (i = 0; i < nentries; ++i) IDL_StrStore(data + i, (char*)list[i]); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_fragment_index GD_FRAGMENT_INDEX 2 2 KEYWORDS */ IDL_VPTR gdidl_get_fragment_index(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); char* field_code = IDL_VarGetString(argv[1]); int index = gd_fragment_index(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(index); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_fragmentname GD_FRAGMENTNAME 2 2 KEYWORDS */ IDL_VPTR gdidl_get_fragmentname(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); int index = (int)IDL_LongScalar(argv[1]); const char* name = gd_fragmentname(D, index); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_StrToSTRING((char*)name); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_framenum GD_FRAMENUM 3 3 KEYWORDS */ IDL_VPTR gdidl_get_framenum(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_LONG64 frame_start; IDL_LONG64 frame_end; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.frame_start = 0; kw.frame_end = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FIELD_START", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(frame_start) }, { "FIELD_END", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(frame_end) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); double value = IDL_DoubleScalar(argv[2]); double frame = gd_framenum_subset64(D, field_code, value, kw.frame_start, kw.frame_end); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_DOUBLE; r->value.d = frame; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_frameoffset GD_FRAMEOFFSET 1 1 KEYWORDS */ IDL_VPTR gdidl_get_frameoffset(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_off64_t foffs = gd_frameoffset64(D, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_LONG64; r->value.l64 = (long long)foffs; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_native_type GD_NATIVE_TYPE 2 2 KEYWORDS */ IDL_VPTR gdidl_get_native_type(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_type_t t = gd_native_type(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(t); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_nfields GD_NENTRIES 1 1 KEYWORDS */ /* the following alias is needed for backwards compatibility */ /* @@DLM: F gdidl_get_nfields GD_NFIELDS 1 1 KEYWORDS */ IDL_VPTR gdidl_get_nfields(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); unsigned int nentries, flags = 0; const char *parent = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int type; IDL_STRING parent; int parent_x; int aliases, hidden, noalias, scalars, vectors; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.type = 0; kw.hidden = kw.noalias = kw.scalars = kw.vectors = kw.aliases = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { { "ALIASES", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(aliases) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "HIDDEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(hidden) }, { "NOALIAS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noalias) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "SCALARS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(scalars) }, { "TYPE", IDL_TYP_UINT, 1, 0, 0, IDL_KW_OFFSETOF(type) }, { "VECTORS", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(vectors) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.parent_x) parent = IDL_STRING_STR(&kw.parent); if (kw.hidden) flags |= GD_ENTRIES_HIDDEN; if (kw.noalias) flags |= GD_ENTRIES_NOALIAS; if (kw.type == 0) { if (kw.vectors) kw.type = GD_VECTOR_ENTRIES; else if (kw.scalars) kw.type = GD_SCALAR_ENTRIES; else if (kw.aliases) kw.type = GD_ALIAS_ENTRIES; } nentries = gd_nentries(D, parent, kw.type, flags); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(nentries); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_nfragments GD_NFRAGMENTS 1 1 KEYWORDS */ IDL_VPTR gdidl_get_nfragments(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); unsigned int nfrags; GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); nfrags = gd_nfragments(D); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(nfrags); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_nframes GD_NFRAMES 1 1 KEYWORDS */ IDL_VPTR gdidl_get_nframes(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_off64_t nframes = gd_nframes64(D); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_LONG64; r->value.l64 = (IDL_LONG64)nframes; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_nvectors GD_NVECTORS 1 1 KEYWORDS */ IDL_VPTR gdidl_get_nvectors(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); unsigned int nfields; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); nfields = gd_nmvectors(D, parent); } else nfields = gd_nvectors(D); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(nfields); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_parent_fragment GD_PARENT_FRAGMENT 1 1 KEYWORDS */ IDL_VPTR gdidl_get_parent_fragment(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); int parent = gd_parent_fragment(D, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(parent); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_protection GD_PROTECTION 1 1 KEYWORDS */ IDL_VPTR gdidl_get_protection(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); int prot = gd_protection(D, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(prot); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_raw_filename GD_RAW_FILENAME 2 2 KEYWORDS */ IDL_VPTR gdidl_get_raw_filename(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* name = gd_raw_filename(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_StrToSTRING((char*)name); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_spf GD_SPF 2 2 KEYWORDS */ IDL_VPTR gdidl_get_spf(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); unsigned int spf = gd_spf(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpUInt(spf); dreturn("%p", r); return r; } /* GD_CARRAY_LEN is a deprecated alias */ /* @@DLM: F gdidl_array_len GD_CARRAY_LEN 2 2 KEYWORDS */ /* @@DLM: F gdidl_array_len GD_ARRAY_LEN 2 2 KEYWORDS */ IDL_VPTR gdidl_array_len(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); size_t len = gd_array_len(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpUInt(len); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_string GD_GET_STRING 2 2 KEYWORDS */ IDL_VPTR gdidl_get_string(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char buffer[GD_MAX_LINE_LENGTH]; GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_get_string(D, field_code, GD_MAX_LINE_LENGTH, buffer); IDL_VPTR r; if (gd_error(D)) { GDIDL_SET_ERROR(D); r = IDL_StrToSTRING(""); } else r = IDL_StrToSTRING(buffer); dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_strings GD_STRINGS 1 1 KEYWORDS */ IDL_VPTR gdidl_get_strings(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; unsigned int nstring; const char** strings; GDIDL_KW_INIT_ERROR; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); nstring = gd_nmfields_by_type(D, parent, GD_STRING_ENTRY); strings = gd_mstrings(D, parent); } else { nstring = gd_nfields_by_type(D, GD_STRING_ENTRY); strings = gd_strings(D); } IDL_VPTR r; if (nstring > 0) { int i; IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nstring, IDL_ARR_INI_ZERO, &r); for (i = 0; i < nstring; ++i) IDL_StrStore(data + i, (char*)strings[i]); } else IDL_MakeTempVector(IDL_TYP_STRING, 0, IDL_ARR_INI_ZERO, &r); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturn("%p", r); return r; } /* @@DLM: F gdidl_get_vector_list GD_VECTOR_LIST 1 1 KEYWORDS */ IDL_VPTR gdidl_get_vector_list(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int i; unsigned int nfields; const char** list; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; gd_type_t type; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); nfields = gd_nmvectors(D, parent); list = gd_mvector_list(D, parent); } else { nfields = gd_nvectors(D); list = gd_vector_list(D); } GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r; IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nfields, IDL_ARR_INI_ZERO, &r); for (i = 0; i < nfields; ++i) IDL_StrStore(data + i, (char*)list[i]); dreturn("%p", r); return r; } /* @@DLM: P gdidl_putdata GD_PUTDATA 3 3 KEYWORDS */ void gdidl_putdata(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_LONG64 first_frame; IDL_LONG64 first_sample; int first_frame_x, first_sample_x; } KW_RESULT; KW_RESULT kw; kw.first_frame = kw.first_sample = kw.first_frame_x = kw.first_sample_x = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x), IDL_KW_OFFSETOF(first_frame) }, { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x), IDL_KW_OFFSETOF(first_sample) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); if (kw.first_frame_x == 0 && kw.first_sample_x == 0) { kw.first_frame = GD_HERE; kw.first_sample = 0; } IDL_ENSURE_ARRAY(argv[2]); if (argv[2]->value.arr->n_dim != 1) GDIDL_KW_ABORT("data must be a vector, not a multidimensional array"); gd_off64_t n_samples = argv[2]->value.arr->n_elts; gd_putdata64(D, field_code, kw.first_frame, kw.first_sample, 0, n_samples, gdidl_gd_type(argv[2]->type), argv[2]->value.arr->data); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_put_constant GD_PUT_CONSTANT 3 3 KEYWORDS */ void gdidl_put_constant(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const void* data = gdidl_from_alltypes(argv[2]->type, &argv[2]->value); gd_put_constant(D, field_code, gdidl_gd_type(argv[2]->type), data); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_put_carray GD_PUT_CARRAY 3 3 KEYWORDS */ void gdidl_put_carray(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int start; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.start = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "START", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(start) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); IDL_ENSURE_ARRAY(argv[2]); if (argv[2]->value.arr->n_dim != 1) GDIDL_KW_ABORT("data must be a vector, not a multidimensional array"); int length = argv[2]->value.arr->n_elts; gd_put_carray_slice(D, field_code, kw.start, length, gdidl_gd_type(argv[2]->type), argv[2]->value.arr->data); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_put_string GD_PUT_STRING 3 3 KEYWORDS */ void gdidl_put_string(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* data = IDL_VarGetString(argv[2]); gd_put_string(D, field_code, data); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_invalid_dirfile GD_INVALID_DIRFILE 0 0 */ IDL_VPTR gdidl_invalid_dirfile(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); IDL_VPTR r = IDL_GettmpInt(gdidl_set_dirfile(gd_invalid_dirfile())); dreturn("%p", r); return r; } /* @@DLM: F gdidl_dirfile_standards GD_DIRFILE_STANDARDS 1 2 KEYWORDS */ IDL_VPTR gdidl_dirfile_standards(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int earliest; int current; int latest; } KW_RESULT; KW_RESULT kw; int vers = 16384; kw.earliest = kw.current = kw.latest = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "CURRENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(current) }, { "EARLIEST", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(earliest) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "LATEST", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(latest) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (argc > 1) vers = IDL_LongScalar(argv[1]); vers = gd_dirfile_standards(D, (vers != 16384) ? vers : kw.current ? GD_VERSION_CURRENT : kw.latest ? GD_VERSION_LATEST : kw.earliest ? GD_VERSION_EARLIEST : 16384); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(vers); dreturn("%p", r); return r; } /* @@DLM: F gdidl_seek GD_SEEK 2 2 KEYWORDS */ IDL_VPTR gdidl_seek(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; gd_off64_t frame_num; gd_off64_t sample_num; int whence; int write; } KW_RESULT; KW_RESULT kw; kw.whence = GD_SEEK_SET; kw.frame_num = kw.sample_num = 0; kw.write = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAME_NUM", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(frame_num) }, { "SAMPLE_NUM", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(sample_num) }, { "WHENCE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(whence) }, { "WRITE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(write) }, { NULL } }; argc = IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_off64_t pos = gd_seek64(D, field_code, kw.frame_num, kw.sample_num, (kw.whence & (GD_SEEK_SET | GD_SEEK_CUR | GD_SEEK_END)) | (kw.write ? GD_SEEK_WRITE : 0)); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_LONG64; r->value.l64 = (IDL_LONG64)pos; dreturn("%p", r); return r; } /* @@DLM: F gdidl_tell GD_TELL 2 2 KEYWORDS */ IDL_VPTR gdidl_tell(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_off64_t pos = gd_tell64(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_Gettmp(); r->type = IDL_TYP_LONG64; r->value.l64 = (IDL_LONG64)pos; dreturn("%p", r); return r; } /* @@DLM: F gdidl_hidden GD_HIDDEN 2 2 KEYWORDS */ IDL_VPTR gdidl_hidden(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); int hidden = gd_hidden(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(hidden); dreturn("%p", r); return r; } /* @@DLM: P gdidl_hide GD_HIDE 2 2 KEYWORDS */ void gdidl_hide(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_hide(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_unhide GD_UNHIDE 2 2 KEYWORDS */ void gdidl_unhide(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); gd_unhide(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_window GD_ADD_WINDOW 5 5 KEYWORDS */ void gdidl_add_window(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); gd_windop_t windop; gd_triplet_t threshold; int nop = 0; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING parent; int eq, ne, le, lt, gt, ge, set, clr; int parent_x; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.eq = kw.ne = kw.le = kw.lt = kw.gt = kw.ge = kw.set = kw.clr = 0; kw.fragment_index = kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { { "CLR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(clr) }, { "EQ", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(eq) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "GE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ge) }, { "GT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(gt) }, { "LE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(le) }, { "LT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(lt) }, { "NE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ne) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { "SET", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(set) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); const char* check = IDL_VarGetString(argv[3]); /* check operator */ if (kw.eq) { windop = GD_WINDOP_EQ; nop++; } if (kw.ne) { windop = GD_WINDOP_NE; nop++; } if (kw.le) { windop = GD_WINDOP_LE; nop++; } if (kw.lt) { windop = GD_WINDOP_LT; nop++; } if (kw.ge) { windop = GD_WINDOP_GE; nop++; } if (kw.gt) { windop = GD_WINDOP_GT; nop++; } if (kw.set) { windop = GD_WINDOP_SET; nop++; } if (kw.clr) { windop = GD_WINDOP_CLR; nop++; } if (nop > 1) GDIDL_KW_ABORT("Multiple operations specified"); else if (nop == 0) GDIDL_KW_ABORT("No operation specified"); switch (windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: threshold.i = IDL_Long64Scalar(argv[4]); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: threshold.u = IDL_ULong64Scalar(argv[4]); break; default: threshold.r = IDL_DoubleScalar(argv[4]); break; } if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_window(D, parent, field_code, in_field, check, windop, threshold); } else gd_add_window(D, field_code, in_field, check, windop, threshold, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_add_mplex GD_ADD_MPLEX 5 5 KEYWORDS */ void gdidl_add_mplex(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING parent; int parent_x; int fragment_index; int max; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = kw.parent_x = kw.max = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "MAX", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(max) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* in_field = IDL_VarGetString(argv[2]); const char* count = IDL_VarGetString(argv[3]); int val = IDL_LongScalar(argv[4]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_mplex(D, parent, field_code, in_field, count, val, kw.max); } else gd_add_mplex(D, field_code, in_field, count, val, kw.max, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_window GD_ALTER_WINDOW 2 2 KEYWORDS */ void gdidl_alter_window(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int nop = 0; const char* in_field = NULL; const char* check = NULL; gd_triplet_t threshold; gd_windop_t windop = GD_WINDOP_UNK; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_VPTR threshold; int eq, ne, le, lt, gt, ge, set, clr; int threshold_x; IDL_STRING in_field; int in_field_x; IDL_STRING check; int check_x; } KW_RESULT; KW_RESULT kw; threshold.r = 0; kw.check_x = kw.in_field_x = kw.threshold_x = 0; kw.eq = kw.ne = kw.le = kw.lt = kw.gt = kw.ge = kw.set = kw.clr = 0; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "CHECK_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(check_x), IDL_KW_OFFSETOF(check) }, { "CLR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(clr) }, { "EQ", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(eq) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "GE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ge) }, { "GT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(gt) }, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x), IDL_KW_OFFSETOF(in_field) }, { "LE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(le) }, { "LT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(lt) }, { "NE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ne) }, { "SET", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(set) }, { "THRESHOLD", 0, 1, IDL_KW_VIN, IDL_KW_OFFSETOF(threshold_x), IDL_KW_OFFSETOF(threshold) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); /* count operators */ if (kw.eq) { windop = GD_WINDOP_EQ; nop++; } if (kw.ne) { windop = GD_WINDOP_NE; nop++; } if (kw.le) { windop = GD_WINDOP_LE; nop++; } if (kw.lt) { windop = GD_WINDOP_LT; nop++; } if (kw.ge) { windop = GD_WINDOP_GE; nop++; } if (kw.gt) { windop = GD_WINDOP_GT; nop++; } if (kw.set) { windop = GD_WINDOP_SET; nop++; } if (kw.clr) { windop = GD_WINDOP_CLR; nop++; } if (nop > 1) GDIDL_KW_ABORT("Multiple operations specified"); /* Need the current windop and/or threshold */ if (nop == 0 || !kw.threshold_x) { gd_entry_t E; gd_entry(D, field_code, &E); gd_free_entry_strings(&E); if (gd_error(D)) { GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); return; } if (nop == 0) windop = E.windop; if (!kw.threshold_x) threshold = E.threshold; } if (kw.in_field_x) in_field = IDL_STRING_STR(&kw.in_field); if (kw.check_x) check = IDL_STRING_STR(&kw.check); if (kw.threshold_x) { switch (windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: threshold.i = IDL_Long64Scalar(kw.threshold); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: threshold.u = IDL_ULong64Scalar(kw.threshold); break; default: threshold.r = IDL_DoubleScalar(kw.threshold); break; } } gd_alter_window(D, field_code, in_field, check, windop, threshold); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_mplex GD_ALTER_MPLEX 2 2 KEYWORDS */ void gdidl_alter_mplex(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char* in_field1 = NULL; const char* in_field2 = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int val, val_x, period; IDL_STRING in_field1; int in_field1_x; IDL_STRING in_field2; int in_field2_x; } KW_RESULT; KW_RESULT kw; kw.in_field1_x = kw.in_field2_x = kw.val_x = 0; kw.period = -1; GDIDL_KW_INIT_ERROR; static IDL_KW_PAR kw_pars[] = { { "COUNT_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x), IDL_KW_OFFSETOF(in_field2) }, { "COUNT_VAL", IDL_TYP_INT, 1, 0, IDL_KW_OFFSETOF(val_x), IDL_KW_OFFSETOF(val) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x), IDL_KW_OFFSETOF(in_field1) }, { "PERIOD", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(period) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); /* no value specified, figure out the previous value */ if (!kw.val_x) { gd_entry_t E; gd_entry(D, field_code, &E); kw.val = E.count_val; } if (!gd_error(D)) { if (kw.in_field1_x) in_field1 = IDL_STRING_STR(&kw.in_field1); if (kw.in_field2_x) in_field2 = IDL_STRING_STR(&kw.in_field2); gd_alter_mplex(D, field_code, in_field1, in_field2, kw.val, kw.period); } GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_naliases GD_NALIASES 2 2 KEYWORDS */ IDL_VPTR gdidl_naliases(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); unsigned int nalias; GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); nalias = gd_naliases(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpUInt(nalias); dreturn("%p", r); return r; } /* @@DLM: F gdidl_alias_target GD_ALIAS_TARGET 2 2 KEYWORDS */ IDL_VPTR gdidl_alias_target(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* name = gd_alias_target(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_StrToSTRING((char*)name); dreturn("%p", r); return r; } /* @@DLM: F gdidl_aliases GD_ALIASES 2 2 KEYWORDS */ IDL_VPTR gdidl_aliases(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int i; unsigned int nalias; const char** list; GDIDL_KW_ONLY_ERROR; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); nalias = gd_naliases(D, field_code); list = gd_aliases(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r; IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, nalias, IDL_ARR_INI_ZERO, &r); for (i = 0; i < nalias; ++i) IDL_StrStore(data + i, (char*)list[i]); dreturn("%p", r); return r; } /* @@DLM: P gdidl_add_alias GD_ADD_ALIAS 3 3 KEYWORDS */ void gdidl_add_alias(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING parent; int parent_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; kw.parent_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x), IDL_KW_OFFSETOF(parent) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char* field_code = IDL_VarGetString(argv[1]); const char* target = IDL_VarGetString(argv[2]); if (kw.parent_x) { const char* parent = IDL_STRING_STR(&kw.parent); gd_madd_alias(D, parent, field_code, target); } else gd_add_alias(D, field_code, target, kw.fragment_index); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_alter_affixes GD_ALTER_AFFIXES 1 1 KEYWORDS */ void gdidl_alter_affixes(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char *prefix = NULL; char *suffix = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; IDL_STRING prefix; int prefix_x; IDL_STRING suffix; int suffix_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = kw.prefix_x = kw.suffix_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { "PREFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(prefix_x), IDL_KW_OFFSETOF(prefix) }, { "SUFFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(suffix_x), IDL_KW_OFFSETOF(suffix) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.prefix_x) prefix = IDL_STRING_STR(&kw.prefix); if (kw.suffix_x) suffix = IDL_STRING_STR(&kw.suffix); gd_alter_affixes(D, kw.fragment_index, prefix, suffix); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_fragment_affixes GD_FRAGMENT_AFFIXES 1 1 KEYWORDS */ IDL_VPTR gdidl_fragment_affixes(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char *prefix; char *suffix; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int fragment_index; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.fragment_index = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_fragment_affixes(D, kw.fragment_index, &prefix, &suffix); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r; IDL_STRING *data = (IDL_STRING*)IDL_MakeTempVector(IDL_TYP_STRING, 2, IDL_ARR_INI_ZERO, &r); IDL_StrStore(data, prefix); IDL_StrStore(data + 1, suffix); free(prefix); free(suffix); dreturn("%p", r); return r; } /* @@DLM: F gdidl_strtok GD_STRTOK 1 1 KEYWORDS */ IDL_VPTR gdidl_strtok(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); const char *string = NULL; char *token; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING string; int string_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.string_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "STRING", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(string_x), IDL_KW_OFFSETOF(string) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.string_x) string = IDL_STRING_STR(&kw.string); token = gd_strtok(D, string); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_StrToSTRING(token); free(token); dreturn("%p", r); return r; } /* @@DLM: F gdidl_desync GD_DESYNC 1 1 KEYWORDS */ IDL_VPTR gdidl_desync(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int ret; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int pathcheck; int reopen; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.pathcheck = kw.reopen = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PATHCHECK", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pathcheck) }, { "REOPEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(reopen) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); ret = gd_desync(D, (kw.pathcheck ? GD_DESYNC_PATHCHECK : 0) | (kw.reopen ? GD_DESYNC_REOPEN : 0)); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpInt(ret); dreturn("%p", r); return r; } /* @@DLM: F gdidl_flags GD_FLAGS 1 1 KEYWORDS */ IDL_VPTR gdidl_flags(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); unsigned long flags, set = 0, reset = 0; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; short int pretty, verbose; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.pretty = kw.verbose = -1; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PRETTY_PRINT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pretty) }, { "VERBOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(verbose) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (kw.pretty == 1) set |= GD_PRETTY_PRINT; else if (kw.pretty == 0) reset |= GD_PRETTY_PRINT; if (kw.verbose == 1) set |= GD_VERBOSE; else if (kw.verbose == 0) reset |= GD_VERBOSE; DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); flags = gd_flags(D, set, reset); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_GettmpLong(flags); dreturn("%p", r); return r; } /* @@DLM: P gdidl_verbose_prefix GD_VERBOSE_PREFIX 1 1 KEYWORDS */ void gdidl_verbose_prefix(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); char *prefix = NULL; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; IDL_STRING prefix; int prefix_x; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.prefix_x = 0; static IDL_KW_PAR kw_pars[] = { GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { "PREFIX", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(prefix_x), IDL_KW_OFFSETOF(prefix) }, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); if (kw.prefix_x) prefix = IDL_STRING_STR(&kw.prefix); gd_verbose_prefix(D, prefix); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: P gdidl_mplex_lookback GD_MPLEX_LOOKBACK 1 2 KEYWORDS */ void gdidl_mplex_lookback(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); int lookback = GD_DEFAULT_LOOKBACK; typedef struct { IDL_KW_RESULT_FIRST_FIELD; GDIDL_KW_RESULT_ERROR; int all; } KW_RESULT; KW_RESULT kw; GDIDL_KW_INIT_ERROR; kw.all = 0; static IDL_KW_PAR kw_pars[] = { { "ALL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(all) }, GDIDL_KW_PAR_ERROR, GDIDL_KW_PAR_ESTRING, { NULL } }; IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw); if (kw.all) lookback = GD_LOOKBACK_ALL; else if (argc > 1) lookback = IDL_LongScalar(argv[1]); DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); gd_mplex_lookback(D, lookback); GDIDL_SET_ERROR(D); IDL_KW_FREE; dreturnvoid(); } /* @@DLM: F gdidl_get_linterp_tablename GD_LINTERP_TABLENAME 2 2 KEYWORDS */ IDL_VPTR gdidl_get_linterp_tablename(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); GDIDL_KW_ONLY_ERROR; DIRFILE* D = gdidl_get_dirfile(IDL_LongScalar(argv[0])); const char *field_code = IDL_VarGetString(argv[1]); char *name = gd_linterp_tablename(D, field_code); GDIDL_SET_ERROR(D); IDL_KW_FREE; IDL_VPTR r = IDL_StrToSTRING(name); free(name); dreturn("%p", r); return r; } /* @@DLM: F gdidl_encoding_support GD_ENCODING_SUPPORT 1 1 */ IDL_VPTR gdidl_encoding_support(int argc, IDL_VPTR argv[], char *argk) { dtraceidl(); IDL_VPTR r = IDL_GettmpInt(gd_encoding_support(IDL_LongScalar(argv[0]))); dreturn("%p", r); return r; } /**** Module initialisation ****/ /* These are defined in the automatically generated sublist.c */ extern IDL_SYSFUN_DEF2 gdidl_procs[]; extern int gdidl_n_procs; extern IDL_SYSFUN_DEF2 gdidl_funcs[]; extern int gdidl_n_funcs; /* These are defined in the automatically generated constants.c */ extern IDL_STRUCT_TAG_DEF gdidl_constants[]; /* @@DLM: F gdidl_generate_constants GETDATA_CONSTANTS 0 0 */ extern IDL_VPTR gdidl_generate_constants(int argc, IDL_VPTR argv[], char *argk); /* GD_ENTRY structure form */ static IDL_MEMINT lincom_dims[] = { 1, GD_MAX_LINCOM }; static IDL_MEMINT polynom_dims[] = { 1, GD_MAX_POLYORD + 1 }; static IDL_STRUCT_TAG_DEF gdidl_entry[] = { { "FIELD", 0, (void*)IDL_TYP_STRING }, { "FIELD_TYPE", 0, (void*)IDL_TYP_INT }, { "FLAGS", 0, (void*)IDL_TYP_UINT }, { "FRAGMENT", 0, (void*)IDL_TYP_INT }, { "IN_FIELDS", lincom_dims, (void*)IDL_TYP_STRING }, { "A", polynom_dims, (void*)IDL_TYP_DOUBLE }, /* POLYNOM */ { "CA", polynom_dims, (void*)IDL_TYP_DCOMPLEX }, /* POLYNOM */ { "ARRAY_LEN", 0, (void*)IDL_TYP_INT }, /* CARRAY */ { "B", lincom_dims, (void*)IDL_TYP_DOUBLE }, /* LINCOM */ { "CB", lincom_dims, (void*)IDL_TYP_DCOMPLEX }, /* LINCOM */ { "BITNUM", 0, (void*)IDL_TYP_INT }, /* (S)BIT */ { "COUNT_VAL", 0, (void*)IDL_TYP_INT }, /* MPLEX */ { "DATA_TYPE", 0, (void*)IDL_TYP_INT }, /* RAW / CONST / CARRAY */ { "DIVIDEND", 0, (void*)IDL_TYP_DOUBLE }, /* RECIP */ { "CDIVIDEND", 0, (void*)IDL_TYP_DCOMPLEX }, /* RECIP */ { "M", lincom_dims, (void*)IDL_TYP_DOUBLE }, /* LINCOM */ { "CM", lincom_dims, (void*)IDL_TYP_DCOMPLEX }, /* LINCOM */ { "N_FIELDS", 0, (void*)IDL_TYP_INT }, /* LINCOM */ { "NUMBITS", 0, (void*)IDL_TYP_INT }, /* (S)BIT */ { "PERIOD", 0, (void*)IDL_TYP_INT }, /* MPLEX */ { "POLY_ORD", 0, (void*)IDL_TYP_INT }, /* POLYNOM */ { "SCALAR", polynom_dims, (void*)IDL_TYP_STRING }, { "SCALAR_IND", polynom_dims, (void*)IDL_TYP_INT }, { "SHIFT", 0, (void*)IDL_TYP_LONG }, /* PHASE */ { "SPF", 0, (void*)IDL_TYP_UINT }, /* RAW */ { "TABLE", 0, (void*)IDL_TYP_STRING }, /* LINTERP */ { "UTHRESHOLD", 0, (void*)IDL_TYP_ULONG }, /* WINDOW */ { "ITHRESHOLD", 0, (void*)IDL_TYP_LONG }, /* WINDOW */ { "RTHRESHOLD", 0, (void*)IDL_TYP_DOUBLE }, /* WINDOW */ { "WINDOP", 0, (void*)IDL_TYP_INT }, /* WINDOW */ { NULL } }; int IDL_Load(void) { dtracevoid(); IDL_SysRtnAdd(gdidl_procs, IDL_FALSE, gdidl_n_procs); IDL_SysRtnAdd(gdidl_funcs, IDL_TRUE, gdidl_n_funcs); /* entry struct */ gdidl_entry_def = IDL_MakeStruct("GD_ENTRY", gdidl_entry); gdidl_const_def = IDL_MakeStruct("GD_CONSTANTS", gdidl_constants); dreturn("%i", 1); return 1; } libgetdata-0.9.0/bindings/idl/makedlm.sh.in0000640000175000017500000000501712614323564020727 0ustar alastairalastair#!/bin/sh # Copyright (C) 2009, 2010 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # @configure_input@ GREP=@GREP@ DATE=@DATE@ opt=$1 in=$2 if test "x$DATE" == "xnot found"; then BUILD_DATE="unspecified" else BUILD_DATE=`date` fi if test "$opt" = "-c"; then cat < #include EOF else cat < STRUCTURE GD_ENTRY EOF fi $GREP @@DLM $in | sort -k 5 | { nfunc=0 nproc=0 while read sc magic type func idl min max key extra; do if test "$opt" = "-c"; then if test "x$key" == "xKEYWORDS"; then key=IDL_SYSFUN_DEF_F_KEYWORDS; else key=0; fi if test $type == "F"; then echo "extern IDL_VPTR $func(int argc, IDL_VPTR argv[], char *argk);" if test -n "$funcstruct"; then funcstruct="$funcstruct, "; fi funcstruct="$funcstruct { { (IDL_SYSRTN_GENERIC)$func }, \"$idl\", $min, $max, $key, 0 }" (( nfunc=nfunc+1 )) else echo "extern void $func(int argc, IDL_VPTR argv[], char *argk);" if test -n "$procstruct"; then procstruct="$procstruct, "; fi procstruct="$procstruct { { (IDL_SYSRTN_GENERIC)$func }, \"$idl\", $min, $max, $key, 0 }" (( nproc=nproc+1 )) fi else if test "x$key" == "xKEYWORDS"; then key=" KEYWORDS"; else key=; fi if test $type == "F"; then type="FUNCTION "; else type="PROCEDURE"; fi echo "$type $idl $min $max$key" fi; done if test "$opt" = "-c"; then echo "int gdidl_n_procs=$nproc; IDL_SYSFUN_DEF2 gdidl_procs[] = { $procstruct };" echo "int gdidl_n_funcs=$nfunc; IDL_SYSFUN_DEF2 gdidl_funcs[] = { $funcstruct };" fi; } libgetdata-0.9.0/bindings/matlab/0000740000175000017500000000000012614323564017037 5ustar alastairalastairlibgetdata-0.9.0/bindings/matlab/gd_alter_divide.m0000640000175000017500000000307612614323564022332 0ustar alastairalastairfunction gd_alter_divide(D, field_code, in1, in2) % GD_ALTER_DIVIDE Modify the metadata of a DIVIDE field % % GD_ALTER_DIVIDE(DIRFILE,NAME,INPUT1,INPUT2) % modifies the metadata of the DIVIDE field called NAME in the % dirfile specified by DIRFILE. The input fields are set to INPUT1, % and INPUT2, if non-zero. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_divide(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.DIVIDE_ENTRY, ... 'in_fields', {{in1; in2}}), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_mplex.m0000640000175000017500000000335612614323564022214 0ustar alastairalastairfunction gd_alter_mplex(D, field_code, in1, in2, count_val, period) % GD_ALTER_MPLEX Modify the metadata of a MPLEX field % % GD_ALTER_MPLEX(DIRFILE,NAME,INPUT1,INPUT2,COUNT_VAL,COUNT_MAX) % modifies the metadata of the MPLEX field called NAME in the % dirfile specified by DIRFILE. The input fields are set to INPUT1, % and INPUT2, if non-zero, and the count value and maximum are set % to COUNT_VAL and COUNT_MAX, respectively. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_mplex(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.MPLEX_ENTRY, ... 'in_fields', {{in1; in2}}, 'count_val', count_val, ... 'period', period), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_unhide.c0000640000175000017500000000305612614323564021137 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_UNHIDE Unhide a field % % GD_UNHIDE(DIRFILE,FIELD_CODE) % unhides the field called FIELD_CODE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_unhide(3) in section 3 % of the UNIX manual for more details. % % See also GD_HIDDEN, GD_HIDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; GDMX_NO_LHS; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); gd_unhide(D, field_code); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_carray.m0000640000175000017500000000333212614323564022342 0ustar alastairalastairfunction gd_alter_carray(D, field_code, const_type, array_len) % GD_ALTER_CARRAY Modify the metadata of a CARRAY field % % GD_ALTER_CARRAY(DIRFILE,NAME,TYPE,LEN) % modifies the metadata of the CARRAY field called NAME in the % dirfile specified by DIRFILE. The storage type is set to TYPE, % which should be one of the data type symbols provided by % GETDATA_CONSTANTS, and the length of the CARRAY is set to LEN. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_carray(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN, GETDATA_CONSTANTS GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.CARRAY_ENTRY, ... 'const_type', const_type, 'array_len', array_len), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_lincom.m0000640000175000017500000000334212614323564022343 0ustar alastairalastairfunction gd_alter_lincom(D, field_code, in_fields, m, b) % GD_ALTER_LINCOM Modify the metadata of a LINCOM field % % GD_ALTER_LINCOM(DIRFILE,NAME,INPUTS,M,B) % modifies the metadata of the LINCOM field called NAME in the % dirfile specified by DIRFILE. The input fields are set according % to INPUT; changing the length of this cell array changes the % number of input fields in the dirfile. The slope and offsets are % set to M and B. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_lincom(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.LINCOM_ENTRY, ... 'in_fields', {in_fields}, 'm', m, 'b', b), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add_phase.m0000640000175000017500000000321512614323564021602 0ustar alastairalastairfunction gd_add_phase(D, field_code, in_fields, shift, fragment_index) % GD_ADD_PHASE Add a PHASE field % % GD_ADD_PHASE(DIRFILE,NAME,INPUT,SHIFT,FRAGMENT) % adds a PHASE field called NAME to the dirfile specified by % DIRFILE. The input field is INPUT and the phase shift is SHIFT. % The field is added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_phase(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_PHASE, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.PHASE_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {in_fields}, 'shift', shift)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add.c0000640000175000017500000000323012614323564020405 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ADD Add a field % % GD_ADD(DIRFILE,ENTRY) % adds a field described by ENTRY to the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % The ENTRY object should be an entry struct; see GETDATA and gd_entry(3) in % the UNIX manual for details. % % See the documentation on the C API function gd_add(3) in section 3 % of the UNIX manual for more details. % % See also GD_MADD, GD_OPEN, GETDATA */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; gd_entry_t *E; GDMX_NO_LHS; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); E = gdmx_to_entry(prhs, 1, 0); gd_add(D, E); gdmx_free_entry(E); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_madd_bit.m0000640000175000017500000000317212614323564021437 0ustar alastairalastairfunction gd_madd_bit(D, parent, field_code, in_fields, bitnum, numbits) % GD_MADD_BIT Add a BIT metafield % % GD_MADD_BIT(DIRFILE,PARENT,NAME,INPUT,BITNUM,NUMBITS) % adds a BIT metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input field is INPUT, the first bit is % BITNUM and the length is NUMBITS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_bit(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_BIT, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.BIT_ENTRY, ... 'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/Makefile.in0000640000175000017500000011055312614323564021113 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/matlab DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/make_contents.sh.in $(dist_matlab_SCRIPTS) \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = make_contents.sh 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)$(matlabdir)" \ "$(DESTDIR)$(matlabdir)" LTLIBRARIES = $(lib_LTLIBRARIES) @GD_EXTERNAL_FALSE@libgetdata_matlab_la_DEPENDENCIES = \ @GD_EXTERNAL_FALSE@ ../../src/libgetdata.la am_libgetdata_matlab_la_OBJECTS = libgetdata_matlab_la-matlab.lo libgetdata_matlab_la_OBJECTS = $(am_libgetdata_matlab_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 = libgetdata_matlab_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdata_matlab_la_LDFLAGS) \ $(LDFLAGS) -o $@ SCRIPTS = $(dist_matlab_SCRIPTS) $(nodist_matlab_SCRIPTS) 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)/src 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 = $(libgetdata_matlab_la_SOURCES) DIST_SOURCES = $(libgetdata_matlab_la_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-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_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2013-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SUBDIRS = test matlabdir = $(matlabbasedir)/getdata matlabfiles = gd_add_bit.m gd_add_divide.m gd_add_lincom.m gd_add_linterp.m \ gd_add_mplex.m gd_add_multiply.m gd_add_phase.m gd_add_polynom.m \ gd_add_raw.m gd_add_recip.m gd_add_sbit.m gd_add_window.m \ gd_alter_bit.m gd_alter_carray.m gd_alter_const.m \ gd_alter_divide.m gd_alter_lincom.m gd_alter_linterp.m \ gd_alter_mplex.m gd_alter_multiply.m gd_alter_phase.m \ gd_alter_polynom.m gd_alter_raw.m gd_alter_recip.m gd_alter_sbit.m \ gd_alter_window.m gd_field_list_by_type.m gd_field_list.m \ gd_get_constant.m gd_madd_bit.m gd_madd_divide.m gd_madd_lincom.m \ gd_madd_linterp.m gd_madd_mplex.m gd_madd_multiply.m \ gd_madd_phase.m gd_madd_polynom.m gd_madd_recip.m gd_madd_sbit.m \ gd_madd_window.m gd_mfield_list_by_type.m gd_mfield_list.m \ gd_mvector_list.m gd_nfields_by_type.m gd_nfields.m \ gd_nmfields_by_type.m gd_nmfields.m gd_nmvectors.m gd_nvectors.m \ gd_put_carray.m gd_put_constant.m gd_vector_list.m \ getdata_constants.m mexfiles = gd_add gd_add_alias \ gd_add_carray gd_add_const \ gd_add_spec gd_add_string gd_aliases \ gd_alias_target gd_alter_affixes \ gd_alter_encoding gd_alter_endianness gd_alter_entry \ gd_alter_frameoffset \ gd_alter_protection gd_alter_spec gd_bof gd_array_len gd_carrays \ gd_close gd_constants gd_delete gd_desync \ gd_dirfilename gd_dirfile_standards \ gd_discard gd_encoding gd_encoding_support gd_endianness \ gd_entry gd_entry_list gd_entry_type gd_eof \ gd_error gd_error_string gd_flags gd_flush gd_fragment_affixes \ gd_fragment_index gd_fragmentname \ gd_framenum gd_frameoffset gd_get_carray gd_get_carray_slice \ gd_getdata \ gd_get_string gd_hidden gd_hide gd_include gd_invalid_dirfile \ gd_linterp_tablename gd_madd gd_madd_alias \ gd_madd_carray gd_madd_const \ gd_madd_spec gd_madd_string \ gd_malter_spec gd_mcarrays \ gd_mconstants gd_metaflush gd_move gd_mplex_lookback \ gd_mstrings gd_naliases gd_native_type gd_nentries gd_nfragments \ gd_nframes gd_open gd_parent_fragment gd_protection \ gd_put_carray_slice \ gd_putdata gd_put_string gd_raw_close gd_raw_filename \ gd_reference gd_rename gd_rewrite_fragment \ gd_seek gd_spf gd_strings gd_strtok \ gd_sync gd_tell gd_unhide gd_uninclude gd_validate gd_verbose_prefix matlabcfiles = $(addsuffix .c,${mexfiles}) matlabmexfiles = $(addsuffix .@mexext@,${mexfiles}) matlabdocfiles = $(addsuffix .m,${mexfiles}) EXTRA_DIST = $(matlabcfiles) doc.tail Contents.m.head dist_matlab_SCRIPTS = $(matlabfiles) nodist_matlab_SCRIPTS = Contents.m getdata_constants.m $(matlabmexfiles) \ $(matlabdocfiles) lib_LTLIBRARIES = libgetdata-matlab.la @GD_EXTERNAL_FALSE@libgetdata_matlab_la_LIBADD = ../../src/libgetdata.la @GD_EXTERNAL_TRUE@libgetdata_matlab_la_LIBADD = $(GETDATA_LIBS) @GD_EXTERNAL_FALSE@AM_CPPFLAGS = -I${top_srcdir}/src -I../../src @GD_EXTERNAL_TRUE@AM_CPPFLAGS = $(GETDATA_CFLAGS) @GD_EXTERNAL_FALSE@GDMX_LIBS = -L../../src/.libs -lgetdata @GD_EXTERNAL_TRUE@GDMX_LIBS = $(GETDATA_LIBS) libgetdata_matlab_la_SOURCES = matlab.c gd_matlab.h libgetdata_matlab_la_CPPFLAGS = ${MATLAB_CPPFLAGS} ${AM_CPPFLAGS} libgetdata_matlab_la_LDFLAGS = -version-info @MATLABGETDATA_VERSION@ all: all-recursive .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 bindings/matlab/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/matlab/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): make_contents.sh: $(top_builddir)/config.status $(srcdir)/make_contents.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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}; \ } libgetdata-matlab.la: $(libgetdata_matlab_la_OBJECTS) $(libgetdata_matlab_la_DEPENDENCIES) $(EXTRA_libgetdata_matlab_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdata_matlab_la_LINK) -rpath $(libdir) $(libgetdata_matlab_la_OBJECTS) $(libgetdata_matlab_la_LIBADD) $(LIBS) install-dist_matlabSCRIPTS: $(dist_matlab_SCRIPTS) @$(NORMAL_INSTALL) @list='$(dist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(matlabdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(matlabdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(matlabdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(matlabdir)$$dir" || exit $$?; \ } \ ; done uninstall-dist_matlabSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(dist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(matlabdir)'; $(am__uninstall_files_from_dir) install-nodist_matlabSCRIPTS: $(nodist_matlab_SCRIPTS) @$(NORMAL_INSTALL) @list='$(nodist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(matlabdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(matlabdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(matlabdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(matlabdir)$$dir" || exit $$?; \ } \ ; done uninstall-nodist_matlabSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(nodist_matlab_SCRIPTS)'; test -n "$(matlabdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(matlabdir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdata_matlab_la-matlab.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 -o $@ $< .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 -o $@ `$(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 $@ $< libgetdata_matlab_la-matlab.lo: matlab.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdata_matlab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdata_matlab_la-matlab.lo -MD -MP -MF $(DEPDIR)/libgetdata_matlab_la-matlab.Tpo -c -o libgetdata_matlab_la-matlab.lo `test -f 'matlab.c' || echo '$(srcdir)/'`matlab.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdata_matlab_la-matlab.Tpo $(DEPDIR)/libgetdata_matlab_la-matlab.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='matlab.c' object='libgetdata_matlab_la-matlab.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdata_matlab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdata_matlab_la-matlab.lo `test -f 'matlab.c' || echo '$(srcdir)/'`matlab.c 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(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-recursive 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" cscopelist: cscopelist-recursive 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 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 $(LTLIBRARIES) $(SCRIPTS) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(matlabdir)" "$(DESTDIR)$(matlabdir)"; 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-libLTLIBRARIES clean-libtool clean-local \ 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-dist_matlabSCRIPTS \ install-nodist_matlabSCRIPTS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-libLTLIBRARIES 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: uninstall-dist_matlabSCRIPTS uninstall-libLTLIBRARIES \ uninstall-nodist_matlabSCRIPTS .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libLTLIBRARIES \ clean-libtool clean-local cscopelist-am ctags ctags-am \ 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-dist_matlabSCRIPTS install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man \ install-nodist_matlabSCRIPTS 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-am uninstall uninstall-am \ uninstall-dist_matlabSCRIPTS uninstall-libLTLIBRARIES \ uninstall-nodist_matlabSCRIPTS %.m: %.c ${srcdir}/doc.tail ${GREP} '^ %' $< | ${SED} -e 's/^ //' > $@ cat ${srcdir}/doc.tail >> $@ %.@mexext@: %.c libgetdata-matlab.la ${MEX} ${AM_CPPFLAGS} -L.libs -lgetdata-matlab $(GDMX_LIBS) $< Contents.m: ${srcdir}/Contents.m.head make_contents.sh $(matlabfiles) \ $(matlabdocfiles) ${srcdir}/doc.tail ${SHELL} ./make_contents.sh ${srcdir} > $@ cat ${srcdir}/doc.tail >> $@ getdata_constants.m: ../make_parameters ../make_parameters m > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters clean-local: rm -rf $(nodist_matlab_SCRIPTS) # 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: libgetdata-0.9.0/bindings/matlab/gd_dirfile_standards.c0000640000175000017500000000356312614323564023347 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_DIRFILE_STANDARDS Change or report the Dirfile Standards Version % % V = GD_DIRFILE_STANDARDS(DIRFILE[,VERSION]) % if given, sets the standards version of DIRFILE to VERSION, which % may be a literal number or else one of the GD.VERSION_... symbols % provided by GETDATA_CONSTANTS. Returns the current version % number, V, after possibly changing it. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_dirfile_standards(3) in % section 3 of the UNIX manual for more details. % % See also GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int n, v = GD_VERSION_CURRENT; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) v = gdmx_to_int(prhs, 1); n = gd_dirfile_standards(D, v); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_error_string.c0000640000175000017500000000360412614323564022401 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ERROR_STRING retrieve the library error string % % S = GD_ERROR_STRING(DIRFILE) % returns the error string, S, associated with the last call to the % C GetData library. Since the MATLAB bindings throw exceptions % on library error, it is only ever useful to use this inside a % CATCH block after a GetData Library error has been thrown. In % this case, the .message member of thrown MEXCEPTION object also % contains this string. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_error_string(3) in section 3 % of the UNIX manual for more details. % % See also GD_ERROR, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *s; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); s = gd_error_string(D, NULL, 0); plhs[0] = gdmx_from_string(s); free(s); } libgetdata-0.9.0/bindings/matlab/gd_rename.c0000640000175000017500000000352012614323564021126 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_RENAME Rename a field or alias % % GD_RENAME(DIRFILE,OLD_NAME,NEW_NAME[,FLAGS]) % renames the field called OLD_NAME to NEW_NAME. If given, FLAGS % should be zero or more of the GD.REN_... symbols provided by % GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_rename(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code, *new_code; unsigned int flags = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(3,4); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); new_code = gdmx_to_string(prhs, 2, 0); if (nrhs > 3) flags = gdmx_to_uint(prhs, 3); gd_rename(D, field_code, new_code, flags); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_add_raw.m0000640000175000017500000000336212614323564021276 0ustar alastairalastairfunction gd_add_raw(D, field_code, data_type, spf, fragment_index) % GD_ADD_RAW Add a RAW field % % GD_ADD_RAW(DIRFILE,NAME,TYPE,SPF,FRAGMENT) % adds a RAW field called NAME to the dirfile specified by % DIRFILE. The type of the raw data is given by TYPE, which should % be one of the data types provided by GETDATA_CONSTANTS(). The % samples-per-frame of the field is given by SPF. The field is % added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_raw(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.RAW_ENTRY, ... 'fragment_index', fragment_index, 'data_type', data_type, 'spf', spf)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_put_constant.m0000640000175000017500000000233112614323564022411 0ustar alastairalastairfunction gd_put_constant(D, field_code, data) % GD_PUT_CONSTANT Modify CONST values % % GD_PUT_CONSTANT(DIRFILE,FIELD_CODE,DATA) % is equivalent to calling GD_PUT_ARRAY_SLICE(DIRFILE, ... % FIELD_CODE,0,DATA) % % See also GD_PUT_ARRAY_SLICE gd_put_carray_slice(D, field_code, 0, data(1)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_nentries.c0000640000175000017500000000446312614323564021515 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_NENTRIES Retrieve a count of fields % % N = GD_NENTRIES(DIRFILE[,PARENT[,TYPE[,FLAGS]]]) % returns the number of fields, N, in the dirfile DIRFILE which % satisfy the supplied PARENT, TYPE, and/or FLAGS. % % If PARENT is given, and not numeric zero, metafields of the specified % parent field will be searched. Otherwise, only top level fields are % considered. If non-zero (matching all types), TYPE should be either one % of the GD.xxx_ENTRY symbols or else one of the special GD.xxx_ENTRIES % symbols provided by GETDATA_CONSTANTS. FLAGS, if given, should be zero % or more of the GD.ENTRIES_... flags, bitwise or'd together. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_nentries(3) in % section 3 of the UNIX manual for more details. % % See also GD_ENTRY_LIST, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *parent = NULL; unsigned int n, type = 0, flags = 0; GDMX_CHECK_RHS2(1,4); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) parent = gdmx_to_string(prhs, 1, 1); if (nrhs > 2) type = gdmx_to_uint(prhs, 2); if (nrhs > 3) flags = gdmx_to_uint(prhs, 3); n = gd_nentries(D, parent, type, flags); mxFree(parent); gdmx_err(D, 0); plhs[0] = gdmx_from_uint(n); } libgetdata-0.9.0/bindings/matlab/gd_add_window.m0000640000175000017500000000371312614323564022014 0ustar alastairalastairfunction gd_add_window(D, field_code, in_field1, in_field2, windop, ... threshold, fragment_index); % GD_ADD_WINDOW Add a WINDOW field % % GD_ADD_WINDOW(DIRFILE,NAME,INPUT1,INPUT2,WINDOP,THRESHOLD,FRAGMENT) % adds a WINDOW field called NAME to the dirfile specified by % DIRFILE. The data input field is INPUT1, and the mask field is % INPUT2. The operator is specified by WINDOP, which should be one % of the GD.WINDOP_... members provided by GETDATA_CONSTANTS, and % the threshold is THRESHOLD. The field is added to the fragment % indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_window(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_WINDOW, GD_OPEN, GETDATA_CONSTANTS GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.WINDOW_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {{in_field1; in_field2}}, ... 'windop', windop, 'threshold', threshold)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_naliases.c0000640000175000017500000000327712614323564021467 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_NALIASES Retrieve the number of names for a field % % N = GD_NALIASES(DIRFILE,FIELD_CODE) % returns the number of aliases, N, of FIELD_CODE (including % FIELD_CODE itself. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_naliases(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALIASES, GD_NENTRIES, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code = NULL; unsigned int n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_naliases(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_uint(n); } libgetdata-0.9.0/bindings/matlab/gd_protection.c0000640000175000017500000000336512614323564022054 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_PROTECTION Report the protection level of a fragment % % P = GD_PROTECTION(DIRFILE,FRAGMENT) % reports the protection level, P, of the fragment given by % FRAGMENT. The returned value will be one of the GD.PROTECT_... % symbols provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_protection(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_PROTECTION, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i, n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); n = gd_protection(D, i); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_tell.c0000640000175000017500000000330512614323564020620 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_TELL Report the location of a field's I/O pointer % % P = GD_TELL(DIRFILE,FIELD_CODE) % returns the position, P, in samples, of the field FIELD_CODE's % I/O pointer. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_tell(3) in section 3 % of the UNIX manual for more details. % % See also GD_SEEK, GD_GETDATA, GD_OPEN. */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; unsigned long long pos; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); pos = gd_tell64(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_ullong(pos); } libgetdata-0.9.0/bindings/matlab/gd_madd_mplex.m0000640000175000017500000000341012614323564022001 0ustar alastairalastairfunction gd_madd_mplex(D, parent, field_code, in_field1, in_field2, ... count_val, period) % GD_MADD_MPLEX Add a MPLEX metafield % % GD_MADD_MPLEX(DIRFILE,PARENT,NAME,INPUT1,INPUT2,COUNT_VAL,COUNT_MAX) % adds a MPLEX metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input data field is INPUT1, the index % field is INPUT2. The target value is COUNT_VAL and the maximum % value of INPUT2 is COUNT_MAX. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_mplex(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_MPLEX, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.MPLEX_ENTRY, ... 'in_fields', {{in_field1; in_field2}}, 'count_val', count_val, ... 'period', period), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/make_contents.sh.in0000640000175000017500000000315112614323564022634 0ustar alastairalastair#!/bin/sh # Copyright (C) 2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # @configure_input@ AWK=@AWK@ DATE=@DATE@ GREP=@GREP@ PRINTF=@PRINTF@ SED=@SED@ VERSION=@GETDATA_MAJOR@.@GETDATA_MINOR@ REVISION=R@GETDATA_REVISION@@GETDATA_VERSION_SUFFIX@ SRCDIR=$1 if test $SRCDIR != "."; then BUILT_FILES=$SRCDIR/gd_*.m fi if test "x$DATE" == "xnot found"; then BUILD_DATE= else BUILD_DATE=`$DATE +%d-%b-%Y` fi echo "% GetData bindings for MATLAB" echo "% Version $VERSION ($REVISION) $BUILD_DATE" echo "%" cat $SRCDIR/Contents.m.head if test "x$PRINTF" != "xnot found"; then ( ls getdata*.m gd_*.m ${BUILT_FILES} | while read x; do ${PRINTF} "%% %-22s - %s\n" \ "`basename $x | ${AWK} 'BEGIN{FS="."} { print toupper($1) }'`" \ "`${GREP} -m 1 '^%' $x | ${SED} 's/% *[A-Z_]* *\(.*\)/\1/'`" done ) | sort fi libgetdata-0.9.0/bindings/matlab/gd_spf.c0000640000175000017500000000315712614323564020455 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_SPF Report the samples-per-frame of a field % % S = GD_SPF(DIRFILE,FIELD_CODE) % reports the samples-per-frame, S, of the field called FIELD_CODE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_spf(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; unsigned int n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_spf(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_uint(n); } libgetdata-0.9.0/bindings/matlab/gd_get_carray.c0000640000175000017500000000423712614323564022005 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_GET_CARRAY Retrieve CARRAY data % % A = GD_GET_CARRAY(DIRFILE,FIELD_CODE[,TYPE]) % retrieves an array, A, of value of the CARRAY field called % FIELD_CODE. If type is given, it should be one of the data type % symbols provided by GETDATA_CONSTANTS, otherwise the data are % returned in their native type. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_get_carray_slice(3) in % section 3 of the UNIX manual for more details. % % See also GD_GET_CARRAY_SLICE, GD_PUT_CARRAY, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; gd_type_t type; size_t len; GDMX_CHECK_RHS2(2,3); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); if (nrhs > 2) type = gdmx_to_gd_type(prhs, 2); else { type = gd_native_type(D, field_code); gdmx_err(D, 0); } len = gd_array_len(D, field_code); gdmx_err(D, 0); plhs[0] = gdmx_vector(type, len, &data); gd_get_carray(D, field_code, type, data); mxFree(field_code); gdmx_err(D, 0); gdmx_fix_vector(plhs[0], type, len, data); } libgetdata-0.9.0/bindings/matlab/gd_array_len.c0000640000175000017500000000331412614323564021634 0ustar alastairalastair/* Copyright (C) 2013-2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ARRAY_LEN Report the length of a CARRAY field % % L = GD_ARRAY_LEN(DIRFILE,FIELD_CODE) % reports the length, L, of the CARRAY field specified by % FIELD_CODE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_endianness(3) in % section 3 of the UNIX manual for more details. % % See also GD_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; size_t n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_array_len(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_size_t(n); } libgetdata-0.9.0/bindings/matlab/gd_error.c0000640000175000017500000000350112614323564021007 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ERROR Report the C library error code % % E = GD_ERROR(DIRFILE) % returns the error code, E, associated with the last call to the % C GetData library. This will be one of the GD.E_... symbols % provided by GETDATA_CONSTANTS. Since the MATLAB bindings throw % exceptions on library error, it is only ever useful to use this % inside a CATCH block after a GetData Library error has been % thrown. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_error(3) in section 3 % of the UNIX manual for more details. % % See also GD_ERROR_STRING, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int e; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); e = gd_error(D); plhs[0] = gdmx_from_int(e); } libgetdata-0.9.0/bindings/matlab/doc.tail0000640000175000017500000000154612614323564020467 0ustar alastairalastair % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/Contents.m.head0000640000175000017500000001117512614323564021721 0ustar alastairalastair% These bindings provide light-weight bindings to the GetData C library for % use withing MATLAB. In general, there is a one-to-one mapping between C API % functions and matlab functions. Differences in behaviour, where notable, are % provided in the corresponing function help. % % The Dirifle object: % Dirfile objects returned from GD_OPEN and similar should be treated as % opaque objects. They should not be used other than when passing to a % function in these bindings. % % GetData symbolic constants: % Like the underlying C API, the GetData bindings make use of a large number % of special numbers. For convenience, a struct containing all these numbers % is provided by the GETDATA_CONSTANTS function, which is typically used by % doing something like: % % >> GD = GETDATA_CONSTANTS; % % This then allows the use of these constants as GD.UINT8, GD.RAW_ENTRY, &c., % which is both shorter than using the function directly, i.e., % GETDATA_CONSTANTS.UINT8, and also only requires evaluating the % GETDATA_CONSTANTS function once. % % In this documentation, when a reference is made to a GetData symbolic % constant, it is done so as if the GD variable had been created as above. % The reader should understand, e.g., GD.UINT8 as referring to the same % special number as the similarly-named C API's symbolic constant, e.g., % GD_UINT8. % % Input and Output: % Functions in these GetData bindings produce either one or zero scalar or % vector outputs, as explained in the corresponding function documentation. % % In general, where the C API would allow a NULL string pointer, these % bindings accept a numeric zero (0) instead of a string input in place of a % NULL. % % Unlike the C Library, real and complex data may be used interchangeably in % function calls. % % Error reporting: % GetData C Library errors are represented in MATLAB as standard exceptions % (see MEXCEPTION). In general, GetData functions should be evaluated in a % TRY ... CATCH ... END block. GetData-specific exceptions can be identified % through their MEXCEPTION.identifier. The component part of a GetData % MEXCPETION.identifier will always start with 'GetData:'. % % Exceptions representing a GetData C Library error will have the component % identifier 'GetData:Lib'. Exceptions generated by the bindings themselves % (almost all of which are failures in data conversion between MATLAB and C % API data types) will have the component identifier 'GetData:GDMX'. For C % Library errors, the mnemonic part of the MEXCEPTION.identifier corresponds % to the C library error code (e.g. 'GetData:Lib:BadCode'). For C Library % errors, numeric error codes can be obtained using the GD_ERROR function, as % in the C Library. The return value of GD_ERROR is unspecified after an % exception in the MATLAB bindings (i.e. a 'GetData:GDMX' exception). % % The Entry structure: % Functions which deal with generic field metadata (GD_ADD, GD_ALTER_ENTRY, % GD_ENTRY, &c.) use structures mirroring the C API's gd_entry_t object with % the following exceptions: % % * In entries with multiple input fields, .IN_FIELDS is a cell array of % strings of the appropriate length. For entries with a single input field, % .IN_FIELDS may be either a simple string or else a cell array of length % one. % % * A distinction is not made between real and complex data. As a result, % the entry struct for, say, a POLYNOM, stores co-efficients in the .A % member, regardless of whether they are complex or purely real. % % * LINCOM entries don't provide a .N_FIELDS member, nor do POLYNOM entries % provide a .POLY_ORD member; these values should be determined by % determining the length of .IN_FIELDS, .M, or .B for LINCOMs or of .A for % POLYNOMs. % % * The .SCALAR and .SCALAR_IND members are provided for field types which % allow non-literal parameters. Where the C API would have NULL pointers % in .SCALAR to indicate a literal, the bindings will have a numeric 0 in % the corresponding .SCALAR cell array element. As with .IN_FIELDS, a % length-one .SCALAR cell array may be replaced by a scalar. % % See gd_entry(3) in section 3 of the UNIX manual for details on the C API's % gd_entry_t object. % % Function list: % NOTE: accompanying documentation for the functions below in general only % point out differences in behaviour between these MATLAB bindings and % the underlying C API function which the MATLAB function wraps. Users % should also consult the C API documentation, which can be found in % section 3 of the UNIX manual, e.g. % % $ man 3 gd_open % libgetdata-0.9.0/bindings/matlab/gd_madd_phase.m0000640000175000017500000000311012614323564021751 0ustar alastairalastairfunction gd_madd_phase(D, parent, field_code, in_fields, shift) % GD_MADD_PHASE Add a PHASE metafield % % GD_MADD_PHASE(DIRFILE,PARENT,NAME,INPUT,SHIFT) % adds a PHASE metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input field is INPUT and the phase % shift SHIFT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_phase(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_PHASE, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.PHASE_ENTRY, ... 'in_fields', {in_fields}, 'shift', shift), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_fragmentname.c0000640000175000017500000000320712614323564022325 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FRAGMENTNAME Report the pathname of a metdata fragment % % P = GD_FRAGMENTNAME(DIRFILE,FRAGMENT) % reports the pathname, P, of the fragment indexed by FRAGMENT in % the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_fragmentname(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN, GD_INCLUDE */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char *s; int i; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); s = gd_fragmentname(D, i); gdmx_err(D, 0); plhs[0] = mxCreateString(s); } libgetdata-0.9.0/bindings/matlab/gd_native_type.c0000640000175000017500000000345212614323564022212 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_NATIVE_TYPE Report the native data type of a field % % T = GD_NATIVE_TYPE(DIRFILE,FIELD_CODE) % returns the native data type, T, of the field specified by % FIELD_CODE. The returned value will be one of the data type % symbols provided by GETDATA_CONSTATNS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_native_type(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; gd_type_t n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_native_type(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_gd_type(n); } libgetdata-0.9.0/bindings/matlab/gd_alter_spec.c0000640000175000017500000000350612614323564022004 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_SPEC Modify field metadata % % GD_ALTER_SPEC(DIRFILE,SPEC[,RECODE]) % modifies the metadata of a field in the dirfile DIRFILE % according to the field specification line SPEC. If % RECODE is given and non-zero, other data will be updated to % reflect metadata changes. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_spec(3) in % section 3 of the UNIX manual for more details. % % See also GD_MALTER_SPEC, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *spec; int recode = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(2,3); D = gdmx_to_dirfile(prhs[0]); spec = gdmx_to_string(prhs, 1, 0); if (nrhs > 2) recode = gdmx_to_int(prhs, 2); gd_alter_spec(D, spec, recode); mxFree(spec); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_madd_alias.c0000640000175000017500000000347512614323564021746 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MADD_ALIAS Add a field alias % % GD_MADD_ALIAS(DIRFILE,PARENT,NAME,TARGET) % adds a field alias metafield called NAME pointing to TARGET under % parent field PARENT in the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_alias(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_ALIAS, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code, *target, *parent; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); parent = gdmx_to_string(prhs, 1, 0); field_code = gdmx_to_string(prhs, 2, 0); target = gdmx_to_string(prhs, 3, 0); gd_madd_alias(D, parent, field_code, target); mxFree(target); mxFree(field_code); mxFree(parent); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_raw.m0000640000175000017500000000345012614323564021653 0ustar alastairalastairfunction gd_alter_raw(D, field_code, data_type, spf, recode) % GD_ALTER_RAW Modify the metadata of a RAW field % % GD_ALTER_RAW(DIRFILE,NAME,TYPE,SPF,RECODE) % modifies the metadata of the RAW field called NAME in the % dirfile specified by DIRFILE. The data type is set to TYPE, if % not GD.NULL, and the samples-per-frame to SPF, if not zero. If % RECODE is non-zero, the binary file associated with the field will % be rewritten to reflect the changes; otherwise the binary file is % not modified. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_raw(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.RAW_ENTRY, ... 'data_type', data_type, 'spf', spf), recode); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_entry.c0000640000175000017500000000356612614323564021032 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ENTRY Retrieve field metadata % % E = GD_ENTRY(DIRFILE,FIELD_CODE) % returns an structure, E, containing the metadata of the field % specified by FIELD_CODE in the dirfile DIRFILE. See GETDATA % and the corresponding C API documentation for information on % this structure. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_entry(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_ENTRY_TYPE, GD_ALTER_ENTRY, GD_OPEN, GETDATA */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; gd_entry_t E; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); gd_entry(D, field_code, &E); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_entry(&E); gd_free_entry_strings(&E); } libgetdata-0.9.0/bindings/matlab/gd_add_recip.m0000640000175000017500000000324512614323564021607 0ustar alastairalastairfunction gd_add_recip(D, field_code, in_field, dividend, fragment_index) % GD_ADD_RECIP Add a RECIP field % % GD_ADD_RECIP(DIRFILE,NAME,INPUT,DIVIDEND,FRAGMENT) % adds a RECIP field called NAME to the dirfile specified by % DIRFILE. The scalar dividend is DIVIDEND, which may be complex % valued. The field is added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_recip(3) in section 3 of % the UNIX manual for more details. % % See also GD_ADD, GD_MADD_RECIP, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.RECIP_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {in_field}, ... 'dividend', dividend)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_mstrings.c0000640000175000017500000000347312614323564021534 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MSTRINGS Fetch all STRING metafield values % % A = GD_MSTRINGS(DIRFILE,PARENT) % returns a cell array of strings, A, containing the values of all % STRING metafields under parent field PARENT. A corresponding % array of field names can be produced with GD_MFIELD_LIST_BY_TYPE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_mstrings(3) in section 3 % of the UNIX manual for more details. % % See also GD_STRINGS, GD_MFIELD_LIST_BY_TYPE, GD_GET_STRING */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *parent; const char **sl; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); parent = gdmx_to_string(prhs, 1, 0); sl = gd_mstrings(D, parent); mxFree(parent); gdmx_err(D, 0); plhs[0] = gdmx_from_string_list(sl); } libgetdata-0.9.0/bindings/matlab/gd_add_polynom.m0000640000175000017500000000332312614323564022177 0ustar alastairalastairfunction gd_add_polynom(D, field_code, in_field, a, fragment_index); % GD_ADD_POLYNOM Add a POLYNOM field % % GD_ADD_POLYNOM(DIRFILE,NAME,INPUT,A,FRAGMENT) % adds a POLYNOM field called NAME to the dirfile specified by % DIRFILE. The input field is INPUT and the co-efficients are % given in the numerical array A, which may be complex valued. % The field is added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_polynom(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_POLYNOM, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.POLYNOM_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {in_field}, 'a', a)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_eof.c0000640000175000017500000000327312614323564020435 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_EOF Report the end of data in a field % % S = GD_EOF(DIRFILE,FIELD_CODE) % reports the sample number, S, where the data of the field % specified by FIELD_CODE ends. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_bof(3) in section 3 % of the UNIX manual for more details. % % See also GD_BOF, GD_OPEN, GD_NFRAMES */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; unsigned long long n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_eof64(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_ullong(n); } libgetdata-0.9.0/bindings/matlab/gd_madd_multiply.m0000640000175000017500000000306112614323564022535 0ustar alastairalastairfunction gd_madd_multiply(D, parent, field_code, in1, in2) % GD_MADD_MULTIPLY Add a MULTIPLY metafield % % GD_MADD_MULTIPLY(DIRFILE,PARENT,NAME,INPUT1,INPUT2) % adds a MULTIPLY metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input fields are INPUT1 and INPUT2. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_multiply(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_MULTIPLY, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.MULTIPLY_ENTRY, ... 'in_fields', {{in1; in2}}), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_entry_type.c0000640000175000017500000000350112614323564022060 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ENTRY_TYPE Retrieve the field type of a field % % T = GD_ENTRY_TYPE(DIRFILE,FIELD_CODE) % returns the entry type, T, of the field specified by FIELD_CODE % in the dirfile DIRFILE. The returned value will be one of the % GD.xxx_ENTRY symbols provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_entry_type(3) in section 3 % of the UNIX manual for more details. % % See also GD_ENTRY, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; gd_entype_t t; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); t = gd_entry_type(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_entype(t); } libgetdata-0.9.0/bindings/matlab/gd_add_divide.m0000640000175000017500000000316512614323564021752 0ustar alastairalastairfunction gd_add_divide(D, field_code, in1, in2, fragment_index) % GD_ADD_DIVIDE Add a DIVIDE field % % GD_ADD_DIVIDE(DIRFILE,NAME,INPUT1,INPUT2,FRAGMENT) % adds a DIVIDE field called NAME to the dirfile specified by % DIRFILE. The input fields are INPUT1 and INPUT2 and the field % is added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_divide(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_DIVIDE, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.DIVIDE_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {{in1; in2}})); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_carrays.c0000640000175000017500000000407312614323564021327 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" #include /* % GD_CARRAYS Fetch all CARRAY values % % A = GD_CARRAYS(DIRFILE[,TYPE]) % returns a cell array of numeric arrays, A, containing all the % CARRAY data in the dirfile DIRFILE. A corresponding array of % field names can be produced with GD_FIELD_LIST_BY_TYPE. The % type of the returned data is given by TYPE, one of the data % type symbols provided by GETDATA_CONSTANTS. If omitted, the % default type, GD.FLOAT64, is used. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_carrays(3) in section 3 % of the UNIX manual for more details. % % See also GD_MCARRAYS, GD_FIELD_LIST_BY_TYPE, GD_GET_CARRAY_SLICE */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; gd_type_t type = GD_FLOAT64; const gd_carray_t *c; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) type = gdmx_to_gd_type(prhs, 1); c = gd_carrays(D, type); gdmx_err(D, 0); /* convert to array of arrays */ plhs[0] = gdmx_from_carrays(c, type); } libgetdata-0.9.0/bindings/matlab/gd_raw_filename.c0000640000175000017500000000332712614323564022315 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_RAW_FILENAME Report the pathname of a binary data file % % P = GD_RAW_FILENAME(DIRFILE,FIELD_CODE) % reports the pathname, P, of the binary file backing the RAW field % specified by FIELD_CODE in the the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_raw_filename(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char *s; char *field_code; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); s = gd_raw_filename(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = mxCreateString(s); } libgetdata-0.9.0/bindings/matlab/gd_nvectors.m0000640000175000017500000000241112614323564021532 0ustar alastairalastairfunction nvectors = gd_nvectors(D) % GD_NVECTORS Retrieve a count of fields % % GD_NVECTORS(DIRFILE) % is equivalent to calling GD_NENTRIES(DIRFILE,0, ... % GD.VECTOR_ENTRIES,0) % % For GD, see GETDATA_CONSTANTS. % % See also GD_NENTRIES, GETDATA_CONSTANTS GD = getdata_constants(); nvectors = gd_nentries(D, 0, GD.VECTOR_ENTRIES, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_mfield_list.m0000640000175000017500000000220312614323564022161 0ustar alastairalastairfunction field_list = gd_mfield_list(D, parent) % GD_MFIELD_LIST Retrieve a list of field names % % GD_FIELD_LIST(DIRFILE,PARENT) % is equivalent to calling GD_ENTRY_LIST(DIRFILE,PARENT,0,0) % % See also GD_ENTRY_LIST field_list = gd_entry_list(D, parent, 0, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_nfields_by_type.m0000640000175000017500000000217012614323564023050 0ustar alastairalastairfunction nfields = gd_nfields_by_type(D, type) % GD_NFIELDS_BY_TYPE Retrieve a count of fields % % GD_NFIELDS_BY_TYPE(DIRFILE,TYPE) % is equivalent to calling GD_NENTRIES(DIRFILE,0,TYPE,0) % % See also GD_NENTRIES nfields = gd_nentries(D, 0, type, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_nmfields.m0000640000175000017500000000215312614323564021473 0ustar alastairalastairfunction nfields = gd_nmfields(D, parent) % GD_NMFIELDS Retrieve a count of fields % % GD_NMFIELDS(DIRFILE,PARENT) % is equivalent to calling GD_NENTRIES(DIRFILE,PARENT,0,0) % % See also GD_NENTRIES nfields = gd_nentries(D, parent, 0, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_flush.c0000640000175000017500000000365312614323564021007 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FLUSH Flush and close modified data files % % GD_FLUSH(DIRFILE[,FIELD_CODE]) % flushes the binary data files associated with the dirfile DIRFILE % to disk, and then closes open files. If FIELD_CODE is given and % not numeric zero, only the specified field is flushed. Otherwise % all open data files are flushed and closed. In this second case, % modified metadata is also flushed. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_flush(3) in section 3 % of the UNIX manual for more details. % % See also GD_CLOSE, GD_SYNC, GD_RAW_CLOSE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code = NULL; GDMX_NO_LHS; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) field_code = gdmx_to_string(prhs, 1, 1); gd_flush(D, field_code); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_nfragments.c0000640000175000017500000000302312614323564022021 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_NFRAGMETNS Report the number of fragments in a dirfile % % N = GD_NFRAGMENTS(DIRFILE) % returns the number of fragments, N, in the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_nfragments(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int n; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); n = gd_nfragments(D); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_hide.c0000640000175000017500000000304412614323564020571 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_HIDE Hide a field % % GD_HIDE(DIRFILE,FIELD_CODE) % hides the field called FIELD_CODE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_hide(3) in section 3 % of the UNIX manual for more details. % % See also GD_HIDDEN, GD_UNHIDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; GDMX_NO_LHS; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); gd_hide(D, field_code); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_entry.c0000640000175000017500000000430212614323564022206 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_ENTRY Modify field metadata % % GD_ALTER_ENTRY(DIRFILE,FIELD_CODE,ENTRY[,RECODE]) % modifies the metadata of the field FIELD_CODE in the dirfile % DIRFILE according to the contents of the ENTRY struct. If % RECODE is given and non-zero, other data will be updated to % reflect metadata changes. % % The DIRFILE object should have previously been created with GD_OPEN. % % This function ignores both the .FIELD member and the .FRAGMENT_INDEX % member of the supplied ENTRY structure. They may be omitted. For a % discussion of the ENTRY structure, see GETDATA. % % See the documentation on the C API function gd_alter_endianness(3) in % section 3 of the UNIX manual for more details. % % See also GD_ADD, GD_OPEN, GETDATA */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; gd_entry_t *E; int recode = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(3,4); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); E = gdmx_to_entry(prhs, 2, GDMX_ENO_FRAG | GDMX_ENO_FIELD); if (nrhs > 3) recode = gdmx_to_int(prhs, 3); gd_alter_entry(D, field_code, E, recode); mxFree(field_code); gdmx_free_entry(E); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_add_alias.c0000640000175000017500000000351212614323564021561 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ADD_ALIAS Add a field alias % % GD_ADD_ALIAS(DIRFILE,NAME,TARGET,FRAGMENT) % adds a field alias called NAME pointing to TARGET in the metadata % fragment indexed by FRAGMENT of the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_alias(3) in section 3 % of the UNIX manual for more details. % % See also GD_MADD_ALIAS, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code, *target; int fragment_index; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); target = gdmx_to_string(prhs, 2, 0); fragment_index = gdmx_to_int(prhs, 3); gd_add_alias(D, field_code, target, fragment_index); mxFree(target); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_mvector_list.m0000640000175000017500000000247412614323564022412 0ustar alastairalastairfunction field_list = gd_mvector_list(D, parent) % GD_MVECTOR_LIST Retrieve a list of field names % % GD_MVECTOR_LIST(DIRFILE,PARENT) % is equivalent to calling GD_ENTRY_LIST(DIRFILE,PARENT, ... % GD.VECTOR_ENTRIES,0) % % For GD, see GETDATA_CONSTANTS. % % See also GD_ENTRY_LIST, GETDATA_CONSTANTS GD = getdata_constants(); field_list = gd_entry_list(D, parent, GD.VECTOR_ENTRIES, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_strtok.c0000640000175000017500000000432212614323564021206 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_STRTOK Tokenise a string using the GetData parser % % A = GD_STRTOK(DIRFILE,STRING) % Converts the string STRING into a cell array of strings, A, by % tokenising it using the GetData library parser. Unlike the C API % this function completely tokenises the provided string at once, % returning all tokens, and should not be called repeatedly. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_strtok(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN, GD_DIRFILE_STANDARDS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *tok, *s; mxArray **sl = NULL; size_t i, n = 0; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); s = gdmx_to_string(prhs, 1, 0); /* convert */ for (tok = gd_strtok(D, s); tok; tok = gd_strtok(D, NULL)) { mxArray **ptr = (mxArray**)mxRealloc(sl, sizeof(mxArray*) * (n + 1)); if (ptr == NULL) mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory."); sl = ptr; sl[n++] = mxCreateString(tok); free(tok); } gdmx_err(D, 0); plhs[0] = mxCreateCellMatrix(1, n); for (i = 0; i < n; ++i) mxSetCell(plhs[0], i, sl[i]); mxFree(sl); } libgetdata-0.9.0/bindings/matlab/gd_put_carray_slice.c0000640000175000017500000000366012614323564023214 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_PUT_CARRAY_SLICE Modify CARRAY or CONST values % % GD_PUT_CARRAY_SLICE(DIRFILE,FIELD_CODE,START,VALUES) % sets elements of the CARRAY or CONST field called FIELD_CODE % starting at element START to the values in the array VALUE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_put_carray_slice(3) in % section 3 of the UNIX manual for more details. % % See also GD_GET_CARRAY_SLICE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; unsigned int start; size_t nsamp, n; gd_type_t type; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); start = gdmx_to_uint(prhs, 2); gdmx_to_data(&data, &type, &nsamp, prhs[3], 3); gd_put_carray_slice(D, field_code, start, nsamp, type, data); gdmx_free_data(data, type); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_parent_fragment.c0000640000175000017500000000317512614323564023041 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_PARENT_FRAGMENT Report the parent of a fragment % % F = GD_PARENT_FRAGMENT(DIRFILE,FRAGMENT) % reports the parent fragment index, F, of the fragment indexed by % FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_parent_fragment(3) in % section 3 of the UNIX manual for more details. % % See also GD_INCLUDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i, n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); n = gd_parent_fragment(D, i); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_discard.c0000640000175000017500000000310412614323564021266 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_DISCARD Close a dirfile % % GD_DISCARD(DIRFILE) % discards all changes and closes the dirfile DIRFILE. The DIRFILE % object supplied will no longer be valid if this function % succeeds. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_discard(3) in section 3 % of the UNIX manual for more details. % % See also GD_CLOSE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int n; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); n = gd_discard(D); if (n) gdmx_err(D, 1); } libgetdata-0.9.0/bindings/matlab/gd_linterp_tablename.c0000640000175000017500000000336012614323564023346 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_LINTER_TABLENAME Report the pathname of binary file % % P = GD_LINTER_TABLENAME(DIRFILE,FIELD_CODE) % reports the pathname, P, of the look-up table associated with the % LINTERP field specified by FIELD_CODE in the the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_linterp_tablename(3) in % section 3 of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char *s; char *field_code; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); s = gd_linterp_tablename(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = mxCreateString(s); } libgetdata-0.9.0/bindings/matlab/gd_fragment_affixes.c0000640000175000017500000000370612614323564023175 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FRAGMENT_AFFIXES Retrieve the affixes of an included fragment % % L = GD_FRAGMENT_AFFIXES(DIRFILE,FRAGMENT) % returns a two-element cell array containing the prefix and suffix % (in that order) of the fragment specified by FRAGMENT in the % dirfile DIRFILE. If an affix is empty, numeric zero will be % reported in the corresponding cell. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_fragment_affixes(3) in % section 3 of the UNIX manual for more details. % % See also GD_ALTER_AFFIXES, GD_INCLUDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int fragment_index; char *al[3]; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); fragment_index = gdmx_to_int(prhs, 1); gd_fragment_affixes(D, fragment_index, al, al + 1); al[2] = NULL; gdmx_err(D, 0); plhs[0] = gdmx_from_string_list((const char**)al); free(al[0]); free(al[1]); } libgetdata-0.9.0/bindings/matlab/gd_madd_spec.c0000640000175000017500000000331412614323564021577 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MADD_SPEC Add a metafield % % GD_MADD_SPEC(DIRFILE,SPEC,PARENT) % adds a metafield described by the field specification line SPEC % to the dirfile DIRFILE under parent field PARENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_spec(3) in section 3 % of the UNIX manual for more details. % % See also GD_MADD, GD_ADD_SPEC, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *spec, *parent; GDMX_NO_LHS; GDMX_CHECK_RHS(3); D = gdmx_to_dirfile(prhs[0]); spec = gdmx_to_string(prhs, 1, 0); parent = gdmx_to_string(prhs, 2, 0); gd_madd_spec(D, spec, parent); mxFree(parent); mxFree(spec); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_raw_close.c0000640000175000017500000000343212614323564021637 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_RAW_CLOSE Close binary files % % GD_RAW_CLOSE(DIRFILE[,FIELD_CODE]) % closes open binary data files associated with the dirfile % DIRFILE. If FIELD_CODE is given and not numeric zero, only the % specified field is closed. Otherwise all open data files closed. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_raw_close(3) in section 3 % of the UNIX manual for more details. % % See also GD_CLOSE, GD_SYNC, GD_FLUSH, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code = NULL; GDMX_NO_LHS; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) field_code = gdmx_to_string(prhs, 1, 1); gd_raw_close(D, field_code); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_verbose_prefix.c0000640000175000017500000000320312614323564022677 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_VERBOSE_PREFIX set the prefix on error messages % % GD_FLUSH(DIRFILE,PREFIX) % set the prefix on Library error messages printed when running in % verbose mode to PREFIX. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_verbose_prefix(3) in % section 3 of the UNIX manual for more details. % % See also GD_OPEN, GD_ERROR_STRING */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *prefix; GDMX_NO_LHS; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); prefix = gdmx_to_string(prhs, 1, 1); gd_verbose_prefix(D, prefix); mxFree(prefix); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_open.c0000640000175000017500000000407712614323564020630 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_OPEN Open or create a dirfile % % D = GD_OPEN(PATH[,FLAGS]) % opens the dirfile PATH, returning a dirfile object, D. If % given, FLAGS should be a bitwise or'd collection of dirfile flags % provided by GETDATA_CONSTANTS. If omitted, FLAGS defaults to % GD.RDONLY. % % Unlike in the C API, an error in GD_OPEN does not result in the creation of % an invalid dirfile (so GD_ERROR and GD_ERROR_STRING cannot be used in a % CATCH block after a failed a GD_OPEN call). Open dirfiles should be % deallocated by calling GD_DISCARD or GD_CLOSE when no longer needed. % % See the documentation on the C API function gd_open(3) in section 3 % of the UNIX manual for more details. % % See also GD_DISCARD, GD_CLOSE, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { char *filename; unsigned long flags = GD_RDONLY; DIRFILE *D; GDMX_CHECK_RHS2(1,2); filename = gdmx_to_string(prhs, 0, 0); if (nrhs > 1) flags = gdmx_to_ulong(prhs, 1); D = gd_open(filename, flags); mxFree(filename); gdmx_err(D, 1); plhs[0] = gdmx_from_dirfile(D); } libgetdata-0.9.0/bindings/matlab/gd_invalid_dirfile.c0000640000175000017500000000275212614323564023011 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_INVALID_DIRFILE Create an invalid dirfile object % % D = GD_INVALID_DIRFILE() % creates an invalid dirfile object, D. It should be deallocated % with GD_CLOSE or GD_DISCARD when no longer needed. % % See the documentation on the C API function gd_invalid_dirfile(3) in % section 3 of the UNIX manual for more details. % % See also GD_CLOSE, GD_DISCARD, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; GDMX_CHECK_RHS(0); D = gd_invalid_dirfile(); plhs[0] = gdmx_from_dirfile(D); } libgetdata-0.9.0/bindings/matlab/gd_putdata.c0000640000175000017500000000413412614323564021323 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_PUTDATA Write vector data % % GD_PUTDATA(DIRFILE,FIELD_CODE,FIRST_FRAME,FIRST_SAMPLE,DATA) % writes the data in DATA to the field called FIELD_CODE. The % sequential samples are written starting FIRST_SAMPLE samples % after the start of frame FIRST_FRAME. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_putdata(3) in section 3 % of the UNIX manual for more details. % % See also GD_GETDATA, GD_PUT_CARRAY_SLICE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; long long first_frame, first_samp; size_t nsamp, n; gd_type_t type; GDMX_CHECK_RHS(5); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); first_frame = gdmx_to_llong(prhs, 2); first_samp = gdmx_to_llong(prhs, 3); gdmx_to_data(&data, &type, &nsamp, prhs[4], 4); n = gd_putdata64(D, field_code, (gd_off64_t)first_frame, (gd_off64_t)first_samp, 0, nsamp, type, data); gdmx_free_data(data, type); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_size_t(n); } libgetdata-0.9.0/bindings/matlab/gd_alter_recip.m0000640000175000017500000000315012614323564022161 0ustar alastairalastairfunction gd_alter_recip(D, field_code, in_fields, dividend) % GD_ALTER_RECIP Modify the metadata of a RECIP field % % GD_ALTER_RECIP(DIRFILE,NAME,INPUT,DIVIDEND) % modifies the metadata of the RECIP field called NAME in the % dirfile specified by DIRFILE. The input field is set to INPUT1, % if non-zero, and the dividend to DIVIDEND. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_recip(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.RECIP_ENTRY, ... 'in_fields', {in_fields}, 'dividend', dividend), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_get_string.c0000640000175000017500000000342312614323564022026 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_GET_CARRAY Retrieve STRING data % % S = GD_GET_CARRAY(DIRFILE,FIELD_CODE) % retrieves the value, S, the STRING field called FIELD_CODE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_get_string(3) in % section 3 of the UNIX manual for more details. % % See also GD_PUT_STRING, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; size_t len; char *s; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); /* get length */ len = gd_get_string(D, field_code, 0, NULL); gdmx_err(D, 0); s = mxMalloc(len); gd_get_string(D, field_code, len, s); mxFree(field_code); gdmx_err(D, 0); plhs[0] = mxCreateString(s); mxFree(s); } libgetdata-0.9.0/bindings/matlab/gd_bof.c0000640000175000017500000000327712614323564020436 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_BOF Report the start of data in a field % % S = GD_BOF(DIRFILE,FIELD_CODE) % reports the sample number, S, where the data of the field % specified by FIELD_CODE starts. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_bof(3) in section 3 % of the UNIX manual for more details. % % See also GD_EOF, GD_OPEN, GD_NFRAMES */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; unsigned long long n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_bof64(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_ullong(n); } libgetdata-0.9.0/bindings/matlab/gd_sync.c0000640000175000017500000000355012614323564020636 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_SYNC Flush modifications to disk % % GD_SYNC(DIRFILE[,FIELD_CODE]) % flushes the binary data files associated with the dirfile DIRFILE % to disk. If FIELD_CODE is given and not numeric zero, only the % specified field is synced. Otherwise all open data files are % synced. In this second case, modified metadata is also flushed. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_sync(3) in section 3 % of the UNIX manual for more details. % % See also GD_CLOSE, GD_FLUSH, GD_RAW_CLOSE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code = NULL; GDMX_NO_LHS; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) field_code = gdmx_to_string(prhs, 1, 1); gd_sync(D, field_code); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_add_lincom.m0000640000175000017500000000341612614323564021766 0ustar alastairalastairfunction gd_add_lincom(D, field_code, in_fields, m, b, fragment_index); % GD_ADD_LINCOM Add a LINCOM field % % GD_ADD_LINCOM(DIRFILE,NAME,INPUTS,M,B,FRAGMENT) % adds a LINCOM field called NAME to the dirfile specified by % DIRFILE. The input fields are provided in the cell array INPUTS % and the slopes and offsets given by the numeric arrays M and B, % which may be complex valued. The field is added to the fragment % indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_lincom(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_LINCOM, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.LINCOM_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {in_fields}, 'm', m, 'b', b)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_window.m0000640000175000017500000000332112614323564022366 0ustar alastairalastairfunction gd_alter_window(D, field_code, in1, in2, windop, threshold) % GD_ALTER_WINDOW Modify the metadata of a WINDOW field % % GD_ALTER_WINDOW(DIRFILE,NAME,INPUT1,INPUT2,WINDOP,THRESHOLD) % modifies the metadata of the WINDOW field called NAME in the % dirfile specified by DIRFILE. The input fields are set to INPUT1, % and INPUT2, if non-zero, the operator to WINDOP and the threshold % to THRESHOLD. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_window(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.WINDOW_ENTRY, ... 'in_fields', {{in1; in2}}, 'windop', windop, 'threshold', threshold), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_frameoffset.c0000640000175000017500000000365212614323564023355 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_FRAMEOFFSET Modify the frameoffset of a fragment % % GD_ALTER_FRAMEOFFSET(DIRFILE,OFFSET,FRAGMENT[,RECODE]) % sets the byte sex of the metadata fragment indexed by FRAGMENT % in the dirfile DIRFILE to OFFSET. If RECODE is given and % non-zero, binary files affected by the offset change will be % converted. Otherwise, the binary files are not modified. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_frameoffset(3) in % section 3 of the UNIX manual for more details. % % See also GD_FRAMEOFFSET, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int i, r; unsigned long long o; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); o = gdmx_to_ullong(prhs, 1); i = gdmx_to_int(prhs, 2); r = gdmx_to_int(prhs, 3); gd_alter_frameoffset64(D, o, i, r); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_phase.m0000640000175000017500000000313312614323564022160 0ustar alastairalastairfunction gd_alter_phase(D, field_code, in_fields, shift) % GD_ALTER_PHASE Modify the metadata of a PHASE field % % GD_ALTER_PHASE(DIRFILE,NAME,INPUT,SHIFT) % modifies the metadata of the PHASE field called NAME in the % dirfile specified by DIRFILE. The input field is set to INPUT, % if non-zero, and the phase shift to SHIFT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_phase(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.PHASE_ENTRY, ... 'in_fields', {in_fields}, 'shift', shift), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_validate.c0000640000175000017500000000316212614323564021452 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_VALIDATE flush modifications to disk % % B = GD_VALIDATE(DIRFILE,FIELD_CODE) % returns boolean true, B, if FIELD_CODE is a valid field. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_validate(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; int n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_validate(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_madd_window.m0000640000175000017500000000355012614323564022170 0ustar alastairalastairfunction gd_madd_window(D, parent, field_code, in_field1, in_field2, windop, ... threshold) % GD_MADD_WINDOW Add a WINDOW metafield % % GD_MADD_WINDOW(DIRFILE,PARENT,NAME,INPUT1,INPUT2) % adds a WINDOW metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The data input field is INPUT1, and the % mask field is INPUT2. The operator is specified by WINDOP, which % should be one of the GD.WINDOP_... members provided by % GETDATA_CONSTANTS, and the threshold is THRESHOLD. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_window(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_WINDOW, GD_MADD, GD_OPEN, GETDATA_CONSTANTS GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.WINDOW_ENTRY, ... 'in_fields', {{in_field1; in_field2}}, 'windop', windop, ... 'threshold', threshold), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add_carray.c0000640000175000017500000000412212614323564021747 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ADD_CARRAY Add a CARRAY field % % GD_ADD_CARRAY(DIRFILE,NAME,TYPE,VALUES,FRAGMENT) % adds a CARRAY field called NAME to the dirfile specified by % DIRFILE. The storage type is TYPE, and the values of the field % are in VALUES. The field is added to the fragment indexed by % FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_carray(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_CARRAY, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_name; size_t n; int fragment_index; gd_type_t const_type, data_type; GDMX_NO_LHS; GDMX_CHECK_RHS(5); D = gdmx_to_dirfile(prhs[0]); field_name = gdmx_to_string(prhs, 1, 0); const_type = gdmx_to_gd_type(prhs, 2); gdmx_to_data(&data, &data_type, &n, prhs[3], 3); fragment_index = gdmx_to_int(prhs, 4); gd_add_carray(D, field_name, const_type, n, data_type, data, fragment_index); gdmx_free_data(data, data_type); mxFree(field_name); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_linterp.m0000640000175000017500000000345212614323564022541 0ustar alastairalastairfunction gd_alter_linterp(D, field_code, in_fields, table, recode); % GD_ALTER_LINTERP Modify the metadata of a LINTERP field % % GD_ALTER_LINTERP(DIRFILE,NAME,INPUT,TABLE,RECODE) % modifies the metadata of the LINTERP field called NAME in the % dirfile specified by DIRFILE. The input field is set to INPUT, % and the associated look-up table path to TABLE, except when these % inputs are numeric zero, indicating no change. If RECODE is % non-zero, an existing look-up table will be renamed to TABLE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_linterp(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.LINTERP_ENTRY, ... 'in_fields', in_fields, 'table', table), recode); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_nframes.c0000640000175000017500000000302312614323564021310 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_NFRAMES Report the length of a dirfile % % N = GD_NFRAMES(DIRFILE) % returns the nominal number of frames, N, in the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_nframes(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; unsigned long long n; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); n = gd_nframes64(D); gdmx_err(D, 0); plhs[0] = gdmx_from_ullong(n); } libgetdata-0.9.0/bindings/matlab/gd_nmvectors.m0000640000175000017500000000244312614323564021714 0ustar alastairalastairfunction nfields = gd_nmvectors(D, parent) % GD_NMVECTORS Retrieve a count of fields % % GD_NMVECTORS(DIRFILE,PARENT) % is equivalent to calling GD_NENTRIES(DIRFILE,PARENT, ... % GD.VECTOR_ENTRIES,0) % % For GD, see GETDATA_CONSTANTS. % % See also GD_NENTRIES, GETDATA_CONSTANTS GD = getdata_constants(); nfields = gd_nentries(D, parent, GD.VECTOR_ENTRIES, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_polynom.m0000640000175000017500000000313612614323564022560 0ustar alastairalastairfunction gd_alter_polynom(D, field_code, in_fields, a) % GD_ALTER_POLYNOM Modify the metadata of a POLYNOM field % % GD_ALTER_POLYNOM(DIRFILE,NAME,INPUT,A) % modifies the metadata of the POLYNOM field called NAME in the % dirfile specified by DIRFILE. The input field is set to INPUT1, % if non-zero, and the co-efficient vector to A. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_polynom(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.POLYNOM_ENTRY, ... 'in_fields', {in_fields}, 'a', a), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/matlab.c0000640000175000017500000011505012614323564020447 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H #include "gd_config.h" #endif #ifdef GD_EXTERNAL # define GD_C89_API # define dtracevoid() # define dtrace(...) # define dprintf(...) # define dreturnvoid() # define dreturn(...) # define dwatch(...) # define GD_SIZE_T_MAX ((size_t)-1) # define GD_INT_TYPE ((gd_type_t)((sizeof(int)) | GD_SIGNED)) # define GD_UINT_TYPE ((gd_type_t)(sizeof(unsigned int))) # define EN(t,v) u.t.v # define GD_DCOMPLEXP_t double * # define GD_DCOMPLEXV(v) double v[][2] # define gd_cs2cs_(a,b) do { (a)[0] = (b)[0]; (a)[1] = (b)[1]; } while(0) # define gd_ca2cs_(a,b,i) gd_cs2cs_((a),(b) + 2 * i) #else #include "internal.h" #endif #define GDMXLIB #include "gd_matlab.h" #ifdef HAVE_STDINT_H #include #endif #include #define GD_LIBCOMP "GetData:Lib:" static const char *gdmx_msgid[GD_N_ERROR_CODES] = { NULL, /* GD_E_OK */ GD_LIBCOMP "Error01", /* unused */ GD_LIBCOMP "Format", GD_LIBCOMP "Error03", /* unused */ GD_LIBCOMP "Creat", GD_LIBCOMP "BadCode", GD_LIBCOMP "BadType", GD_LIBCOMP "IO", GD_LIBCOMP "Error08", /* unused */ GD_LIBCOMP "InternalError", GD_LIBCOMP "Alloc", GD_LIBCOMP "Range", GD_LIBCOMP "LUT", GD_LIBCOMP "RecurseLevel", GD_LIBCOMP "BadDirfile", GD_LIBCOMP "BadFieldType", GD_LIBCOMP "AccMode", GD_LIBCOMP "Unsupported", GD_LIBCOMP "UnknownEncoding", GD_LIBCOMP "BadEntry", GD_LIBCOMP "Duplicate", GD_LIBCOMP "Dimension", GD_LIBCOMP "BadIndex", GD_LIBCOMP "BadScalar", GD_LIBCOMP "BadReference", GD_LIBCOMP "Protected", GD_LIBCOMP "Delete", GD_LIBCOMP "Argument", GD_LIBCOMP "Callback", GD_LIBCOMP "Exists", GD_LIBCOMP "UncleanDB", GD_LIBCOMP "Domain", GD_LIBCOMP "BadRepr", GD_LIBCOMP "Error33", /* unused */ GD_LIBCOMP "Error34", /* unused */ GD_LIBCOMP "Bounds", GD_LIBCOMP "LineTooLong" }; /* persistent errors */ static int gdmx_errno = GD_E_OK; static char *gdmx_estring = NULL; /* for error reporting */ struct gdmx_context_t { const char *name; const char *field; int num; }; static char gdmx_context_buf[1024]; const char *gdmx_context(const struct gdmx_context_t *x, int uc) { dtrace("%p, %i", x, uc); if (x == NULL) strcpy(gdmx_context_buf, "(unknown item)"); else { if (x->name == NULL) { if (x->field == NULL) sprintf(gdmx_context_buf, "parameter %i", x->num); else sprintf(gdmx_context_buf, "field '%s' of struct parameter %i", x->field, x->num); } else { if (x->field == NULL) strcpy(gdmx_context_buf, x->name); else sprintf(gdmx_context_buf, "field '%s' of %s", x->field, x->name); } gdmx_context_buf[1023] = 0; if (uc) gdmx_context_buf[0] += 'A' - 'a'; } dreturn("\"%s\"", gdmx_context_buf); return gdmx_context_buf; } /* doesn't return on error */ void gdmx_err(DIRFILE *D, int discard) { dtrace("%p, %i", D, discard); if (gdmx_estring) { free(gdmx_estring); gdmx_estring = NULL; } gdmx_errno = gd_error(D); if (gdmx_errno == GD_E_OK) { dreturnvoid(); return; } gdmx_estring = gd_error_string(D, NULL, 0); if (discard) gd_discard(D); #ifdef GETDATA_DEBUG gd_colclear(); #endif mexErrMsgIdAndTxt(gdmx_msgid[gdmx_errno], gdmx_estring); } static gd_type_t gdmx_type(const mxArray *a, const struct gdmx_context_t *ctx, int cflag) { gd_type_t t = GD_UNKNOWN; mxClassID id; dtrace("%p, %p, %i", a, ctx, cflag); id = mxGetClassID(a); switch (id) { case mxDOUBLE_CLASS: t = GD_FLOAT64; break; case mxSINGLE_CLASS: t = GD_FLOAT32; break; case mxINT8_CLASS: t = GD_INT8; break; case mxUINT8_CLASS: t = GD_UINT8; break; case mxINT16_CLASS: t = GD_INT16; break; case mxUINT16_CLASS: t = GD_UINT16; break; case mxINT32_CLASS: t = GD_INT32; break; case mxUINT32_CLASS: t = GD_UINT32; break; case mxINT64_CLASS: t = GD_INT64; break; case mxUINT64_CLASS: t = GD_UINT64; break; default: if (ctx) mexErrMsgIdAndTxt("GetData:GDMX:NotNumber", "%s must be numerical.", gdmx_context(ctx, 1)); } /* handle complex data */ if (cflag) { if (t == GD_FLOAT64) t = GD_COMPLEX128; else if (t == GD_FLOAT32) t = GD_COMPLEX64; else if (ctx) mexErrMsgIdAndTxt("GetData:GDMX:ComplexInt", "GetData cannot handle integer complex data in %s.", gdmx_context(ctx, 0)); else t = GD_UNKNOWN; } dreturn("0x%X", (unsigned)t); return t; } mxClassID gdmx_classid(gd_type_t t) { mxClassID id = mxUNKNOWN_CLASS; dtrace("0x%X", t); switch (t) { case GD_UINT8: id = mxUINT8_CLASS; break; case GD_INT8: id = mxINT8_CLASS; break; case GD_UINT16: id = mxUINT16_CLASS; break; case GD_INT16: id = mxINT16_CLASS; break; case GD_UINT32: id = mxUINT32_CLASS; break; case GD_INT32: id = mxINT32_CLASS; break; case GD_UINT64: id = mxUINT64_CLASS; break; case GD_INT64: id = mxINT64_CLASS; break; case GD_FLOAT32: case GD_COMPLEX64: id = mxSINGLE_CLASS; break; case GD_FLOAT64: case GD_COMPLEX128: id = mxDOUBLE_CLASS; break; default: mexErrMsgIdAndTxt("GetData:GDMX:BadType", "Bad GetData data type: 0x%X", t); } dreturn("%i", (int)id); return id; } static size_t gdmx_get_length(const mxArray *a) { const mwSize *dims; int i, ndims; size_t nelem = 1; dtrace("%p", a); ndims = mxGetNumberOfDimensions(a); dims = mxGetDimensions(a); for (i = 0; i < ndims; ++i) nelem *= dims[i]; dreturn("%zu", nelem); return nelem; } /* returns zero if it's a scalar */ static int gdmx_check_scalar(const mxArray *a, const struct gdmx_context_t *ctx) { size_t nelem; dtrace("%p, %p", a, ctx); nelem = gdmx_get_length(a); if (ctx && nelem > 1) mexErrMsgIdAndTxt("GetData:GDMX:NotScalar", "%s must be scalar.", gdmx_context(ctx, 1)); dreturn("%i", (nelem > 1) ? 1 : 0); return (nelem > 1) ? 1 : 0; } /* convert to a desired scalar type */ #define CONVERT_TO_CTYPE(f,t) \ switch (t) { \ case GD_UINT8: *((uint8_t*)v) = ((f*)datum)[i]; break; \ case GD_INT8: *((int8_t*)v) = ((f*)datum)[i]; break; \ case GD_UINT16: *((uint16_t*)v) = ((f*)datum)[i]; break; \ case GD_INT16: *((int16_t*)v) = ((f*)datum)[i]; break; \ case GD_UINT32: *((uint32_t*)v) = ((f*)datum)[i]; break; \ case GD_INT32: *((int32_t*)v) = ((f*)datum)[i]; break; \ case GD_UINT64: *((uint64_t*)v) = ((f*)datum)[i]; break; \ case GD_INT64: *((int64_t*)v) = ((f*)datum)[i]; break; \ case GD_FLOAT32: *((float*)v) = ((f*)datum)[i]; break; \ case GD_FLOAT64: *((double*)v) = ((f*)datum)[i]; break; \ case GD_COMPLEX64: ((float*)v)[0] = ((f*)datum)[i]; \ ((float*)v)[1] = c ? ((f*)idatum)[i] : 0; break; \ case GD_COMPLEX128: ((double*)v)[0] = ((f*)datum)[i]; \ ((double*)v)[1] = c ? ((f*)idatum)[i] : 0; break; \ default: GDMX_INTERNAL_ERROR; \ } static mxArray *gdmx_get_field(const mxArray *a, const struct gdmx_context_t *ctx, const char *field) { mxArray *v; dtrace("%p, %p, \"%s\"", a, ctx, field); v = mxGetField(a, 0, field); if (ctx && v == NULL) mexErrMsgIdAndTxt("GetData:GDMX:BadStruct", "Missing required field '%s' in %s", field, gdmx_context(ctx, 0)); dreturn("%p", v); return v; } static int gdmx_convert_scalar(const mxArray *a, const struct gdmx_context_t *ctx, gd_type_t t, int i, void *v) { mxClassID id; void *datum, *idatum = NULL; int c; dtrace("%p, %p, 0x%X, %i, %p", a, ctx, t, v); /* check for scalarity */ if (i == -1) { gdmx_check_scalar(a, ctx); i = 0; } /* matlab type */ c = mxIsComplex(a); id = mxGetClassID(a); /* data pointer */ datum = mxGetData(a); if (c) idatum = mxGetImagData(a); switch (id) { case mxDOUBLE_CLASS: CONVERT_TO_CTYPE(double,t); break; case mxSINGLE_CLASS: CONVERT_TO_CTYPE(float,t); break; case mxINT8_CLASS: CONVERT_TO_CTYPE(int8_t,t); break; case mxUINT8_CLASS: CONVERT_TO_CTYPE(uint8_t,t); break; case mxINT16_CLASS: CONVERT_TO_CTYPE(int16_t,t); break; case mxUINT16_CLASS: CONVERT_TO_CTYPE(uint16_t,t); break; case mxINT32_CLASS: CONVERT_TO_CTYPE(int32_t,t); break; case mxUINT32_CLASS: CONVERT_TO_CTYPE(uint32_t,t); break; case mxINT64_CLASS: CONVERT_TO_CTYPE(int64_t,t); break; case mxUINT64_CLASS: CONVERT_TO_CTYPE(uint64_t,t); break; default: if (ctx) mexErrMsgIdAndTxt("GetData:GDMX:NotNumber", "%s must be numerical.", gdmx_context(ctx, 1)); dreturn("%i", 1); return 1; } dreturn("%i", 0); return 0; } /* this is only really appropriate for small arrays */ static void *gdmx_convert_array(const mxArray *a, const struct gdmx_context_t *ctx, gd_type_t t, size_t *n) { char *ptr; size_t i, nelem; dtrace("%p, %p, 0x%X, %p(%zu)", a, ctx, t, n, *n); nelem = gdmx_get_length(a); if (nelem > *n) nelem = *n; else if (nelem < *n) *n = nelem; if (nelem == 0) { dreturn("%p", NULL); return NULL; } ptr = (char*)mxMalloc(GD_SIZE(t) * nelem); if (!ptr) mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory."); for (i = 0; i < nelem; ++i) gdmx_convert_scalar(a, ctx, t, i, ptr + GD_SIZE(t) * i); dreturn("%p", ptr); return ptr; } static void gdmx_convert_struct_scalar(const mxArray *a, const struct gdmx_context_t *ctx_in, const char *field, gd_type_t t, void *v) { mxArray *e; struct gdmx_context_t ctx = { ctx_in->name, field, ctx_in->num }; dtrace("%p, %p, \"%s\", 0x%X, %p", a, ctx_in, field, t, v); e = gdmx_get_field(a, ctx_in, field); gdmx_convert_scalar(e, &ctx, t, -1, v); dreturnvoid(); } static int gdmx_is_zero(const mxArray *a) { double v; dtrace("%p", a); if (gdmx_convert_scalar(a, NULL, GD_FLOAT64, -1, &v)) { dreturn("%i", 0); return 0; } dreturn("%i", v ? 0 : 1); return v ? 0 : 1; } /* strings created thus need to be mxFree'd by the caller */ static char *gdmx_to_string_(const mxArray *a, const struct gdmx_context_t *ctx, int null_ok) { char *s = NULL; dtrace("%p, %p, %i", a, ctx, null_ok); s = mxArrayToString(a); if (s == NULL) { if (null_ok && gdmx_is_zero(a)) { dreturn("%p", NULL); return NULL; } if (ctx) mexErrMsgIdAndTxt("GetData:GDMX:StringConversion", "Unable to interpret %s as string.", gdmx_context(ctx, 0)); } dreturn("\"%s\"", s); return s; } char *gdmx_to_string(const mxArray **rhs, int n, int null_ok) { struct gdmx_context_t ctx = { NULL, NULL, n }; return gdmx_to_string_(rhs[n], &ctx, null_ok); } static char *gdmx_convert_struct_string(const mxArray *a, const struct gdmx_context_t *ctx_in, const char *field) { char *s; mxArray *e; struct gdmx_context_t ctx = { ctx_in->name, field, ctx_in->num }; dtrace("%p, %p, \"%s\"", a, ctx_in, field); e = gdmx_get_field(a, ctx_in, field); s = gdmx_to_string_(e, &ctx, 1); dreturn("\"%s\"", s ? s : "(nil)"); return s; } static double gdmx_to_double_(const mxArray *a, const struct gdmx_context_t *ctx) { double v; dtrace("%p, %p", a, ctx); gdmx_convert_scalar(a, ctx, GD_FLOAT64, -1, &v); dreturn("%g", v); return v; } double gdmx_to_double(const mxArray **rhs, int n) { struct gdmx_context_t ctx = { NULL, NULL, n }; return gdmx_to_double_(rhs[n], &ctx); } static int gdmx_to_int_(const mxArray *a, const struct gdmx_context_t *ctx) { int v; dtrace("%p, %p", a, ctx); gdmx_convert_scalar(a, ctx, GD_INT_TYPE, -1, &v); dreturn("%i", v); return v; } int gdmx_to_int(const mxArray **rhs, int n) { struct gdmx_context_t ctx = { NULL, NULL, n }; return gdmx_to_int_(rhs[n], &ctx); } static long long gdmx_to_llong_(const mxArray *a, const struct gdmx_context_t *ctx) { int64_t v; dtrace("%p, %p", a, ctx); gdmx_convert_scalar(a, ctx, GD_INT64, -1, &v); dreturn("%lli", (long long)v); return (long long)v; } long long gdmx_to_llong(const mxArray **rhs, int n) { struct gdmx_context_t ctx = { NULL, NULL, n }; return gdmx_to_llong_(rhs[n], &ctx); } static unsigned long long gdmx_to_ullong_(const mxArray *a, const struct gdmx_context_t *ctx) { uint64_t v; dtrace("%p, %p", a, ctx); gdmx_convert_scalar(a, ctx, GD_UINT64, -1, &v); dreturn("%llu", (unsigned long long)v); return (unsigned long long)v; } unsigned long long gdmx_to_ullong(const mxArray **rhs, int n) { struct gdmx_context_t ctx = { NULL, NULL, n }; return gdmx_to_ullong_(rhs[n], &ctx); } static unsigned long gdmx_to_ulong_(const mxArray *a, const struct gdmx_context_t *ctx) { uint64_t v; dtrace("%p, %p", a, ctx); gdmx_convert_scalar(a, ctx, GD_UINT64, -1, &v); dreturn("%lu", (unsigned long)v); return (unsigned long)v; } unsigned long gdmx_to_ulong(const mxArray **rhs, int n) { struct gdmx_context_t ctx = { NULL, NULL, n }; return gdmx_to_ulong_(rhs[n], &ctx); } static mxArray *gdmx_from_cdouble(double* x) { mxArray *lhs; dtrace("{%g, %g}", x[0], x[1]); lhs = mxCreateNumericMatrix(1, 1, mxDOUBLE_CLASS, mxCOMPLEX); *((double*)mxGetData(lhs)) = x[0]; *((double*)mxGetImagData(lhs)) = x[1]; dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_bool(int x) { mxArray *lhs; dtrace("%i", x); lhs = mxCreateLogicalScalar(x ? true : false); dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_long(long x) { mxArray *lhs; dtrace("%li", x); lhs = mxCreateNumericMatrix(1, 1, mxINT32_CLASS, mxREAL); *((int32_t*)mxGetData(lhs)) = x; dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_llong(long long x) { mxArray *lhs; dtrace("%lli", x); lhs = mxCreateNumericMatrix(1, 1, mxINT64_CLASS, mxREAL); *((int64_t*)mxGetData(lhs)) = x; dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_ulong(unsigned long x) { mxArray *lhs; dtrace("%lu", x); lhs = mxCreateNumericMatrix(1, 1, mxUINT32_CLASS, mxREAL); *((uint32_t*)mxGetData(lhs)) = x; dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_ullong(unsigned long long x) { mxArray *lhs; dtrace("%llu", x); lhs = mxCreateNumericMatrix(1, 1, mxUINT64_CLASS, mxREAL); *((uint64_t*)mxGetData(lhs)) = x; dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_triplet(gd_triplet_t datum, gd_windop_t windop) { mxArray *a; dtrace("{%g, %llu, %lli}, %i", datum.r, datum.u, datum.i, windop); switch (windop) { case GD_WINDOP_EQ: case GD_WINDOP_NE: a = gdmx_from_llong(datum.i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: a = gdmx_from_ullong(datum.u); break; default: a = gdmx_from_double(datum.r); break; } dreturn("%p", a); return a; } mxArray *gdmx_from_data(const void *data, gd_type_t type, size_t n) { mxArray *a; dtrace("%p, 0x%X, %zu", data, type, n); a = mxCreateNumericMatrix(1, n, gdmx_classid(type), (type & GD_COMPLEX) ? mxCOMPLEX : mxREAL); if (type == GD_COMPLEX64) { size_t i; float *p, *pr, *pi; p = (float*)data; pr = (float*)mxGetData(a); pi = (float*)mxGetImagData(a); for (i = 0; i < n; ++i) { pr[i] = *(p++); pi[i] = *(p++); } } else if (type == GD_COMPLEX128) { size_t i; double *p, *pr, *pi; p = (double*)data; pr = (double*)mxGetData(a); pi = (double*)mxGetImagData(a); for (i = 0; i < n; ++i) { pr[i] = *(p++); pi[i] = *(p++); } } else memcpy(mxGetData(a), data, GD_SIZE(type) * n); dreturn("%p", a); return a; } mxArray *gdmx_from_nstring_list(const char **l, size_t n) { mxArray *lhs; size_t i; dtrace("%p, %zu", l, n); /* create and populate cell array */ lhs = mxCreateCellMatrix(1, n); for (i = 0; i < n; ++i) if (l[i] == NULL) mxSetCell(lhs, i, mxCreateDoubleScalar(0)); else mxSetCell(lhs, i, mxCreateString(l[i])); dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_string_list(const char **l) { mxArray *lhs; mxArray **s = NULL, **ptr; int i; dtrace("%p", l); /* count and stringify */ for (i = 0; l[i]; ++i) { ptr = (mxArray **)mxRealloc(s, sizeof(mxArray*) * (i + 1)); if (ptr == NULL) { mxFree(s); mexErrMsgIdAndTxt("GetData:GDMX:Alloc", "Out of memory."); } s = ptr; s[i] = mxCreateString(l[i]); } /* create and populate cell array */ lhs = mxCreateCellMatrix(1, i); for (--i; i >= 0; --i) mxSetCell(lhs, i, s[i]); mxFree(s); dreturn("%p", lhs); return lhs; } #define GDMX_COMMON_FIELDS "field", "field_type", "fragment_index" #define GDMX_NCOMMON 3 #define GDMX_SCALAR_FIELDS "scalar", "scalar_ind" #define GDMX_NSCALAR 2 mxArray *gdmx_from_entry(const gd_entry_t *E) { mxArray *lhs; int nfields = 0; int nscalar = 0; const char **field_names = NULL; /* field lists */ const int bit_nfields = GDMX_NSCALAR + 3; const char *bit_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "bitnum", "numbits", GDMX_SCALAR_FIELDS}; const int carray_nfields = 2; const char *carray_fields[] = {GDMX_COMMON_FIELDS, "const_type", "array_len"}; const int const_nfields = 1; const char *const_fields[] = {GDMX_COMMON_FIELDS, "const_type"}; const int lincom_nfields = GDMX_NSCALAR + 3; const char *lincom_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "m", "b", GDMX_SCALAR_FIELDS}; const int linterp_nfields = 2; const char *linterp_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "table"}; const int mplex_nfields = GDMX_NSCALAR + 3; const char *mplex_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "count_val", "period", GDMX_SCALAR_FIELDS}; const int multiply_nfields = 1; const char *multiply_fields[] = {GDMX_COMMON_FIELDS, "in_fields"}; const int phase_nfields = GDMX_NSCALAR + 2; const char *phase_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "shift", GDMX_SCALAR_FIELDS}; const int polynom_nfields = GDMX_NSCALAR + 2; const char *polynom_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "a", GDMX_SCALAR_FIELDS}; const int raw_nfields = GDMX_NSCALAR + 2; const char *raw_fields[] = {GDMX_COMMON_FIELDS, "spf", "data_type", GDMX_SCALAR_FIELDS}; const int recip_nfields = GDMX_NSCALAR + 2; const char *recip_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "dividend", GDMX_SCALAR_FIELDS}; const int window_nfields = GDMX_NSCALAR + 3; const char *window_fields[] = {GDMX_COMMON_FIELDS, "in_fields", "windop", "threshold", GDMX_SCALAR_FIELDS}; const char *common_fields[] = {GDMX_COMMON_FIELDS}; dtrace("%p", E); switch (E->field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: nfields = GDMX_NCOMMON + bit_nfields; field_names = bit_fields; break; case GD_CARRAY_ENTRY: nfields = GDMX_NCOMMON + carray_nfields; field_names = carray_fields; break; case GD_CONST_ENTRY: nfields = GDMX_NCOMMON + const_nfields; field_names = const_fields; break; case GD_INDEX_ENTRY: case GD_STRING_ENTRY: nfields = GDMX_NCOMMON; field_names = common_fields; break; case GD_LINCOM_ENTRY: nfields = GDMX_NCOMMON + lincom_nfields; field_names = lincom_fields; break; case GD_LINTERP_ENTRY: nfields = GDMX_NCOMMON + linterp_nfields; field_names = linterp_fields; break; case GD_MPLEX_ENTRY: nfields = GDMX_NCOMMON + mplex_nfields; field_names = mplex_fields; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: nfields = GDMX_NCOMMON + multiply_nfields; field_names = multiply_fields; break; case GD_PHASE_ENTRY: nfields = GDMX_NCOMMON + phase_nfields; field_names = phase_fields; break; case GD_POLYNOM_ENTRY: nfields = GDMX_NCOMMON + polynom_nfields; field_names = polynom_fields; break; case GD_RAW_ENTRY: nfields = GDMX_NCOMMON + raw_nfields; field_names = raw_fields; break; case GD_RECIP_ENTRY: nfields = GDMX_NCOMMON + recip_nfields; field_names = recip_fields; break; case GD_WINDOW_ENTRY: nfields = GDMX_NCOMMON + window_nfields; field_names = window_fields; break; default: GDMX_INTERNAL_ERROR; } lhs = mxCreateStructMatrix(1, 1, nfields, field_names); /* populate */ mxSetField(lhs, 0, "field", mxCreateString(E->field)); mxSetField(lhs, 0, "field_type", gdmx_from_entype(E->field_type)); mxSetField(lhs, 0, "fragment_index", gdmx_from_int(E->fragment_index)); switch (E->field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0])); mxSetField(lhs, 0, "bitnum", gdmx_from_int(E->EN(bit,bitnum))); mxSetField(lhs, 0, "numbits", gdmx_from_int(E->EN(bit,numbits))); nscalar = 2; break; case GD_CARRAY_ENTRY: mxSetField(lhs, 0, "array_len", gdmx_from_size_t(E->EN(scalar,array_len))); /* fallthrough */ case GD_CONST_ENTRY: mxSetField(lhs, 0, "const_type", gdmx_from_gd_type(E->EN(scalar,const_type))); break; case GD_INDEX_ENTRY: case GD_STRING_ENTRY: break; case GD_LINCOM_ENTRY: mxSetField(lhs, 0, "in_fields", gdmx_from_nstring_list((const char**)E->in_fields, E->EN(lincom,n_fields))); if (E->flags & GD_EN_COMPSCAL) { mxSetField(lhs, 0, "m", gdmx_from_data(E->EN(lincom,cm), GD_COMPLEX128, E->EN(lincom,n_fields))); mxSetField(lhs, 0, "b", gdmx_from_data(E->EN(lincom,cb), GD_COMPLEX128, E->EN(lincom,n_fields))); } else { mxSetField(lhs, 0, "m", gdmx_from_data(E->EN(lincom,m), GD_FLOAT64, E->EN(lincom,n_fields))); mxSetField(lhs, 0, "b", gdmx_from_data(E->EN(lincom,b), GD_FLOAT64, E->EN(lincom,n_fields))); } nscalar = GD_MAX_LINCOM * 2; break; case GD_LINTERP_ENTRY: mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0])); mxSetField(lhs, 0, "table", mxCreateString(E->EN(linterp,table))); break; case GD_MPLEX_ENTRY: mxSetField(lhs, 0, "in_fields", gdmx_from_nstring_list((const char**)E->in_fields, 2)); mxSetField(lhs, 0, "count_val", gdmx_from_int(E->EN(mplex,count_val))); mxSetField(lhs, 0, "period", gdmx_from_int(E->EN(mplex,period))); nscalar = 2; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: mxSetField(lhs, 0, "in_fields", gdmx_from_nstring_list((const char**)E->in_fields, 2)); break; case GD_PHASE_ENTRY: mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0])); mxSetField(lhs, 0, "shift", gdmx_from_llong(E->EN(phase,shift))); nscalar = 1; break; case GD_POLYNOM_ENTRY: mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0])); if (E->flags & GD_EN_COMPSCAL) { mxSetField(lhs, 0, "a", gdmx_from_data(E->EN(polynom,ca), GD_COMPLEX128, E->EN(polynom,poly_ord) + 1)); } else { mxSetField(lhs, 0, "a", gdmx_from_data(E->EN(polynom,a), GD_FLOAT64, E->EN(polynom,poly_ord) + 1)); } nscalar = E->EN(polynom,poly_ord) + 1; break; case GD_RAW_ENTRY: mxSetField(lhs, 0, "data_type", gdmx_from_gd_type(E->EN(raw,data_type))); mxSetField(lhs, 0, "spf", gdmx_from_uint(E->EN(raw,spf))); nscalar = 1; break; case GD_RECIP_ENTRY: mxSetField(lhs, 0, "in_fields", mxCreateString(E->in_fields[0])); if (E->flags & GD_EN_COMPSCAL) mxSetField(lhs, 0, "dividend", gdmx_from_cdouble((double*)&E->EN(recip,cdividend))); else mxSetField(lhs, 0, "dividend", gdmx_from_double(E->EN(recip,dividend))); nscalar = 1; break; case GD_WINDOW_ENTRY: mxSetField(lhs, 0, "in_fields", gdmx_from_nstring_list((const char**)E->in_fields, 2)); mxSetField(lhs, 0, "windop", gdmx_from_windop(E->EN(window,windop))); mxSetField(lhs, 0, "threshold", gdmx_from_triplet(E->EN(window,threshold), E->EN(window,windop))); nscalar = 1; break; default: GDMX_INTERNAL_ERROR; } /* handle scalars */ if (nscalar > 0) { mxSetField(lhs, 0, "scalar", gdmx_from_nstring_list((const char **)E->scalar, nscalar)); mxSetField(lhs, 0, "scalar_ind", gdmx_from_data(E->scalar_ind, GD_INT_TYPE, nscalar)); } dreturn("%p", lhs); return lhs; } mxArray *gdmx_from_carrays(const gd_carray_t *c, gd_type_t type) { size_t i, n, comp; mxArray *lhs; mxClassID id; dtrace("%p, 0x%X", c, type); id = gdmx_classid(type); comp = type & GD_COMPLEX; /* count */ for (n = 0; c[n].n; ++n) ; lhs = mxCreateCellMatrix(1, n); for (n = 0; c[n].n; ++n) { mxArray *a = mxCreateNumericMatrix(1, c[n].n, id, comp ? mxCOMPLEX : mxREAL); void *pr = mxGetData(a); if (type == GD_COMPLEX128) { double *pi = mxGetImagData(a); for (i = 0; i < c[n].n; ++i) { ((double*)pr)[i] = ((double*)c[n].d)[2 * i]; pi[i] = ((double*)c[n].d)[2 * i + 1]; } } else if (type == GD_COMPLEX64) { float *pi = mxGetImagData(a); for (i = 0; i < c[n].n; ++i) { ((float*)pr)[i] = ((float*)c[n].d)[2 * i]; pi[i] = ((float*)c[n].d)[2 * i + 1]; } } else memcpy(pr, c[n].d, GD_SIZE(type) * c[n].n); mxSetCell(lhs, n, a); } dreturn("%p", lhs); return lhs; } #define GDMX_MXDIRFILE_FMT "MXDIRFILE:%p;" mxArray *gdmx_from_dirfile(const DIRFILE *D) { dtrace("%p", D); mxArray *a; char s[100]; sprintf(s, GDMX_MXDIRFILE_FMT, D); a = mxCreateString(s); dreturn("%p (\"%s\")", a, s); return a; } DIRFILE *gdmx_to_dirfile(const mxArray *mxa) { DIRFILE *D = NULL; const char *dirfile; dtrace("%p", mxa); dirfile = mxArrayToString(mxa); if (dirfile) sscanf(dirfile, GDMX_MXDIRFILE_FMT, &D); else mexErrMsgIdAndTxt("GetData:GDMX:BadMXDirfile", "Indeciperhable MXDirfile.", dirfile); if (D == NULL) mexErrMsgIdAndTxt("GetData:GDMX:BadMXDirfile", "Indeciperhable MXDirfile: '%s'.", dirfile); dreturn("%p", D); return D; } void gdmx_free_entry(gd_entry_t *E) { int i, ns = 0, ni = 0; dtrace("%p", E); if (E) { switch (E->field_type) { case GD_LINCOM_ENTRY: ni = E->EN(lincom,n_fields); ns = ni * 2; break; case GD_LINTERP_ENTRY: mxFree(E->EN(linterp,table)); case GD_DIVIDE_ENTRY: case GD_MULTIPLY_ENTRY: ni = 2; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: ni = 1; ns = 2; break; case GD_PHASE_ENTRY: case GD_RECIP_ENTRY: ns = ni = 1; break; case GD_POLYNOM_ENTRY: ni = 1; ns = E->EN(polynom,poly_ord) + 1; break; case GD_RAW_ENTRY: ni = 1; break; case GD_WINDOW_ENTRY: ni = 2; ns = 1; break; case GD_MPLEX_ENTRY: ni = ns = 2; break; default: break; } for (i = 0; i < ni; ++i) if (E->in_fields[i]) mxFree(E->in_fields[i]); for (i = 0; i < ns; ++i) if (E->scalar[i]) mxFree(E->scalar[i]); mxFree(E); } dreturnvoid(); } static int gdmx_convert_in_fields(const mxArray *str, const struct gdmx_context_t *ctx, gd_entry_t *E) { mxArray *a; size_t i, nelem = 1; struct gdmx_context_t ectx = { ctx->name, "in_fields", ctx->num }; dtrace("%p, %p, %p", str, ctx, E); a = gdmx_get_field(str, ctx, "in_fields"); if (mxIsCell(a)) { nelem = gdmx_get_length(a); if (nelem > GD_MAX_LINCOM) nelem = GD_MAX_LINCOM; for (i = 0; i < nelem; ++i) { E->in_fields[i] = gdmx_to_string_(mxGetCell(a, i), &ectx, 1); } } else if (mxIsChar(a)) /* a single in_field */ E->in_fields[0] = gdmx_to_string_(a, &ectx, 0); else if (gdmx_is_zero(a)) E->in_fields[0] = NULL; else mexErrMsgIdAndTxt("GetData:GDMX:BadEntry", "Expected cell array or string %s.", gdmx_context(&ectx, 0)); dreturn("%i", nelem); return nelem; } static int gdmx_convert_entry_array(const mxArray *str, const struct gdmx_context_t *ctx, const char *field, GD_DCOMPLEXV(d), size_t nelem) { size_t i; mxArray *a; GD_DCOMPLEXP_t v; struct gdmx_context_t ectx = { ctx->name, field, ctx->num }; dtrace("%p, %p, \"%s\", %p, %zu", str, ctx, field, d, nelem); a = gdmx_get_field(str, ctx, field); v = gdmx_convert_array(a, &ectx, GD_COMPLEX128, &nelem); for (i = 0; i < nelem; ++i) gd_ca2cs_(d[i],v,i); mxFree(v); dreturn("%i", nelem); return nelem; } gd_entry_t *gdmx_to_entry(const mxArray **rhs, int n, unsigned flags) { int v; uint64_t s; size_t nscalar = 0; gd_entry_t *E; struct gdmx_context_t ctx = { NULL, NULL, n }; dtrace("%p, %i, %x", rhs, n, flags); /* check for struct */ if (!mxIsStruct(rhs[n])) mexErrMsgIdAndTxt("GetData:GDMX:BadEntry", "Expected entry struct for %s.", gdmx_context(&ctx, 0)); E = mxMalloc(sizeof(gd_entry_t)); memset(E, 0, sizeof(gd_entry_t)); /* fill the entry */ if (~flags & GDMX_ENO_FIELD) E->field = gdmx_convert_struct_string(rhs[n], &ctx, "field"); gdmx_convert_struct_scalar(rhs[n], &ctx, "field_type", GD_INT_TYPE, &v); E->field_type = v; if (~flags & GDMX_ENO_FRAG) gdmx_convert_struct_scalar(rhs[n], &ctx, "fragment_index", GD_INT_TYPE, &E->fragment_index); switch (E->field_type) { case GD_BIT_ENTRY: case GD_SBIT_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); gdmx_convert_struct_scalar(rhs[n], &ctx, "bitnum", GD_INT_TYPE, &E->EN(bit,bitnum)); gdmx_convert_struct_scalar(rhs[n], &ctx, "numbits", GD_INT_TYPE, &E->EN(bit,numbits)); break; case GD_CARRAY_ENTRY: gdmx_convert_struct_scalar(rhs[n], &ctx, "array_len", GD_UINT64, &s); E->EN(scalar,array_len) = (size_t)s; /* fallthrough */ case GD_CONST_ENTRY: gdmx_convert_struct_scalar(rhs[n], &ctx, "const_type", GD_INT_TYPE, &v); E->EN(scalar,const_type) = v; break; case GD_DIVIDE_ENTRY: case GD_MULTIPLY_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); break; case GD_LINCOM_ENTRY: E->EN(lincom,n_fields) = gdmx_convert_in_fields(rhs[n], &ctx, E); E->flags |= GD_EN_COMPSCAL; gdmx_convert_entry_array(rhs[n], &ctx, "m", E->EN(lincom,cm), E->EN(lincom,n_fields)); gdmx_convert_entry_array(rhs[n], &ctx, "b", E->EN(lincom,cb), E->EN(lincom,n_fields)); break; case GD_LINTERP_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); E->EN(linterp,table) = gdmx_convert_struct_string(rhs[n], &ctx, "table"); break; case GD_MPLEX_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); gdmx_convert_struct_scalar(rhs[n], &ctx, "count_val", GD_INT_TYPE, &E->EN(mplex,count_val)); gdmx_convert_struct_scalar(rhs[n], &ctx, "period", GD_INT_TYPE, &E->EN(mplex,period)); break; case GD_PHASE_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); gdmx_convert_struct_scalar(rhs[n], &ctx, "shift", GD_INT64, &E->EN(phase,shift)); break; case GD_POLYNOM_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); E->flags |= GD_EN_COMPSCAL; E->EN(polynom,poly_ord) = gdmx_convert_entry_array(rhs[n], &ctx, "a", E->EN(polynom,ca), GD_MAX_POLYORD + 1) - 1; break; case GD_RAW_ENTRY: gdmx_convert_struct_scalar(rhs[n], &ctx, "data_type", GD_INT_TYPE, &v); E->EN(raw,data_type) = v; gdmx_convert_struct_scalar(rhs[n], &ctx, "spf", GD_UINT_TYPE, &E->EN(raw,spf)); nscalar = 1; break; case GD_RECIP_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); E->flags |= GD_EN_COMPSCAL; gdmx_convert_struct_scalar(rhs[n], &ctx, "dividend", GD_COMPLEX128, &E->EN(recip,cdividend)); break; case GD_STRING_ENTRY: break; case GD_WINDOW_ENTRY: gdmx_convert_in_fields(rhs[n], &ctx, E); gdmx_convert_struct_scalar(rhs[n], &ctx, "windop", GD_INT_TYPE, &v); E->EN(window,windop) = v; switch (v) { case GD_WINDOP_EQ: case GD_WINDOP_NE: gdmx_convert_struct_scalar(rhs[n], &ctx, "threshold", GD_INT64, &E->EN(window,threshold).i); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: gdmx_convert_struct_scalar(rhs[n], &ctx, "threshold", GD_UINT64, &E->EN(window,threshold).u); break; default: gdmx_convert_struct_scalar(rhs[n], &ctx, "threshold", GD_FLOAT64, &E->EN(window,threshold).r); break; } break; default: mexErrMsgIdAndTxt("GetData:GDMX:BadEntryType", "Invalid field_type %i for entry struct in parameter %i.", E->field_type, n); } if (nscalar > 0) { mxArray *scalar = gdmx_get_field(rhs[n], NULL, "scalar"); if (scalar) { int *si = NULL; mxArray *scalar_ind = gdmx_get_field(rhs[n], NULL, "scalar_ind"); if (scalar_ind) { struct gdmx_context_t si_ctx = { NULL, "scalar_ind", n }; si = gdmx_convert_array(scalar_ind, &si_ctx, GD_INT_TYPE, &nscalar); } if (mxIsChar(scalar)) { /* a single scalar */ E->scalar[0] = gdmx_to_string_(scalar, NULL, 0); if (si) E->scalar_ind[0] = si[0]; else E->scalar_ind[0] = -1; } else if (!mxIsCell(scalar)) mexErrMsgIdAndTxt("GetData:GDMX:BadEntryScalars", "Field 'scalar' must be a string or cell array in parameter %i", n); else { abort(); } mxFree(si); } } dreturn("%p", E); return E; } /* convert nframes and nsamples from the rhs into nsamples */ size_t gdmx_to_nsamp(DIRFILE *D, const char *field_code, const mxArray **rhs, int nf, int ns) { size_t nframes; size_t nsamp; dtrace("%p, %i, %i", rhs, nf, ns); nframes = gdmx_to_size_t(rhs, nf); nsamp = gdmx_to_size_t(rhs, ns); if (nframes > 0) { unsigned int spf = gd_spf(D, field_code); gdmx_err(D, 0); /* overflow */ if ((GD_SIZE_T_MAX - nsamp) / spf <= nframes) mexErrMsgIdAndTxt("GetData:GDMX:Overflow", "Data range too large."); nsamp += spf * nframes; } dreturn("%zu", nsamp); return nsamp; } /* create a matlab vector; call gdmx_fix_vector after loading data */ mxArray *gdmx_vector(gd_type_t type, size_t nsamp, void **data) { mxArray *lhs; mxComplexity cflag = (type & GD_COMPLEX) ? mxCOMPLEX : mxREAL; dtrace("0x%X, %zu, %p", type, nsamp, data); lhs = mxCreateNumericMatrix(1, (mwSize)nsamp, gdmx_classid(type), cflag); if (data) { /* in the complex place, we have to do the load out-of-place */ if (type & GD_COMPLEX) *data = mxMalloc(GD_SIZE(type) * nsamp); else *data = mxGetData(lhs); } dreturn("%p (%p)", lhs, data ? *data : NULL); return lhs; } /* store complex data, if necessary */ void gdmx_fix_vector(mxArray *lhs, gd_type_t type, size_t nsamp, void *data) { dtrace("%p, 0x%x, %zu, %p", lhs, type, nsamp, data); if (type & GD_COMPLEX) { size_t i; if (type == GD_COMPLEX64) { const float *ptr = (float *)data; float *pr = (float*)mxGetData(lhs); float *pi = (float*)mxGetImagData(lhs); for (i = 0; i < nsamp; ++i) { pr[i] = *(ptr++); pi[i] = *(ptr++); } } else { const double *ptr = (double *)data; double *pr = (double*)mxGetData(lhs); double *pi = (double*)mxGetImagData(lhs); for (i = 0; i < nsamp; ++i) { pr[i] = *(ptr++); pi[i] = *(ptr++); } } mxFree(data); } dreturnvoid(); } void gdmx_to_data(void **data, gd_type_t *type, size_t *nsamp, const mxArray *rhs, int n) { int cflag = 0; size_t i, ndims, ns = 1; gd_type_t t; const mwSize *dims; struct gdmx_context_t ctx = { NULL, NULL, n }; dtrace("%p, %p, %p, %p, %i", data, type, nsamp, rhs, n); /* check for complex data */ if (mxIsComplex(rhs)) cflag = 1; /* datatype */ *type = t = gdmx_type(rhs, &ctx, cflag); /* length */ ndims = mxGetNumberOfDimensions(rhs); dims = mxGetDimensions(rhs); for (i = 0; i < ndims; ++i) ns *= dims[i]; *nsamp = ns; /* complex data needs a temporary buffer */ if (t == GD_COMPLEX64) { float *d, *pr, *pi; *data = mxMalloc(sizeof(float) * 2 * ns); d = (float*)*data; pr = (float*)mxGetData(rhs); pi = (float*)mxGetImagData(rhs); for (i = 0; i < ns; ++i) { d[i * 2] = pr[i]; d[i * 2 + 1] = pi[i]; } } else if (t == GD_COMPLEX128) { double *d, *pr, *pi; *data = mxMalloc(sizeof(double) * 2 * ns); d = (double*)*data; pr = (double*)mxGetData(rhs); pi = (double*)mxGetImagData(rhs); for (i = 0; i < ns; ++i) { d[i * 2] = pr[i]; d[i * 2 + 1] = pi[i]; } } else *data = mxGetData(rhs); dreturn("%p; 0x%X, %zu", *data, *type, *nsamp); } void gdmx_free_data(void *data, gd_type_t type) { dtrace("%p, 0x%X", data, type); if (type & GD_COMPLEX) mxFree(data); dreturnvoid(); } void gdmx_to_sdata(const char ***data, size_t *nsamp, const mxArray *rhs, int n) { size_t i, ndims, ns; const mwSize *dims; struct gdmx_context_t ctx = { NULL, NULL, n }; dtrace("%p, %p, %p, %i", data, nsamp, rhs, n); if (!mxIsCell(rhs)) mexErrMsgIdAndTxt("GetData:GDMX:BadData", "Expected cell array of strings in %s, %i.", gdmx_context(&ctx, 0), (int)mxGetClassID(rhs)); *nsamp = ns = gdmx_get_length(rhs); /* create the string list */ *data = mxMalloc(sizeof(**data) * ns); for (i = 0; i < ns; ++i) (*data)[i] = gdmx_to_string_(mxGetCell(rhs, i), &ctx, 1); dreturn("%p; %zu", *data, *nsamp); } void gdmx_free_sdata(const char **data, size_t n) { size_t i; dtrace("%p, %zu", data, n); for (i = 0; i < n; ++i) mxFree((char*)data[i]); mxFree(data); dreturnvoid(); } libgetdata-0.9.0/bindings/matlab/gd_field_list_by_type.m0000640000175000017500000000222112614323564023537 0ustar alastairalastairfunction field_list = gd_field_list_by_type(D, type) % GD_FIELD_LIST_BY_TYPE Retrieve a list of field names % % GD_FIELD_LIST_BY_TYPE(DIRFILE,TYPE) % is equivalent to calling GD_ENTRY_LIST(DIRFILE,0,TYPE,0) % % See also GD_ENTRY_LIST field_list = gd_entry_list(D, 0, type, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd_recip.m0000640000175000017500000000312512614323564021761 0ustar alastairalastairfunction gd_madd_recip(D, parent, field_code, in_fields, dividend) % GD_MADD_RECIP Add a RECIP metafield % % GD_MADD_RECIP(DIRFILE,PARENT,NAME,INPUT,DIVIDEND) % adds a RECIP metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input field is INPUT, and the dividend % DIVIDEND. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_recip(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_RECIP, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.RECIP_ENTRY, ... 'in_fields', {in_fields}, 'dividend', dividend), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd_polynom.m0000640000175000017500000000312312614323564022352 0ustar alastairalastairfunction gd_madd_polynom(D, parent, field_code, in_fields, a) % GD_MADD_POLYNOM Add a POLYNOM metafield % % GD_MADD_POLYNOM(DIRFILE,PARENT,NAME,INPUT,A) % adds a POLYNOM metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input field is INPUT and the vector of % co-efficients is A. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_polynom(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_POLYNOM, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.POLYNOM_ENTRY, ... 'in_fields', {in_fields}, 'a', a), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_protection.c0000640000175000017500000000344612614323564023243 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_PROTECTION Modify the byte sex of a fragment % % GD_ALTER_PROTECTION(DIRFILE,LEVEL,FRAGMENT) % sets the protection level of the metadata fragment indexed by % FRAGMENT in the dirfile DIRFILE to LEVEL, which should be one of % the GD.PROTECT_[...] symbols provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_protection(3) in % section 3 of the UNIX manual for more details. % % See also GD_PROTECTION, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i, n; GDMX_NO_LHS; GDMX_CHECK_RHS(3); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); n = gdmx_to_int(prhs, 2); gd_alter_protection(D, n, i); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_include.c0000640000175000017500000000443012614323564021303 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_INCLUDE Add a format metadata fragment % % GD_INCLUDE(DIRFILE,PATH,PARENT,FLAGS[,PREFIX[,SUFFIX]]) % adds the fragment at PATH to the open dirfile DIRFILE below the % current fragment indexed by PARENT. FLAGS should be zero or more % Dirfile flags provided by GETDATA_CONSTANTS, bitwise-or'd % together. If given an not numeric zero, PREFIX and SUFFIX % provide the fragment affixes. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_include_affix(3) in % section 3 of the UNIX manual for more details. % % See also GD_UNINCLUDE, GD_FRAGMENT_AFFIXES, GD_ALTER_AFFIXEX, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *filename; char *prefix = NULL, *suffix = NULL; int parent, n; unsigned long flags; GDMX_CHECK_RHS2(4,6); D = gdmx_to_dirfile(prhs[0]); filename = gdmx_to_string(prhs, 1, 0); parent = gdmx_to_int(prhs, 2); flags = gdmx_to_ulong(prhs, 3); if (nrhs > 4) prefix = gdmx_to_string(prhs, 4, 1); if (nrhs > 5) suffix = gdmx_to_string(prhs, 5, 1); n = gd_include_affix(D, filename, parent, prefix, suffix, flags); mxFree(filename); mxFree(prefix); mxFree(suffix); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_hidden.c0000640000175000017500000000321512614323564021113 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_HIDDEN Report whether a field is hidden % % B = GD_HIDDEN(DIRFILE,FIELD_CODE) % returns boolean true, B, if FIELD_CODE is hidden in the metadata. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_hidden(3) in section 3 % of the UNIX manual for more details. % % See also GD_HIDE, GD_UNHIDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; int n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_hidden(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_bool(n); } libgetdata-0.9.0/bindings/matlab/gd_add_spec.c0000640000175000017500000000336612614323564021431 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ADD_SPEC Add a field % % GD_ADD_SPEC(DIRFILE,SPEC,FRAGMENT) % adds a field described by the field specification line SPEC to % the dirfile DIRFILE. The field is added to the fragment indexed % by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_spec(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_SPEC, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *spec; int fragment_index; GDMX_NO_LHS; GDMX_CHECK_RHS(3); D = gdmx_to_dirfile(prhs[0]); spec = gdmx_to_string(prhs, 1, 0); fragment_index = gdmx_to_int(prhs, 2); gd_add_spec(D, spec, fragment_index); mxFree(spec); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_const.m0000640000175000017500000000321512614323564022207 0ustar alastairalastairfunction gd_alter_const(D, field_code, const_type) % GD_ALTER_CONST Modify the metadata of a CONST field % % GD_ALTER_CONST(DIRFILE,NAME,TYPE) % modifies the metadata of the CONST field called NAME in the % dirfile specified by DIRFILE, setting the storage type of the % field to TYPE, which should be one of the data type symbols % provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_const(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN, GETDATA_CONSTANTS GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.CONST_ENTRY, ... 'const_type', const_type), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_put_carray.m0000640000175000017500000000232312614323564022042 0ustar alastairalastairfunction gd_put_carray(D, field_code, data) % GD_PUT_CARRAY Modify CARRAY values % % GD_PUT_CARRAY(DIRFILE,FIELD_CODE,DATA) % is equivalent to calling GD_PUT_CARRAY_SLICE(DIRFILE, ... % FIELD_CODE,0,DATA) % % See also GD_PUT_CARRAY_SLICE gd_put_carray_slice(D, field_code, 0, data); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_entry_list.c0000640000175000017500000000457312614323564022064 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ENTRY_LIST Retrieve a list of field names % % L = GD_ENTRY_LIST(DIRFILE[,PARENT[,TYPE[,FLAGS]]]) % returns a cell array of strings, L, listing all fields in the % dirfile DIRFILE which satisfy the supplied PARENT, TYPE, and/or % FLAGS. % % If PARENT is given, and not numeric zero, metafields of the specified % parent field will be searched. Otherwise, only top level fields are % considered. If non-zero (matching all types), TYPE should be either one % of the GD.xxx_ENTRY symbols or else one of the special GD.xxx_ENTRIES % symbols provided by GETDATA_CONSTANTS. FLAGS, if given, should be zero % or more of the GD.ENTRIES_... flags, bitwise or'd together. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_entry_list(3) in % section 3 of the UNIX manual for more details. % % See also GD_NENTRIES, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *parent = NULL; unsigned int type = 0, flags = 0; const char **fl; GDMX_CHECK_RHS2(1,4); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) parent = gdmx_to_string(prhs, 1, 1); if (nrhs > 2) type = gdmx_to_uint(prhs, 2); if (nrhs > 3) flags = gdmx_to_uint(prhs, 3); fl = gd_entry_list(D, parent, type, flags); mxFree(parent); gdmx_err(D, 0); plhs[0] = gdmx_from_string_list(fl); } libgetdata-0.9.0/bindings/matlab/gd_mplex_lookback.c0000640000175000017500000000331612614323564022654 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MPLEX_LOOKBACK Set the MPLEX look-back length % % GD_MPLEX_LOOKBACK(DIRFILE,LOOKBACK) % sets the lookback length to LOOKBACK, which should be a number % or the special symbol GD.LOOKBACK_ALL provided by % GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_mplex_lookback(3) in % section 3 of the UNIX manual for more details. % % See also GD_GETDATA, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int lookback; GDMX_NO_LHS; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); lookback = gdmx_to_int(prhs, 1); gd_mplex_lookback(D, lookback); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/test/0000740000175000017500000000000012614323564020016 5ustar alastairalastairlibgetdata-0.9.0/bindings/matlab/test/Makefile.in0000640000175000017500000004667312614323564022105 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = bindings/matlab/test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2013, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests @TEST_MATLAB_TRUE@TESTS_ENVIRONMENT = ${DL_LIBRARY_PATH}=../../../src/.libs:../.libs:${${DL_LIBRARY_PATH}} MATLABPATH=${srcdir}:..:${srcdir}/.. ${srcdir}/test.sh ${MATLAB} @TEST_MATLAB_TRUE@matlabTESTS = big_test.m @TEST_MATLAB_TRUE@TESTS = $(addprefix ${srcdir}/,$(matlabTESTS)) EXTRA_DIST = ${matlabTESTS} test.sh all: all-am .SUFFIXES: $(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 bindings/matlab/test/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign bindings/matlab/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: $(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): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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-TESTS check-local 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 clean-local 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: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am check-local clean \ clean-generic clean-libtool clean-local cscopelist-am ctags-am \ 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 tags-am uninstall \ uninstall-am check-local: check-TESTS echo $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ # 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: libgetdata-0.9.0/bindings/matlab/test/Makefile.am0000640000175000017500000000250512614323564022056 0ustar alastairalastair# Copyright (C) 2013, 2014, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests if TEST_MATLAB TESTS_ENVIRONMENT=${DL_LIBRARY_PATH}=../../../src/.libs:../.libs:${${DL_LIBRARY_PATH}} MATLABPATH=${srcdir}:..:${srcdir}/.. ${srcdir}/test.sh ${MATLAB} matlabTESTS=big_test.m TESTS=$(addprefix ${srcdir}/,$(matlabTESTS)) endif EXTRA_DIST=${matlabTESTS} test.sh check-local: check-TESTS echo $(MAKE) getdata-clean-dirs getdata-clean-dirs: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dirs rm -rf *~ libgetdata-0.9.0/bindings/matlab/test/big_test.m0000640000175000017500000015322212614323564022003 0ustar alastairalastair% Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA function big_test try ne = 0; filedir='dirfile'; format=strcat(filedir, '/format'); format1=strcat(filedir, '/format1'); form2=strcat(filedir, '/form2'); data=strcat(filedir, '/data'); new1=strcat(filedir, '/new1'); format_data =[... '/ENDIAN little\n'... 'data RAW INT8 8\n'... 'lincom LINCOM data 1.1 2.2 INDEX 2.2 3.3;4.4 linterp const const\n'... '/META data mstr STRING "This is a string constant."\n'... '/META data mconst CONST COMPLEX128 3.3;4.4\n'... '/META data mcarray CARRAY FLOAT64 1.9 2.8 3.7 4.6 5.5\n'... '/META data mlut LINTERP DATA ./lut\n'... 'const CONST FLOAT64 5.5\n'... 'carray CARRAY FLOAT64 1.1 2.2 3.3 4.4 5.5 6.6\n'... 'linterp LINTERP data ./lut\n'... 'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n'... 'bit BIT data 3 4\n'... 'sbit SBIT data 5 6\n'... 'mplex MPLEX data sbit 1 10\n'... 'mult MULTIPLY data sbit\n'... 'div DIVIDE mult bit\n'... 'recip RECIP div 6.5;4.3\n'... 'phase PHASE data 11\n'... 'window WINDOW linterp mult LT 4.1\n'... '/ALIAS alias data\n'... 'string STRING "Zaphod Beeblebrox"\n'... ]; form2_data = 'const2 CONST INT8 -19\n'; fields = {'INDEX'; 'alias'; 'bit'; 'carray'; 'const'; 'data'; 'div'; ... 'lincom'; 'linterp'; 'mplex'; 'mult'; 'phase'; 'polynom'; 'recip'; ... 'sbit'; 'string'; 'window'}; nfields = 17; % Create the dirfile mkdir(filedir); fid=fopen(format, 'w'); fprintf(fid, format_data); fclose(fid); fid=fopen(form2, 'w'); fprintf(fid, form2_data); fclose(fid); data_data=0:1:80; fid=fopen(data, 'w'); fwrite(fid, data_data); fclose(fid); % 0: getdata_constants check GD = getdata_constants(); ne = ne + check_num(0, GD.RDWR, 1); % 1: gd_error check try D = gd_open('x'); catch exc ne = ne + check_exc(exc, 1, 'IO'); end % 2: gd_open check try D = gd_open(filedir, GD.RDWR); catch exc ne = ne + check_ok(exc, 2); end % 3: getdata check try d = gd_getdata(D, 'data', 5, 0, 1, 0); ne = ne + check_array(3, d, [40:47]); catch exc ne = ne + check_ok(exc, 3); end % 10: getdata check (complex128) try d = gd_getdata(D, 'data', 5, 0, 1, 0, GD.COMPLEX128); ne = ne + check_array(2, d, [ complex(40,0), complex(41,0), ... complex(42,0), complex(43,0), complex(44,0), complex(45,0), ... complex(46,0), complex(47,0) ]); catch exc ne = ne + check_ok(exc, 10); end % 12: gd_get_constant check try d = gd_get_constant(D, 'const'); ne = ne + check_num(12, d, 5.5); catch exc ne = ne + check_ok(exc, 12); end % 23: gd_nfields check try d = gd_nfields(D); ne = ne + check_num(23, d, nfields); catch exc ne = ne + check_ok(exc, 23); end % 25: gd_field_list check try d = gd_field_list(D); ne = ne + check_sarray(25, d, fields); catch exc ne = ne + check_ok(exc, 25); end % 26: gd_nmfields check try d = gd_nmfields(D, 'data'); ne = ne + check_num(26, d, 4); catch exc ne = ne + check_ok(exc, 26); end % 27: gd_mfield_list check try d = gd_mfield_list(D, 'data'); ne = ne + check_sarray(27, d, ... { 'mstr'; 'mconst'; 'mcarray'; 'mlut'; }); catch exc ne = ne + check_ok(exc, 27); end % 28: gd_nframes check try d = gd_nframes(D); ne = ne + check_num(28, d, 10); catch exc ne = ne + check_ok(exc, 28); end % 29: gd_spf check try d = gd_spf(D, 'data'); ne = ne + check_num(29, d, 8); catch exc ne = ne + check_ok(exc, 29); end % 30: gd_putdata check p = [ 13, 14, 15, 16 ]; try d = gd_putdata(D, 'data', 5, 1, p); ne = ne + check_num(30, d, 4); catch exc ne = ne + check_ok2(exc, 30, 1); end try d = gd_getdata(D, 'data', 5, 0, 1, 0); catch exc ne = ne + check_ok2(exc, 30, 2); end % 37: gd_putdata check (complex) p = [ complex(33,0), complex(34,0), complex(35,0), complex(36,0) ]; try d = gd_putdata(D, 'data', 5, 1, p); ne = ne + check_num(37, d, 4); catch exc ne = ne + check_ok2(exc, 37, 1); end try d = gd_getdata(D, 'data', 5, 0, 1, 0); ne = ne + check_array(37, d, [40, 33, 34, 35, 36, 45, 46, 47]); catch exc ne = ne + check_ok2(exc, 37, 2); end % 38: error_string try gd_getdata(D, 'x', 1, 0, 1, 0); catch exc ne = ne + check_exc(exc, 38, 'BadCode'); end ne = ne + check_num(38, gd_error(D), GD.E_BAD_CODE); ne = ne + check_string(38, gd_error_string(D), 'Field not found: x'); % 39: entry_type try d = gd_entry_type(D, 'data'); ne = ne + check_num(39, d, GD.RAW_ENTRY); catch exc ne = ne + check_ok(exc, 39); end % 40: entry (raw) check try d = gd_entry(D, 'data'); ne = ne + check_string2(40, 1, d.field, 'data'); ne = ne + check_num2(40, 2, d.field_type, GD.RAW_ENTRY); ne = ne + check_num2(40, 3, d.fragment_index, 0); ne = ne + check_num2(40, 4, d.data_type, GD.INT8); catch exc ne = ne + check_ok(exc, 40); end % 42: entry (lincom) check try d = gd_entry(D, 'lincom'); ne = ne + check_string2(42, 1, d.field, 'lincom'); ne = ne + check_num2(42, 2, d.field_type, GD.LINCOM_ENTRY); ne = ne + check_num2(42, 3, d.fragment_index, 0); ne = ne + check_sarray2(42, 4, d.in_fields, { 'data'; 'INDEX'; 'linterp' }); ne = ne + check_array2(42, 5, d.m, [ 1.1, 2.2, 5.5 ]); ne = ne + check_array2(42, 6, d.b, [ 2.2, complex(3.3,4.4), 5.5 ]); ne = ne + check_sarray2(42, 7, d.scalar, {0; 0; 'const'; 0; 0; 'const'}); ne = ne + check_array2(42, 8, d.scalar_ind, [0, 0, -1, 0, 0, -1]); catch exc ne = ne + check_ok(exc, 42); end % 44: entry (polynom) check try d = gd_entry(D, 'polynom'); ne = ne + check_string2(44, 1, d.field, 'polynom'); ne = ne + check_num2(44, 2, d.field_type, GD.POLYNOM_ENTRY); ne = ne + check_num2(44, 3, d.fragment_index, 0); ne = ne + check_string2(44, 4, d.in_fields, 'data'); ne = ne + check_array2(44, 5, d.a, [ 1.1, 2.2, 2.2, complex(3.3, 4.4), ... 5.5, 5.5]); ne = ne + check_sarray2(44, 6, d.scalar, {0; 0; 0; 0; 'const'; 'const'}); ne = ne + check_array2(44, 7, d.scalar_ind, [0, 0, 0, 0, -1, -1]); catch exc ne = ne + check_ok(exc, 44); end % 45: entry (linterp) check try d = gd_entry(D, 'linterp'); ne = ne + check_string2(45, 1, d.field, 'linterp'); ne = ne + check_num2(45, 2, d.field_type, GD.LINTERP_ENTRY); ne = ne + check_num2(45, 3, d.fragment_index, 0); ne = ne + check_string2(45, 4, d.in_fields, 'data'); ne = ne + check_string2(45, 5, d.table, './lut'); catch exc ne = ne + check_ok(exc, 45); end % 46: entry (bit) check try d = gd_entry(D, 'bit'); ne = ne + check_string2(46, 1, d.field, 'bit'); ne = ne + check_num2(46, 2, d.field_type, GD.BIT_ENTRY); ne = ne + check_num2(46, 3, d.fragment_index, 0); ne = ne + check_string2(46, 4, d.in_fields, 'data'); ne = ne + check_num2(46, 5, d.bitnum, 3); ne = ne + check_num2(46, 6, d.numbits, 4); catch exc ne = ne + check_ok(exc, 46); end % 47: entry (sbit) check try d = gd_entry(D, 'sbit'); ne = ne + check_string2(47, 1, d.field, 'sbit'); ne = ne + check_num2(47, 2, d.field_type, GD.SBIT_ENTRY); ne = ne + check_num2(47, 3, d.fragment_index, 0); ne = ne + check_string2(47, 4, d.in_fields, 'data'); ne = ne + check_num2(47, 5, d.bitnum, 5); ne = ne + check_num2(47, 6, d.numbits, 6); catch exc ne = ne + check_ok(exc, 47); end % 48: entry (mult) check try d = gd_entry(D, 'mult'); ne = ne + check_string2(48, 1, d.field, 'mult'); ne = ne + check_num2(48, 2, d.field_type, GD.MULTIPLY_ENTRY); ne = ne + check_num2(48, 3, d.fragment_index, 0); ne = ne + check_sarray2(48, 4, d.in_fields, { 'data'; 'sbit'; }); catch exc ne = ne + check_ok(exc, 48); end % 49: entry (phase) check try d = gd_entry(D, 'phase'); ne = ne + check_string2(49, 1, d.field, 'phase'); ne = ne + check_num2(49, 2, d.field_type, GD.PHASE_ENTRY); ne = ne + check_num2(49, 3, d.fragment_index, 0); ne = ne + check_string2(49, 4, d.in_fields, 'data'); ne = ne + check_num2(49, 5, d.shift, 11); catch exc ne = ne + check_ok(exc, 49); end % 50: entry (const) check try d = gd_entry(D, 'const'); ne = ne + check_string2(50, 1, d.field, 'const'); ne = ne + check_num2(50, 2, d.field_type, GD.CONST_ENTRY); ne = ne + check_num2(50, 3, d.fragment_index, 0); ne = ne + check_num2(50, 5, d.const_type, GD.FLOAT64); catch exc ne = ne + check_ok(exc, 50); end % 51: entry (string) check try d = gd_entry(D, 'string'); ne = ne + check_string2(51, 1, d.field, 'string'); ne = ne + check_num2(51, 2, d.field_type, GD.STRING_ENTRY); ne = ne + check_num2(51, 3, d.fragment_index, 0); catch exc ne = ne + check_ok(exc, 51); end % 52: gd_fragment_index check try d = gd_fragment_index(D, 'data'); catch exc ne = ne + check_ok(exc, 52); end ne = ne + check_num(52, d, 0); % 53: add_raw try gd_add_raw(D, 'new1', GD.FLOAT64, 3, 0); catch exc ne = ne + check_ok2(exc, 53, 1); end try d = gd_entry(D, 'new1'); ne = ne + check_string2(53, 1, d.field, 'new1'); ne = ne + check_num2(53, 2, d.field_type, GD.RAW_ENTRY); ne = ne + check_num2(53, 3, d.fragment_index, 0); ne = ne + check_num2(53, 4, d.data_type, GD.FLOAT64); ne = ne + check_num2(53, 4, d.spf, 3); catch exc ne = ne + check_ok2(exc, 53, 2); end % 54: add entry (lincom) check try gd_add_lincom(D, 'new2', { 'in1'; 'in2' }, [9.9, 7.7], [8.8, 6.6], 0); catch exc ne = ne + check_ok2(exc, 54, 1); end try d = gd_entry(D, 'new2'); ne = ne + check_string2(54, 1, d.field, 'new2'); ne = ne + check_num2(54, 2, d.field_type, GD.LINCOM_ENTRY); ne = ne + check_num2(54, 3, d.fragment_index, 0); ne = ne + check_sarray2(54, 4, d.in_fields, { 'in1'; 'in2' }); ne = ne + check_array2(54, 5, d.m, [ 9.9, 7.7 ]); ne = ne + check_array2(54, 6, d.b, [ 8.8, 6.6 ]); catch exc ne = ne + check_ok2(exc, 54, 2); end % 57: add entry (polynom) check try gd_add_polynom(D, 'new5', 'in1', [3.9, 4.8, 5.7, complex(6.6,7.5)], 0); catch exc ne = ne + check_ok2(exc, 57, 1); end try d = gd_entry(D, 'new5'); ne = ne + check_string2(57, 1, d.field, 'new5'); ne = ne + check_num2(57, 2, d.field_type, GD.POLYNOM_ENTRY); ne = ne + check_num2(57, 3, d.fragment_index, 0); ne = ne + check_string2(57, 4, d.in_fields, 'in1'); ne = ne + check_array2(57, 5, d.a, [3.9, 4.8, 5.7, complex(6.6,7.5)]); catch exc ne = ne + check_ok2(exc, 57, 2); end % 58: add entry (linterp) check try gd_add_linterp(D, 'new6', 'in', './some/table', 0); catch exc ne = ne + check_ok2(exc, 58, 1); end try d = gd_entry(D, 'new6'); ne = ne + check_string2(58, 1, d.field, 'new6'); ne = ne + check_num2(58, 2, d.field_type, GD.LINTERP_ENTRY); ne = ne + check_num2(58, 3, d.fragment_index, 0); ne = ne + check_string2(58, 4, d.in_fields, 'in'); ne = ne + check_string2(58, 5, d.table, './some/table'); catch exc ne = ne + check_ok2(exc, 58, 2); end % 59: add entry (bit) check try gd_add_bit(D, 'new7', 'in', 13, 12, 0); catch exc ne = ne + check_ok2(exc, 59, 1); end try d = gd_entry(D, 'new7'); ne = ne + check_string2(59, 1, d.field, 'new7'); ne = ne + check_num2(59, 2, d.field_type, GD.BIT_ENTRY); ne = ne + check_num2(59, 3, d.fragment_index, 0); ne = ne + check_string2(59, 4, d.in_fields, 'in'); ne = ne + check_num2(59, 5, d.bitnum, 13); ne = ne + check_num2(59, 6, d.numbits, 12); catch exc ne = ne + check_ok2(exc, 59, 2); end % 60: add entry (sbit) check try gd_add_sbit(D, 'new8', 'in', 14, 15, 0); catch exc ne = ne + check_ok2(exc, 60, 1); end try d = gd_entry(D, 'new8'); ne = ne + check_string2(60, 1, d.field, 'new8'); ne = ne + check_num2(60, 2, d.field_type, GD.SBIT_ENTRY); ne = ne + check_num2(60, 3, d.fragment_index, 0); ne = ne + check_string2(60, 4, d.in_fields, 'in'); ne = ne + check_num2(60, 5, d.bitnum, 14); ne = ne + check_num2(60, 6, d.numbits, 15); catch exc ne = ne + check_ok2(exc, 60, 2); end % 61: add entry (mult) check try gd_add_multiply(D, 'new9', 'in1', 'in2', 0); catch exc ne = ne + check_ok2(exc, 61, 1); end try d = gd_entry(D, 'new9'); ne = ne + check_string2(61, 1, d.field, 'new9'); ne = ne + check_num2(61, 2, d.field_type, GD.MULTIPLY_ENTRY); ne = ne + check_num2(61, 3, d.fragment_index, 0); ne = ne + check_sarray2(61, 4, d.in_fields, { 'in1'; 'in2'; }); catch exc ne = ne + check_ok2(exc, 61, 2); end % 62: add entry (phase) check try gd_add_phase(D, 'new10', 'in1', 22, 0); catch exc ne = ne + check_ok2(exc, 62, 1); end try d = gd_entry(D, 'new10'); ne = ne + check_string2(62, 1, d.field, 'new10'); ne = ne + check_num2(62, 2, d.field_type, GD.PHASE_ENTRY); ne = ne + check_num2(62, 3, d.fragment_index, 0); ne = ne + check_string2(62, 4, d.in_fields, 'in1'); ne = ne + check_num2(62, 5, d.shift, 22); catch exc ne = ne + check_ok2(exc, 62, 2); end % 63: add entry (const) check try gd_add_const(D, 'new11', GD.COMPLEX128, 2.6, 0); catch exc ne = ne + check_ok2(exc, 63, 1); end try d = gd_entry(D, 'new11'); ne = ne + check_string2(63, 1, d.field, 'new11'); ne = ne + check_num2(63, 2, d.field_type, GD.CONST_ENTRY); ne = ne + check_num2(63, 3, d.fragment_index, 0); ne = ne + check_num2(63, 5, d.const_type, GD.COMPLEX128); catch exc ne = ne + check_ok2(exc, 63, 2); end try d = gd_get_constant(D, 'new11', GD.FLOAT64); ne = ne + check_num2(63, 6, d, 2.6); catch exc ne = ne + check_ok2(exc, 63, 3); end % 64: fragmentname try d = gd_fragmentname(D, 0); ne = ne + check_eostring(64, d, 'dirfile/format'); catch exc ne = ne + check_ok(exc, 64); end % 65: nfragments try d = gd_nfragments(D); ne = ne + check_num(65, d, 1); catch exc ne = ne + check_ok(exc, 65); end % 66: include try d = gd_include(D, 'form2', 0, 0); ne = ne + check_num2(66, 1, d, 1); catch exc ne = ne + check_ok2(exc, 66, 1); end try d = gd_get_constant(D, 'const2'); ne = ne + check_num2(66, 2, d, -19); catch exc ne = ne + check_ok2(exc, 66, 2); end % 67: nfields_by_type try d = gd_nfields_by_type(D, GD.LINCOM_ENTRY); ne = ne + check_num(67, d, 2); catch exc ne = ne + check_ok(exc, 67); end % 68: field_list_by_type try d = gd_field_list_by_type(D, GD.LINCOM_ENTRY); ne = ne + check_sarray(68, d, { 'lincom', 'new2' }); catch exc ne = ne + check_ok(exc, 68); end % 69: nfields_by_type try d = gd_nvectors(D); ne = ne + check_num(69, d, 22); catch exc ne = ne + check_ok(exc, 69); end % 70: vector_list check try d = gd_vector_list(D); ne = ne + check_sarray(70, d, ... {'INDEX'; 'alias'; 'bit'; 'data'; 'div'; 'lincom'; 'linterp'; ... 'mplex'; 'mult'; 'new1'; 'new10'; 'new2'; 'new5'; 'new6'; 'new7'; ... 'new8'; 'new9'; 'phase'; 'polynom'; 'recip'; 'sbit'; 'window'}); catch exc ne = ne + check_ok(exc, 70); end % 71: madd entry (lincom) check try gd_madd_lincom(D, 'data', 'mnew1', { 'in1'; 'in2' }, [9.9, 7.7], ... [8.8, 6.6]); catch exc ne = ne + check_ok2(exc, 71, 1); end try d = gd_entry(D, 'data/mnew1'); ne = ne + check_string2(71, 1, d.field, 'data/mnew1'); ne = ne + check_num2(71, 2, d.field_type, GD.LINCOM_ENTRY); ne = ne + check_num2(71, 3, d.fragment_index, 0); ne = ne + check_sarray2(71, 4, d.in_fields, { 'in1'; 'in2' }); ne = ne + check_array2(71, 5, d.m, [ 9.9, 7.7 ]); ne = ne + check_array2(71, 6, d.b, [ 8.8, 6.6 ]); catch exc ne = ne + check_ok2(exc, 71, 2); end % 74: madd polynom check try gd_madd_polynom(D, 'data', 'mnew4', 'in1', [3.9, 4.8, 5.7, ... complex(6.6,7.5)]); catch exc ne = ne + check_ok2(exc, 74, 1); end try d = gd_entry(D, 'data/mnew4'); ne = ne + check_string2(74, 1, d.field, 'data/mnew4'); ne = ne + check_num2(74, 2, d.field_type, GD.POLYNOM_ENTRY); ne = ne + check_num2(74, 3, d.fragment_index, 0); ne = ne + check_string2(74, 4, d.in_fields, 'in1'); ne = ne + check_array2(74, 5, d.a, [3.9, 4.8, 5.7, complex(6.6,7.5)]); catch exc ne = ne + check_ok2(exc, 74, 2); end % 75: add entry (linterp) check try gd_madd_linterp(D, 'data', 'mnew6', 'in', './some/table'); catch exc ne = ne + check_ok2(exc, 75, 1); end try d = gd_entry(D, 'data/mnew6'); ne = ne + check_string2(75, 1, d.field, 'data/mnew6'); ne = ne + check_num2(75, 2, d.field_type, GD.LINTERP_ENTRY); ne = ne + check_num2(75, 3, d.fragment_index, 0); ne = ne + check_string2(75, 4, d.in_fields, 'in'); ne = ne + check_string2(75, 5, d.table, './some/table'); catch exc ne = ne + check_ok2(exc, 75, 2); end % 76: add entry (bit) check try gd_madd_bit(D, 'data', 'mnew7', 'in', 13, 12); catch exc ne = ne + check_ok2(exc, 76, 1); end try d = gd_entry(D, 'data/mnew7'); ne = ne + check_string2(76, 1, d.field, 'data/mnew7'); ne = ne + check_num2(76, 2, d.field_type, GD.BIT_ENTRY); ne = ne + check_num2(76, 3, d.fragment_index, 0); ne = ne + check_string2(76, 4, d.in_fields, 'in'); ne = ne + check_num2(76, 5, d.bitnum, 13); ne = ne + check_num2(76, 6, d.numbits, 12); catch exc ne = ne + check_ok2(exc, 76, 2); end % 77: add entry (sbit) check try gd_madd_sbit(D, 'data', 'mnew8', 'in', 14, 15); catch exc ne = ne + check_ok2(exc, 77, 1); end try d = gd_entry(D, 'data/mnew8'); ne = ne + check_string2(77, 1, d.field, 'data/mnew8'); ne = ne + check_num2(77, 2, d.field_type, GD.SBIT_ENTRY); ne = ne + check_num2(77, 3, d.fragment_index, 0); ne = ne + check_string2(77, 4, d.in_fields, 'in'); ne = ne + check_num2(77, 5, d.bitnum, 14); ne = ne + check_num2(77, 6, d.numbits, 15); catch exc ne = ne + check_ok2(exc, 77, 2); end % 78: add entry (mult) check try gd_madd_multiply(D, 'data', 'mnew9', 'in1', 'in2'); catch exc ne = ne + check_ok2(exc, 78, 1); end try d = gd_entry(D, 'data/mnew9'); ne = ne + check_string2(78, 1, d.field, 'data/mnew9'); ne = ne + check_num2(78, 2, d.field_type, GD.MULTIPLY_ENTRY); ne = ne + check_num2(78, 3, d.fragment_index, 0); ne = ne + check_sarray2(78, 4, d.in_fields, { 'in1'; 'in2'; }); catch exc ne = ne + check_ok2(exc, 78, 2); end % 79: add entry (phase) check try gd_madd_phase(D, 'data', 'mnew10', 'in1', 22); catch exc ne = ne + check_ok2(exc, 79, 1); end try d = gd_entry(D, 'data/mnew10'); ne = ne + check_string2(79, 1, d.field, 'data/mnew10'); ne = ne + check_num2(79, 2, d.field_type, GD.PHASE_ENTRY); ne = ne + check_num2(79, 3, d.fragment_index, 0); ne = ne + check_string2(79, 4, d.in_fields, 'in1'); ne = ne + check_num2(79, 5, d.shift, 22); catch exc ne = ne + check_ok2(exc, 79, 2); end % 80: madd entry (const) check try gd_madd_const(D, 'data', 'mnew11', GD.FLOAT64, 2.6); catch exc ne = ne + check_ok2(exc, 80, 1); end try d = gd_entry(D, 'data/mnew11'); ne = ne + check_string2(80, 1, d.field, 'data/mnew11'); ne = ne + check_num2(80, 2, d.field_type, GD.CONST_ENTRY); ne = ne + check_num2(80, 3, d.fragment_index, 0); ne = ne + check_num2(80, 5, d.const_type, GD.FLOAT64); catch exc ne = ne + check_ok2(exc, 80, 2); end try d = gd_get_constant(D, 'data/mnew11'); ne = ne + check_num2(80, 6, d, 2.6); catch exc ne = ne + check_ok2(exc, 80, 3); end % 81: get_string try d = gd_get_string(D, 'string'); ne = ne + check_string(81, d, 'Zaphod Beeblebrox'); catch exc ne = ne + check_ok(exc, 81); end % 82: add string try gd_add_string(D, 'new12', '---string---', 0); catch exc ne = ne + check_ok2(exc, 82, 1); end try d = gd_entry(D, 'new12'); ne = ne + check_string2(82, 1, d.field, 'new12'); ne = ne + check_num2(82, 2, d.field_type, GD.STRING_ENTRY); ne = ne + check_num2(82, 3, d.fragment_index, 0); catch exc ne = ne + check_ok2(exc, 82, 2); end try d = gd_get_string(D, 'new12'); ne = ne + check_string(82, d, '---string---'); catch exc ne = ne + check_ok(exc, 82); end % 83: madd string try gd_madd_string(D, 'data', 'mnew12', '---mstring---'); catch exc ne = ne + check_ok2(exc, 83, 1); end try d = gd_entry(D, 'data/mnew12'); ne = ne + check_string2(83, 1, d.field, 'data/mnew12'); ne = ne + check_num2(83, 2, d.field_type, GD.STRING_ENTRY); ne = ne + check_num2(83, 3, d.fragment_index, 0); catch exc ne = ne + check_ok2(exc, 83, 2); end try d = gd_get_string(D, 'data/mnew12'); ne = ne + check_string(83, d, '---mstring---'); catch exc ne = ne + check_ok(exc, 83); end % 84: add_spec try gd_add_spec(D, 'lorem STRING "Lorem ipsum"', 0); catch exc ne = ne + check_ok2(exc, 84, 1); end try d = gd_get_string(D, 'lorem'); ne = ne + check_string(84, d, 'Lorem ipsum'); catch exc ne = ne + check_ok2(exc, 84, 2); end % 85: madd_spec try gd_madd_spec(D, 'ipsum STRING "dolor sit amet."', 'lorem'); catch exc ne = ne + check_ok2(exc, 85, 1); end try d = gd_get_string(D, 'lorem/ipsum'); ne = ne + check_string(85, d, 'dolor sit amet.'); catch exc ne = ne + check_ok2(exc, 85, 2); end % 86: put_constant try gd_put_constant(D, 'const', 86); catch exc ne = ne + check_ok2(exc, 86, 1); end try d = gd_get_constant(D, 'const'); ne = ne + check_num2(86, 6, d, 86); catch exc ne = ne + check_ok2(exc, 86, 2); end % 93: put_constant try gd_put_constant(D, 'new11', complex(93,134)); catch exc ne = ne + check_ok2(exc, 93, 1); end try d = gd_get_constant(D, 'new11'); ne = ne + check_num2(93, 6, d, complex(93,134)); catch exc ne = ne + check_ok2(exc, 93, 2); end % 94: put_string try gd_put_string(D, 'string', 'Arthur Dent'); catch exc ne = ne + check_ok2(exc, 94, 1); end try d = gd_get_string(D, 'string'); ne = ne + check_string(94, d, 'Arthur Dent'); catch exc ne = ne + check_ok2(exc, 94, 2); end % 95: nmfields_by_type try d = gd_nmfields_by_type(D, 'data', GD.LINCOM_ENTRY); ne = ne + check_num(95, d, 1); catch exc ne = ne + check_ok(exc, 95); end % 96: mfield_list_by_type try d = gd_mfield_list_by_type(D, 'data', GD.LINCOM_ENTRY); ne = ne + check_sarray(96, d, {'mnew1'}); catch exc ne = ne + check_ok(exc, 96); end % 97: nmvectors try d = gd_nmvectors(D, 'data'); ne = ne + check_num(97, d, 8); catch exc ne = ne + check_ok(exc, 97); end % 98: mvector_list try d = gd_mvector_list(D, 'data'); ne = ne + check_sarray(98, d, {'mlut', 'mnew1', 'mnew4', 'mnew6', ... 'mnew7', 'mnew8', 'mnew9', 'mnew10'}); catch exc ne = ne + check_ok(exc, 98); end % 99: gd_alter_raw try gd_alter_raw(D, 'new1', GD.INT32, 4, 0); catch exc ne = ne + check_ok2(exc, 99, 1); end try d = gd_entry(D, 'new1'); ne = ne + check_string2(99, 1, d.field, 'new1'); ne = ne + check_num2(99, 2, d.field_type, GD.RAW_ENTRY); ne = ne + check_num2(99, 3, d.fragment_index, 0); ne = ne + check_num2(99, 4, d.data_type, GD.INT32); ne = ne + check_num2(99, 4, d.spf, 4); catch exc ne = ne + check_ok2(exc, 99, 2); end % 100: gd_alter_lincom try gd_alter_lincom(D, 'new2', {'in4'; 0; 'in6'}, [ 0.99, 11, 1.96 ], ... [ 7.8, 0.022, 0 ]); catch exc ne = ne + check_ok2(exc, 100, 1); end try d = gd_entry(D, 'new2'); ne = ne + check_string2(100, 1, d.field, 'new2'); ne = ne + check_num2(100, 2, d.field_type, GD.LINCOM_ENTRY); ne = ne + check_num2(100, 3, d.fragment_index, 0); ne = ne + check_sarray2(100, 4, d.in_fields, { 'in4'; 'in2'; 'in6' }); ne = ne + check_array2(100, 5, d.m, [ 0.99, 11, 1.96 ]); ne = ne + check_array2(100, 6, d.b, [ 7.8, 0.022, 0 ]); catch exc ne = ne + check_ok2(exc, 100, 2); end % 102: gd_alter_polynom try gd_alter_polynom(D, 'new5', 0, [ 1.1, 1.2, 1.3, 1.4, 1.5 ]); catch exc ne = ne + check_ok2(exc, 102, 1); end try d = gd_entry(D, 'new5'); ne = ne + check_string2(102, 1, d.field, 'new5'); ne = ne + check_num2(102, 2, d.field_type, GD.POLYNOM_ENTRY); ne = ne + check_num2(102, 3, d.fragment_index, 0); ne = ne + check_string2(102, 4, d.in_fields, 'in1'); ne = ne + check_array2(102, 5, d.a, [1.1, 1.2, 1.3, 1.4, 1.5]); catch exc ne = ne + check_ok2(exc, 102, 2); end % 104: gd_alter_linterp try gd_alter_linterp(D, 'new6', 'in3', 0, 0); catch exc ne = ne + check_ok2(exc, 104, 1); end try d = gd_entry(D, 'new6'); ne = ne + check_string2(104, 1, d.field, 'new6'); ne = ne + check_num2(104, 2, d.field_type, GD.LINTERP_ENTRY); ne = ne + check_num2(104, 3, d.fragment_index, 0); ne = ne + check_string2(104, 4, d.in_fields, 'in3'); ne = ne + check_string2(104, 5, d.table, './some/table'); catch exc ne = ne + check_ok2(exc, 104, 2); end % 105: gd_alter_bit try gd_alter_bit(D, 'new7', 'in3', 3, 0); catch exc ne = ne + check_ok2(exc, 105, 1); end try d = gd_entry(D, 'new7'); ne = ne + check_string2(105, 1, d.field, 'new7'); ne = ne + check_num2(105, 2, d.field_type, GD.BIT_ENTRY); ne = ne + check_num2(105, 3, d.fragment_index, 0); ne = ne + check_string2(105, 4, d.in_fields, 'in3'); ne = ne + check_num2(105, 5, d.bitnum, 3); ne = ne + check_num2(105, 6, d.numbits, 12); catch exc ne = ne + check_ok2(exc, 105, 2); end % 106: gd_alter_sbit try gd_alter_sbit(D, 'new8', 'in3', 3, 9); catch exc ne = ne + check_ok2(exc, 106, 1); end try d = gd_entry(D, 'new8'); ne = ne + check_string2(106, 1, d.field, 'new8'); ne = ne + check_num2(106, 2, d.field_type, GD.SBIT_ENTRY); ne = ne + check_num2(106, 3, d.fragment_index, 0); ne = ne + check_string2(106, 4, d.in_fields, 'in3'); ne = ne + check_num2(106, 5, d.bitnum, 3); ne = ne + check_num2(106, 6, d.numbits, 9); catch exc ne = ne + check_ok2(exc, 106, 2); end % 107: gd_alter_multiply try gd_alter_multiply(D, 'new9', 'in6', 0); catch exc ne = ne + check_ok2(exc, 107, 1); end try d = gd_entry(D, 'new9'); ne = ne + check_string2(107, 1, d.field, 'new9'); ne = ne + check_num2(107, 2, d.field_type, GD.MULTIPLY_ENTRY); ne = ne + check_num2(107, 3, d.fragment_index, 0); ne = ne + check_sarray2(107, 4, d.in_fields, { 'in6'; 'in2'; }); catch exc ne = ne + check_ok2(exc, 107, 2); end % 108: alter phase try gd_alter_phase(D, 'new10', 'in2', 23); catch exc ne = ne + check_ok2(exc, 108, 1); end try d = gd_entry(D, 'new10'); ne = ne + check_string2(108, 1, d.field, 'new10'); ne = ne + check_num2(108, 2, d.field_type, GD.PHASE_ENTRY); ne = ne + check_num2(108, 3, d.fragment_index, 0); ne = ne + check_string2(108, 4, d.in_fields, 'in2'); ne = ne + check_num2(108, 5, d.shift, 23); catch exc ne = ne + check_ok2(exc, 108, 2); end % 109: atler const try gd_alter_const(D, 'new11', GD.FLOAT64); catch exc ne = ne + check_ok2(exc, 109, 1); end try d = gd_entry(D, 'new11'); ne = ne + check_string2(109, 1, d.field, 'new11'); ne = ne + check_num2(109, 2, d.field_type, GD.CONST_ENTRY); ne = ne + check_num2(109, 3, d.fragment_index, 0); ne = ne + check_num2(109, 5, d.const_type, GD.FLOAT64); catch exc ne = ne + check_ok2(exc, 109, 2); end % 110: gd_encoding try d = gd_encoding(D, 0); ne = ne + check_num(110, d, GD.UNENCODED); catch exc ne = ne + check_ok(exc, 110); end % 111: gd_encoding try d = gd_endianness(D, 0); ne = ne + check_num(111, d, GD.LITTLE_ENDIAN + GD.NOT_ARM_ENDIAN); catch exc ne = ne + check_ok(exc, 111); end % 112: dirfilename try d = gd_dirfilename(D); ne = ne + check_eostring(112, d, 'dirfile'); catch exc ne = ne + check_ok(exc, 112); end % 113: gd_parent_fragment try d = gd_parent_fragment(D, 1); ne = ne + check_num(113, d, 0); catch exc ne = ne + check_ok(exc, 113); end % 114: gd_alter_protection try gd_alter_protection(D, 0, GD.PROTECT_DATA); catch exc ne = ne + check_ok(exc, 114); end % 115: gd_protection try d = gd_protection(D, 0); ne = ne + check_num(115, d, GD.PROTECT_DATA); catch exc ne = ne + check_ok(exc, 115); end % 116: gd_raw_filename try d = gd_raw_filename(D, 'data'); ne = ne + check_eostring(116, d, 'dirfile/data'); catch exc ne = ne + check_ok(exc, 116); end % 117: gd_reference try d = gd_reference(D); ne = ne + check_string2(117, 1, d, 'data'); catch exc ne = ne + check_ok2(exc, 117, 1); end try d = gd_reference(D, 'new1'); ne = ne + check_string2(117, 2, d, 'new1'); catch exc ne = ne + check_ok2(exc, 117, 2); end % 118: gd_eof try d = gd_eof(D, 'lincom'); ne = ne + check_num(118, d, 81); catch exc ne = ne + check_ok(exc, 118); end % 119: gd_alter_encoding try gd_alter_encoding(D, GD.SLIM_ENCODED, 1, 0); catch exc ne = ne + check_ok(exc, 119); end % 120: gd_alter_endiannness try gd_alter_endianness(D, GD.BIG_ENDIAN, 1, 0); catch exc ne = ne + check_ok(exc, 120); end % 121: gd_alter_spec try gd_alter_spec(D, 'new10 PHASE in5 3', 0); catch exc ne = ne + check_ok2(exc, 121, 1); end try d = gd_entry(D, 'new10'); ne = ne + check_string2(121, 1, d.field, 'new10'); ne = ne + check_num2(121, 2, d.field_type, GD.PHASE_ENTRY); ne = ne + check_num2(121, 3, d.fragment_index, 0); ne = ne + check_string2(121, 4, d.in_fields, 'in5'); ne = ne + check_num2(121, 5, d.shift, 3); catch exc ne = ne + check_ok2(exc, 121, 2); end % 122: gd_delete try gd_delete(D, 'new10', 0); catch exc ne = ne + check_ok2(exc, 122, 1); end try d = gd_entry(D, 'new10'); catch exc ne = ne + check_exc2(exc, 122, 2, 'BadCode'); end % 123: gd_malter_spec try gd_malter_spec(D, 'mnew10 PHASE in4 11', 'data', 0); catch exc ne = ne + check_ok2(exc, 123, 1); end try d = gd_entry(D, 'data/mnew10'); ne = ne + check_string2(123, 1, d.field, 'data/mnew10'); ne = ne + check_num2(123, 2, d.field_type, GD.PHASE_ENTRY); ne = ne + check_num2(123, 3, d.fragment_index, 0); ne = ne + check_string2(123, 4, d.in_fields, 'in4'); ne = ne + check_num2(123, 5, d.shift, 11); catch exc ne = ne + check_ok2(exc, 123, 2); end % 124: move try gd_move(D, 'new9', 1, 0); catch exc ne = ne + check_ok2(exc, 124, 1); end try d = gd_fragment_index(D, 'new9'); ne = ne + check_num(124, d, 1); catch exc ne = ne + check_ok2(exc, 124, 2); end % 125: rename try gd_rename(D, 'new9', 'newer', 0); catch exc ne = ne + check_ok2(exc, 125, 1); end try d = gd_fragment_index(D, 'newer'); ne = ne + check_num(125, d, 1); catch exc ne = ne + check_ok2(exc, 125, 2); end % 126: unclude try gd_uninclude(D, 1, 0); catch exc ne = ne + check_ok2(exc, 126, 1); end try d = gd_nfragments(D); ne = ne + check_num(126, d, 1); catch exc ne = ne + check_ok2(exc, 126, 2); end % 127: frameoffset try d = gd_frameoffset(D, 0); ne = ne + check_num(127, d, 0); catch exc ne = ne + check_ok(exc, 127); end % 128: alter_frameoffset try gd_alter_frameoffset(D, 33, 0, 0); catch exc ne = ne + check_ok2(exc, 128, 1); end try d = gd_frameoffset(D, 0); ne = ne + check_num(128, d, 33); catch exc ne = ne + check_ok2(exc, 128, 2); end % 129: native_type try d = gd_native_type(D, 'data'); ne = ne + check_num(129, d, GD.INT8); catch exc ne = ne + check_ok(exc, 129); end % 131: validate try d = gd_validate(D, 'new7'); catch exc ne = ne + check_exc(exc, 131, 'BadCode'); end % 132: framenum try gd_reference(D, 'data'); d = gd_framenum(D, 'data', 33.3); ne = ne + check_num(132, d, 37.1625); catch exc ne = ne + check_ok(exc, 132); end % 133: framenum_subset try d = gd_framenum(D, 'data', 33.3, 6); ne = ne + check_num(133, d, 37.1625); catch exc ne = ne + check_ok(exc, 133); end % 142: gd_bof try d = gd_bof(D, 'lincom'); ne = ne + check_num(142, d, 264); catch exc ne = ne + check_ok(exc, 142); end % 143: entry (div) check try d = gd_entry(D, 'div'); ne = ne + check_string2(143, 1, d.field, 'div'); ne = ne + check_num2(143, 2, d.field_type, GD.DIVIDE_ENTRY); ne = ne + check_num2(143, 3, d.fragment_index, 0); ne = ne + check_sarray2(143, 4, d.in_fields, { 'mult'; 'bit'; }); catch exc ne = ne + check_ok(exc, 143); end % 145: entry (recip) check try d = gd_entry(D, 'recip'); ne = ne + check_string2(145, 1, d.field, 'recip'); ne = ne + check_num2(145, 2, d.field_type, GD.RECIP_ENTRY); ne = ne + check_num2(145, 3, d.fragment_index, 0); ne = ne + check_num2(145, 4, d.dividend, complex(6.5,4.3)); catch exc ne = ne + check_ok(exc, 145); end % 146: add entry (DIV) check try gd_add_divide(D, 'new14', 'in1', 'in2', 0); catch exc ne = ne + check_ok2(exc, 146, 1); end try d = gd_entry(D, 'new14'); ne = ne + check_string2(146, 1, d.field, 'new14'); ne = ne + check_num2(146, 2, d.field_type, GD.DIVIDE_ENTRY); ne = ne + check_num2(146, 3, d.fragment_index, 0); ne = ne + check_sarray2(146, 4, d.in_fields, { 'in1'; 'in2'; }); catch exc ne = ne + check_ok2(exc, 146, 2); end % 148: add entry (recip) check try gd_add_recip(D, 'new16', 'in3', 33.3, 0); catch exc ne = ne + check_ok2(exc, 148, 1); end try d = gd_entry(D, 'new16'); ne = ne + check_string2(148, 1, d.field, 'new16'); ne = ne + check_num2(148, 2, d.field_type, GD.RECIP_ENTRY); ne = ne + check_num2(148, 3, d.fragment_index, 0); ne = ne + check_string2(148, 4, d.in_fields, 'in3'); ne = ne + check_num2(148, 3, d.dividend, 33.3); catch exc ne = ne + check_ok2(exc, 148, 2); end % 149: madd entry (div) check try gd_madd_divide(D, 'data', 'mnew14', 'in1', 'in2'); catch exc ne = ne + check_ok2(exc, 149, 1); end try d = gd_entry(D, 'data/mnew14'); ne = ne + check_string2(149, 1, d.field, 'data/mnew14'); ne = ne + check_num2(149, 2, d.field_type, GD.DIVIDE_ENTRY); ne = ne + check_num2(149, 3, d.fragment_index, 0); ne = ne + check_sarray2(149, 4, d.in_fields, { 'in1'; 'in2'; }); catch exc ne = ne + check_ok2(exc, 149, 2); end % 151: madd entry (recip) check try gd_madd_recip(D, 'data', 'mnew16', 'in1', complex(5.5,6.6)); catch exc ne = ne + check_ok2(exc, 151, 1); end try d = gd_entry(D, 'data/mnew16'); ne = ne + check_string2(151, 1, d.field, 'data/mnew16'); ne = ne + check_num2(151, 2, d.field_type, GD.RECIP_ENTRY); ne = ne + check_num2(151, 3, d.fragment_index, 0); ne = ne + check_string2(151, 4, d.in_fields, 'in1'); ne = ne + check_num2(151, 5, d.dividend, complex(5.5,6.6)); catch exc ne = ne + check_ok2(exc, 151, 2); end % 155: rewrite_fragment try gd_rewrite_fragment(D, 0); catch exc ne = ne + check_ok(exc, 155); end % 156: invalid_dirfile try d = gd_invalid_dirfile(); catch exc ne = ne + check_ok(exc, 156); end try gd_discard(d); catch []; end % 157: standards try d = gd_dirfile_standards(D); ne = ne + check_num(157, d, GD.DIRFILE_STANDARDS_VERSION); catch exc ne = ne + check_ok2(exc, 157, 1); end try d = gd_dirfile_standards(D, 0); catch exc ne = ne + check_exc2(exc, 157, 2, 'Argument'); end % 158: get_carray try d = gd_get_carray(D, 'carray'); ne = ne + check_array(158, d, [1.1, 2.2, 3.3, 4.4, 5.5, 6.6]); catch exc ne = ne + check_ok(exc, 158); end % 159: gd_carray_slice try d = gd_get_carray_slice(D, 'carray', 2, 2); ne = ne + check_array(159, d, [3.3, 4.4]); catch exc ne = ne + check_ok(exc, 159); end % 167: gd_carrays try d = gd_carrays(D); ne = ne + check_num(167, length(d), 1); ne = ne + check_array(167, d{1}, [1.1, 2.2, 3.3, 4.4, 5.5, 6.6]); catch exc ne = ne + check_ok(exc, 167); end % 168: gd_put_carray try gd_put_carray(D, 'carray', [9,8,7,6,5,4]); catch exc ne = ne + check_ok2(exc, 168, 1); end try d = gd_get_carray(D, 'carray'); ne = ne + check_array(168, d, [9,8,7,6,5,4]); catch exc ne = ne + check_ok2(exc, 168, 2); end % 169: gd_put_carray try gd_put_carray_slice(D, 'carray', 2, [169,169]); catch exc ne = ne + check_ok2(exc, 169, 1); end try d = gd_get_carray(D, 'carray'); ne = ne + check_array(169, d, [9,8,169,169,5,4]); catch exc ne = ne + check_ok2(exc, 169, 2); end % 177: gd_array_len try d = gd_array_len(D, 'carray'); ne = ne + check_num(177, d, 6); catch exc ne = ne + check_ok(exc, 177); end % 178: gd_entry (carray) try d = gd_entry(D, 'carray'); ne = ne + check_string2(178, 1, d.field, 'carray'); ne = ne + check_num2(178, 2, d.field_type, GD.CARRAY_ENTRY); ne = ne + check_num2(178, 3, d.fragment_index, 0); ne = ne + check_num2(178, 4, d.const_type, GD.FLOAT64); ne = ne + check_num2(178, 5, d.array_len, 6); catch exc ne = ne + check_ok(exc, 178); end % 179: add_carray try gd_add_carray(D, 'new17', GD.FLOAT64, [1.1,2.2,3.3,4.4], 0); catch exc ne = ne + check_ok2(exc, 179, 1); end try d = gd_entry(D, 'new17'); ne = ne + check_string2(179, 1, d.field, 'new17'); ne = ne + check_num2(179, 2, d.field_type, GD.CARRAY_ENTRY); ne = ne + check_num2(179, 3, d.fragment_index, 0); ne = ne + check_num2(179, 4, d.const_type, GD.FLOAT64); ne = ne + check_num2(179, 5, d.array_len, 4); catch exc ne = ne + check_ok2(exc, 179, 2); end try d = gd_get_carray(D, 'new17'); ne = ne + check_array(179, d, [1.1,2.2,3.3,4.4]); catch exc ne = ne + check_ok2(exc, 179, 3); end % 180: madd_carray try gd_madd_carray(D, 'data', 'mnew17', GD.FLOAT64, [1.8, 18.0]); catch exc ne = ne + check_ok2(exc, 180, 1); end try d = gd_entry(D, 'data/mnew17'); ne = ne + check_string2(180, 1, d.field, 'data/mnew17'); ne = ne + check_num2(180, 2, d.field_type, GD.CARRAY_ENTRY); ne = ne + check_num2(180, 3, d.fragment_index, 0); ne = ne + check_num2(180, 4, d.const_type, GD.FLOAT64); ne = ne + check_num2(180, 5, d.array_len, 2); catch exc ne = ne + check_ok2(exc, 180, 2); end try d = gd_get_carray(D, 'data/mnew17'); ne = ne + check_array(180, d, [1.8, 18.0]); catch exc ne = ne + check_ok2(exc, 180, 3); end % 181: alter_carray try gd_alter_carray(D, 'new17', GD.INT32, 5); catch exc ne = ne + check_ok2(exc, 181, 1); end try d = gd_entry(D, 'new17'); ne = ne + check_string2(181, 1, d.field, 'new17'); ne = ne + check_num2(181, 2, d.field_type, GD.CARRAY_ENTRY); ne = ne + check_num2(181, 3, d.fragment_index, 0); ne = ne + check_num2(181, 4, d.const_type, GD.INT32); ne = ne + check_num2(181, 5, d.array_len, 5); catch exc ne = ne + check_ok2(exc, 181, 2); end try d = gd_get_carray(D, 'new17'); ne = ne + check_array(181, d, [1,2,3,4,0]); catch exc ne = ne + check_ok2(exc, 181, 3); end % 183: gd_constants try d = gd_constants(D); ne = ne + check_array(183, d, [86, 93]); catch exc ne = ne + check_ok(exc, 183); end % 191: gd_mconstants try d = gd_mconstants(D, 'data'); ne = ne + check_array(191, d, [3.3, 2.6]); catch exc ne = ne + check_ok(exc, 191); end % 199: gd_strings try d = gd_strings(D); ne = ne + check_sarray(199, d, {'Lorem ipsum'; '---string---'; ... 'Arthur Dent'}); catch exc ne = ne + check_ok(exc, 199); end % 200: gd_mstrings try d = gd_mstrings(D, 'data'); ne = ne + check_sarray(200, d, {'This is a string constant.'; ... '---mstring---'}); catch exc ne = ne + check_ok(exc, 200); end % 203: seek try d = gd_seek(D, 'data', 35, 0, GD.SEEK_SET); ne = ne + check_num(203, d, 280); catch exc ne = ne + check_ok2(exc, 203, 1); end try d = gd_getdata(D, 'data', GD.HERE, 0, 1, 0); ne = ne + check_array(203, d, [16:1:23]); catch exc ne = ne + check_ok2(exc, 203, 2); end % 204: tell try d = gd_tell(D, 'data'); ne = ne + check_num(204, d, 288); catch exc ne = ne + check_ok(exc, 204); end % 205: hide try gd_hide(D, 'data'); catch exc ne = ne + check_ok(exc, 205); end % 206: hidden try d = gd_hidden(D, 'data'); ne = ne + check_num(206, d, 1); catch exc ne = ne + check_ok(exc, 206); end % 207: unhide try gd_unhide(D, 'data'); catch exc ne = ne + check_ok2(exc, 207, 1); end try d = gd_hidden(D, 'data'); ne = ne + check_num(207, d, 0); catch exc ne = ne + check_ok2(exc, 207, 2); end % 208: sync try gd_sync(D, 'data'); catch exc ne = ne + check_ok(exc, 208); end % 209: sync try gd_flush(D, 'data'); catch exc ne = ne + check_ok(exc, 209); end % 210: metaflush try gd_metaflush(D); catch exc ne = ne + check_ok(exc, 210); end % 211: gd_entry (window) try d = gd_entry(D, 'window'); ne = ne + check_string2(211, 1, d.field, 'window'); ne = ne + check_num2(211, 2, d.field_type, GD.WINDOW_ENTRY); ne = ne + check_num2(211, 3, d.fragment_index, 0); ne = ne + check_sarray2(211, 4, d.in_fields, { 'linterp'; 'mult' }); ne = ne + check_num2(211, 5, d.windop, GD.WINDOP_LT); ne = ne + check_num2(211, 6, d.threshold, 4.1); catch exc ne = ne + check_ok(exc, 211); end % 212: gd_add_window try gd_add_window(D, 'new18', 'in1', 'in2', GD.WINDOP_NE, 32, 0); catch exc ne = ne + check_ok2(exc, 212, 1); end try d = gd_entry(D, 'new18'); ne = ne + check_string2(212, 1, d.field, 'new18'); ne = ne + check_num2(212, 2, d.field_type, GD.WINDOW_ENTRY); ne = ne + check_num2(212, 3, d.fragment_index, 0); ne = ne + check_sarray2(212, 4, d.in_fields, { 'in1'; 'in2' }); ne = ne + check_num2(212, 5, d.windop, GD.WINDOP_NE); ne = ne + check_num2(212, 6, d.threshold, 32); catch exc ne = ne + check_ok2(exc, 212, 2); end % 214: gd_add_window try gd_madd_window(D, 'data', 'mnew18', 'in1', 'in2', GD.WINDOP_EQ, 214); catch exc ne = ne + check_ok2(exc, 214, 1); end try d = gd_entry(D, 'data/mnew18'); ne = ne + check_string2(214, 1, d.field, 'data/mnew18'); ne = ne + check_num2(214, 2, d.field_type, GD.WINDOW_ENTRY); ne = ne + check_num2(214, 3, d.fragment_index, 0); ne = ne + check_sarray2(214, 4, d.in_fields, { 'in1'; 'in2' }); ne = ne + check_num2(214, 5, d.windop, GD.WINDOP_EQ); ne = ne + check_num2(214, 6, d.threshold, 214); catch exc ne = ne + check_ok2(exc, 214, 2); end % 217: gd_alter_window try gd_alter_window(D, 'new18', 'in3', 0, GD.WINDOP_GE, 32e2); catch exc ne = ne + check_ok2(exc, 217, 1); end try d = gd_entry(D, 'new18'); ne = ne + check_string2(217, 1, d.field, 'new18'); ne = ne + check_num2(217, 2, d.field_type, GD.WINDOW_ENTRY); ne = ne + check_num2(217, 3, d.fragment_index, 0); ne = ne + check_sarray2(217, 4, d.in_fields, { 'in3'; 'in2' }); ne = ne + check_num2(217, 5, d.windop, GD.WINDOP_GE); ne = ne + check_num2(217, 6, d.threshold, 32e2); catch exc ne = ne + check_ok2(exc, 217, 2); end % 218: gd_alias_target try d = gd_alias_target(D, 'alias'); ne = ne + check_string(218, d, 'data'); catch exc ne = ne + check_ok(exc, 218); end % 219: gd_add_alias try gd_add_alias(D, 'new20', 'data', 0); catch exc ne = ne + check_ok2(exc, 219, 1); end try d = gd_alias_target(D, 'new20'); ne = ne + check_string(219, d, 'data'); catch exc ne = ne + check_ok2(exc, 219, 2); end % 220: madd_alias try gd_madd_alias(D, 'data', 'mnew20', 'data'); catch exc ne = ne + check_ok2(exc, 219, 1); end try d = gd_alias_target(D, 'data/mnew20'); ne = ne + check_string(219, d, 'data'); catch exc ne = ne + check_ok2(exc, 219, 2); end % 221: naliases try d = gd_naliases(D, 'data'); ne = ne + check_num(221, d, 4); catch exc ne = ne + check_ok(exc, 221); end % 222: aliases try d = gd_aliases(D, 'data'); ne = ne + check_sarray(222, d, {'data'; 'alias'; 'data/mnew20'; 'new20'}); catch exc ne = ne + check_ok(exc, 222); end % 223: include_affix try gd_include(D, 'format1', 0, GD.CREAT + GD.EXCL, 'A', 'Z'); catch exc ne = ne + check_ok2(exc, 41, 1); end % 226: fragment_affixes try d = gd_fragment_affixes(D, 1); ne = ne + check_sarray(226, d, {'A'; 'Z'}); catch exc ne = ne + check_ok(exc, 226); end % 227: alter_affixes try gd_alter_affixes(D, 1, 'B', ''); catch exc ne = ne + check_ok2(exc, 227, 1); end try d = gd_fragment_affixes(D, 1); ne = ne + check_sarray(226, d, {'B'; ''}); catch exc ne = ne + check_ok2(exc, 227, 2); end % 228: gd_entry (mplex) try d = gd_entry(D, 'mplex'); ne = ne + check_string2(228, 1, d.field, 'mplex'); ne = ne + check_num2(228, 2, d.field_type, GD.MPLEX_ENTRY); ne = ne + check_num2(228, 3, d.fragment_index, 0); ne = ne + check_sarray2(228, 4, d.in_fields, { 'data'; 'sbit' }); ne = ne + check_num2(228, 5, d.count_val, 1); ne = ne + check_num2(228, 6, d.period, 10); catch exc ne = ne + check_ok(exc, 228); end % 229: gd_add_mplex try gd_add_mplex(D, 'new21', 'in1', 'in2', 5, 6, 0); catch exc ne = ne + check_ok2(exc, 229, 1); end try d = gd_entry(D, 'new21'); ne = ne + check_string2(229, 1, d.field, 'new21'); ne = ne + check_num2(229, 2, d.field_type, GD.MPLEX_ENTRY); ne = ne + check_num2(229, 3, d.fragment_index, 0); ne = ne + check_sarray2(229, 4, d.in_fields, { 'in1'; 'in2' }); ne = ne + check_num2(229, 5, d.count_val, 5); ne = ne + check_num2(229, 6, d.period, 6); catch exc ne = ne + check_ok2(exc, 229, 2); end % 230: gd_add_mplex try gd_madd_mplex(D, 'data', 'mnew21', 'in3', 'in2', 0, 12); catch exc ne = ne + check_ok2(exc, 230, 1); end try d = gd_entry(D, 'data/mnew21'); ne = ne + check_string2(230, 1, d.field, 'data/mnew21'); ne = ne + check_num2(230, 2, d.field_type, GD.MPLEX_ENTRY); ne = ne + check_num2(230, 3, d.fragment_index, 0); ne = ne + check_sarray2(230, 4, d.in_fields, { 'in3'; 'in2' }); ne = ne + check_num2(230, 5, d.count_val, 0); ne = ne + check_num2(230, 6, d.period, 12); catch exc ne = ne + check_ok2(exc, 230, 2); end % 231: gd_alter_mplex try gd_alter_mplex(D, 'new21', 'in4', 0, 3, 7); catch exc ne = ne + check_ok2(exc, 231, 1); end try d = gd_entry(D, 'new21'); ne = ne + check_string2(231, 1, d.field, 'new21'); ne = ne + check_num2(231, 2, d.field_type, GD.MPLEX_ENTRY); ne = ne + check_num2(231, 3, d.fragment_index, 0); ne = ne + check_sarray2(231, 4, d.in_fields, { 'in4'; 'in2' }); ne = ne + check_num2(231, 5, d.count_val, 3); ne = ne + check_num2(231, 6, d.period, 7); catch exc ne = ne + check_ok2(exc, 231, 2); end % 232: gd_strtok try d = gd_strtok(D, '"test1 test2" test3\ test4'); ne = ne + check_sarray(232, d, {'test1 test2'; 'test3 test4'}); catch exc ne = ne + check_ok(exc, 232); end % 233: raw_close try gd_raw_close(D, 'data'); catch exc ne = ne + check_ok(exc, 233); end % 234: desync try d = gd_desync(D); ne = ne + check_num(234, d, 0); catch exc ne = ne + check_ok(exc, 234); end % 235: gd_flags try d = gd_flags(D, GD.PRETTY_PRINT, 0); ne = ne + check_num(235, d, GD.PRETTY_PRINT); catch exc ne = ne + check_ok(exc, 235); end % 236: gd_verbose_prefix try gd_verbose_prefix(D, 'big_test: '); catch exc ne = ne + check_ok(exc, 236); end % 237: gd_nentries try d = gd_nentries(D, 'data', GD.SCALAR_ENTRIES, ... GD.ENTRIES_HIDDEN + GD.ENTRIES_NOALIAS); ne = ne + check_num(237, d, 6); catch exc ne = ne + check_ok(exc, 237); end % 239: gd_nentries try d = gd_entry_list(D, 'data', GD.SCALAR_ENTRIES, ... GD.ENTRIES_HIDDEN + GD.ENTRIES_NOALIAS); ne = ne + check_sarray(239, d, {'mstr', 'mconst', 'mcarray', ... 'mnew11', 'mnew12', 'mnew17'}); catch exc ne = ne + check_ok(exc, 239); end % 240: gd_mplex_lookback try gd_mplex_lookback(D, GD.LOOKBACK_ALL); catch exc ne = ne + check_ok(exc, 240); end % 241: gd_linterp_tablename try d = gd_linterp_tablename(D, 'linterp'); ne = ne + check_eostring(241, d, 'dirfile/lut'); catch exc ne = ne + check_ok(exc, 241); end % 242: gd_mcarrays try d = gd_mcarrays(D, 'data'); ne = ne + check_num2(242, 1, length(d), 2); ne = ne + check_array2(242, 2, d{1}, [1.9, 2.8, 3.7, 4.6, 5.5]); ne = ne + check_array2(242, 3, d{2}, [1.8, 18.0]); catch exc ne = ne + check_ok(exc, 242); end % 271: gd_encoding_support d = gd_encoding_support(GD.SIE_ENCODED); ne = ne + check_num(271, d, GD.RDWR); % 272: NULL return from gd_reference try d = gd_open('dirfile/empty', GD.RDWR + GD.CREAT + GD.EXCL); catch exc ne = ne + check_ok2(exc, 272, 1); end try d = gd_reference(d); ne = ne + check_string(272, d, ''); catch exc ne = ne + check_ok2(exc, 272, 1); end gd_discard(D); rmdir(filedir, 's'); if ne > 0 ne fail; end catch exc disp(exc.getReport); disp('Stack:'); disp(struct2cell(transpose(exc.stack))); fail end end % hackery function fail fid=fopen('test_failed', 'w'); fclose(fid); exit force end % pretty-print an array function str = pp_array(a) str = ['[ ', num2str(a), ' ]']; end function str = pp_sarray(a) str = '['; for i = 1:length(a) if (isnumeric(a{i})) str = strcat(str, sprintf(' %s', num2str(a{i}))); else str = strcat(str, sprintf(' %s', a{i})); end end str = strcat(str, ' ]'); end % Check functions function ne = check_ok(exc, t) if (isempty(strmatch('GetData:', exc.identifier))) rethrow(exc); end fprintf(2, 'e[%i] = %s\n', t, exc.identifier); disp(exc.getReport); ne = 1; end function ne = check_ok2(exc, t, m) if (isempty(strmatch('GetData:', exc.identifier))) rethrow(exc); end fprintf(2, 'e[%i,%i] = %s\n', t, m, exc.identifier); disp(exc.getReport); ne = 1; end function ne = check_exc(exc, t, v) if (isempty(strmatch('GetData:', exc.identifier))) rethrow(exc); end ne = check_string(t,exc.identifier,strcat('GetData:Lib:', v)); end function ne = check_exc2(exc, t, m, v) if (isempty(strmatch('GetData:', exc.identifier))) rethrow(exc); end ne = check_string2(t,m,exc.identifier,strcat('GetData:Lib:', v)); end function ne = check_eostring(t,v,g) l = length(v); f = l - length(g) + 1; if (strcmp(v(f:l), g) == 0) fprintf(2, 's[%i] = [...]''%s'', expected [...]''%s''\n', t, v(f:l), g); ne = 1; else ne = 0; end end function ne = check_string(t,v,g) if (strcmp(v, g) == 0) fprintf(2, 's[%i] = ''%s'', expected ''%s''\n', t, v, g); ne = 1; else ne = 0; end end function ne = check_string2(t,m,v,g) if (strcmp(v, g) == 0) fprintf(2, 's[%i,%i] = ''%s'', expected ''%s''\n', t, m, v, g); ne = 1; else ne = 0; end end function ne = check_sarray(t,v,g) same = 1; if (length(v) ~= length(g)) same = 0; else for i = 1:length(v) if (isnumeric(v{i}) ~= isnumeric(g{i})) same = 0; elseif (isnumeric(v{i})) if (v{i} ~= g{i}) same = 0; end elseif (strcmp(v{i},g{i}) == 0) same = 0; end end end if (~same) fprintf(2, 's[%i] = %s, expected %s\n', t, pp_sarray(v), pp_sarray(g)); ne = 1; else ne = 0; end end function ne = check_sarray2(t,m,v,g) same = 1; if (length(v) ~= length(g)) same = 0; else for i = 1:length(v) if (isnumeric(v{i}) ~= isnumeric(g{i})) same = 0; elseif (isnumeric(v{i})) if (v{i} ~= g{i}) same = 0; end elseif (strcmp(v{i},g{i}) == 0) same = 0; end end end if (~same) fprintf(2, 's[%i,%i] = %s, expected %s\n', t, m, pp_sarray(v), ... pp_sarray(g)); ne = 1; else ne = 0; end end function ne = check_array(t,v,g) if (~isequal(v,g)) fprintf(2, 'a[%i] = %s, expected %s\n', t, pp_array(v), pp_array(g)); ne = 1; else ne = 0; end end function ne = check_array2(t,m,v,g) if (~isequal(v,g)) fprintf(2, 'a[%i,%i] = %s, expected %s\n', t, m, pp_array(v), pp_array(g)); ne = 1; else ne = 0; end end function ne = check_num(t,v,g) if (v ~= g) fprintf(2, 'n[%i] = %s, expected %s\n', t, num2str(v), num2str(g)); ne = 1; else ne = 0; end end function ne = check_num2(t,m,v,g) if (v ~= g) fprintf(2, 'n[%i,%i] = %s, expected %s\n', t, m, num2str(v), num2str(g)); ne = 1; else ne = 0; end end libgetdata-0.9.0/bindings/matlab/test/test.sh0000740000175000017500000000026212614323564021334 0ustar alastairalastair#!/bin/sh s=`basename $2 .m` rm -f ./test_failed $1 -nodesktop -nodisplay -nosplash -nojvm -r "$s; quit;" #lame if test -e ./test_failed; then rm -f ./test_failed exit 1 fi libgetdata-0.9.0/bindings/matlab/gd_delete.c0000640000175000017500000000353212614323564021124 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_DELETE Delete a field from a dirfile % % GD_DELETE(DIRFILE,NAME[,FLAGS]) % deletes the field called NAME from the dirfile DIRFILE. If % given, FLAGS should be a bitwise or'd collection of zero or more % of the GD.DEL_... flags provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_delete_alias(3) in % section 3 of the UNIX manual for more details. % % See also GD_DELETE_ALIAS, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; unsigned int flags = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(2, 3); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); if (nrhs > 2) flags = gdmx_to_uint(prhs, 2); gd_delete(D, field_code, flags); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/Makefile.am0000640000175000017500000001123012614323564021072 0ustar alastairalastair# Copyright (C) 2013-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign SUBDIRS=test matlabdir=$(matlabbasedir)/getdata matlabfiles=gd_add_bit.m gd_add_divide.m gd_add_lincom.m gd_add_linterp.m \ gd_add_mplex.m gd_add_multiply.m gd_add_phase.m gd_add_polynom.m \ gd_add_raw.m gd_add_recip.m gd_add_sbit.m gd_add_window.m \ gd_alter_bit.m gd_alter_carray.m gd_alter_const.m \ gd_alter_divide.m gd_alter_lincom.m gd_alter_linterp.m \ gd_alter_mplex.m gd_alter_multiply.m gd_alter_phase.m \ gd_alter_polynom.m gd_alter_raw.m gd_alter_recip.m gd_alter_sbit.m \ gd_alter_window.m gd_field_list_by_type.m gd_field_list.m \ gd_get_constant.m gd_madd_bit.m gd_madd_divide.m gd_madd_lincom.m \ gd_madd_linterp.m gd_madd_mplex.m gd_madd_multiply.m \ gd_madd_phase.m gd_madd_polynom.m gd_madd_recip.m gd_madd_sbit.m \ gd_madd_window.m gd_mfield_list_by_type.m gd_mfield_list.m \ gd_mvector_list.m gd_nfields_by_type.m gd_nfields.m \ gd_nmfields_by_type.m gd_nmfields.m gd_nmvectors.m gd_nvectors.m \ gd_put_carray.m gd_put_constant.m gd_vector_list.m \ getdata_constants.m mexfiles=gd_add gd_add_alias \ gd_add_carray gd_add_const \ gd_add_spec gd_add_string gd_aliases \ gd_alias_target gd_alter_affixes \ gd_alter_encoding gd_alter_endianness gd_alter_entry \ gd_alter_frameoffset \ gd_alter_protection gd_alter_spec gd_bof gd_array_len gd_carrays \ gd_close gd_constants gd_delete gd_desync \ gd_dirfilename gd_dirfile_standards \ gd_discard gd_encoding gd_encoding_support gd_endianness \ gd_entry gd_entry_list gd_entry_type gd_eof \ gd_error gd_error_string gd_flags gd_flush gd_fragment_affixes \ gd_fragment_index gd_fragmentname \ gd_framenum gd_frameoffset gd_get_carray gd_get_carray_slice \ gd_getdata \ gd_get_string gd_hidden gd_hide gd_include gd_invalid_dirfile \ gd_linterp_tablename gd_madd gd_madd_alias \ gd_madd_carray gd_madd_const \ gd_madd_spec gd_madd_string \ gd_malter_spec gd_mcarrays \ gd_mconstants gd_metaflush gd_move gd_mplex_lookback \ gd_mstrings gd_naliases gd_native_type gd_nentries gd_nfragments \ gd_nframes gd_open gd_parent_fragment gd_protection \ gd_put_carray_slice \ gd_putdata gd_put_string gd_raw_close gd_raw_filename \ gd_reference gd_rename gd_rewrite_fragment \ gd_seek gd_spf gd_strings gd_strtok \ gd_sync gd_tell gd_unhide gd_uninclude gd_validate gd_verbose_prefix matlabcfiles=$(addsuffix .c,${mexfiles}) matlabmexfiles=$(addsuffix .@mexext@,${mexfiles}) matlabdocfiles=$(addsuffix .m,${mexfiles}) EXTRA_DIST=$(matlabcfiles) doc.tail Contents.m.head dist_matlab_SCRIPTS=$(matlabfiles) nodist_matlab_SCRIPTS=Contents.m getdata_constants.m $(matlabmexfiles) \ $(matlabdocfiles) lib_LTLIBRARIES=libgetdata-matlab.la if GD_EXTERNAL libgetdata_matlab_la_LIBADD=$(GETDATA_LIBS) AM_CPPFLAGS=$(GETDATA_CFLAGS) GDMX_LIBS=$(GETDATA_LIBS) else libgetdata_matlab_la_LIBADD=../../src/libgetdata.la AM_CPPFLAGS=-I${top_srcdir}/src -I../../src GDMX_LIBS=-L../../src/.libs -lgetdata endif libgetdata_matlab_la_SOURCES=matlab.c gd_matlab.h libgetdata_matlab_la_CPPFLAGS=${MATLAB_CPPFLAGS} ${AM_CPPFLAGS} libgetdata_matlab_la_LDFLAGS=-version-info @MATLABGETDATA_VERSION@ %.m: %.c ${srcdir}/doc.tail ${GREP} '^ %' $< | ${SED} -e 's/^ //' > $@ cat ${srcdir}/doc.tail >> $@ %.@mexext@: %.c libgetdata-matlab.la ${MEX} ${AM_CPPFLAGS} -L.libs -lgetdata-matlab $(GDMX_LIBS) $< Contents.m: ${srcdir}/Contents.m.head make_contents.sh $(matlabfiles) \ $(matlabdocfiles) ${srcdir}/doc.tail ${SHELL} ./make_contents.sh ${srcdir} > $@ cat ${srcdir}/doc.tail >> $@ getdata_constants.m: ../make_parameters ../make_parameters m > $@ ../make_parameters: ../make_parameters.c cd .. && ${MAKE} make_parameters clean-local: rm -rf $(nodist_matlab_SCRIPTS) libgetdata-0.9.0/bindings/matlab/gd_get_carray_slice.c0000640000175000017500000000444012614323564023160 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_GET_CARRAY_SLICE Retrieve CARRAY data % % A = GD_GET_CARRAY_SLICE(DIRFILE,FIELD_CODE,START,LEN[,TYPE]) % retrieves a subset, A, of the CARRAY field called FIELD_CODE. % LEN elements are retrieved, starting with element START. If type % is given, it should be one of the data type symbols provided by % GETDATA_CONSTANTS, otherwise the data are returned in their % native type. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_get_carray_slice(3) in % section 3 of the UNIX manual for more details. % % See also GD_GET_CARRAY, GD_PUT_CARRAY_SLICE, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; unsigned int start; size_t len; gd_type_t type; GDMX_CHECK_RHS2(4,5); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); start = gdmx_to_uint(prhs, 2); len = gdmx_to_size_t(prhs, 3); if (nrhs > 4) type = gdmx_to_gd_type(prhs, 4); else { type = gd_native_type(D, field_code); gdmx_err(D, 0); } plhs[0] = gdmx_vector(type, len, &data); gd_get_carray_slice(D, field_code, start, len, type, data); mxFree(field_code); gdmx_err(D, 0); gdmx_fix_vector(plhs[0], type, len, data); } libgetdata-0.9.0/bindings/matlab/gd_add_mplex.m0000640000175000017500000000353112614323564021630 0ustar alastairalastairfunction gd_add_mplex(D, field_code, in_field1, in_field2, count_val, ... period, fragment_index) % GD_ADD_MPLEX Add a MPLEX field % % GD_ADD_MPLEX(DIRFILE,NAME,INPUT1,INPUT2,COUNT_VAL,COUNT_MAX,FRAGMENT) % adds a MPLEX field called NAME to the dirfile specified by % DIRFILE. The input data field is INPUT1, the index field is % INPUT2. The target value is COUNT_VAL and the maximum value of % INPUT2 is COUNT_MAX. The field is added to the fragment % indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_mplex(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_MPLEX, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.MPLEX_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {{in_field1; in_field2}}, ... 'count_val', count_val, 'period', period)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add_const.c0000640000175000017500000000410112614323564021611 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ADD_CONST Add a CONST field % % GD_ADD_CONST(DIRFILE,NAME,TYPE,VALUE,FRAGMENT) % adds a CONST field called NAME to the dirfile specified by % DIRFILE. The storage type is TYPE, and the value of the field % is VALUE. The field is added to the fragment indexed by % FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_const(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_CONST, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_name; size_t n; int fragment_index; gd_type_t const_type, data_type; GDMX_NO_LHS; GDMX_CHECK_RHS(5); D = gdmx_to_dirfile(prhs[0]); field_name = gdmx_to_string(prhs, 1, 0); const_type = gdmx_to_gd_type(prhs, 2); gdmx_to_data(&data, &data_type, &n, prhs[3], 3); fragment_index = gdmx_to_int(prhs, 4); gd_add_const(D, field_name, const_type, data_type, data, fragment_index); gdmx_free_data(data, data_type); mxFree(field_name); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_madd_const.c0000640000175000017500000000402612614323564021774 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MADD_CONST Add a CONST metafield % % GD_MADD_CONST(DIRFILE,PARENT,NAME,TYPE,VALUE) % adds a CONST metafield called NAME to the dirfile specified by % DIRFILE under parent PARENT. The storage type is TYPE, and the % value of the field is VALUE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_const(3) in section 3 % of the UNIX manual for more details. % % See also GD_MADD, GD_ADD_CONST, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_name, *parent; size_t n; gd_type_t const_type, data_type; GDMX_NO_LHS; GDMX_CHECK_RHS(5); D = gdmx_to_dirfile(prhs[0]); parent = gdmx_to_string(prhs, 1, 0); field_name = gdmx_to_string(prhs, 2, 0); const_type = gdmx_to_gd_type(prhs, 3); gdmx_to_data(&data, &data_type, &n, prhs[4], 4); n = gd_madd_const(D, parent, field_name, const_type, data_type, data); gdmx_free_data(data, data_type); mxFree(field_name); mxFree(parent); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_nmfields_by_type.m0000640000175000017500000000222412614323564023225 0ustar alastairalastairfunction nfields = gd_nmfields_by_type(D, parent, type) % GD_NMFIELDS_BY_TYPE Retrieve a count of fields % % GD_NMFIELDS_BY_TYPE(DIRFILE,PARENT,TYPE) % is equivalent to calling GD_NENTRIES(DIRFILE,PARENT,TYPE,0) % % See also GD_NENTRIES nfields = gd_nentries(D, parent, type, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_get_constant.m0000640000175000017500000000255012614323564022363 0ustar alastairalastairfunction n = gd_get_constant(D, field_code, varargin) % GD_GET_CONSTANT Retrieve CONST data % % N = GD_GET_CONSTANT(DIRFILE,FIELD,TYPE) % is equivalent to N = GD_GET_CARRAY_SLICE(DIRFILE,FIELD,0,1,TYPE) % % N = GD_GET_CONSTANT(DIRFILE,FIELD) % is equivalent to N = GD_GET_CARRAY_SLICE(DIRFILE,FIELD,0,1) % % See also GD_GET_CARRAY_SLICE if (numel(varargin) > 0) n = gd_get_carray_slice(D, field_code, 0, 1, varargin{1}); else n = gd_get_carray_slice(D, field_code, 0, 1); end end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_encoding.c0000640000175000017500000000337512614323564021455 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ENCODING Report the data encoding of a fragment % % E = GD_ENCODING(DIRFILE,FRAGMENT) % reports the encoding, E, of the fragment indexed by FRAGMENT % in the dirfile DIRFILE. The returned value will be one of the % GD.xxx_ENCODED symbols provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_encoding(3) in % section 3 of the UNIX manual for more details. % % See also GD_ALTER_ENCODING, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; unsigned long n; int i; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); n = gd_encoding(D, i); gdmx_err(D, 0); plhs[0] = gdmx_from_ulong(n); } libgetdata-0.9.0/bindings/matlab/gd_madd_divide.m0000640000175000017500000000304112614323564022120 0ustar alastairalastairfunction gd_madd_divide(D, parent, field_code, in1, in2) % GD_MADD_DIVIDE Add a DIVIDE metafield % % GD_MADD_DIVIDE(DIRFILE,PARENT,NAME,INPUT1,INPUT2) % adds a DIVIDE metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input fields are INPUT1 and INPUT2. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_divide(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_DIVIDE, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.DIVIDE_ENTRY, ... 'in_fields', {{in1; in2}}), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_fragment_index.c0000640000175000017500000000331712614323564022655 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FRAGMENT_INDEX Report the fragment index of a field % % I = GD_FRAGMENT_INDEX(DIRFILE,FIELD_CODE) % returns the fragment index, I, of the field specified by % FIELD_CODE in the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_fragment_index(3) in % section 3 of the UNIX manual for more details. % % See also GD_ENTRY, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; int n; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); n = gd_fragment_index(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_put_string.c0000640000175000017500000000323612614323564022061 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_PUT_STRING Modify STRING values % % GD_PUT_STRING(DIRFILE,FIELD_CODE,VALUE) % sets the value of the STRING field FIELD_CODE to VALUE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_put_string(3) in section 3 % of the UNIX manual for more details. % % See also GD_GET_STRING, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_name, *value; GDMX_NO_LHS; GDMX_CHECK_RHS(3); D = gdmx_to_dirfile(prhs[0]); field_name = gdmx_to_string(prhs, 1, 0); value = gdmx_to_string(prhs, 2, 0); gd_put_string(D, field_name, value); mxFree(field_name); mxFree(value); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_framenum.c0000640000175000017500000000416012614323564021472 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FRAMENUM Reverse look-up on a field % % F = GD_FRAMENUM(DIRFILE,FIELD_CODE,VALUE[,START[,END]]) % performs a reverse look-up on the field FIELD_CODE, reporting the % (fractional) frame number, F, where it takes on the value VALUE. % If given and non-zero, only the portion of the field between % START and END are considered. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_framenum_subset(3) in % section 3 of the UNIX manual for more details. % % See also GD_BOF, GD_EOF, GD_OPEN, GD_GETDATA */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; double r, value; long long first_samp = 0, last_samp = 0; GDMX_CHECK_RHS2(3,5); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); value = gdmx_to_double(prhs, 2); if (nrhs > 3) first_samp = gdmx_to_llong(prhs, 3); if (nrhs > 4) last_samp = gdmx_to_llong(prhs, 4); r = gd_framenum_subset64(D, field_code, value, first_samp, last_samp); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_double(r); } libgetdata-0.9.0/bindings/matlab/gd_alias_target.c0000640000175000017500000000317512614323564022324 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALIAS_TARGET Report the target of an /ALIAS % % T = GD_ALIAS_TARGET(DIRFILE,NAME) % returns the target, T, of the alias named NAME. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alias_target(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALIASES, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char *s; char *field_code; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); s = gd_alias_target(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = mxCreateString(s); } libgetdata-0.9.0/bindings/matlab/gd_field_list.m0000640000175000017500000000216012614323564022006 0ustar alastairalastairfunction field_list = gd_field_list(D) % GD_FIELD_LIST Retrieve a list of field names % % GD_FIELD_LIST_BY_TYPE(DIRFILE) % is equivalent to calling GD_ENTRY_LIST(DIRFILE,0,0,0) % % See also GD_ENTRY_LIST field_list = gd_entry_list(D, 0, 0, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_vector_list.m0000640000175000017500000000244012614323564022226 0ustar alastairalastairfunction field_list = gd_vector_list(D) % GD_VECTOR_LIST Retrieve a list of field names % % GD_VECTOR_LIST(DIRFILE) % is equivalent to calling GD_ENTRY_LIST(DIRFILE,0, ... % GD.VECTOR_ENTRIES,0) % % For GD, see GETDATA_CONSTANTS. % % See also GD_ENTRY_LIST, GETDATA_CONSTANTS GD = getdata_constants(); field_list = gd_entry_list(D, 0, GD.VECTOR_ENTRIES, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add_string.c0000640000175000017500000000360412614323564022000 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ADD_STRING Add a STRING field % % GD_ADD_STRING(DIRFILE,NAME,VALUE,FRAGMENT) % adds a STRING field called NAME to the dirfile specified by % DIRFILE. The value of the field is set to VALUE. The field is % added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_string(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_STRING, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_name, *value; int fragment_index; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); field_name = gdmx_to_string(prhs, 1, 0); value = gdmx_to_string(prhs, 2, 0); fragment_index = gdmx_to_int(prhs, 3); gd_add_string(D, field_name, value, fragment_index); mxFree(field_name); mxFree(value); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_metaflush.c0000640000175000017500000000304212614323564021646 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_METAFLUSH Flush metadata changes to disk % % GD_METAFLUSH(DIRFILE) % flushes all pending metadata changes in the dirfile DIRFILE to % disk. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_metaflush(3) in section 3 % of the UNIX manual for more details. % % See also GD_CLOSE, GD_FLUSH, GD_OPEN, GD_REWRITE_FRAGMENT */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; GDMX_NO_LHS; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); gd_metaflush(D); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_uninclude.c0000640000175000017500000000332712614323564021652 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_UNINCLUDE Remove a metadata fragment from a dirfile % % GD_FLUSH(DIRFILE,FRAGMENT[,DEL]) % removes the fragment indexed by FRAGMENT from the dirfile % DIRFILE. If DEL is given and non-zero, also deletes the file % on disk. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_uninclude(3) in section 3 % of the UNIX manual for more details. % % See also GD_INCLUDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i, d = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(2,3); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); if (nrhs > 2) d = gdmx_to_int(prhs, 2); gd_uninclude(D, i, d); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_strings.c0000640000175000017500000000330012614323564021344 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_STRINGS Fetch all STRING values % % A = GD_STRINGS(DIRFILE) % returns a cell array of strings, A, containing all the STRING % data in the dirfile DIRFILE. A corresponding array of field % names can be produced with GD_FIELD_LIST_BY_TYPE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_strings(3) in section 3 % of the UNIX manual for more details. % % See also GD_MSTRINGS, GD_FIELD_LIST_BY_TYPE, GD_GET_STRING */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char **sl; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); sl = gd_strings(D); gdmx_err(D, 0); plhs[0] = gdmx_from_string_list(sl); } libgetdata-0.9.0/bindings/matlab/gd_reference.c0000640000175000017500000000343212614323564021617 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_REFERENCE Set or report the reference field name % % F = GD_REFERENCE(DIRFILE[,FIELD_CODE]) % sets the reference field of DIRFILE to FIELD_CODE, if given and % not numeric zero. Returns the reference field, F, after possibly % updating it. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_reference(3) in section 3 % of the UNIX manual for more details. % % See also GD_NFRAMES, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char *s; char *field_code = NULL; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) field_code = gdmx_to_string(prhs, 1, 1); s = gd_reference(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = mxCreateString(s); } libgetdata-0.9.0/bindings/matlab/gd_seek.c0000640000175000017500000000433712614323564020615 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_SEEK Set the location of a field's I/O pointer % % P = GD_SEEK(DIRFILE,FIELD_CODE,FRAME,SAMPLE,FLAGS) % places the I/O pointer of the field FIELD_CODE SAMPLE samples % after the start of frame number FRAME. Flags should be one of % GD.SEEK_SET, GD.SEEK_CUR, or GD.SEEK_END, possibly bitwise or'd % with GD.SEEK_WRITE. These symbols are provided by % GETDATA_CONSTANTS. Returns the position, P, in samples, after % setting it. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_seek(3) in section 3 % of the UNIX manual for more details. % % See also GD_TELL, GD_GETDATA, GD_OPEN. */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_code; long long first_frame, first_samp; int flags; unsigned long long pos; GDMX_CHECK_RHS(5); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); first_frame = gdmx_to_llong(prhs, 2); first_samp = gdmx_to_llong(prhs, 3); flags = gdmx_to_int(prhs, 4); pos = gd_seek64(D, field_code, (gd_off64_t)first_frame, (gd_off64_t)first_samp, flags); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_ullong(pos); } libgetdata-0.9.0/bindings/matlab/gd_add_sbit.m0000640000175000017500000000333012614323564021441 0ustar alastairalastairfunction gd_add_sbit(D, field_code, in_fields, bitnum, numbits, fragment_index) % GD_ADD_SBIT Add a SBIT field % % GD_ADD_SBIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS,FRAGMENT) % adds a SBIT field called NAME to the dirfile specified by DIRFILE. % The input field is INPUT, the first bit is BITNUM and the length % is NUMBITS. The field is added to the fragment indexed by % FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_sbit(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_SBIT, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.SBIT_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {in_fields}, ... 'bitnum', bitnum, 'numbits', numbits)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd_sbit.m0000640000175000017500000000320212614323564021614 0ustar alastairalastairfunction gd_madd_sbit(D, parent, field_code, in_fields, bitnum, numbits) % GD_MADD_SBIT Add a SBIT metafield % % GD_MADD_SBIT(DIRFILE,PARENT,NAME,INPUT,BITNUM,NUMBITS) % adds a SBIT metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input field is INPUT, the first bit is % BITNUM and the length is NUMBITS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_sbit(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_SBIT, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.SBIT_ENTRY, ... 'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_frameoffset.c0000640000175000017500000000323012614323564022156 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FRAMEOFFSET Report the frame offset of a fragment % % O = GD_FRAME_OFFSET(DIRFILE,FRAGMENT) % reports the frame offset of the fragment specified by FRAGMENT % in the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_frame_offset(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_FRAMEOFFSET, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; unsigned long long n; int i; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); n = gd_frameoffset64(D, i); gdmx_err(D, 0); plhs[0] = gdmx_from_ullong(n); } libgetdata-0.9.0/bindings/matlab/gd_alter_endianness.c0000640000175000017500000000436012614323564023200 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_ENDIANNESS Modify the byte sex of a fragment % % GD_ALTER_ENDIANNESS(DIRFILE,ENDIANNESS,FRAGMENT[,RECODE]) % sets the byte sex of the metadata fragment indexed by FRAGMENT % in the dirfile DIRFILE to ENDIANNESS, which should be one of: % numeric zero, indicating the native type of the platform; % GD.BIG_ENDIAN, or GD.LITTLE_ENDIAN, optionally bitwise or'd with % either GD.ARM_ENDIAN or GD.NOT_ARM_ENDIAN. See GETDATA_CONSTANTS % for these constants. If RECODE is given and non-zero, binary % files affected by the byte sex change will be converted. % Otherwise, the binary files are not modified. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_endianness(3) in % section 3 of the UNIX manual for more details. % % See also GD_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i, r = 0; unsigned long e; GDMX_NO_LHS; GDMX_CHECK_RHS2(3,4); D = gdmx_to_dirfile(prhs[0]); e = gdmx_to_ulong(prhs, 1); i = gdmx_to_int(prhs, 2); if (nrhs > 3) r = gdmx_to_int(prhs, 3); gd_alter_endianness(D, e, i, r); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_constants.c0000640000175000017500000000420012614323564021667 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_CONSTANTS Fetch all CONST values % % A = GD_CONSTANTS(DIRFILE[,TYPE]) % returns a numeric array, A, containing all the CONST data in the % dirfile DIRFILE. A corresponding array of field names can be % produced with GD_FIELD_LIST_BY_TYPE. The type of the returned % data is given by TYPE, one of the data type symbols provided by % GETDATA_CONSTANTS. If omitted, the default type, GD.FLOAT64, is % used. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_constants(3) in section 3 % of the UNIX manual for more details. % % See also GD_MCONSTANTS, GD_FIELD_LIST_BY_TYPE, GD_GET_CONSTANT, % GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const void *data; unsigned int n; gd_type_t type = GD_FLOAT64; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) type = gdmx_to_gd_type(prhs, 1); data = gd_constants(D, type); gdmx_err(D, 0); /* length */ n = gd_nfields_by_type(D, GD_CONST_ENTRY); gdmx_err(D, 0); plhs[0] = gdmx_from_data(data, type, n); } libgetdata-0.9.0/bindings/matlab/gd_move.c0000640000175000017500000000356512614323564020636 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MOVE Move a field between fragments % % GD_MOVE(DIRFILE,FIELD_CODE,NEW_FRAGMENT[,FLAGS]) % moves the field called FIELD_CODE to the new fragment indexed by % NEW_FRAGMENT. FLAGS should be zero or more of the GD.REN_... % symbols provided by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_move(3) in % section 3 of the UNIX manual for more details. % % See also GD_MOVE_ALIAS, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; int new_frag, move_data = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(3,4); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); new_frag = gdmx_to_int(prhs, 2); if (nrhs > 3) move_data = gdmx_to_int(prhs, 3); gd_move(D, field_code, new_frag, move_data); mxFree(field_code); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_mfield_list_by_type.m0000640000175000017500000000225512614323564023723 0ustar alastairalastairfunction field_list = gd_mfield_list_by_type(D, parent, type) % GD_MFIELD_LIST_BY_TYPE Retrieve a list of field names % % GD_MFIELD_LIST_BY_TYPE(DIRFILE,PARENT,TYPE) % is equivalent to calling GD_ENTRY_LIST(DIRFILE,PARENT,TYPE,0) % % See also GD_ENTRY_LIST field_list = gd_entry_list(D, parent, type, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_mconstants.c0000640000175000017500000000442012614323564022050 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MCONSTANTS Fetch all CONST metafield values % % A = GD_MCONSTANTS(DIRFILE,PARENT[,TYPE]) % returns a numeric array, A, containing all the CONST metafield % data under parent field PARENT. A corresponding array of field % names can be produced with GD_MFIELD_LIST_BY_TYPE. The type of % the returned data is given by TYPE, one of the data type symbols % provided by GETDATA_CONSTANTS. If omitted, the default type, % GD.FLOAT64, is used. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_mconstants(3) in section 3 % of the UNIX manual for more details. % % See also GD_CONSTANTS, GD_FIELD_LIST_BY_TYPE, GD_GET_CONSTANT, % GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const void *data; unsigned int n; char *field_code; gd_type_t type = GD_FLOAT64; GDMX_CHECK_RHS2(2,3); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); if (nrhs > 2) type = gdmx_to_gd_type(prhs, 2); data = gd_mconstants(D, field_code, type); gdmx_err(D, 0); /* length */ n = gd_nmfields_by_type(D, field_code, GD_CONST_ENTRY); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_data(data, type, n); } libgetdata-0.9.0/bindings/matlab/gd_desync.c0000640000175000017500000000360012614323564021143 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_DESYNC Modify the byte sex of a fragment % % B = GD_DESYNC(DIRFILE[,FLAGS]) % returns a boolean, B, indicating whether the dirfile DIRFILE on % disk has been changed by a third-party since having been opened % by GetData. If given, FLAGS should be a bitwise-or'd collection % of zero or more of the GD.DESYNC_... symbols provided by % GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_desync(3) in section 3 % the UNIX manual for more details. % % See also GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; unsigned int flags = 0; int n; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) flags = gdmx_to_uint(prhs, 1); n = gd_desync(D, 0); gdmx_err(D, 0); plhs[0] = gdmx_from_bool(n); } libgetdata-0.9.0/bindings/matlab/gd_alter_affixes.c0000640000175000017500000000410712614323564022475 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_AFFIXES Modify the affixes of an included fragment % % GD_ALTER_ENDIANNESS(DIRFILE,FRAGMENT,PREFIX,SUFFIX) % modifies the prefix and suffix associated with the fragment % indexed by FRAGMENT in the dirfile DIRFILE. If PREFIX or SUFFIX % is numeric zero, no change is made to the associated affix. % Otherwise, the affix is set to the value of the parameter. To % remove an affix, set it to the empty string: ''. % Otherwise, the binary files are not modified. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_affixes(3) in % section 3 of the UNIX manual for more details. % % See also GD_FRAGMENT_AFFIXES, GD_INCLUDE, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int i; char *p = NULL, *s = NULL; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); p = gdmx_to_string(prhs, 2, 1); s = gdmx_to_string(prhs, 3, 1); gd_alter_affixes(D, i, p, s); mxFree(p); mxFree(s); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_getdata.c0000640000175000017500000000470712614323564021300 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_GETDATA Retrieve vector data % % V = GD_GETDATA(DIRFILE,FIELD_CODE,FIRST_FRAME,FIRST_SAMP,NFRAMES,NSAMP ... % [,TYPE]) % retrieves a vector, V, of NFRAMES frames plus NSAMPLES samples of % data from the vector field FIELD_CODE starting FIRST_SAMP samples % past the start of FIRST_FRAME. If type is given, it should be % one of the data type symbols provided by GETDATA_CONSTANTS, % otherwise the data are returned in their native type. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_getdata(3) in % section 3 of the UNIX manual for more details. % % See also GD_PUTDATA, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; long long first_frame, first_samp; size_t nsamp; gd_type_t type; void *data; GDMX_CHECK_RHS2(6,7); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); first_frame = gdmx_to_llong(prhs, 2); first_samp = gdmx_to_llong(prhs, 3); nsamp = gdmx_to_nsamp(D, field_code, prhs, 4, 5); if (nrhs > 6) type = gdmx_to_gd_type(prhs, 6); else { type = gd_native_type(D, field_code); gdmx_err(D, 0); } plhs[0] = gdmx_vector(type, nsamp, &data); nsamp = gd_getdata64(D, field_code, (gd_off64_t)first_frame, (gd_off64_t)first_samp, 0, nsamp, type, data); mxFree(field_code); gdmx_err(D, 0); gdmx_fix_vector(plhs[0], type, nsamp, data); } libgetdata-0.9.0/bindings/matlab/gd_madd_linterp.m0000640000175000017500000000317012614323564022334 0ustar alastairalastairfunction gd_madd_linterp(D, parent, field_code, in_fields, table) % GD_MADD_LINTERP Add a LINTERP metafield % % GD_MADD_LINTERP(DIRFILE,PARENT,NAME,INPUT,TABLE) % adds a LINTERP metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input field is INPUT and the associated % look-up table is given by the path TABLE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_linterp(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_LINTERP, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.LINTERP_ENTRY, ... 'in_fields', in_fields, 'table', table), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_encoding_support.c0000640000175000017500000000353312614323564023245 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ENCODING_SUPPORT Run-time detection of supported GetData encodings % % N = GD_ENCODING_SUPPORT(ENCODING) % returns GD.RDWR if the ENCODING specified can be both read and % written by the library, GD.RDONLY if it can only be read, or % -1 if neither is supported, or if the specified ENCODING was % invalid. % % GD.RDWR and GD.RDONLY are provided by the GETDATA_CONSTANTS() function, % and the ENCODING should be specified using one one of the GD.xxx_ENCODED % symbols provided by that function. % % See the documentation on the C API function gd_encoding_support(3) in % section of the UNIX manual for more details. */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code = NULL; int n; unsigned long e; GDMX_CHECK_RHS(1); e = gdmx_to_ulong(prhs, 0); n = gd_encoding_support(e); plhs[0] = gdmx_from_int(n); } libgetdata-0.9.0/bindings/matlab/gd_aliases.c0000640000175000017500000000332512614323564021303 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALIASES Retrieve a list of aliases for a field % % A = GD_ALIASES(DIRFILE,NAME) % returns a cell array of strings, A, comprising all the aliases of % the field called NAME. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_aliases(3) in section 3 % of the UNIX manual for more details. % % See also GD_NALIASES, GD_ENTRY_LIST, GD_ALIAS_TARGET, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_code; const char **al; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); field_code = gdmx_to_string(prhs, 1, 0); al = gd_aliases(D, field_code); mxFree(field_code); gdmx_err(D, 0); plhs[0] = gdmx_from_string_list(al); } libgetdata-0.9.0/bindings/matlab/gd_add_linterp.m0000640000175000017500000000331012614323564022153 0ustar alastairalastairfunction gd_add_linterp(D, field_code, in_field, table, fragment_index); % GD_ADD_LINTERP Add a LINTERP field % % GD_ADD_LINTERP(DIRFILE,NAME,INPUT,TABLE,FRAGMENT) % adds a LINTERP field called NAME to the dirfile specified by % DIRFILE. The input field is INPUT and the associated look-up % table is given by the path TABLE. The field is added to the % fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_linterp(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_LINTERP, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.LINTERP_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', in_field, 'table', table)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_dirfilename.c0000640000175000017500000000300212614323564022131 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_DIRFILENAME Report the path to a dirfile % % P = GD_DIRFILENAME(DIRFILE) % reports the path, P, to the dirfile DIRFILE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_dirfilename(3) in % section 3 of the UNIX manual for more details. % % See also GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; const char *s; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); s = gd_dirfilename(D); gdmx_err(D, 0); plhs[0] = mxCreateString(s); } libgetdata-0.9.0/bindings/matlab/gd_close.c0000640000175000017500000000312012614323564020760 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_CLOSE Save and close a dirfile % % GD_CLOSE(DIRFILE) % flushes all changes and closes the dirfile DIRFILE. The DIRFILE % object supplied will no longer be valid if this function % succeeds. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_close(3) in section 3 % of the UNIX manual for more details. % % See also GD_DISCARD, GD_OPEN, GD_FLUSH */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; int n; GDMX_CHECK_RHS(1); D = gdmx_to_dirfile(prhs[0]); n = gd_close(D); if (n) gdmx_err(D, 1); } libgetdata-0.9.0/bindings/matlab/gd_matlab.h0000640000175000017500000001010612614323564021122 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GD_MATLAB_H /* mex runs GCC in -ansi mode */ #ifndef GDMXLIB #define GD_C89_API #endif #define GD_64BIT_API #include "getdata.h" #include #define GDMX_INTERNAL_ERROR \ mexErrMsgIdAndTxt("GetData:GDMX:InternalError", \ "Internal error at [%s,%i]", __FILE__, __LINE__ ) #define GDMX_NO_LHS \ if (nlhs > 0) \ mexErrMsgIdAndTxt("GetData:GDMX:nLHS", \ "Too many output arguments.") #define GDMX_CHECK_RHS(n) \ if (nrhs != (n)) \ mexErrMsgIdAndTxt("GetData:GDMX:nRHS", \ "Invalid argument count; wanted %i, given %i", \ (n), nrhs) #define GDMX_CHECK_RHS2(m,n) \ if (nrhs < (m)) \ mexErrMsgIdAndTxt("GetData:GDMX:nRHS", \ "Invalid argument count; wanted at least %i, given %i", \ (m), nrhs); \ else if (nrhs > (n)) \ mexErrMsgIdAndTxt("GetData:GDMX:nRHS", \ "Invalid argument count; wanted at most %i, given %i", \ (n), nrhs) /* integer type aliases */ #if SIZEOF_SIZE_T == 8 #define gdmx_to_size_t(a,b) ((size_t)gdmx_to_ullong(a,b)) #define gdmx_from_size_t gdmx_from_ullong #else #define gdmx_to_size_t(a,b) ((size_t)gdmx_to_ulong(a,b)) #define gdmx_from_size_t gdmx_from_ulong #endif #define gdmx_to_gd_type(a,b) ((gd_type_t)gdmx_to_int(a,b)) #define gdmx_from_gd_type gdmx_from_int #define gdmx_from_entype gdmx_from_int #define gdmx_from_windop gdmx_from_int #ifdef __cplusplus extern "C" { #endif void gdmx_err(DIRFILE *, int); mxClassID gdmx_classid(gd_type_t); void gdmx_free_entry(gd_entry_t *); /* convert to MATLAB type */ #define gdmx_from_string mxCreateString mxArray *gdmx_from_dirfile(const DIRFILE*); mxArray *gdmx_from_data(const void *, gd_type_t, size_t); mxArray *gdmx_from_entry(const gd_entry_t*); mxArray *gdmx_from_nstring_list(const char **, size_t); mxArray *gdmx_from_string_list(const char **); #define gdmx_from_int gdmx_from_long #define gdmx_from_uint gdmx_from_ulong #define gdmx_from_double mxCreateDoubleScalar mxArray *gdmx_from_bool(int); mxArray *gdmx_from_long(long); mxArray *gdmx_from_llong(long long); mxArray *gdmx_from_ulong(unsigned long); mxArray *gdmx_from_ullong(unsigned long long); mxArray *gdmx_from_carrays(const gd_carray_t *, gd_type_t); mxArray *gdmx_from_sarrays(const char ***); mxArray *gdmx_vector(gd_type_t, size_t, void**); void gdmx_fix_vector(mxArray *, gd_type_t, size_t, void*); /* convert from MATLAB type */ DIRFILE *gdmx_to_dirfile(const mxArray *); char *gdmx_to_string(const mxArray **, int, int); int gdmx_to_int(const mxArray **, int); #define GDMX_ENO_FRAG 0x1 #define GDMX_ENO_FIELD 0x2 gd_entry_t *gdmx_to_entry(const mxArray **, int, unsigned); double gdmx_to_double(const mxArray **, int); long gdmx_to_long(const mxArray **, int); long long gdmx_to_llong(const mxArray **, int); #define gdmx_to_uint(a,b) ((unsigned int)gdmx_to_ulong(a,b)) unsigned long gdmx_to_ulong(const mxArray **, int); unsigned long long gdmx_to_ullong(const mxArray **, int); size_t gdmx_to_nsamp(DIRFILE*, const char*, const mxArray**, int, int); void gdmx_to_data(void**, gd_type_t*, size_t*, const mxArray*, int); void gdmx_free_data(void*, gd_type_t); void gdmx_to_sdata(const char***, size_t*, const mxArray*, int); void gdmx_free_sdata(const char**, size_t); #ifdef __cplusplus } #endif #endif libgetdata-0.9.0/bindings/matlab/gd_alter_sbit.m0000640000175000017500000000321612614323564022023 0ustar alastairalastairfunction gd_alter_sbit(D, field_code, in_fields, bitnum, numbits) % GD_ALTER_SBIT Modify the metadata of a SBIT field % % GD_ALTER_SBIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS) % modifies the metadata of the SBIT field called NAME in the % dirfile specified by DIRFILE. The input field is set to INPUT, % the first bit to BITNUM, and the number of bits to NUMBITS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_sbit(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.SBIT_ENTRY, ... 'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd.c0000640000175000017500000000343612614323564020572 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MADD Add a metafield % % GD_MADD(DIRFILE,ENTRY,PARENT) % adds a metafield described by ENTRY to the dirfile DIRFILE under % parent field PARENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % The ENTRY object should be an entry struct; see GETDATA and gd_entry(3) in % the UNIX manual for details. % % See the documentation on the C API function gd_madd(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_OPEN, GETDATA */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *parent; gd_entry_t *E; GDMX_NO_LHS; GDMX_CHECK_RHS(3); D = gdmx_to_dirfile(prhs[0]); E = gdmx_to_entry(prhs, 1, GDMX_ENO_FRAG); parent = gdmx_to_string(prhs, 2, 0); gd_madd(D, E, parent); gdmx_free_entry(E); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_alter_multiply.m0000640000175000017500000000311412614323564022736 0ustar alastairalastairfunction gd_alter_multiply(D, field_code, in1, in2) % GD_ALTER_MULTIPLY Modify the metadata of a MULTIPLY field % % GD_ALTER_MULTIPLY(DIRFILE,NAME,INPUT1,INPUT2) % modifies the metadata of the MULTIPLY field called NAME in the % dirfile specified by DIRFILE. The input fields are set to INPUT1, % and INPUT2, if non-zero. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_multiply(3) in section % 3 of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.MULTIPLY_ENTRY, ... 'in_fields', {{in1; in2}}), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd_lincom.m0000640000175000017500000000327312614323564022144 0ustar alastairalastairfunction gd_madd_lincom(D, parent, field_code, in_fields, m, b); % GD_MADD_LINCOM Add a LINCOM metafield % % GD_MADD_LINCOM(DIRFILE,PARENT,NAME,IPUTS,M,B) % adds a LINCOM metafield called NAME under PARENT to the dirfile % specified by DIRFILE. The input fields are provided in the cell % array INPUTS and the slopes and offsets given by the numeric % arrays M and B, which may be complex valued. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_lincom(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD_LINCOM, GD_MADD, GD_OPEN GD = getdata_constants(); gd_madd(D, struct('field', field_code, 'field_type', GD.LINCOM_ENTRY, ... 'in_fields', {in_fields}, 'm', m, 'b', b), parent); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add_bit.m0000640000175000017500000000332012614323564021255 0ustar alastairalastairfunction gd_add_bit(D, field_code, in_fields, bitnum, numbits, fragment_index) % GD_ADD_BIT Add a BIT field % % GD_ADD_BIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS,FRAGMENT) % adds a BIT field called NAME to the dirfile specified by DIRFILE. % The input field is INPUT, the first bit is BITNUM and the length % is NUMBITS. The field is added to the fragment indexed by % FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_bit(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_BIT, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.BIT_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {in_fields}, ... 'bitnum', bitnum, 'numbits', numbits)); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd_string.c0000640000175000017500000000354612614323564022162 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MADD_STRING Add a STRING field % % GD_MADD_STRING(DIRFILE,PARENT,NAME,VALUE) % adds a STRING metafield called NAME to the dirfile specified by % DIRFILE under parent field PARENT. The value of the field is % set to VALUE. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_string(3) in section 3 % of the UNIX manual for more details. % % See also GD_MADD, GD_ADD_STRING, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *field_name, *value, *parent; GDMX_NO_LHS; GDMX_CHECK_RHS(4); D = gdmx_to_dirfile(prhs[0]); parent = gdmx_to_string(prhs, 1, 0); field_name = gdmx_to_string(prhs, 2, 0); value = gdmx_to_string(prhs, 3, 0); gd_madd_string(D, parent, field_name, value); mxFree(field_name); mxFree(value); mxFree(parent); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_flags.c0000640000175000017500000000354512614323564020762 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_FLAGS Modify or report dirfile flags % % F = GD_FLAGS(DIRFILE,SET,RESET) % sets the operational flags of the dirfile DIRFILE according to % SET and RESET, which should be bitwise or'd collections of the % Dirfile flags provided by GETDATA_CONSTANTS. This function then % returns the update flag register, F. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_flags(3) in section 3 % of the UNIX manual for more details. % % See also GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; unsigned long set, reset, flags; GDMX_CHECK_RHS(3); D = gdmx_to_dirfile(prhs[0]); set = gdmx_to_ulong(prhs, 1); reset = gdmx_to_ulong(prhs, 2); flags = gd_flags(D, set, reset); gdmx_err(D, 0); plhs[0] = gdmx_from_ulong(flags); } libgetdata-0.9.0/bindings/matlab/gd_malter_spec.c0000640000175000017500000000367212614323564022165 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_SPEC Modify metafield metadata % % GD_ALTER_SPEC(DIRFILE,SPEC,PARENT[,RECODE]) % modifies the metadata of a metafield under parent field PARENT in % the dirfile DIRFILE according to the field specification line % SPEC. If RECODE is given and non-zero, other data will be % updated to reflect metadata changes. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_malter_spec(3) in % section 3 of the UNIX manual for more details. % % See also GD_ALTER_SPEC, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; char *spec, *parent; int recode = 0; GDMX_NO_LHS; GDMX_CHECK_RHS2(3,4); D = gdmx_to_dirfile(prhs[0]); spec = gdmx_to_string(prhs, 1, 0); parent = gdmx_to_string(prhs, 2, 0); if (nrhs > 3) recode = gdmx_to_int(prhs, 3); gd_malter_spec(D, spec, parent, recode); mxFree(spec); mxFree(parent); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_mcarrays.c0000640000175000017500000000431212614323564021500 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" #include /* % GD_MCARRAYS Fetch all CARRAY metafield values % % A = GD_MCARRAYS(DIRFILE,PARENT[,TYPE]) % returns a cell array of numeric arrays, A, containing all the % CARRAY data in the for metafields under parent field PARENT. A % corresponding array of field names can be produced with % GD_MFIELD_LIST_BY_TYPE. The type of the returned data is given % by TYPE, one of the data type symbols provided by % GETDATA_CONSTANTS. If omitted, the default type, GD.FLOAT64, is % used. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_mcarrays(3) in section 3 % of the UNIX manual for more details. % % See also GD_CARRAYS, GD_MFIELD_LIST_BY_TYPE, GD_GET_CARRAY_SLICE */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; gd_type_t type = GD_FLOAT64; const gd_carray_t *c; char *parent; GDMX_CHECK_RHS2(2,3); D = gdmx_to_dirfile(prhs[0]); parent = gdmx_to_string(prhs, 1, 0); if (nrhs > 2) type = gdmx_to_gd_type(prhs, 2); c = gd_mcarrays(D, parent, type); mxFree(parent); gdmx_err(D, 0); /* convert to array of arrays */ plhs[0] = gdmx_from_carrays(c, type); } libgetdata-0.9.0/bindings/matlab/gd_alter_encoding.c0000640000175000017500000000405412614323564022637 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ALTER_ENCODING Modify the encoding of a fragment % % GD_ALTER_ENCODING(DIRFILE,ENCODING,FRAGMENT[,RECODE]) % sets the encoding of the metadata fragment indexed by FRAGMENT % in the dirfile DIRFILE to ENCODING, which should be one of the % GD.xxx_ENCODED constants provided by GETDATA_CONSTANTS. % If RECODE is given and non-zero, binary files affected by the % encoding change will be converted. Otherwise, the binary files % are not modified. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_endianness(3) in % section 3 of the UNIX manual for more details. % % See also GD_ENCODING, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i, r = 0; unsigned int e; GDMX_NO_LHS; GDMX_CHECK_RHS2(3,4); D = gdmx_to_dirfile(prhs[0]); e = gdmx_to_uint(prhs, 1); i = gdmx_to_int(prhs, 2); if (nrhs > 3) r = gdmx_to_int(prhs, 3); gd_alter_encoding(D, e, i, r); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/gd_nfields.m0000640000175000017500000000211712614323564021316 0ustar alastairalastairfunction nfields = gd_nfields(D) % GD_NFIELDS Retrieve a count of fields % % GD_NFIELDS(DIRFILE) % is equivalent to calling GD_NENTRIES(DIRFILE,0,0,0) % % See also GD_NENTRIES nfields = gd_nentries(D, 0, 0, 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_add_multiply.m0000640000175000017500000000320512614323564022360 0ustar alastairalastairfunction gd_add_multiply(D, field_code, in1, in2, fragment_index) % GD_ADD_MULTIPLY Add a MULTIPLY field % % GD_ADD_MULTIPLY(DIRFILE,NAME,INPUT1,INPUT2,FRAGMENT) % adds a MULTIPLY field called NAME to the dirfile specified by % DIRFILE. The input fields are INPUT1 and INPUT2 and the field % is added to the fragment indexed by FRAGMENT. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_add_multiply(3) in section 3 % of the UNIX manual for more details. % % See also GD_ADD, GD_MADD_MULTIPLY, GD_OPEN GD = getdata_constants(); gd_add(D, struct('field', field_code, 'field_type', GD.MULTIPLY_ENTRY, ... 'fragment_index', fragment_index, 'in_fields', {{in1; in2}})); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_madd_carray.c0000640000175000017500000000404512614323564022130 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_MADD_CARRAY Add a CARRAY field % % GD_MADD_CARRAY(DIRFILE,PARENT,NAME,TYPE,VALUES) % adds a CARRAY metafield called NAME to the dirfile specified by % DIRFILE under parent field PARENT. The storage type is TYPE, % and the values of the field are in VALUES. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_madd_carray(3) in section 3 % of the UNIX manual for more details. % % See also GD_MADD, GD_ADD_CARRAY, GD_OPEN */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; char *field_name, *parent; size_t n; gd_type_t const_type, data_type; GDMX_NO_LHS; GDMX_CHECK_RHS(5); D = gdmx_to_dirfile(prhs[0]); parent = gdmx_to_string(prhs, 1, 0); field_name = gdmx_to_string(prhs, 2, 0); const_type = gdmx_to_gd_type(prhs, 3); gdmx_to_data(&data, &data_type, &n, prhs[4], 4); gd_madd_carray(D, parent, field_name, const_type, n, data_type, data); gdmx_free_data(data, data_type); mxFree(field_name); mxFree(parent); gdmx_err(D, 0); } libgetdata-0.9.0/bindings/matlab/getdata_constants.m0000640000175000017500000001725712614323564022740 0ustar alastairalastairfunction GD = getdata_constants() % GETDATA_CONSTANTS Define GetData symbolic constants % % GETDATA_CONSTANTS produces a structure containing the symbolic constants % used by the GetData bindings. Member names of the structure correspond to % names of symbolic constants used in the GetData C API. % % Although it can be used in immediate context by doing something like % % >> GETDATA_CONSTANTS.FLOAT64 % % ans = % % 136 % % it is usually assigned to a variable, which prevents having to evaluate this % function more than once. We recommend calling this variable GD: % % >> GD = GETDATA_CONSTANTS; % >> GD.FLOAT64 % % ans = % % 136 % % providing more succinct symbol names which closely resemble the cor- % respondng C API symbol names (e.g. GD_FLOAT64). In the documentation for % these bindings, we assume such a GD variable has been defined, and refer to % symbolic constants as GD.<...> when necessary. % % See also GETDATA GD = struct(... 'VERSION', '0.9.0', ... 'E_OK', int32(0), ... 'E_FORMAT', int32(2), ... 'E_CREAT', int32(4), ... 'E_BAD_CODE', int32(5), ... 'E_BAD_TYPE', int32(6), ... 'E_IO', int32(7), ... 'E_INTERNAL_ERROR', int32(9), ... 'E_ALLOC', int32(10), ... 'E_RANGE', int32(11), ... 'E_LUT', int32(12), ... 'E_RECURSE_LEVEL', int32(13), ... 'E_BAD_DIRFILE', int32(14), ... 'E_BAD_FIELD_TYPE', int32(15), ... 'E_ACCMODE', int32(16), ... 'E_UNSUPPORTED', int32(17), ... 'E_UNKNOWN_ENCODING', int32(18), ... 'E_BAD_ENTRY', int32(19), ... 'E_DUPLICATE', int32(20), ... 'E_DIMENSION', int32(21), ... 'E_BAD_INDEX', int32(22), ... 'E_BAD_SCALAR', int32(23), ... 'E_BAD_REFERENCE', int32(24), ... 'E_PROTECTED', int32(25), ... 'E_DELETE', int32(26), ... 'E_ARGUMENT', int32(27), ... 'E_CALLBACK', int32(28), ... 'E_EXISTS', int32(29), ... 'E_UNCLEAN_DB', int32(30), ... 'E_DOMAIN', int32(31), ... 'E_BAD_REPR', int32(5), ... 'E_BOUNDS', int32(35), ... 'E_LINE_TOO_LONG', int32(36), ... 'E_BAD_ENDIANNESS', int32(27), ... 'E_BAD_PROTECTION', int32(27), ... 'E_BAD_VERSION', int32(27), ... 'E_OPEN_LINFILE', int32(12), ... 'E_FLUSH', int32(7), ... 'E_OPEN', int32(7), ... 'E_OPEN_FRAGMENT', int32(7), ... 'E_OPEN_INCLUDE', int32(7), ... 'E_RAW_IO', int32(7), ... 'E_TRUNC', int32(7), ... 'RDONLY', int32(0), ... 'RDWR', int32(1), ... 'FORCE_ENDIAN', int32(2), ... 'BIG_ENDIAN', int32(4), ... 'LITTLE_ENDIAN', int32(8), ... 'CREAT', int32(16), ... 'EXCL', int32(32), ... 'TRUNC', int32(64), ... 'PEDANTIC', int32(128), ... 'FORCE_ENCODING', int32(256), ... 'VERBOSE', int32(512), ... 'IGNORE_DUPS', int32(1024), ... 'IGNORE_REFS', int32(2048), ... 'PRETTY_PRINT', int32(4096), ... 'ARM_ENDIAN', int32(8192), ... 'NOT_ARM_ENDIAN', int32(0), ... 'PERMISSIVE', int32(16384), ... 'TRUNCSUB', int32(32768), ... 'AUTO_ENCODED', int32(0), ... 'BZIP2_ENCODED', int32(83886080), ... 'FLAC_ENCODED', int32(167772160), ... 'GZIP_ENCODED', int32(67108864), ... 'LZMA_ENCODED', int32(100663296), ... 'SIE_ENCODED', int32(117440512), ... 'SLIM_ENCODED', int32(50331648), ... 'TEXT_ENCODED', int32(33554432), ... 'UNENCODED', int32(16777216), ... 'ZZSLIM_ENCODED', int32(150994944), ... 'ZZIP_ENCODED', int32(134217728), ... 'NO_ENTRY', int32(0), ... 'RAW_ENTRY', int32(1), ... 'LINCOM_ENTRY', int32(2), ... 'LINTERP_ENTRY', int32(3), ... 'BIT_ENTRY', int32(4), ... 'MULTIPLY_ENTRY', int32(5), ... 'PHASE_ENTRY', int32(6), ... 'INDEX_ENTRY', int32(7), ... 'POLYNOM_ENTRY', int32(8), ... 'SBIT_ENTRY', int32(9), ... 'DIVIDE_ENTRY', int32(10), ... 'RECIP_ENTRY', int32(11), ... 'WINDOW_ENTRY', int32(12), ... 'MPLEX_ENTRY', int32(13), ... 'CONST_ENTRY', int32(16), ... 'CARRAY_ENTRY', int32(18), ... 'STRING_ENTRY', int32(17), ... 'NULL', int32(0), ... 'UINT8', int32(1), ... 'INT8', int32(33), ... 'UINT16', int32(2), ... 'INT16', int32(34), ... 'UINT32', int32(4), ... 'INT32', int32(36), ... 'UINT64', int32(8), ... 'INT64', int32(40), ... 'FLOAT32', int32(132), ... 'FLOAT64', int32(136), ... 'COMPLEX64', int32(264), ... 'COMPLEX128', int32(272), ... 'DEL_META', int32(1), ... 'DEL_DATA', int32(2), ... 'DEL_DEREF', int32(4), ... 'DEL_FORCE', int32(8), ... 'REN_DATA', int32(1), ... 'REN_UPDB', int32(2), ... 'REN_DANGLE', int32(4), ... 'REN_FORCE', int32(8), ... 'PROTECT_NONE', int32(0), ... 'PROTECT_FORMAT', int32(1), ... 'PROTECT_DATA', int32(2), ... 'PROTECT_ALL', int32(3), ... 'SYNTAX_ABORT', int32(0), ... 'SYNTAX_RESCAN', int32(1), ... 'SYNTAX_IGNORE', int32(2), ... 'SYNTAX_CONTINUE', int32(3), ... 'E_FORMAT_BAD_SPF', int32(1), ... 'E_FORMAT_N_FIELDS', int32(2), ... 'E_FORMAT_N_TOK', int32(3), ... 'E_FORMAT_NUMBITS', int32(4), ... 'E_FORMAT_BITNUM', int32(5), ... 'E_FORMAT_BITSIZE', int32(6), ... 'E_FORMAT_CHARACTER', int32(7), ... 'E_FORMAT_BAD_LINE', int32(8), ... 'E_FORMAT_RES_NAME', int32(9), ... 'E_FORMAT_ENDIAN', int32(10), ... 'E_FORMAT_BAD_TYPE', int32(11), ... 'E_FORMAT_BAD_NAME', int32(12), ... 'E_FORMAT_UNTERM', int32(13), ... 'E_FORMAT_METARAW', int32(14), ... 'E_FORMAT_NO_PARENT', int32(15), ... 'E_FORMAT_DUPLICATE', int32(16), ... 'E_FORMAT_LOCATION', int32(17), ... 'E_FORMAT_PROTECT', int32(18), ... 'E_FORMAT_LITERAL', int32(19), ... 'E_FORMAT_WINDOP', int32(20), ... 'E_FORMAT_META_META', int32(21), ... 'E_FORMAT_ALIAS', int32(22), ... 'E_FORMAT_MPLEXVAL', int32(23), ... 'VERSION_CURRENT', int32(-1), ... 'VERSION_LATEST', int32(-2), ... 'VERSION_EARLIEST', int32(-3), ... 'SEEK_SET', int32(0), ... 'SEEK_CUR', int32(1), ... 'SEEK_END', int32(2), ... 'SEEK_WRITE', int32(4), ... 'WINDOP_UNK', int32(0), ... 'WINDOP_EQ', int32(1), ... 'WINDOP_GE', int32(2), ... 'WINDOP_GT', int32(3), ... 'WINDOP_LE', int32(4), ... 'WINDOP_LT', int32(5), ... 'WINDOP_NE', int32(6), ... 'WINDOP_SET', int32(7), ... 'WINDOP_CLR', int32(8), ... 'DESYNC_PATHCHECK', int32(1), ... 'DESYNC_REOPEN', int32(2), ... 'ALL_ENTRIES', int32(0), ... 'VECTOR_ENTRIES', int32(33), ... 'SCALAR_ENTRIES', int32(34), ... 'ALIAS_ENTRIES', int32(-1), ... 'ENTRIES_HIDDEN', int32(1), ... 'ENTRIES_NOALIAS', int32(2), ... 'EN_CALC', int32(2), ... 'EN_HIDDEN', int32(4), ... 'EN_COMPSCAL', int32(1), ... 'ALL_FRAGMENTS', int32(-1), ... 'DEFAULT_LOOKBACK', int32(10), ... 'DIRFILE_STANDARDS_VERSION', int32(9), ... 'HERE', int32(-1), ... 'LOOKBACK_ALL', int32(-1), ... 'MAX_LINE_LENGTH', int32(4096) ... ); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_alter_bit.m0000640000175000017500000000320712614323564021640 0ustar alastairalastairfunction gd_alter_bit(D, field_code, in_fields, bitnum, numbits) % GD_ALTER_BIT Modify the metadata of a BIT field % % GD_ALTER_BIT(DIRFILE,NAME,INPUT,BITNUM,NUMBITS) % modifies the metadata of the BIT field called NAME in the % dirfile specified by DIRFILE. The input field is set to INPUT, % the first bit to BITNUM, and the number of bits to NUMBITS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_alter_bit(3) in section 3 % of the UNIX manual for more details. % % See also GD_ALTER_ENTRY, GD_OPEN GD = getdata_constants(); gd_alter_entry(D, field_code, struct('field_type', GD.BIT_ENTRY, ... 'in_fields', {in_fields}, 'bitnum', bitnum, 'numbits', numbits), 0); end % Copyright (C) 2013 D. V. Wiebe % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % This file is part of the GetData project. % % GetData 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. % % GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., % 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA libgetdata-0.9.0/bindings/matlab/gd_endianness.c0000640000175000017500000000346712614323564022020 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_ENDIANNESS Report the data byte sex of a fragment % % E = GD_ENDIANNESS(DIRFILE,FRAGMENT) % reports the byte sex, E, of the fragment indexed by FRAGMENT % in the dirfile DIRFILE. The returned value will (almost always) % be either GD.BIG_ENDIAN or GD.LITTLE_ENDIAN, which are provided % by GETDATA_CONSTANTS. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_endiannes(3) in % section 3 of the UNIX manual for more details. % % See also GD_ALTER_ENDIANNESS, GD_OPEN, GETDATA_CONSTANTS */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; unsigned long n; int i; GDMX_CHECK_RHS(2); D = gdmx_to_dirfile(prhs[0]); i = gdmx_to_int(prhs, 1); n = gd_endianness(D, i); gdmx_err(D, 0); plhs[0] = gdmx_from_ulong(n); } libgetdata-0.9.0/bindings/matlab/gd_rewrite_fragment.c0000640000175000017500000000331412614323564023224 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "gd_matlab.h" /* % GD_REWRITE_FRAGMENT Rewrite fragment metadata to disk % % GD_REWRITE_FRAGMENT(DIRFILE[,FRAGMENT]) % forces a rewrite of the fragment metadata on disk of the fragment % indexed by FRAGMENT, if given, or else all fragments. % % The DIRFILE object should have previously been created with GD_OPEN. % % See the documentation on the C API function gd_rewrite_fragment(3) in % section 3 of the UNIX manual for more details. % % See also GD_METAFLUSH, GD_OPEN, GD_CLOSE */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { DIRFILE *D; void *data; int i = GD_ALL_FRAGMENTS; GDMX_NO_LHS; GDMX_CHECK_RHS2(1,2); D = gdmx_to_dirfile(prhs[0]); if (nrhs > 1) i = gdmx_to_int(prhs, 1); gd_rewrite_fragment(D, i); gdmx_err(D, 0); } libgetdata-0.9.0/AUTHORS0000640000175000017500000000235012614323564015054 0ustar alastairalastairC. B. Netterfield developed the original dirfile standard and created the first GetData library. D. V. Wiebe developed the "large dirfile extension" (AKA Standards Version 3) and currently maintains GetData and the dirfile standards. Ted Kisner wrote the PutData library (libdirfile). Sean Bryan provided code which was adapted to create the MATLAB bindings. Eli Fidler ported PutData to this version of the GetData library. Joseph Fowler provided code which was adapted to create the slimlib encoding support. Adam D Hincks provided code whic was adapted to create the zzip encoding support. The original zzip encoding (ZIRFILE) was developed by Mike Nolta . Peter Kümmel ported GetData to MSVC (Windows). George Staikos maintained the GetData library as part of kst. Adam Treat wrote the code for the PHASE field type. Matthew Truch wrote the dirfile2ascii conversion utility. Andrew Walker maintained the GetData library as part of kst. vi: tw=75 libgetdata-0.9.0/compile0000740000175000017500000001624512614323564015370 0ustar alastairalastair#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 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 # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. 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/,$2, in *,$file_conv,*) ;; 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_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= 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'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= 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 $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= 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: libgetdata-0.9.0/configure.ac0000640000175000017500000010706112614323564016277 0ustar alastairalastairdnl Copyright (C) 2008-2015 D. V. Wiebe dnl dnllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl m4_include([m4/version.m4]) AC_INIT([GetData],[getdata_version],[getdata-devel@lists.sourceforge.net],, [http://getdata.sourceforge.net/]) AC_COPYRIGHT( [Parts of this program are copyright (C) 2008-2015 D. V. Wiebe. These parts may be redistributed and/or modified 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. See the file COPYING for details.] ) AC_DEFINE([GETDATA_MAJOR], [getdata_major], [ The major version number ]) AC_DEFINE([GETDATA_MINOR], [getdata_minor], [ The minor version number ]) AC_DEFINE([GETDATA_REVISION], [getdata_revision], [ The revision number ]) AC_DEFINE([GETDATA_VERSION_SUFFIX], ["getdata_extra"], [ Other qualifiers on the version number triplet (if any) ]) AC_SUBST([GETDATA_MAJOR], [getdata_major]) AC_SUBST([GETDATA_MINOR], [getdata_minor]) AC_SUBST([GETDATA_REVISION], [getdata_revision]) AC_SUBST([GETDATA_VERSION_SUFFIX], [getdata_extra]) AC_PREREQ([2.65]) AC_CONFIG_MACRO_DIR([m4]) LT_PREREQ([2.2.7b]) AC_ARG_VAR([BUILDCC], [C compiler command targetting the build system ] [(only needed if cross-compiling)]) dnl export version information from m4/version.m4 AC_SUBST(GETDATA_IFACE_VERSION, [getdata_iface_version]) AC_SUBST(GETDATA_IMPL_REVISION, [getdata_impl_revision]) AC_SUBST(GETDATA_IFACE_AGE, [getdata_iface_age]) AC_SUBST(GETDATAXX_VERSION, [getdataxx_version]) AC_SUBST(FGETDATA_VERSION, [fgetdata_version]) AC_SUBST(F95GETDATA_VERSION, [f95getdata_version]) AC_SUBST(MATLABGETDATA_VERSION, [matlabgetdata_version]) AC_CONFIG_SRCDIR([src/getdata.c]) AC_CONFIG_HEADER([src/gd_config.h]) dnl Features BUINDINGS_BUILT= BINDINGS_LEFT= ENCODINGS_BUILT=" raw ascii sie" ENCODINGS_LEFT= PRIVATE_LIBS= echo "*** Checking GetData configuration" echo dnl Build/Host triplets AC_CANONICAL_BUILD AC_CANONICAL_HOST dnl Legacy API AC_ARG_ENABLE(legacy-api, AS_HELP_STRING([--enaable-legacy-api], [include the legacy API wrapper in the library]), dnl' [ case "${enableval}" in no) include_legacy_api="no" ;; *) include_legacy_api="yes" ;; esac ], [ include_legacy_api="no" ]) AC_MSG_CHECKING([whether to include the legacy API]) AC_MSG_RESULT([$include_legacy_api]) if test "x$include_legacy_api" != "xno"; then DEFINE_GD_LEGACY_API="#define GD_LEGACY_API" else DEFINE_GD_LEGACY_API="/* #undef GD_LEGACY_API */" fi AC_SUBST([DEFINE_GD_LEGACY_API]) dnl debugging AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert], [enable assertions]), [ case "${enableval}" in yes) enable_assert="yes" ;; *) enable_assert="no" ;; esac ], [ enable_assert="no" ]) AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debugging messages]), [ case "${enableval}" in yes) enable_debug="yes" ;; *) enable_debug="no" ;; esac ], [ enable_debug="no" ]) AC_MSG_CHECKING([whether to enable debugging messages]) AC_MSG_RESULT([$enable_debug]) if test "x$enable_debug" = "xyes"; then AC_DEFINE([GETDATA_DEBUG], [], [ Define to enable debugging messages ]) enable_assert="yes" GETDATA_DEBUG=1 else GETDATA_DEBUG=0 fi AC_SUBST([GETDATA_DEBUG]) AC_MSG_CHECKING([whether to enable assertions]) AC_MSG_RESULT([$enable_assert]) if test "x$enable_assert" = "xno"; then AC_DEFINE(NDEBUG, 1, [ Define to disable assertions ]) fi dnl C99 stuff AC_ARG_ENABLE(ansi-c, AS_HELP_STRING([--enable-ansi-c], [use ANSI C (C89) work-arounds for C99 code]), [ if test "x${enableval}" != "xno"; then disable_c99="yes"; else disable_c99="no"; fi ], [disable_c99="no"]) AC_MSG_CHECKING([whether to build in ANSI C compliance mode]) AC_MSG_RESULT([$disable_c99]) dnl bindings, globally make_cxxbindings="yes" make_f77bindings="yes" make_pybindings="yes" make_idlbindings="yes" make_perlbindings="yes" make_matlabbindings="yes" make_phpbindings="yes" AC_ARG_ENABLE(bindings, AS_HELP_STRING([--disable-bindings], [don't build any bindings; just build the C library]), [ if test "x${enableval}" = "xno"; then make_cxxbindings="no" make_f77bindings="no" make_pybindings="no" make_idlbindings="no" make_perlbindings="no" make_matlabbindings="no" make_phpbindings="no" fi ]) dnl C++ bindings AC_ARG_ENABLE(cplusplus, AS_HELP_STRING([--disable-cplusplus], [don't build the C++ bindings (libgetdata++)]), [ case "${enableval}" in no) make_cxxbindings="no" ;; *) make_cxxbindings="yes" ;; esac ]) AC_MSG_CHECKING([whether to include the C++ bindings]) AC_MSG_RESULT([$make_cxxbindings]) dnl Fortran 77 bindings AC_ARG_ENABLE(fortran, AS_HELP_STRING([--disable-fortran], [don't build the Fortran 77 bindings (libfgetdata) nor ]dnl' [the Fortran 95 bindings (libf95getdata)]), [ case "${enableval}" in no) make_f77bindings="no" ;; *) make_f77bindings="yes" ;; esac ]) dnl Fortran 95 bindings AC_ARG_ENABLE(fortran95, AS_HELP_STRING([--disable-fortran95], [don't build the Fortran 95 bindings (libf95getdata)]),dnl' [ case "${enableval}" in no) make_f95bindings="no" ;; *) make_f95bindings="yes" ;; esac ], [ make_f95bindings="$make_f77bindings" ]) AC_MSG_CHECKING([whether to include the Fortran 95 bindings]) AC_MSG_RESULT([$make_f95bindings]) if test "x$make_f77bindings$make_f95bindings" = "xnoyes"; then make_f77bindings="yes (required by Fortran 95 bindings)" fi AC_MSG_CHECKING([whether to include the Fortran 77 bindings]) AC_MSG_RESULT([$make_f77bindings]) dnl IDL bindings AC_ARG_ENABLE(idl, AS_HELP_STRING([--disable-idl], [don't build the Interactive Data Language (IDL) bindings ]dnl' [(IDL_GetData)]), [ case "${enableval}" in no) make_idlbindings="no" ;; *) make_idlbindings="yes" ;; esac ]) AC_MSG_CHECKING([whether to include the IDL bindings]) AC_MSG_RESULT([$make_idlbindings]) dnl MATLAB bindings AC_ARG_ENABLE(matlab, AS_HELP_STRING([--disable-matlab], [don't build the MATLAB bindings]),dnl' [ case "${enableval}" in no) make_matlabbindings="no" ;; *) make_matlabbindings="yes" ;; esac ]) AC_MSG_CHECKING([whether to include the MATLAB bindings]) AC_MSG_RESULT([$make_matlabbindings]) dnl Perl bindings AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [don't build the Perl bindings (GetData)]),dnl' [ case "${enableval}" in no) make_perlbindings="no" ;; *) make_perlbindings="yes" ;; esac ]) AC_MSG_CHECKING([whether to include the Perl bindings]) AC_MSG_RESULT([$make_perlbindings]) dnl PHP bindings AC_ARG_ENABLE(php, AS_HELP_STRING([--disable-php], [don't build the PHP bindings]),dnl' [ case "${enableval}" in no) make_phpbindings="no" ;; *) make_phpbindings="yes" ;; esac ]) dnl Python bindings AC_ARG_ENABLE(python, AS_HELP_STRING([--disable-python], [don't build the Python bindings (pygetdata)]),dnl' [ case "${enableval}" in no) make_pybindings="no" ;; *) make_pybindings="yes" ;; esac ]) AC_MSG_CHECKING([whether to include the Python bindings]) AC_MSG_RESULT([$make_pybindings]) AC_MSG_CHECKING([whether to include the PHP bindings]) AC_MSG_RESULT([$make_phpbindings]) dnl Modules AC_ARG_ENABLE(modules, AS_HELP_STRING([--enable-modules], [build external encodings in dynamically loaded modules instead of directly into the core GetData library]), [ case "${enableval}" in no) use_modules="no" ;; *) use_modules="yes" ;; esac ], [ use_modules="no" ]) AC_MSG_CHECKING([whether to enable getdata modules]) AC_MSG_RESULT([$use_modules]) if test "x$use_modules" != "xno"; then AC_DEFINE([USE_MODULES], [], [ Define if building with modules ]) fi AC_ARG_WITH(module-dir, AS_HELP_STRING([--with-module-dir=DIR], [if building modules, install them in DIR. This is ignored if --enable-modules isn't specified [default: LIBDIR/getdata]]),dnl' [ case "${withval}" in no) moduledir="$libdir/getdata" ;; *) moduledir="${withval}" ;; esac ], [ moduledir="$libdir/getdata" ]) AC_SUBST([moduledir]) dnl LTDL AC_ARG_WITH([ltdl], AS_HELP_STRING([--with-ltdl=PREFIX], [if building modules, use the GNU ltdl library located in PREFIX [default: autodetect]]), [ case "${withval}" in no) ltdl_prefix= ;; *) ltdl_prefix="${withval}" ;; esac ], [ ltdl_prefix= ]) dnl Kill switch for external libraries AC_ARG_WITH([external-libraries], AS_HELP_STRING([--without-external-libraries], [disable all features relying on external libraries]), [ case "${withval}" in no) no_extern="yes";; *) no_extern="no";; esac ], [ no_extern="no" ]) dnl Programs echo echo "*** Initialising build system" echo AM_INIT_AUTOMAKE AC_PROG_LN_S AC_PROG_AWK AC_PROG_GREP AC_PROG_SED AC_ARG_VAR([DATE], \ [a date program which supports '+%...' conversion specifiers]) AC_CHECK_PROGS([DATE], [date], [not found]) AC_ARG_VAR([DIFF], [a POSIX-compatible diff]) AC_CHECK_PROGS([DIFF], [diff], []) AC_ARG_VAR([JOT], [a BSD-style jot;] [SysV-derived systems (like GNU/Linux) may find it easier to use SEQ (q.v.)]) AC_CHECK_PROGS([JOT], [jot], [not found]) AC_ARG_VAR([PRINTF], [a POSIX-compatible printf]) AC_CHECK_PROGS([PRINTF], [printf], [not found]) AC_ARG_VAR([SEQ], [a SysV-style seq;] [BSD-derived systems (like MacOS X) may find it easier to use JOT (q.v.)]) AC_CHECK_PROGS([SEQ], [seq], [not found]) GD_MSYS_SHELL dnl verion info AC_SUBST([DEFINE_GD_GETDATA_VERSION], ["#define GD_GETDATA_VERSION \"]dnl" getdata_version[\""]) [DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} ]dnl ifelse(`getdata_major', `0',dnl" [%i%02i getdata_minor getdata_revision`"],dnl` [%i%02i%02i getdata_major getdata_minor getdata_revision`"])dnl` AC_SUBST([DEFINE_GD_GETDATA_INT_VERSION]) echo echo "*** Checking host environment" echo dnl unaligned memory access dnl user knows best AC_ARG_ENABLE([fast-unaligned], AS_HELP_STRING([--enable-fast-unaligned], [use fast loads and stores with non-aligned data. WARNING: Enabling this on ] [a platform which does not support fast unaligned memory access may cause ] [the library to silently corrupt data. [default: autodetect]]), [ case "${enableval}" in yes) gd_unaligned_override="yes" ;; no) gd_unaligned_override="no" ;; *) gd_unaligned_override="check" ;; esac ], [gd_unaligned_override="check"]) m4_divert_once([HELP_ENABLE], AS_HELP_STRING([--disable-fast-unaligned], [don't use fast loads and stores with non-aligned data, ]dnl' [even if it looks like they should work. This is always ] [safe, but can result in significant slow-down.] [ [default: autodetect]])) AC_MSG_CHECKING([whether ${host} supports fast unaligned memory access]) if test "x$gd_unaligned_override" = "xyes"; then gd_unaligned_ok=yes AC_MSG_RESULT([yes (forced)]) elif test "x$gd_unaligned_override" = "xno"; then gd_unaligned_ok=no AC_MSG_RESULT([no (forced)]) else case "${host}" in i?86-*-*|powerpc*-*-*|x86_64-*-*|armv[6789]*-*-*) gd_unaligned_ok=yes ;; *) gd_unaligned_ok=no ;; esac AC_MSG_RESULT([$gd_unaligned_ok]) fi if test "x$gd_unaligned_ok" = "xyes"; then AC_DEFINE([UNALIGNED_ACCESS_OK], [1], [Define to 1 if the platform supports fast unaligned memory access]) fi dnl FDIRSEP is used in Fortran, where '\' should not be escaped. AC_MSG_CHECKING([the directory separator]) case "${host}" in *-*-djgpp|*-*-mingw32) GD_FDIRSEP=\\; GD_DIRSEP=\\\\ ;; *) GD_FDIRSEP=/; GD_DIRSEP=/ ;; esac AC_SUBST([GD_FDIRSEP]) AC_SUBST([GD_DIRSEP]) AC_DEFINE_UNQUOTED([GD_DIRSEP], ['$GD_DIRSEP'], [ The directory separator between path elements ]) AC_MSG_RESULT([$GD_FDIRSEP]) AC_MSG_CHECKING([for extra LDFLAGS needed on ${host}]) case "${host}" in *-pc-mingw*) NO_UNDEFINED=" -no-undefined" NO_DLOPEN_TESTS=1 ;; *-*-cygwin*) NO_UNDEFINED=" -no-undefined -enable-auto-import" NO_DLOPEN_TESTS=1 ;; *) NO_DLOPEN_TESTS=0 ;; esac if test "x${NO_UNDEFINED}" = "x"; then AC_MSG_RESULT([none needed]) else AC_MSG_RESULT([${NO_UNDEFINED}]) fi AC_MSG_CHECKING([whether the test suite can dynamically load objects]) if test "x${NO_DLOPEN_TESTS}" = "x1"; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes]) fi dnl DL library path munging for test suite case "${host}" in *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;; *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;; esac AC_SUBST([DL_LIBRARY_PATH]) echo echo "*** Checking C compiler characteristics" echo AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_PROG_CC_C_O if test "x$disable_c99" != "xyes"; then AC_PROG_CC_C99 if test "x$ac_cv_prog_cc_c99" = "xno"; then disable_c99="yes" fi fi if test "x$disable_c99" = "xyes"; then DEFINE_GD_NO_C99_API="#define GD_NO_C99_API" else DEFINE_GD_NO_C99_API="/* #undef GD_NO_C99_API */" fi AC_SUBST([DEFINE_GD_NO_C99_API]) AC_HEADER_STDC AM_PROG_AS echo echo "*** Checking C++ compiler characteristics" echo AC_PROG_CXX AC_PROG_CXX_C_O if test "x$make_f77bindings" != "xno"; then echo echo "*** Checking Fortran 77 compiler characteristics" echo AC_PROG_F77 AC_PROG_F77_C_O fi if test "x$make_f95bindings" != "xno"; then echo echo "*** Checking Fortran 90 compiler characteristics" echo AC_PROG_FC AC_PROG_FC_C_O # does $FC accept fortran code with .f90 extension? AC_MSG_CHECKING([whether the Fortran 90 compiler works]) AC_LANG_PUSH([Fortran]) ac_ext="f90" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]); FC=;]) AC_LANG_POP fi if test "x${cross_compiling}" != "xno"; then echo echo "*** Checking the build environment" echo if test -z "$BUILDCC"; then if test -n "$build_alias"; then AC_CHECK_PROGS([BUILDCC], [${build_alias}-gcc ${build_alias}-cc ${build_alias}-cl]) fi fi if test -z "$BUILDCC"; then AC_CHECK_PROGS([BUILDCC], [gcc cc cl]) fi # bindings requiring interpreters aren't built when cross compiling make_idlbindings=no make_phpbindings=no make_pybindings=no make_perlbindings=no make_matlabbindings=no else if test -z "$BUILDCC"; then BUILDCC=$CC fi AC_SUBST([BUILDCC]) fi echo echo "*** Building libtool" echo LT_INIT([dlopen]) AC_SUBST([LIBTOOL_DEPS]) LT_OUTPUT dnl libltdl stuff if test "x${use_modules}" != "xno"; then echo echo "*** Configuring the dynamic loader" echo saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$ltdl_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$ltdl_prefix/lib" fi AC_CHECK_LIB([ltdl],[lt_dlinit], [have_ltdl=yes], [have_ltdl=no]) LDFLAGS=$saved_ldflags LIBS=$saved_libs if test "x$have_ltdl" == "xno"; then AC_MSG_ERROR([libltdl is required to build modules. Please either specify the location of the libltdl library using --with-ldtl=PREFIX or else disable the building of modules by using --disable-modules.]) fi if test "x$ltdl_prefix" != "x"; then LIBLTDL="-L${ltdl_prefix}/lib -lltdl" LTDLINCL="-I${ltdl_prefix}/include" saved_cppflags=$CPPFLAGS CPPFLAGS="${CPPFLAGS} ${LTDLINCL}" AC_CHECK_HEADERS(ltdl.h) CPPFLAGS=$saved_cppflags else AC_CHECK_HEADERS(ltdl.h) LIBLTDL="-lltdl" fi dnl pthread AC_SEARCH_LIBS([pthread_mutex_lock],[pthread], [use_pthread=yes AC_DEFINE([USE_PTHREAD], [], [Define if you have a POSIX compliant thread ] [library]) ], [use_pthread=no]) AC_CHECK_HEADERS(pthread.h) fi AC_SUBST([LIBLTDL]) AC_SUBST([LTDLINCL]) dnl check if we found a C++ compiler if test "x$CXX" == "x"; then make_cxxbindings=no fi dnl check if we found a Fortran 77 compiler if test "x$F77" == "x"; then make_f77bindings=no make_f95bindings=no fi dnl check if we found a free-form Fortran compiler if test "x$FC" == "x"; then make_f95bindings=no fi dnl compiler checks echo echo "*** Checking additional compiler characteristics" echo AC_C_INLINE AC_C_RESTRICT GD_C_RESTRICT_ARRAY GD_PROG_CC_WALL GD_PROG_CC_WEXTRA if test "x$make_cxxbindings" != "xno"; then GD_PROG_CXX_WALL GD_PROG_CXX_WEXTRA fi if test "x$make_f77bindings" != "xno"; then GD_PROG_F77_WALL GD_PROG_F77_WEXTRA GD_LANG_F77_COMPILER_INTEL fi dnl F77 stuff if test "x$make_f77bindings" != "xno"; then AC_F77_WRAPPERS if test "x$ac_cv_f77_mangling" == "xunknown"; then make_f77bindings=no make_f95bindings=no fi fi if test "x$make_f95bindings" != "xno"; then GD_PROG_FC_WALL GD_PROG_FC_WEXTRA GD_LANG_FC_COMPILER_INTEL fi AC_MSG_CHECKING([if we're linking against the Microsoft C Run-Time]) #' AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __MSVCRT__ choke me #endif ]])], [gd_msvcrt=yes], [gd_msvcrt=no]) AC_MSG_RESULT([$gd_msvcrt]) dnl 64-bit stat() requires MSVCRT 6.1 or later. This may prohibit using dnl GetData on Windows95. Oh no! if test "$gd_msvcrt" = "yes"; then AC_DEFINE([__MSVCRT_VERSION__], [0x601], [ If compiling aginst the MSVCRT, define to 0x601 ]) fi dnl libraries echo echo "*** Looking for additional libraries" echo AC_SEARCH_LIBS([ceil],[m]) dnl headers echo echo "*** Looking for additional header files" echo AC_CHECK_HEADERS([asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \ float.h inttypes.h io.h libgen.h libkern/OSByteOrder.h \ math.h stddef.h stdint.h sys/endian.h sys/file.h sys/param.h \ sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.h \ unistd.h]) if test "x$disable_c99" = "xno"; then AC_CHECK_HEADERS([complex.h]) fi AC_HEADER_DIRENT dnl types echo echo "*** Checking data types" echo AC_C_CONST AC_C_BIGENDIAN GD_C_FLOATORDERING AC_TYPE_INT8_T AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_MODE_T AC_TYPE_OFF_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T if test "x$disable_c99" = "xno"; then AC_CHECK_TYPES([_Complex float, _Complex double]) fi AC_CHECK_TYPES([struct stat64, struct _stat64, struct __stat64, off64_t]) dnl integer sizes AC_CHECK_SIZEOF([off_t]) AC_CHECK_SIZEOF([size_t]) AC_CHECK_SIZEOF([short int]) AC_CHECK_SIZEOF([int]) AC_CHECK_SIZEOF([long int]) AC_CHECK_SIZEOF([long long int]) AC_CHECK_SIZEOF([unsigned short int]) AC_CHECK_SIZEOF([unsigned int]) AC_CHECK_SIZEOF([unsigned long int]) AC_CHECK_SIZEOF([unsigned long long int]) AC_CHECK_SIZEOF([void *]) dnl C89 API types if test $ac_cv_sizeof_int -eq 2; then gd_int16_t="int" elif test $ac_cv_sizeof_short_int -eq 2; then gd_int16_t="short int" elif test $ac_cv_sizeof_long_int -eq 2; then gd_int16_t="long int" elif test $ac_cv_sizeof_long_long_int -eq 2; then gd_int16_t="long long int" fi if test $ac_cv_sizeof_unsigned_int -eq 2; then gd_uint16_t="unsigned int" elif test $ac_cv_sizeof_unsigned_short_int -eq 2; then gd_uint16_t="unsigned short int" elif test $ac_cv_sizeof_unsigned_long_int -eq 2; then gd_uint16_t="unsigned long int" elif test $ac_cv_sizeof_unsigned_long_long_int -eq 2; then gd_uint16_t="unsigned long long int" fi if test $ac_cv_sizeof_int -eq 8; then gd_int64_t="int" elif test $ac_cv_sizeof_short_int -eq 8; then gd_int64_t="short int" elif test $ac_cv_sizeof_long_int -eq 8; then gd_int64_t="long int" elif test $ac_cv_sizeof_long_long_int -eq 8; then gd_int64_t="long long int" fi if test $ac_cv_sizeof_unsigned_int -eq 8; then gd_uint64_t="unsigned int" elif test $ac_cv_sizeof_unsigned_short_int -eq 8; then gd_uint64_t="unsigned short int" elif test $ac_cv_sizeof_unsigned_long_int -eq 8; then gd_uint64_t="unsigned long int" elif test $ac_cv_sizeof_unsigned_long_long_int -eq 8; then gd_uint64_t="unsigned long long int" fi if test "x$gd_cv_type_off64_t" = "xyes"; then dnl Assume we have the entire LFS defined transitional API AC_DEFINE([HAVE_OFF64_T], [1], [ Define to 1 if the system has the type `off64_t'. ]) dnl ` fi DEFINE_gd_int16_t="# define gd_int16_t $gd_int16_t"; DEFINE_gd_uint16_t="# define gd_uint16_t $gd_uint16_t"; DEFINE_gd_int64_t="# define gd_int64_t $gd_int64_t"; DEFINE_gd_uint64_t="# define gd_uint64_t $gd_uint64_t"; AC_SUBST([DEFINE_gd_int16_t]) AC_SUBST([DEFINE_gd_uint16_t]) AC_SUBST([DEFINE_gd_int64_t]) AC_SUBST([DEFINE_gd_uint64_t]) dnl library functions echo echo "*** Looking for additional library functions" echo AC_CHECK_FUNCS([basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \ _finite fpathconf fseeko fseeko64 _fstat fstat64 _fstat64 \ fstatat fstatat64 fsync ftello ftello64 ftruncate ftruncate64 \ getcwd _getcwd getdelim gmtime_r isnan _isnan lseek64 \ _lseeki64 lstat lstat64 _mkdir mkfifo nan _open openat \ pathconf _read readdir_r readlink renameat _rmdir setrlimit \ snprintf _snprintf stat64 _stat64 _strtoi64 strtoll strtoq \ _strtoui64 strtoull strtouq symlink _unlink unlinkat _write]) if test "x$disable_c99" = "xno"; then AC_CHECK_FUNCS([cabs]) fi AC_FUNC_STRERROR_R AC_FUNC_FORK AC_MSG_CHECKING([whether mkdir accepts two arguments]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_IO_H #include #endif ], [[ #ifdef HAVE__MKDIR _mkdir("x", 00777); #else mkdir("x", 00777); #endif ]])], [gd_2arg_mkdir=yes], [gd_2arg_mkdir=no]) AC_MSG_RESULT([$gd_2arg_mkdir]) if test $gd_2arg_mkdir = "no"; then AC_DEFINE([MKDIR_NO_MODE], [1], [ Define to 1 if the `mkdir' function takes only one argument.]) fi dnl` AC_CHECK_DECLS([isfinite],,, [ #ifdef HAVE_MATH_H #include #endif ]) AC_CHECK_DECLS([_strtoi64, _strtoui64],,, [ #ifdef STDC_HEADERS #include #endif ]) AC_CHECK_DECLS([bswap16, bswap_16, OSSwapInt16],,, [ #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_LIBKERN_OSBYTEORDER_H #include #endif ]) AC_CHECK_DECLS([get_unaligned, put_unaligned],,, [ #ifdef HAVE_ASM_UNALIGNED_H #include #endif ]) dnl idl if test "x$make_idlbindings" = "xyes"; then echo echo "*** Configuring interactive data language (IDL) bindings" echo AC_MSG_CHECKING([whether C99 is supported]) if test "x$disable_c99" = "xno"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) make_idlbindings=no fi fi if test "x$make_idlbindings" = "xyes"; then GD_IDL([5.5]) if test "x$have_idl" = "xno"; then make_idlbindings="no" fi fi dnl matlab if test "x$make_matlabbindings" = "xyes"; then echo echo "*** Configuring MATLAB bindings" echo GD_MATLAB if test "x$have_matlab" = "xno"; then make_matlabbindings=no fi fi dnl perl if test "x$make_perlbindings" = "xyes"; then echo echo "*** Configuring Perl bindings" echo GD_PERL if test "x$have_perl" = "xno"; then make_perlbindings=no fi fi dnl php if test "x$make_phpbindings" = "xyes"; then echo echo "*** Configuring PHP bindings" echo AC_MSG_CHECKING([whether C99 is supported]) if test "x$disable_c99" = "xno"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) make_phpbindings=no fi fi if test "x$make_phpbindings" = "xyes"; then GD_PHP if test "x$have_php" = "xno"; then make_phpbindings=no fi fi dnl python if test "x$make_pybindings" = "xyes"; then echo echo "*** Configuring python bindings" echo GD_PYTHON([2.3]) have_numpy="no (required for python bindings)" if test "x$have_python" = "xno"; then make_pybindings="no" else AC_MSG_CHECKING([for NumPy]) cat > conftest.py << EOF import sys try: import numpy except ImportError: sys.exit(1) EOF if $PYTHON conftest.py > /dev/null 2>&1; then have_numpy="yes" fi AC_MSG_RESULT([$have_numpy]) fi if test "x$have_numpy" = "xyes"; then AC_MSG_CHECKING([NumPy includes]) NUMPY_CPPFLAGS=-I`$PYTHON -c "import numpy; print numpy.get_include()"` AC_MSG_RESULT([$NUMPY_CPPFLAGS]) saved_cppflags=$CPPFLAGS CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS} ${NUMPY_CPPFLAGS}" AC_CHECK_HEADERS([numpy/arrayobject.h],,[have_numpy="no"],[ #include ]) CPPFLAGS=$saved_cppflags else make_pybindings=no fi fi dnl external encodings GD_CHECK_ENCODING([bzip2],[bz2],[BZ2_bzReadOpen],[bzlib.h],[bzip2],[bunzip2],[]) GD_CHECK_ENCODING([flac],[FLAC],[FLAC__stream_decoder_init_FILE],[FLAC/all.h], [flac],[],[]) GD_CHECK_ENCODING([gzip],[z],[gzopen],[zlib.h],[gzip],[gunzip], [gzseek64 gztell64]) GD_CHECK_ENCODING([lzma],[lzma],[lzma_auto_decoder],[lzma.h],[xz],[],[]) GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h], [slimdata slim], [unslim],[slimdopen slimdrawsize]) GD_CHECK_ENCODING([zzip],[zzip],[zzip_open],[zzip/lib.h],[zip],[unzip],[]) dnl zzslim hackery -- there's no easy way to check whether slim supports zzip AC_ARG_ENABLE(zzslim, AS_HELP_STRING([--enable-zzslim], [skip probing for zzslim required features and enable the zzslim encoding. Note: zzslim encoding support requires both slim and zzip encoding support. [default: autodetect]]), [ case "${enableval}" in no) zzslim_override="no" ;; *) zzslim_override="yes" ;; esac ], [ zzslim_override="auto" ]) m4_divert_once([HELP_ENABLE], AS_HELP_STRING([--disable-zzslim], [disable zzslim encodings support])) echo echo "*** Configuring zzslim support " echo if test $zzslim_override = "no"; then AC_MSG_CHECKING([for zzslim support]) AC_MSG_RESULT([no (forced)]) use_zzslim=no else AC_MSG_CHECKING([for slim support]) AC_MSG_RESULT([$use_slim]) AC_MSG_CHECKING([for zzip support]) AC_MSG_RESULT([$use_zzip]) if test "$use_slim$use_zzip" == "yesyes"; then if test $zzslim_override = "yes"; then AC_MSG_CHECKING([for zzslim support]) AC_MSG_RESULT([yes (forced)]) use_zzslim=yes elif test "x$CXX" = "x"; then AC_MSG_CHECKING([for zzslim support]) AC_MSG_RESULT([no (no C++ compiler available for configure test)]) use_zzslim=no else dnl try linking to the slim library to see if it contains the unprototyped dnl ibitstream::ibitstream(ZZIP_FILE *file, int buffersize) dnl given that this function isn't public, this is probably easily broken AC_MSG_CHECKING([whether -lslim contains zzip capability]) AC_LANG_PUSH([C++]) saved_ldflags=$LDFLAGS saved_libs=$LIBS LDFLAGS="$SLIM_LDFLAGS $LDFLAGS" LIBS="$SLIM_LIBS $LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM( [[ struct zzip_file; typedef struct zzip_file ZZIP_FILE; class ibitstream { public: ibitstream(ZZIP_FILE *file, int buffersize); }; ]], [[ ZZIP_FILE *file; ibitstream foo(file, 0); ]] )], [slim_zzip="yes"], [slim_zzip="no"]) AC_MSG_RESULT([$slim_zzip]) LDFLAGS=$saved_ldflags LIBS=$saved_libs AC_LANG_POP use_zzslim=$slim_zzip fi else use_zzslim="no" fi fi dnl add to summary and private lib list if test "x$use_zzslim" != "xno"; then AC_DEFINE([USE_ZZSLIM], [], [ Define to enable zzslim support ]) if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} zzslim"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} zzslim"; fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} zzslim"; fi if test ! -z "${LIBS}"; then PRIVATE_LIBS="${LIBS} ${PRIVATE_LIBS}" fi AC_SUBST([PRIVATE_LIBS]) dnl Calculate absolute docdir cat < conftest.sh prefix=$prefix test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=\$prefix exec_prefix=$exec_prefix datarootdir=$datarootdir PACKAGE_TARNAME=$PACKAGE_TARNAME echo $docdir EOF absolute_docdir=`$SHELL conftest.sh` AC_SUBST([absolute_docdir]) dnl output echo echo "*** Writing configure output" echo AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([bindings/Makefile]) AC_CONFIG_FILES([bindings/cxx/Makefile]) AC_CONFIG_FILES([bindings/cxx/test/Makefile]) AC_CONFIG_FILES([bindings/f77/Makefile]) AC_CONFIG_FILES([bindings/f77/test/Makefile]) AC_CONFIG_FILES([bindings/f77/test/test_getdata.f]) AC_CONFIG_FILES([bindings/idl/Makefile]) AC_CONFIG_FILES([bindings/idl/makedlm.sh]) AC_CONFIG_FILES([bindings/idl/test/Makefile]) AC_CONFIG_FILES([bindings/matlab/Makefile]) AC_CONFIG_FILES([bindings/matlab/make_contents.sh]) AC_CONFIG_FILES([bindings/matlab/test/Makefile]) AC_CONFIG_FILES([bindings/perl/Makefile]) AC_CONFIG_FILES([bindings/perl/Build.PL]) AC_CONFIG_FILES([bindings/php/Makefile]) AC_CONFIG_FILES([bindings/php/test/Makefile]) AC_CONFIG_FILES([bindings/python/Makefile]) AC_CONFIG_FILES([bindings/python/setup.py]) AC_CONFIG_FILES([bindings/python/test/Makefile]) AC_CONFIG_FILES([doc/Makefile]) AC_CONFIG_FILES([man/Makefile]) AC_CONFIG_FILES([man/gd_alter_encoding.3]) AC_CONFIG_FILES([man/gd_alter_endianness.3]) AC_CONFIG_FILES([man/gd_alter_frameoffset.3]) AC_CONFIG_FILES([src/Makefile]) dnl This doubling allows us to build getdata.h as a normal AC_CONFIG_FILE, but dnl use AC_CONFIG_HEADERS to check whether it has changed. AC_CONFIG_FILES([src/getdata.h.in2:src/getdata.h.in]) AC_CONFIG_HEADERS([src/getdata.h:src/getdata.h.in2], [chmod a-w src/getdata.h]) AC_CONFIG_FILES([src/getdata.pc]) AC_CONFIG_FILES([test/Makefile]) AC_CONFIG_FILES([util/Makefile]) dnl Automake conditionals AM_CONDITIONAL(GETDATA_DEBUG, [test "x$enable_debug" == "xyes"]) AM_CONDITIONAL(HAVE_SED, [ test "x${SED}" != 'x' ]) AM_CONDITIONAL(INTEL_F77_COMPILER, [test "x$gd_cv_f77_compiler_intel" == "xyes"]) AM_CONDITIONAL(INTEL_FC_COMPILER, [test "x$gd_cv_fc_compiler_intel" == "xyes"]) AM_CONDITIONAL(INCLUDE_LEGACY_API, [test "x$include_legacy_api" != "xno"]) AM_CONDITIONAL(MAKE_CXXBINDINGS, [test "x$make_cxxbindings" = "xyes"]) AM_CONDITIONAL(MAKE_F77BINDINGS, [test "x$make_f77bindings" != "xno"]) AM_CONDITIONAL(MAKE_F95BINDINGS, [test "x$make_f95bindings" = "xyes"]) AM_CONDITIONAL(MAKE_PYBINDINGS, [test "x$make_pybindings" = "xyes"]) AM_CONDITIONAL(MAKE_IDLBINDINGS, [test "x$make_idlbindings" = "xyes"]) AM_CONDITIONAL(MAKE_PERLBINDINGS, [test "x$make_perlbindings" = "xyes"]) AM_CONDITIONAL(MAKE_MATLABBINDINGS, [test "x$make_matlabbindings" = "xyes"]) AM_CONDITIONAL(MAKE_PHPBINDINGS, [test "x$make_phpbindings" = "xyes"]) AM_CONDITIONAL(USE_MODULES, [test "x$use_modules" != "xno"]) AM_CONDITIONAL(TEST_PYTHON, [test "x$NO_DLOPEN_TESTS" = "x0"]) AM_CONDITIONAL(TEST_IDL, [test "x$NO_DLOPEN_TESTS" = "x0"]) AM_CONDITIONAL(TEST_PERL, [test "x$HAVE_Test__Harness" = "xyes"]) AM_CONDITIONAL(TEST_MATLAB, [test "x$NO_DLOPEN_TESTS" = "x0"]) AM_CONDITIONAL(TEST_PHP, [test "x$NO_DLOPEN_TESTS" = "x0"]) AM_CONDITIONAL(HAVE_DIFF, [test "x$DIFF" != "x"]) AM_CONDITIONAL(USE_ZZSLIM, [test "x$use_zzslim" = "xyes"]) AM_CONDITIONAL(GD_EXTERNAL, [false]) dnl we do this here to avoid screwing up other tests LDFLAGS="${LDFLAGS}${NO_UNDEFINED}" AC_OUTPUT dnl Handy summary if test "x$make_cxxbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} C++" else BINDINGS_LEFT="${BINDINGS_LEFT} C++" fi if test "x$make_f77bindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-77" else BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-77" fi if test "x$make_f95bindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-95" else BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-95" fi if test "x$make_idlbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} IDL" else BINDINGS_LEFT="${BINDINGS_LEFT} IDL" fi if test "x$make_matlabbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} MATLAB" else BINDINGS_LEFT="${BINDINGS_LEFT} MATLAB" fi if test "x$make_phpbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} PHP" else BINDINGS_LEFT="${BINDINGS_LEFT} PHP" fi if test "x$make_perlbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Perl" else BINDINGS_LEFT="${BINDINGS_LEFT} Perl" fi if test "x$make_pybindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Python" else BINDINGS_LEFT="${BINDINGS_LEFT} Python" fi if test "x$BINDINGS_BUILT" = "x"; then BINDINGS_BUILT=" none" fi if test "x$BINDINGS_LEFT" = "x"; then BINDINGS_LEFT=" none" fi if test "x$ENCODINGS_MODS" = "x"; then ENCODINGS_MODS=" none" fi if test "x$ENCODINGS_LEFT" = "x"; then ENCODINGS_LEFT=" none" fi if test "x$enable_debug$enable_assert" = "xnoyes"; then enable_debug="assert only" fi echo echo "Configuration summary: " echo " Build platform: ${build}" if test "x${cross_compiling}" != "xno"; then echo " Cross compiling for: ${host}" fi echo " ANSI C compatibility mode: ${disable_c99}" echo " Legacy API: ${include_legacy_api}" echo " Verbose debugging: ${enable_debug}" echo " Fast unaligned memory access: ${gd_unaligned_ok}" echo " Use modules: ${use_modules}" if test "x${use_modules}" != "xno"; then echo " Thread-safe dynamic loading: ${use_pthread}" fi echo echo " Supported internal encodings: ${ENCODINGS_BUILT}" if test "x${use_modules}" != "xno"; then echo " Supported external encodings: ${ENCODINGS_MODS}" fi echo " Unsupported encodings: ${ENCODINGS_LEFT}" echo echo " Bindings built: ${BINDINGS_BUILT}" echo " Bindings not built: ${BINDINGS_LEFT}" echo libgetdata-0.9.0/COPYING0000640000175000017500000006350212614323564015045 0ustar alastairalastair 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! libgetdata-0.9.0/util/0000740000175000017500000000000012614323564014757 5ustar alastairalastairlibgetdata-0.9.0/util/checkdirfile.c0000640000175000017500000001757312614323564017556 0ustar alastairalastair/* Copyright (C) 2007-2010, 2012, 2014 D. V. Wiebe * *************************************************************************** * * This program 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 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 Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser 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 */ #ifdef HAVE_CONFIG_H #include "gd_config.h" #endif #ifndef HAVE_SNPRINTF #ifdef HAVE__SNPRINTF #define snprintf _snprintf #endif #endif #include #include #include #include "getdata.h" #ifndef PACKAGE_STRING #define PACKAGE_STRING PACKAGE_NAME " " PACKAGE_VERSION #endif static int callback(gd_parser_data_t *pdata, void* ne) { char getdata_error[2048]; printf(" syntax error: %s\n", gd_error_string(pdata->dirfile, getdata_error, 2048)); (*(int*)ne)++; return GD_SYNTAX_IGNORE; } int main(int argc, char* argv[]) { DIRFILE* dirfile; int e, i, j; char getdata_error[2048]; off_t n; int ne = 0; unsigned int nfields = 0; const char **flist, **mflist; if (argc < 2 || !strcmp(argv[1], "--version") || !strcmp(argv[1], "--help")) { printf("Usage:\n" " checkdirfile DIRFILE Check the DirFile database " "DIRFILE for\n" " errors.\n" " checkdirfile [ --help | --version ] Print this message and exit.\n" "\n\n" "This program is part of %s.\n" "Copyright (C) 2008-2010, 2012 D. V. Wiebe\n" "Please send reports of bugs and other communication to:\n\n %s\n\n" "This program comes with NO WARRANTY, not even for MERCHANTABILITY " "or FITNESS\n" "FOR A PARTICULAR PURPOSE. You may redistribute it under the terms of " "the GNU\n" "Lesser General Public License, either version 2.1 of the License, or " "(at your\n" "option) any later version.\n\n" "You should have received a copy of the GNU Lesser General Public " "License along\n" "with this program; if not, write to the Free Software Foundation," "Inc.,\n" "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n", PACKAGE_STRING, PACKAGE_BUGREPORT); return 1; } /* open the dirfile -- the callback will print syntax errors as * found, and return the number of lines with errors in ne. */ puts("Checking syntax..."); dirfile = gd_cbopen(argv[1], GD_RDONLY, callback, &ne); /* open error */ e = gd_error(dirfile); if (e) { if (e != GD_E_FORMAT) { printf(" getdata error: %s\n", gd_error_string(dirfile, getdata_error, 2048)); gd_close(dirfile); return 1; } } if (ne > 0) printf(" Found %i line%s with syntax errors.\n", ne, (ne == 1) ? "" : "s"); else { int vers[GD_DIRFILE_STANDARDS_VERSION + 1]; int nvers = 0; int first = -1; int start = 1; printf(" Syntax OK.\n\n"); /* Run through every known standards version and check whether the dirfile * is conformant by trying to set the loaded dirfile's version to that * value */ for (i = 0; i <= GD_DIRFILE_STANDARDS_VERSION; ++i) { if (gd_dirfile_standards(dirfile, i) == i) { vers[i] = 1; nvers++; } else vers[i] = 0; } if (nvers == 0) { puts("WARNING: Dirfile conforms to no Standards Version."); } else { printf("Dirfile conforms to Standards %s ", (nvers == 1) ? "Version" : "Versions"); /* pretty-print the list of conformed versions */ for (i = 0; i <= GD_DIRFILE_STANDARDS_VERSION; ++i) { if (vers[i]) { if (first == -1) first = i; } else if (first != -1) { if (!start) fputs(", ", stdout); else start = 0; if (first == i) printf("%i", i); else if (first + 1 == i) printf("%i, %i", first, i); else printf("%i-%i", first, i); first = -1; } } if (first != -1) { if (!start) fputs(", ", stdout); if (first == GD_DIRFILE_STANDARDS_VERSION) printf("%i", GD_DIRFILE_STANDARDS_VERSION); else if (first + 1 == GD_DIRFILE_STANDARDS_VERSION) printf("%i, %i", first, GD_DIRFILE_STANDARDS_VERSION); else printf("%i-%i", first, GD_DIRFILE_STANDARDS_VERSION); fputs(" (the latest version)", stdout); } puts(""); } } /* Check the validity of each entry defined */ ne = 0; puts("\nChecking fields..."); flist = gd_entry_list(dirfile, NULL, 0, GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS); for (i = 0; flist[i] != NULL; ++i) { if (gd_validate(dirfile, flist[i])) { printf(" getdata error checking %s: %s\n", flist[i], gd_error_string(dirfile, getdata_error, 2048)); ne++; } nfields++; mflist = gd_entry_list(dirfile, flist[i], 0, GD_ENTRIES_HIDDEN | GD_ENTRIES_NOALIAS); for (j = 0; mflist[j] != NULL; ++j) { char code[GD_MAX_LINE_LENGTH]; snprintf(code, GD_MAX_LINE_LENGTH, "%s/%s", flist[i], mflist[j]); if (gd_validate(dirfile, code)) { printf(" getdata error checking %s: %s\n", code, gd_error_string(dirfile, getdata_error, 2048)); ne++; } nfields++; } /* ferret out dangling meta ALIASes by first collecting a list * of all of them, and then trying to use them as field codes */ mflist = gd_entry_list(dirfile, flist[i], GD_ALIAS_ENTRIES, GD_ENTRIES_HIDDEN); for (j = 0; mflist[j] != NULL; ++j) { char code[GD_MAX_LINE_LENGTH]; snprintf(code, GD_MAX_LINE_LENGTH, "%s/%s", flist[i], mflist[j]); if (gd_entry_type(dirfile, code) == GD_NO_ENTRY) { if (gd_error(dirfile) == GD_E_BAD_CODE) { printf(" dangling alias %s pointing to non-existent %s\n", code, gd_alias_target(dirfile, code)); } else { printf(" getdata error checking alias %s: %s\n", code, gd_error_string(dirfile, getdata_error, 2048)); } ne++; } nfields++; } } /* ferret out dangling ALIASes by first collecting a list * of all of them, and then trying to use them as field codes */ flist = gd_entry_list(dirfile, NULL, GD_ALIAS_ENTRIES, GD_ENTRIES_HIDDEN); for (i = 0; flist[i] != NULL; ++i) { if (gd_entry_type(dirfile, flist[i]) == GD_NO_ENTRY) { if (gd_error(dirfile) == GD_E_BAD_CODE) { printf(" dangling alias %s pointing to non-existent %s\n", flist[i], gd_alias_target(dirfile, flist[i])); } else { printf(" getdata error checking alias %s: %s\n", flist[i], gd_error_string(dirfile, getdata_error, 2048)); } ne++; } nfields++; } if (ne > 0) printf(" Found %i problems in %u %s.\n", ne, nfields, nfields > 1 ? "entries" : "entry"); else printf(" No problems found in %u %s.\n", nfields, nfields > 1 ? "entries" : "entry"); /* try to retrieve the number of frames in the dirfile */ puts("\nChecking frames..."); n = gd_nframes(dirfile); if (gd_error(dirfile)) { printf(" getdata error: %s\n", gd_error_string(dirfile, getdata_error, 2048)); gd_close(dirfile); return 1; } printf(" Found %llu %s.\n", (unsigned long long)n, n == 1 ? "frame" : "frames"); gd_close(dirfile); return 0; } libgetdata-0.9.0/util/Makefile.in0000640000175000017500000005674312614323564017045 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = checkdirfile$(EXEEXT) dirfile2ascii$(EXEEXT) subdir = util DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_checkdirfile_OBJECTS = checkdirfile.$(OBJEXT) checkdirfile_OBJECTS = $(am_checkdirfile_OBJECTS) checkdirfile_LDADD = $(LDADD) checkdirfile_DEPENDENCIES = ../src/libgetdata.la 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_dirfile2ascii_OBJECTS = dirfile2ascii.$(OBJEXT) dirfile2ascii_OBJECTS = $(am_dirfile2ascii_OBJECTS) dirfile2ascii_LDADD = $(LDADD) dirfile2ascii_DEPENDENCIES = ../src/libgetdata.la 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)/src 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 = $(checkdirfile_SOURCES) $(dirfile2ascii_SOURCES) DIST_SOURCES = $(checkdirfile_SOURCES) $(dirfile2ascii_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2010, 2013, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign LDADD = ../src/libgetdata.la AM_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src checkdirfile_SOURCES = checkdirfile.c dirfile2ascii_SOURCES = dirfile2ascii.c 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 util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign util/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 checkdirfile$(EXEEXT): $(checkdirfile_OBJECTS) $(checkdirfile_DEPENDENCIES) $(EXTRA_checkdirfile_DEPENDENCIES) @rm -f checkdirfile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(checkdirfile_OBJECTS) $(checkdirfile_LDADD) $(LIBS) dirfile2ascii$(EXEEXT): $(dirfile2ascii_OBJECTS) $(dirfile2ascii_DEPENDENCIES) $(EXTRA_dirfile2ascii_DEPENDENCIES) @rm -f dirfile2ascii$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dirfile2ascii_OBJECTS) $(dirfile2ascii_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/checkdirfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfile2ascii.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 -o $@ $< .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 -o $@ `$(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: $(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" 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 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 clean-local \ 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 TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic clean-libtool clean-local \ cscopelist-am ctags ctags-am 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 tags-am uninstall uninstall-am \ uninstall-binPROGRAMS clean-local: rm -rf *~ # 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: libgetdata-0.9.0/util/Makefile.am0000640000175000017500000000217012614323564017015 0ustar alastairalastair# Copyright (C) 2008-2010, 2013, 2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign LDADD=../src/libgetdata.la AM_CPPFLAGS=${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src bin_PROGRAMS=checkdirfile dirfile2ascii checkdirfile_SOURCES=checkdirfile.c dirfile2ascii_SOURCES=dirfile2ascii.c clean-local: rm -rf *~ libgetdata-0.9.0/util/dirfile2ascii.c0000640000175000017500000004166412614323564017651 0ustar alastairalastair/* Copyright (C) 2010, 2011 Matthew Truch * Copyright (C) 2010, 2012, 2014 D. V. Wiebe * *************************************************************************** * * This program 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 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 Lesser General Public * License for more details. * * You should have received a copy of the GNU Lesser 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 */ #include "internal.h" #include #ifndef HAVE_OFF64_T #define off64_t off_t #endif #define BUF_LEN GD_MAX_LINE_LENGTH #define F_LEN 16 #define VALID_PRECISION_CHARS "#- +`I.0123456789" struct field { char *name; int type; unsigned int spf; union { double *dbl; int64_t *i64; uint64_t *u64; } u; char format[F_LEN]; size_t n_read; }; void version(void) { printf("dirfile2ascii (%s)\n" "Copyright (C) 2010, 2011, 2012, 2014 Matthew Truch and others\n\n" "Please send reports of bugs and other communication to:\n %s\n\n" "This program comes with NO WARRANTY, not even for MERCHANTABILITY " "or FITNESS\n" "FOR A PARTICULAR PURPOSE. You may redistribute it under the terms of " "the GNU\n" "Lesser General Public License, either version 2.1 of the License, or " "(at your\n" "option) any later version.\n\n" "You should have received a copy of the GNU Lesser General Public " "License along\n" "with this program; if not, write to the Free Software Foundation," "Inc.,\n" "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n", PACKAGE_STRING, PACKAGE_BUGREPORT); exit(-1); } void usage(char *exe) { printf("Usage: %s [OPTION]... DIRFILE\n" " [[-a|-A|-e|-E|-F|-g|-G|-o|-i|-u|-x|-X] FIELD]...\n" "Dump specified fields from the dirfile DIRFILE as ASCII on stdout.\n\n" "Mandatory arguments to long options are mandatory for short options " "too.\n" #if 0 " -b, --boxcar boxcar average over skipped samples before output. " "Ignored\n" " if --skip is not specified.\n" #endif " -d, --delimiter=D separate columns by D (default: a single " "space)\n" " -f, --first-frame=F-M read from frame F to frame M (inclusive).\n" " -f, --first-frame=F:N equivalent to --first-frame=F --num-frames=N\n" " -f, --first-frame=F if F >= 0, start reading at frame F. If F is " "-1 and\n" " --num-frames=N is specified, read the last N " "frames.\n" " If not specified, F = 0 is assumed.\n" " -n, --num-frames=N read at most N frames. If not specified, or " "if N = 0,\n" " all frames to the end of the dirfile are " "read.\n" " -p, --precision=FMT use FMT to format output. FMT may contain any " "of the\n" " flag characters, a field width, and/or a " "precision as\n" " specified in printf(3). It may NOT contain " "a length\n" " modifier.\n" " -q, --quiet don't write verbose message to standard error " "(the\n" " default).\n" " -s, --skip=S if S > 0, output only one sample for every S " "frames.\n" " -v, --verbose write verbosely to standard error.\n" " -z, --fill=STRING print STRING to fill up columns which run past " "the end\n" " of their corresponding field. The default " "is to\n" " fill floating point columns with \"NaN\" and " "integer\n" " columns with \"0\" (without quotation marks)." "\n\n" "Any number of fields may be specified. Each specified field is printed " "in a\n" "separate column. A field name may be preceded by a short option, one " "of -a, -A,\n" "-e, -E, -F, -g, -G, -o, -i, -u, -x, -X, indicating the conversion to be " "used.\n" "See printf(3) for the meaning of these conversion specifiers. The " "output flags,\n" "width, and precision may be specified by --precision. If no " "conversion\n" "specifier is given, %%f is used.\n\n" "For conversion specifiers %%a, %%A, %%e, %%E, %%f, %%F, %%g, %%G, data " "is read from the\n" "dirfile as double precision floats. For conversion specifier %%i, the " "data is\n" "read as 64-bit signed integers. For conversion specifiers %%o, " "%%u, %%x, %%X, the\n" "data is read as 64-bit unsigned integers.\n", exe); exit(-1); } int main (int argc, char **argv) { char char_buffer[BUF_LEN]; char *tmp; char *delimiter = " "; char *precision = ""; char *zero = NULL; char *dirfile_name = NULL; DIRFILE *dirfile; size_t nf = 0; off64_t ff = 0; size_t n_want; unsigned int j; unsigned int max_spf = 0; unsigned int min_spf = INT_MAX; int c, i; int numfields = 0; struct field fields[BUF_LEN]; int verbose = 0; int interpolate = 0; size_t skip = 0; int skipping = 0; size_t k, z; #if 0 int average = 0; #endif int optind = 0; const double NaN = NAN; const struct option longopts[] = { #if 0 { "boxcar", 0, NULL, 'b' }, #endif { "delimieter", 1, NULL, 'd' }, { "fill", 1, NULL, 'z' }, { "first-frame", 1, NULL, 'f' }, { "help", 0, NULL, '?' }, { "num-frames", 1, NULL, 'n' }, { "precision", 1, NULL, 'p' }, { "quiet", 0, NULL, 'q' }, { "skip", 1, NULL, 's' }, { "verbose", 0, NULL, 'v' }, { "version", 0, NULL, 2 }, { 0, 0, 0, 0 } }; /* handy things to know about conversion specifiers */ #define READ_AS_DOUBLE 0x000 #define READ_AS_INT 0x100 #define READ_AS_UINT 0x200 struct { int t; const char* f; } type_data[0x7f]; type_data[(int)'a'].t = READ_AS_DOUBLE; type_data[(int)'a'].f = "a"; type_data[(int)'A'].t = READ_AS_DOUBLE; type_data[(int)'A'].f = "A"; type_data[(int)'e'].t = READ_AS_DOUBLE; type_data[(int)'e'].f = "e"; type_data[(int)'E'].t = READ_AS_DOUBLE; type_data[(int)'E'].f = "E"; type_data[(int)'f'].t = READ_AS_DOUBLE; type_data[(int)'f'].f = "f"; type_data[(int)'F'].t = READ_AS_DOUBLE; type_data[(int)'F'].f = "F"; type_data[(int)'g'].t = READ_AS_DOUBLE; type_data[(int)'g'].f = "g"; type_data[(int)'G'].t = READ_AS_DOUBLE; type_data[(int)'G'].f = "G"; type_data[(int)'i'].t = READ_AS_INT; type_data[(int)'i'].f = PRIi64; type_data[(int)'o'].t = READ_AS_UINT; type_data[(int)'o'].f = PRIo64; type_data[(int)'u'].t = READ_AS_UINT; type_data[(int)'u'].f = PRIu64; type_data[(int)'x'].t = READ_AS_UINT; type_data[(int)'x'].f = PRIx64; type_data[(int)'X'].t = READ_AS_UINT; type_data[(int)'X'].f = PRIX64; while ((c = getopt_long(argc, argv, "-f:n:d:x:X:g:G:e:E:a:A:F:i:o:p:s:u:z:bvqh?", longopts, &optind)) != -1) { switch (c) { case 1: /* The case of no option */ if (dirfile_name == NULL) { dirfile_name = optarg; } else { /* Standard output field */ if (numfields >= BUF_LEN) { fprintf(stderr, "Error: Too many fields!\n"); exit(-2); } fields[numfields].type = 'f'; fields[numfields].name = optarg; numfields++; } break; case 2: version(); break; case 'x': /* output field types */ case 'X': case 'i': case 'o': case 'g': case 'G': case 'e': case 'E': case 'u': case 'F': case 'A': case 'a': if (numfields >= BUF_LEN) { fprintf(stderr, "Error: Too many fields!\n"); exit(-2); } fields[numfields].type = c; fields[numfields].name = optarg; numfields++; break; case 'f': /* firstframe */ ff = (off64_t)strtoll(optarg, &tmp, 0); if (tmp[0] == ':' && tmp[1] != '\0') nf = (size_t)strtoll(&(tmp[1]), NULL, 0); else if (tmp[0] == '-' && tmp[1] != '\0') nf = (size_t)(strtoll(&(tmp[1]), NULL, 0) - ff); break; case 'n': /* numframes */ nf = (size_t)strtoll(optarg, NULL, 0); break; case 'p': if (strlen(optarg) < (F_LEN - 6)) precision = optarg; else fprintf(stderr, "Ignoring exceedingly long -p argument (%s).\n", optarg); break; case 'v': verbose = 1; break; case 'q': verbose = 0; break; case 'd': delimiter = optarg; break; case 's': skip = strtoll(optarg, NULL, 0); break; case 'z': zero = optarg; break; case 'b': #if 0 average = 1; #endif fprintf(stderr, "Warning: Ignoring -b found on command line.\n"); break; case 'h': case '?': default: usage(argv[0]); break; } } if (dirfile_name == NULL) { fprintf(stderr, "Error: No dirfile specified.\n"); exit(-4); } if (numfields < 1) { fprintf(stderr, "Error: At least one field must be specified.\n"); exit(-3); } if ((ff == -1) && (nf == 0)) { fprintf(stderr, "Warning: Ignoring negative first frame with no frame " "count given.\n"); ff = 0; } for (z = 0; z < strlen(precision); z++) { if (strchr(VALID_PRECISION_CHARS, precision[z]) == NULL) { fprintf(stderr, "Error: Invalid character (%c) found in precision string (%s).\n", precision[z], precision); exit(-5); } } if (skip) skipping = 1; if (skip < 1) skip = 1; dirfile = gd_open(dirfile_name, GD_RDONLY); if (gd_error(dirfile)) { fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile, char_buffer, BUF_LEN)); gd_close(dirfile); exit(1); } if (nf == 0) { nf = gd_nframes(dirfile) - ff; if (gd_error(dirfile)) { fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile, char_buffer, BUF_LEN)); gd_close(dirfile); exit(3); } } if (ff == -1) { ff = gd_nframes(dirfile) - nf; if (gd_error(dirfile)) { fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile, char_buffer, BUF_LEN)); gd_close(dirfile); exit(3); } } /* Get spfs and sanity checks for all fields */ for (i = 0; i < numfields; i++) { fields[i].spf = gd_spf(dirfile, fields[i].name); if (gd_error(dirfile)) { fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile, char_buffer, BUF_LEN)); gd_close(dirfile); exit(3); } if (max_spf && fields[i].spf != max_spf) interpolate = 1; if (fields[i].spf > max_spf) max_spf = fields[i].spf; if (fields[i].spf < min_spf) min_spf = fields[i].spf; } if (interpolate && nf == 1 && min_spf == 1) { fprintf(stderr, "Error: Interpolation required, " "but at least one field has only 1 sample.\n"); exit(-6); } if (verbose) { fprintf(stderr, "Reading %d field%s from %s\n", numfields, (numfields > 1) ? "s" : "", dirfile_name); fprintf(stderr, "First frame: %llu Number of frames: %zd\n", (long long)ff, nf); } for (i = 0; i < numfields; i++) { /* Read in all the fields */ n_want = nf * fields[i].spf; if (type_data[fields[i].type].t == READ_AS_DOUBLE) { fields[i].u.dbl = (double *)malloc(sizeof(double) * n_want); if (fields[i].u.dbl == NULL) { perror("malloc"); gd_close(dirfile); exit(4); } fields[i].n_read = gd_getdata(dirfile, fields[i].name, ff, 0, nf, 0, GD_FLOAT64, fields[i].u.dbl); } else if (type_data[fields[i].type].t == READ_AS_INT) { fields[i].u.i64 = (int64_t *)malloc(sizeof(int64_t) * n_want); if (fields[i].u.i64 == NULL) { perror("malloc"); gd_close(dirfile); exit(4); } fields[i].n_read = gd_getdata(dirfile, fields[i].name, ff, 0, nf, 0, GD_INT64, fields[i].u.i64); } else { fields[i].u.u64 = (uint64_t *)malloc(sizeof(uint64_t) * n_want); if (fields[i].u.u64 == NULL) { perror("malloc"); gd_close(dirfile); exit(4); } fields[i].n_read = gd_getdata(dirfile, fields[i].name, ff, 0, nf, 0, GD_UINT64, fields[i].u.u64); } if (gd_error(dirfile)) { fprintf(stderr, "GetData error: %s\n", gd_error_string(dirfile, char_buffer, BUF_LEN)); gd_close(dirfile); exit(5); } else if (!zero && n_want > fields[i].n_read) { if (verbose) fprintf(stderr, "Short read on field %i, padding %zu frames\n", i, n_want - fields[i].n_read); if (type_data[fields[i].type].t == READ_AS_DOUBLE) { for (k = fields[i].n_read; k < n_want; ++k) fields[i].u.dbl[k] = NaN; } else if (type_data[fields[i].type].t == READ_AS_INT) { memset(fields[i].u.i64 + fields[i].n_read, 0, (n_want - fields[i].n_read) * sizeof(int64_t)); } else { memset(fields[i].u.u64 + fields[i].n_read, 0, (n_want - fields[i].n_read) * sizeof(uint64_t)); } } } /* Generate format string with precision */ for (i = 0; i < numfields; i++) snprintf(fields[i].format, F_LEN, "%%%s%s", precision, type_data[fields[i].type].f); for (k = 0; k < nf; k += skip) { for (j = 0; j < (skipping ? 1 : max_spf); j++) { for (i = 0; i < numfields; i++) { if (fields[i].spf == max_spf || skipping) { if (zero && k * fields[i].spf + j >= fields[i].n_read) printf("%s", zero); else if (type_data[fields[i].type].t == READ_AS_DOUBLE) printf(fields[i].format, fields[i].u.dbl[k * fields[i].spf + j]); else if (type_data[fields[i].type].t == READ_AS_INT) printf(fields[i].format, fields[i].u.i64[k * fields[i].spf + j]); else printf(fields[i].format, fields[i].u.u64[k * fields[i].spf + j]); } else { /* need to interpolate: */ /* formula is y = y0 + (x-x0) * (y1-y0)/(x1-x0) */ /* val= y0 + diff * slope */ /* Note that if max_spfs isn't a multiple of all spfs then some of */ /* the data will only be approximated (except at frame boundaries). */ unsigned int prev_samp, next_samp, offset; double slope, diff, val; prev_samp = (unsigned int)floor((double)j * (double)fields[i].spf / (double)max_spf); next_samp = prev_samp + 1; diff = ((double)prev_samp + (double)(j % (max_spf / fields[i].spf)) / (double)(max_spf / fields[i].spf)) - (double)prev_samp; if (k == (nf - 1) && next_samp == fields[i].spf) /* we're on ultimate sample, so use slope from previous set */ offset = 1; else offset = 0; if (zero && k * fields[i].spf + j >= fields[i].n_read) { printf("%s", zero); } else if (type_data[fields[i].type].t == READ_AS_DOUBLE) { slope = (fields[i].u.dbl[k * fields[i].spf + next_samp - offset] - fields[i].u.dbl[k * fields[i].spf + prev_samp - offset]) / ((double)next_samp - (double)prev_samp); val = fields[i].u.dbl[k * fields[i].spf + prev_samp] + diff * slope; printf(fields[i].format, val); } else if (type_data[fields[i].type].t == READ_AS_INT) { slope = ((double)fields[i].u.i64[k * fields[i].spf + next_samp - offset] - (double)fields[i].u.i64[k * fields[i].spf + prev_samp - offset]) / ((double)next_samp - (double)prev_samp); val = (double)fields[i].u.i64[k * fields[i].spf + prev_samp] + diff * slope; printf(fields[i].format, (int64_t)val); } else { slope = ((double)fields[i].u.u64[k * fields[i].spf + next_samp - offset] - (double)fields[i].u.u64[k * fields[i].spf + prev_samp - offset]) / ((double)next_samp - (double)prev_samp); val = (double)fields[i].u.u64[k * fields[i].spf + prev_samp] + diff * slope; printf(fields[i].format, (uint64_t)val); } } if (i < (numfields - 1)) { printf("%s", delimiter); } else { printf("\n"); } } } } gd_close(dirfile); return 0; } libgetdata-0.9.0/ChangeLog0000640000175000017500000112215612614323564015566 0ustar alastairalastair2015-10-05 D. V. Wiebe svn:1009 GetData-0.9.0rc3: * bindings/cxx/dirfile.cpp (GetData::EncodingSupport): Use GetData::EncodingScheme for the encoding parameter. * bindings/cxx/dirfile.cpp (Dirfile::Delete): Use unsigned for the flags parameter. * bindings/cxx/getdata/fragment.h: Add FlacEncoding. * bindings/idl/getdata.c (gdidl_delete): Add missing /META flag. * bindings/php/getdata.c (gdphp_callback): Don't accept floating point response from callback. * bindings/matlab/Contents.m.head bindings/matlab/gd_move.c bindings/perl/GetData.pm.in doc/README.cxx doc/README.f77 doc/README.f95 doc/README.idl doc/README.php doc/README.python: Update bindings docs. * test/put_nofile.c: Fix !defined HAVE_SETRLIMIT case. * test/test.h (gd_pathwrite): Also escape hash and space and use in all cases. * test/get_linterp_abs.c: Use gd_pathwrite. Don't double buffer format_data. 2015-10-05 D. V. Wiebe svn:1008 * configure.ac: Fix handling of --with-ltdl. * src/encoding.c src/internal.h: Move inclusion of out of header. * src/compat.c (gd_StatAt64): Don't define if GD_NO_64BIT_STAT is defined. * test/gzip_put_nframes.c test/gzip_put_off.c test/gzip_seek.c test/gzip_seek_far.c test/gzip_seek_put.c: Fix for !defined(USE_GZIP). * bindings/f77/getdata.f.in: Delete GDDELA and GDDSTP. * configure.ac: remove check for -fno-backslash * m4/compiler.m4 (GD_PROG_F77_FNO_BACKSLASH): Deleted. * bidnings/f77/test/big_test.f: Define backslash parameter. 2015-09-30 D. V. Wiebe svn:1007 GetData-0.9.0rc2. 2015-09-27 D. V. Wiebe svn:1006 * test/gzip_seek_far.c: Allow both 256 and 4000 which can be returned by different builds of zlib. * src/getdata.c (_GD_ExtractRepr): Remove unused 4th parameter from EXTRACT_REPR. 2015-09-26 D. V. Wiebe svn:1005 * bindings/cxx/bitentry.cpp (BitEntry::Scalar BitEntry::ScalarIndex) bindings/cxx/sbitentry.cpp (SBitEntry::Scalar SBitEntry::ScalarIndex): Moved to header. * bindings/cxx/getdata/bitentry.h (Input Scalar ScalarIndex) bindings/cxx/getdata/divideentry.h (Input) bindings/cxx/getdata/entry.h (Input Scalar ScalarIndex Scale CScale Offset COffset Coefficient CCoefficient SetInput SetScale SetOffset SetCoefficient) bindings/cxx/getdata/lincomentry.h (Input Scalar ScalarIndex Scale CScale Offset COffset SetInput SetScale SetOffset) bindings/cxx/getdata/linterpentry.h (Input) bindings/cxx/getdata/mplexentry.h (Input Scalar ScalarIndex) bindings/cxx/getdata/multiplyentry.h (Input) bindings/cxx/getdata/phaseentry.h (Input Scalar ScalarIndex) bindings/cxx/getdata/polynomentry.h (Input Scalar ScalarIndex Coefficient CCoefficient SetCoefficient) bindings/cxx/getdata/rawentry.h (Scalar ScalarIndex) bindings/cxx/getdata/recipentry.h (Index Scalar ScalarIndex) bindings/cxx/getdata/sbitentry.h (Index Scalar ScalarIndex) bindings/cxx/getdata/windowentry.h (Index Scalar ScalarIndex): Remove default from index. * bindings/python/pydirfile.c (gdpy_dirfile_getfieldlist gdpy_dirfile_getmfieldlist gdpy_dirfile_getnmfields): Fix type cast. * configure.ac: Remove GD_C_CAST_COMPLEX * src/getdata.c (_GD_ExtractRepr): Avoid calling complex functions unnecessarily. * src/internal.h: Remove GD_RTOC. * configure.ac: Check for gzseek64 and gztell64 * src/gzip.c (_GD_GzipSeek): Abstractify gzseek and gztell. * src/internal.h: Redirect gd_StatAt64 if GD_NO_64BIT_STAT. 2015-09-25 D. V. Wiebe svn:1004 GetData-0.9.0rc1: * src/internal.h (gd_ef_strerr_t): Mark first argument const. * src/include.c (_GD_SetFieldAffixes): Remove unused ns and nsl arguments. * src/legacy.c (GetFormat): Remove DSV 10 stuff. * test/ascii_get_here.c: Fix e1 check. * test/flac_put_int32.c: Fix signedness. * bindings/matlab/gd_add_indir.m bindings/matlab/gd_add_sindir.m bindings/matlab/gd_alter_indir.m bindings/matlab/gd_alter_sindir.m bindings/matlab/gd_madd_indir.m bindings/matlab/gd_madd_sindir.m bindings/matlab/gd_msarrays.c: Deleted. * src/nan.h: Deleted. * src/internal.h: Merged in nan.h content. * test/gzip_put_off.c test/gzip_seek_put.c: Halve the amount of data used. Merge in build system fixes from GetData-0.8 branch, revision 969: * Makefile.am: Don't run matlabdistcheck and idldistcheck against an installed GetData. * bindings/idl/Makefile.am bindings/python/Makefile.am: Fix VPATH builds again. 2015-09-25 D. V. Wiebe svn:1003 * src/flac.c (_GD_FlacWrite): Fix data marshalling for little-ended data. * test/flac_put_complex128.c: Added. 2015-09-24 D. V. Wiebe svn:1001 * src/flac.c: Added. * configure.ac src/Makefile.am src/encoding.c (_GD_EncodingUnderstood) src/flush.c (_GD_FlushFragment): Deal with FLAC. * bindings/make_parameters.c src/getdata.h.in: Add GD_FLAC_ENCODED. * man/dirfile-encoding.5: Updated. * src/internal.h: data_type added to gd_ef_open_t. * src/bzip2.c (_GD_Bzip2DoOpen): Clean up after errors. * src/internal.h: Abstractify strerror stuff. * src/compat.c (gd_sterror): Added. * src/errors.c (gd_error_string): Call gd_sterrror. * src/fpos.c (_GD_DoSeek): Renamed from _GD_WriteSeek. Handle short writes. * src/slim.c: Handle ZZSLIM. * src/slim.c (Seek) src/zzip.c (_GD_ZzipSeek): Deal with seeks past the EOF. Properly update and report file->pos. * src/slim.c (DoOpen): Record full path name along with SLIMFILE in file->edata. Renamed from _GD_SlimOpen. * src/slim.c (Open): Added. * src/zzip.c (_GD_ZzipName): Put both .zip name and field name in file->name. * src/zzip.c (_GD_ZzipDoOpen): Renamed from _GD_ZzipOpen. Open containing archive (ZZIP_DIR) separately from the data file (ZZIP_FILE). * src/zzip.c (_GD_ZzipOpen): Added. * src/zzip.c (_GD_ZzipDoOpen): Call _GD_DoOpen. * src/zzslim.c (_GD_ZzslimOpen _GD_ZzslimSeek _GD_ZzslimRead _GD_ZzslimClose _GD_ZzslimSize): Removed. Instead, define ZZSLIM and include slim.c. * src/internal.h: Added error to gd_raw_file_. Added strerr to encoding_t. Added GD_EF_STRERR. * src/bzip2.c src/gzip.c src/lzma.c src/zzip.c: Record errors in file->error. * src/errors.c (_GD_SetEncIOError) src/bzip2.c (_GD_Bzip2Strerr) src/gzip.c (_GD_GzipStrerr) src/lzma.c (_GD_LzmaStrerr) src/slim.c (Strerr) src/zzip.c (_GD_ZzipStrerr): Added. * src/del.c (_GD_Delete) src/encoding.c (_GD_FiniRawIO _GD_InitRawIO) src/flimits.c (_GD_GetEOF) src/fpos.c (_GD_DoSeek gd_tell) src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c (_GD_MogrifyFile) src/name.c (_GD_Rename) src/nframes.c (gd_nframes64) src/putdata.c (_GD_DoRawOut): Set error via _GD_SetEncIOError. * src/encoding.c (_GD_MissingFramework): Deal with GD_EF_STRERR * src/fpos.c (_GD_Seek): _GD_DoSeek has already set the error. * src/errors.c: Added GD_E_IO_ENC_*. * src/errors.c (_GD_SetEncIOError): Added. * src/getdata.h.in: Fix GD_DIRFILE_STANDARDS_VERSION. * test/name_dot10.c: Deleted. * test/ascii_get_here.c test/ascii_put_here.c test/ascii_seek.c test/ascii_seek_far.c test/bzip_seek.c test/bzip_seek_far.c test/flac_add.c test/flac_get_big.c test/flac_get_far.c test/flac_get_get.c test/flac_get_get2.c test/flac_get_little.c test/flac_nframes.c test/flac_put_big.c test/flac_put_float64.c test/flac_put_int32.c test/flac_put_little.c test/flac_seek.c test/flac_seek_far.c test/flac_sync.c test/gzip_seek.c test/gzip_seek_far.c test/lzma_xz_seek.c test/lzma_xz_seek_far.c test/seek_far.c test/sie_seek.c test/sie_seek_far.c test/slim_seek.c test/slim_seek_far.c test/zzip_seek.c test/zzip_seek_far.c test/zzslim_seek.c test/zzslim_seek_far.c: Added. 2015-09-22 D. V. Wiebe svn:1000 * bindings/python/pydirfile.c bindings/python/pygetdata.c configure.ac: Make NumPy support mandatory. * src/common.c (_GD_GetRepr): Remove DSV 10 features. 2015-09-22 D. V. Wiebe svn:999 * src/fragment.c (_GD_SubFragmentList): Removed (part of DSV 10). * bindings/f77/test/gdcopn.f: remove GD_VB 2015-09-22 D. V. Wiebe svn:998 * bindings/idl/getdata.c bindings/python/pydirfile.c bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/perl/GetData.xs: Use gd_off64_t in place of off64_t or off_t. * bindings/perl/GetData.xs bindings/perl/simple_funcs.pl (gdp64): Deleted; use the 64-bit API always. * bindings/python/pydirfile.c (gdpy_dirfile_getdata gdpy_dirfile_getnframes gdpy_dirfile_getbof gdpy_dirfile_getbof gdpy_dirfile_geteof gdpy_dirfile_putdata gdpy_dirfile_getframenum gdpy_dirfile_seek gdpy_dirfile_tell) bindings/python/pyfragment.c (gdpy_fragment_getoffset gdpy_fragment_setoffset): Call the 64-bit API. * configure.ac: Remove AC_SYS_LARGEFILE * src/internal.h: Define _LARGEFILE64_SOURCE. * test/header_off64t: Added. * m4/php.m4: Handle NONE for php-binary. * src/getdata.h.in: Do 64-bit API redirection if _FILE_OFFSET_BITS == 64. * src/zzslim.c (_GD_ZzslimSeek) src/zzip.c (_GD_ZzipSeek) src/slim.c (_GD_SlimSeek): Cast count to the correct type. * src/gzip.c (_GD_GzipSeek): Use the 64-bit zlib API. 2015-09-21 D. V. Wiebe svn:997 * src/add.c (_GD_InvalidEntype _GD_Add) src/close.c (_GD_FreeD) src/constant.c (gd_array_len) src/del.c (_GD_ClearDerived _GD_DeReference) src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate) src/field_list.c (_GD_EntryIndex) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion) src/fpos.c (_GD_GetFilePos _GD_Seek) src/getdata.c (_GD_DoField gd_getdata64) src/getdata.h.in src/internal.h src/mod.c (_GD_Change) src/name.c (_GD_UpdateInputs) src/native.c (_GD_NativeType) src/parse.c (_GD_ParseArray _GD_ParseFieldSpec _GD_ParseDirective) src/putdata.c (_GD_DoFieldOut) src/spf.c (_GD_GetSPF) src/include.c (_GD_SetFieldAffixes): Remove DSV 10 features. * src/add.c (gd_add_indir gd_add_sindir gd_add_sarray gd_madd_indir gd_madd_sindir gd_madd_sarray) src/field_list.c (gd_sarrays gd_msarrays) src/getdata.c (_GD_IndirData _GD_DoIndir _GD_DoSindir) src/mod.c (gd_alter_indir gd_alter_sindir gd_alter_sarray) src/parse.c (_GD_ParseNamespace) src/string.c (gd_get_sarray gd_put_sarray_slice gd_put_sarray) src/fragment.c (_GD_CheckChangeNamespace gd_fragment_namespace): Removed. * src/string.c (gd_get_sarray_slice): Made static. * test/add_dot10.c test/add_indir.c test/add_sarray.c test/add_sarray_nil.c test/add_sindir.c test/alter_entry_sarray.c test/alter_indir.c test/alter_sarray.c test/alter_sindir.c test/get_indir.c test/get_sarray.c test/get_sarray_len.c test/get_sarray_slice.c test/get_sindir.c test/get_sindir_none.c test/get_sindir_null.c test/get_sindir_type.c test/get_type_string.c test/madd_indir.c test/madd_sarray.c test/madd_sindir.c test/name_updb_sarray.c test/parse_include_ns2.c test/parse_include_nsabs.c test/parse_include_nsinh.c test/parse_include_nspop.c test/parse_include_nsrabs.c test/parse_include_nsrainh.c test/parse_include_nsrinh.c test/parse_include_nsroot.c test/parse_indir.c test/parse_ns.c test/parse_ns_abs.c test/parse_ns_dot.c test/parse_ns_dotdot.c test/parse_ns_dotdotns.c test/parse_ns_dotns.c test/parse_ns_ndotdots.c test/parse_ns_ndots.c test/parse_ns_nsdot.c test/parse_ns_nsdotdot.c test/parse_ns_par.c test/parse_ns_sub.c test/parse_nsf.c test/parse_nsf_abs.c test/parse_nsf_alias.c test/parse_nsf_dot.c test/parse_nsf_hide.c test/parse_nsf_index.c test/parse_nsf_meta.c test/parse_nsf_meta2.c test/parse_nsf_par.c test/parse_nsf_ref.c test/parse_nsf_refabs.c test/parse_nsf_refrel.c test/parse_nsf_root.c test/parse_nsf_rpar.c test/parse_nsf_sub.c test/parse_sarray.c test/parse_sarray_long.c test/parse_sindir.c put_indir.c test/put_sarray.c test/put_sarray_slice.c test/put_sindir.c test/svlist_array.c test/svlist_array_meta.c test/add_ns.c test/add_ns_frag.c test/add_ns_frag2.c test/include_ns.c test/name_ns.c test/name_ns2.c test/name_nsdot.c test/parse_include_ns.c: Deleted. * test/name_updb.c test/name_updb_carray.c test/native_string.c: Remove DSV 10 tests. * bindings/make_parameters.c bindings/cxx/dirfile.cpp (Dirfile::Entry Dirfile::GetData) bindings/cxx/entry.cpp (Entry::CheckIndex scalar_ok) bindings/cxx/getdata/entry.h bindings/f77/fgetdata.c (GDGSCA GDASCA) bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry) bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_convert_entry_num gdidl_read_idl_entry gdidl_getdata) bindings/matlab/gd_getdata.c bindings/matlab/matlab.c (gdmx_from_entry gdmx_to_entry) bindings/perl/GetData.xs (gdp_to_entry entry getdata) bindings/perl/simple_funcs.xsin bindings/php/getdata.c (gdphp_from_entry gdphp_to_entry gd_getdata) bindings/python/pydirfile.c (gdpy_dirfile_getdata) bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_entry_getinfields gdpy_entry_setinfields gdpy_entry_getarraylen gdpy_entry_setarraylen gdpy_entry_getparms) bindings/python/pygetdata.c (gdpy_convert_to_pylist gdpy_convert_to_pyobj): Remove DSV 10 features. * bindings/cxx/dirfile.cpp (Dirfile::GetSarray Dirfile::Sarrays Dirfile::MSarrays Dirfile::PutSarray) bindings/f77/fgetdata.c (GDGEID GDGESD GDGESA GDADID GDADSD GDMDID GDMDSD GDADSA GDMDSA GDALID GDALSD GDSARX GDMSAX GDGTSA GDPTSA GDALSA GDGSTD GDGSTP GDXSTP) bindings/f77/getdata.f90.in (fgd_sarray_value_max fgd_msarray_value_max fgd_get_sarray fgd_get_sarray_slice fgd_put_sarray fgd_put_sarray_slice fgd_add_sarray fgd_madd_sarray fgd_alter_sarray fgd_add_indir fgd_add_sindir fgd_madd_indir fgd_madd_sindir fgd_alter_indir fgd_alter_sindir fgd_getstrdata) bindings/idl/getdata.c (gdidl_add_sarray gdidl_get_sarray gdidl_get_sarray gdidl_alter_sarray gdidl_add_indir gdidl_alter_indir gdidl_add_sindir gdidl_alter_sindir) bindings/matlab/matlab.c (gdmx_from_sarrays) bindings/perl/GetData.xs (get_sarray get_sarray_slice sarrays put_sarray put_sarray_slice add_sarray madd_sarray msarrays) bindings/php/getdata.c (gdphp_convert_sarray gd_add_sarray gd_add_indir gd_add_sindir gd_alter_sarray gd_alter_indir gd_alter_sindir gd_sarrays gd_get_sarray gd_madd_sarray gd_madd_indir gd_madd_sindir gd_msarrays gd_put_sarray) bindings/python/pydirfile.c (gdpy_dirfile_getsarray gdpy_dirfile_sarrays gdpy_dirfile_msarrays gdpy_dirfile_putsarray): Removed. * bindings/cxx/getdata/indirentry.h bindings/cxx/getdata/sarrayentry.h bindings/cxx/getdata/sindirentry.h bindings/cxx/indirentry.cpp bindings/cxx/sarrayentry.cpp bindings/cxx/sindirentry.cpp bindings/matlab/gd_add_sarray.c bindings/matlab/gd_alter_sarray.m bindings/matlab/gd_get_sarray.c bindings/matlab/gd_get_sarray_slice.c bindings/matlab/gd_madd_sarray.c bindings/matlab/gd_put_sarray.m bindings/matlab/gd_put_sarray_slice.c bindings/matlab/gd_sarrays.c: Deleted. * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/matlab/test/big_test.m bindings/perl/t/big_test.t bindings/php/test/big_test.php bindings/python/test/big_test.py doc/list.tests: Deleted tests 272-298. Renumbered test 299 to 272. 2015-09-20 D. V. Wiebe svn:995 * src/encoding.c (_GD_FiniRawIO) src/fpos.c (_GD_WriteSeek): Place large buffers on the heap. 2015-09-20 D. V. Wiebe svn:993 Merge in bugfixes from GetData-0.8: * src/add.c (_GD_Add _GD_AddAlias) src/fragment.c (_GD_CheckAffixes): Don't dealias during the duplicate field name check. (r973) * test/add_dangle_dup.c: Added. (r973) * cmake/test/CMakeLists.txt: blacklist gzip tests. (r976) * src/getdata.h.in: Don't attempt to use __nonnull. (r976) * configure.ac: Fix cygwin check. (r976) * src/getdata.c (_GD_DoRaw): Rewind RAW file if necessary after zero-padding. (r977) * test/get_foffs2.c test/seek_foffs2.c: Added. (r977) * src/raw.c (_GD_RawSeek): Handle landing in the middle of a sample. (r977) * src/raw.c (_GD_RawSeek): Remember the actual position, not the requested position. (r977) * bindings/idl/test/Makefile.am bindings/matlab/test/Makefile.am bindings/perl/Makefile.am bindings/python/test/Makefile.am: Fix DL_LIBRARY_PATH ordering. (r977) * bindings/perl/GetData.pm.in: Fix perldoc markup. (r977) * bindings/f77/fgetdata.c (GDFLSH GDSYNC GDRCLO): Fix zero-length string checks. (r979) * bindings/python/pyfragment.c (gdpy_fragment_getprefix gdpy_fragment_getsuffix): Fix memory leaks. (r979) * src/add.c (_GD_Add) src/legacy.c (_GD_GetDirfile) src/mod.c (gd_alter_spec): Fix on-error memory leaks. (r979) * src/common.c (_GD_GetRepr): Only set field_code to field_code_in if necessary. (r979) * src/flush.c (_GD_StringEscapeise): Fix upper nibble of hex encoding. * test/flush_hex.c: Added. (r979) * src/getdata.c (_GD_DoBit): Fix sign mask. (r979) * src/sie.c (_GD_SampIndSize): Fix return value. (r980) * src/sie.c (_GD_SampIndWrite): Flush stdio buffer before truncating to avoid having a partially written file on disk. (r980) * test/sie_put_trunc_nf.c: Added. (r980) * bindings/python/pydirfile.c (gdpy_dirfile_getrawfilename) bindings/python/pyfragment.c (gdpy_fragment_getprefix gdpy_fragment_getsuffix): Free C strings after calling PyString_FromString. Patch from Matthew Petroff. (r985) * bindings/python/pydirfile.c (gdpy_dirfile_delete) bindings/python/pyentry.c (gdpy_entry_delete) bindings/python/pyfragment.c (gdpy_fragment_delete): Free the object. (r985) * src/raw.c (_GD_RawOpen): Don't set the mode if open fails. (r988) * test/put_nofile.c: Added. (r988) * src/fpos.c (_GD_WriteSeek): Don't overrun the buffer when doing OOP seeks. (r989, r990, r992) * test/gzip_put_off.c * test/gzip_seek_put.c: Added. (r989, r990) * src/nframes.c (gd_nframes64): Close the reference field if it's open for writing to ensure everything is on disk before we check its size. (r989) * test/gzip_put_nframes.c: Added. (r989) Also: * src/internal.h: Merge BUFFER_SIZE and GD_BUFFER_SIZE. 2015-05-15 D. V. Wiebe svn:974 * m4/compiler.m4 (GD_C_CAST_COMPLEX): Added. * configure.ac: Call GD_C_CAST_COMPLEX in C99 mode. * src/internal.h: Define GD_RTOC to handle GD_COMPLEX_CONV_OK. * src/getdata.c (EXTRACT_REPRS EXTRACT_REPR2 EXTRACT_REPRR2 EXTRACT_REPR): Use GD_RTOC when appropriate. 2015-05-15 D. V. Wiebe svn:972 * src/name.c (_GD_MungeCode): Fix buffer overrun. Don't write spurious slash. Patch from Seth Hillbrand. Merge in bugfixes from 0.8 branch: * src/include.c )_GD_Include): Only open the file read-write if it's being truncated or created. (r949) * test/open_rofs.c: Added. (r949) * bindings/f77/fgetdata.c (GDREFE): Convert a passed empty string to NULL. (r956) * bindings/f77/getdata.f90.in (fgd_reference): Handle empty string from GDREFE. (r956) * bindings/python/pydirfile.c (gdpy_dirfile_getreference): Handle NULL from gd_reference. (r956) * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/matlab/test/big_test.m bindings/perl/t/big_test.t bindings/python/test/big_test.py: Add test 299. (r956, where it is test 243). * src/sie.c (_GD_SampIndSeek): Behave when seeking on an empty file. (r960) * src/sie.c (_GD_SampIndWrite): Update cur_end when reallocing p. (r960) * src/sie.c (_GD_SampIndWrite): Fix fence-post error in memcpy. (r960) * test/sie.put_many.c test/sie_put_newo.c test/sie_put_newo0.c: Added. (r961) * src/getdata.h.in: Delete all the __REDIRECTs. (r969) * test/get_uint32.c test/get_uint64.c: Fix signed integer overflow. Also: * bindings/php/getdata.c (gd_reference): Handle NULL from gd_reference. * bindings/php/test/big_test/php: Add test 299. * bindings/python/pydirfile.c (gdpy_dirfile_getstrings): Fix error call. 2014-04-29 D. V. Wiebe svn:955 * bindings/idl/getdata.c (gdidl_reference): Converted from procedure to function returning the string returned by gd_reference(), or the empty string if gd_reference returns NULL. 2014-04-24 D. V. Wiebe svn:954 Merge in bugfixes from 0.8 branch, rev.953: * bindings/python/pygetdata.c (gdpylist_append gdpy_to_pystringlist): Added. * bindings/python/pydirfile.c (gdpy_dirfile_getvectorlist gdpy_dirfile_getfieldlist gdpy_dirfile_getmfieldlist gdpy_dirfile_getmvectorlist gdpy_dirfile_aliaslist gdpy_dirfile_entrylist(: Call gdpy_to_pystringlist(); * bindings/python/pygetdata.c (gdpy_convert_to_pylist) bindings/python/pydirfile.c (gdpy_dirfile_carrays gdpy_dirfile_getconstants gdpy_dirfile_mcarrays gdpy_dirfile_getstrings): Call gdpylist_append(). * bindings/python/pydirfile.c (gdpy_dirfile_getstring): Fix clean-up on error. * test/add_raw_spf_scalar.c: Initialise E. * test/open_sym_a.c: Free string. 2015-04-15 D. V. Wiebe svn:952 * configure.ac: Call AC_TYPE_MODE_T and AC_TYPE_SSIZE_T. * src/internal.h [_MSC_VER]: Don't typedef mode_t. * cmake/CMakeLists.txt: Define mode_t. * src/bzip.c (_GD_Bzip2Read) src/flimits.c (_GD_GetBOF gd_bof64) src/parse.c (_GD_TokToNum): Use stdint types instead of "long long" directly. 2015-04-03 D. V. Wiebe svn:947 * configure.ac bindings/idl/package/configure.ac bindings/matlab/package/configure.ac: Use AC_USE_SYSTEM_EXTENSIONS and AC_SYS_LARGEFILE instead of definining feature macros explicitly. * m4/compiler.m4 (GD_CHECK_LFS_TYPE): Deleted. 2014-12-31 D. V. Wiebe svn:940 * src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Fix recursion counting on error. * src/getdata.h.in src/errors.c: Merge GD_E_BAD_REPR into GD_E_BAD_CODE. * src/common.c (_GD_FindEntry): Added. * src/entry.c (gd_raw_filename gd_entry, gd_entry_type gd_linterp_tablename) src/flush.c (_GD_SyncOrClose) src/spf.c (_GD_GetSPF) src/constant.c (gd_put_carray_slice gd_put_carray) src/putdata.c (gd_putdata64) src/flimits.c (gd_eof64 gd_bof64) src/fpos.c (gd_tell64 gd_seek64): Use _GD_FindEntry instead of _GD_FindFieldAndRepr. * src/constant.c (_GD_PutCarraySlice) src/putdata.c (_GD_DoFieldOut): Remove repr parameter. * src/putdata.c (_GD_DoLinterpOut _GD_DoLincomOut _GD_DoBitOut _GD_DoPhaseOut _GD_DoRecipOut _GD_DoPolynomOut _GD_DoMplexOut _GD_DoConstOut): Return error if input field has a repr. * src/parse.c: Use struct parser_state to pass around parser data rather than passing bits and pieces individually. * src/internal.h: Define struct parser_state. * src/parse.c (_GD_SimpleParserInit): Added. * src/open.c (_GD_Open): Initialise the parser proto-state; set or clear GD_PEDANTIC in the dirfile flags after parsing completes. * src/mod.c (gd_alter_spec gd_malter_spec) src/parse.c (gd_strtok) src/add.c (_GD_FixName gd_madd_spec gd_add_spec): Call _GD_SimpleParserInit(). * src/parse.c (_GD_ParseFieldSpec): Speed up strcmps. * src/common.c (_GD_GrabDir): Let callers (i.e. _GD_Include) skip canonicalisation, if they've already done it. * src/internal.h: Add ns and nsl to gd_fragment_t. * src/name.c (_GD_MungeCode): Remove subfield munging (the P parameter). Replace err_ok with flags parameter. Don't malloc the buffer it the caller doesn't want it. * src/name.c (_GD_ValidateField): Replaced affix parameter with flags. * src/parse.c (_GD_SubfieldCode _GD_CodeFromFrag _GD_InputCode _GD_SetField): Added. * src/name.c (_GD_MungeCode _GD_CheckCodeAffixes _GD_ValidateField) src/include.c (_GD_SetFieldAffixes _GD_Include): Handle namespaces. * src/parse.c (_GD_ParseNamespace): Added. * src/parse.c (_GD_ParseDirective): Handle "/NAMESPACE" * src/name,c (_GD_MakeNewCode): Handle errors better. * src/getdata.h.in: Declare GD_EN_DOTTED. * src/name.c (_GD_PerformRename) src/add.c (_GD_Add): Set or clear GD_EN_DOTTED. * src/fragment.c (_GD_SubFragmentList _GD_CheckChangeNamespace gd_fragment_namespace): Added. 2014-10-16 D. V. Wiebe svn:929 * src/open.c (_GD_CreateDirfile): Force GD_RDWR when creating a dirfile. * test/creat_rdonly.c: Updated. * test/creat_rdonly_exists.c: Added. 2014-10-16 D. V. Wiebe svn:928 * bindings/make_parameters.c: Replace numeric type literals with CPP macros for legibility. * man/gd_getdata.3: Explain I/O pointers more. * src/getdata.h.in: Merge GD_E_OPEN, GD_E_TRUNC, GD_E_RAW_IO, GD_E_OPEN_FRAGMENT, most of GD_E_FLUSH and half of GD_E_OPEN_LINFILE into the new GD_E_IO and deprecate. The remainder of GD_E_OPEN_LINFILE (syntax errors) is now the new GD_E_LUT. * src/common.c (_GD_ReadLinterpFile): Consolidate error handling code. Handle syntax errors better. * src/flush.c (_GD_FieldSpec): Raise GD_E_LINE_TOO_LONG for line overflows. * src/errors.c (_GD_SetError2 _GD_SetError gd_error_string): Track stdlib errno separately and implicitly. * bindings/python/pygetdata.c: Define deprecated Exceptions as aliases for current ones. 2014-07-30 D. V. Wiebe svn:921 * src/del.c (gd_delete_alias): Deleted. * src/del.c (gd_delete): Don't dereference the field code. * bindings/f77/fgetdata.c (GDDELA) bindings/f77/getdata.f90.in (fgd_delete_alias) bindings/cxx/dirfile.cpp (Dirfile::DeleteAlias) bindings/php/getdata.c (gd_delete_alias) bindings/python/pydirfile.c (gdpy_dirfile_deletealias): Deleted. * bindings/matlab/gd_delete_alias.c: Deleted. * bindings/perl/simple_funcs.xsin: Deleted delete_alias. * bindings/idl/getdata.c (gdidl_delete): Removed the /ALIAS keyword. * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/matlab/test/big_test.m bindings/perl/t/big_test.t bindings/php/test/big_test.php bindings/python/test/big_test.py: Deleted test 225. 2014-07-25 D. V. Wiebe svn:915 * Makefile.am: Auotmake version bumped to 1.13. * configure.ac: Autoconf version bumped to 2.65. 2014-07-25 D. V. Wiebe svn:914 * src/parse.c (_GD_TokToNum): Added. * src/parse.c (_GD_SetScalar): Call _GD_TokToNum to parse numbers. * src/errors.c: Add GD_E_CODE_AMBIGUOUS suberror. * src/flush.c (_GD_WriteFieldCode): Append "<0>" when necessary to avoid otherwise ambiguous scalar field codes. Replaced "space" with "flags" parameter. Add "index" parameter. * src/add.c (_GD_CopyScalars) src/mod.c (_GD_AlterScalar): Reject ambiguous field codes when the format file writer won't be able to deal with them. * src/internal.h: Alias GD_PERMISSIVE to GD_NOSTANDARD for legibility. * src/common.c (_GD_GetRepr): Add .z (we'll want that later). * src/parse.c (_GD_ConstType): Handle GD_STRING. * src/parse.c (_GD_ParseRaw): Don't set GD_E_FORMAT more than once. * src/parse.c (_GD_SetScalar): Check for the closing > with CARRAY indices. * test/add_amb_code7.c test/alter_entry_scalar_amb.c test/flush_amb_code.c test/parse_scalar1.c test/parse_scalar2.c test/parse_scalar_repr.c: Added. 2014-07-17 D. V. Wiebe svn:912 * bindings/f77/fgetdata.c (_GDF_SetDirfile): Don't abort on error, just return -1 (optionally discarding the dirfile first). * bindings/f77/fgetdata.c (_GDF_Callback GDCOPN): Handle running out of DUNs. 2014-07-17 D. V. Wiebe svn:911 * src/getdata.c (_GD_DoSindir): Renamed from gd_getstrdata64 and internalised. Do return_type checks, and handle num_samp = 0. * src/getdata.c (gd_getstrdata): Deleted. * src/getdata.h.in: Add GD_STRING. * src/native.c (_GD_NativeType): Return GD_STRING for string types. * bindings/make_parameters.c: Add GD_STRING. * bindings/cxx/dirfile.cpp (Dirfile::GetData) bindings/f77/fgetdata.c (GDGSTD GDGSTP) bindings/idl/getdata.c (gdidl_getdata) bindings/perl/GetData.xs (getdata) bindings/python/pydirfile.c (gdpy_dirfile_getdata): Convert gd_getstrdata call to gd_getdata. * bindings/matlab/gd_getdata.c: Handle SINDIR. * bindings/matlab/gd_getstrdata.c: Deleted. * bindings/php/getdata.c (gd_getdata): Handle SINDIR; made return_type optional. * bindings/php/getdata.c (gd_getstrdata): Deleted. * test/get_none.c: Added. * test/get_sindir.c: Replaced by renaming getstr_sindir.c. * test/get_sindir_none.c test/get_sindir_null.c: Added. * test/get_sindir_type.c: Replaced. * test/getstr_here.c test: Deleted. * configure.ac: Renamed the intermediate getdata.h file from getdata.ah to getdata.in2. 2014-07-16 D. V. Wiebe svn:908 * bindings/cxx/dirfile.cpp (GetData::EncodingSupport Dirfile::ArrayLen Dirfile::GetData(..., const char** data_out) Dirfile::GetSarray Dirfile::Sarrays Dirfile::MSarrays Dirfile::PutSarray): Added. * bindings/cxx/getdata/sindirentry.h bindings/cxx/getdata/indirentry.h bindings/cxx/getdata/sarrayentry.h bindings/cxx/indirentry.cpp bindings/cxx/sarrayentry.cpp bindings/cxx/sindirentry.cpp * bindings/cxx/indexentry.cpp: Deleted. * bindings/f77/fgetdata.c (_GDF_GetEntryYoke GDGEID GDGESD GDGESA GDADID GDADSD GDMDID GDMDSD GDADSA GDMDSA GDALID GDALSD GDENCS GDSARX GDMSAX GDARLN GDGTSA GDPTSA GDALSA GDGSTD GDGSTP GDXSTP GDDSTP): Added. * bindings/f77/getdata.f90.in (fgd_array_len fgd_encoding_support fgd_sarray_value_max fgd_msarray_value_max fgd_get_sarray fgd_get_sarray_slice fgd_put_sarray fgd_put_sarray_slice fgd_add_sarray fgd_madd_sarray fgd_alter_sarray fgd_add_indir fgd_add_sindir fgd_madd_indir fgd_madd_sindir fgd_alter_indir fgd_alter_sindir fgd_getstrdata): Added. * bindings/idl/getdata.c (gdidl_add_yoke_ gdidl_alter_yoke_ gdidl_encoding_support gdidl_add_sarray gdidl_get_sarray gdidl_alter_sarray gdidl_put_sarray gdidl_add_indir gdidl_alter_indir gdidl_add_sindir gdidl_alter_sindir): Added. * bindings/idl/getdata.c (gdidl_array_len): Renamed from gdidl_carray_len. * bindings/idl/getdata.c (gdidl_getdata): Support gd_getstrdata, too. * bindings/matlab/gd_add_indir.m bindings/matlab/gd_add_sarray.c bindings/matlab/gd_add_sindir.m bindings/matlab/gd_alter_indir.m bindings/matlab/gd_alter_sarray.m bindings/matlab/gd_alter_sindir.m bindings/matlab/gd_carray_len.m bindings/matlab/gd_encoding_support.c bindings/matlab/gd_get_sarray.c bindings/matlab/gd_get_sarray_slice.c bindings/matlab/gd_getstrdata.c bindings/matlab/gd_madd_indir.m bindings/matlab/gd_madd_sarray.c bindings/matlab/gd_madd_sindir.m bindings/matlab/gd_msarrays.c bindings/matlab/gd_put_sarray.m bindings/matlab/gd_put_sarray_slice.c bindings/matlab/gd_sarrays.c: Added. * bindings/matlab/gd_array_len.c: Renamed from gd_carray_len.c. * bindings/matlab/matlab.c (gdmx_from_sarrays gdmx_to_sdata gdmx_free_sdata): Added. * bindings/perl/GetData.xs (gdp_convert_const_avpv gdp_convert_strarr gdp_newRVavpv0 array_len get_sarray get_sarray_slice sarrays put_sarray put_sarray_slice add_sarray madd_sarray msarrays): Added. * bindings/perl/simple_funcs.xsin (array_len alter_sarray add_indir add_sindir alter_indir alter_sindir madd_indir madd_sindir): Added. * bindings/php/getdata.c (gdphp_convert_sarray gdphp_convert_nsarray gd_add_sarray gd_add_indir gd_add_sindir gd_alter_sarray gd_alter_indir gd_alter_sindir gd_array_len gd_sarrays gd_get_sarray gd_getstrdata gd_madd_sarray gd_madd_indir gd_madd_sindir gd_msarrays gd_put_sarray gd_encoding_support): Added. * bindings/python/pydirfile.c (gdpy_dirfile_getsarray gdpy_dirfile_arraylen gdpy_dirfile_sarrays gdpy_dirfile_msarrays gdpy_dirfile_putsarray): Added. * bindings/python/pyentry.c: Handle SARRAY, INDIR, SINDIR * bindings/python/pygetdata.c (gdpy_encoding_support): Added. * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/matlab/test/big_test.m bindings/perl/t/big_test.t bindings/php/test/big_test.php bindings/python/test/big_test.py: Added tests 271 through 298. * src/field_list.c (_GD_EntryIndex): Handle SARRAY, INDIR, SINDIR * gd_get_sarray_slice (gd_get_sarray_slice): Fix return for GD_INVALID. 2014-05-27 D. V. Wiebe svn:907 * src/constant.c (gd_array_len): Added. * src/constant.c (gd_carray_len): Replaced with a gd_array_len() call and marked deprecated. * src/string.c (gd_sarray_len): Deleted. * man/gd_array_len.3: Renamed from man/gd_carray_len.3 2014-05-23 D. V. Wiebe svn:906 * src/field_list.c (gd_sarrays gd_msarrays): Added. * src/close.c (_GD_FreeD) src/entry.c (_GD_FreeE): Free sarray_value_list. * test/svlist_array.c test/svlist_array_meta.c: Added. * src/field_list.c (gd_mstrings): Don't use realloc to skip the unnecessary potential memcpy. * src/include.c (_GD_SetFieldAffixes) src/open.c (_GD_CreateDirfile) src/zzslim.c (_GD_ZzslimName): Use sprintf instead of convolutions of strcpy and strcat for efficiency's sake. 2014-05-22 D. V. Wiebe svn:905 * src/slim.c (_GD_SlimOpen _GD_SlimSize): Disable the slimdopen and slimdrawsize stuff to avoid a slimlib bug. * src/bzip.c src/lzma.c: Re-order some functions to get modules working again. * src/encoding.c (_GD_InitialiseFramework): Don't try to lock the mutex if it's not needed. 2014-05-19 D. V. Wiebe svn:904 * src/lzma.c: Rewritten with better understanding of liblzma. Includes write support. * src/encoding.c: LZMA write support. * test/lzma_xz_get_get.c test/lzma_xz_get_get2.c test/lzma_xz_put.c test/lzma_xz_get_put.c test/lzma_xz_add.c test/lzma_xz_sync.c test/lzma_xz_move_to.c test/lzma_put.c test/lzma_xz_get_far.c test/lzma_xz_put_pad.c test/lzma_xz_put_endian.c test/lzma_xz_put_back.c test/lzma_xz_put_get.c: Added. * test/lzma_xz_get.c test/lzma_xz_nframes.c: Renamed from xz_{get|nframes}.c. * test/encode_support.c: Update for LZMA writes. * src/bzip.c: Remove unnecessary .write member. 2014-05-10 D. V. Wiebe svn:903 * src/slim.c (_GD_SlimOpen _GD_SlimSize): Use slimdopen and slimdrawsize if available to reduce race conditions. 2014-05-06 D. V. Wiebe svn:901 * src/encoding.c: Add bzip2 OOP write support. * src/bzip.c (_GD_Bzip2DoOpen _GD_Bzip2Open _GD_Bzip2Seek _GD_Bzip2Close _GD_Bzip2Read): Handle writes. Properly clean up on error. Track file->pos. * src/bzip.c (_GD_Bzip2Write _GD_Bzip2Sync): Added. * test/bzip_add.c test/bzip_put_back.c test/bzip_move_to.c test/bzip_get_far.c test/bzip_put_pad.c test/bzip_put_sub.c test/bzip_get_get2.c test/bzip_put_get.c test/bzip_put_endian.c test/bzip_sync.c test/bzip_get_put.c: Added. * test/bzip_put.c: Replaced with a working test. * src/fpos.c (_GD_WriteSeek): Fix offset in the seek call. * src/gzip.c (_GD_GzipSeek): Handle seeks past the EOF while reading. * test/gzip_get_far.c test/gzip_put_pad.c: Added. * test/test.h: Remove unnecessary include statements. * src/encoding.c (_GD_MoveOver): Don't attempt to change mode if not needed. * bindings/matlab/matlab.c (gdmx_from_string_list): Use mxFree. * bindings/perl/GetData.xs (gdp_get_type): Fix undef check. 2014-05-05 D. V. Wiebe svn:896 * src/encoding.c (gd_encoding_support): Call _GD_InitialiseFramework(). 2014-05-05 D. V. Wiebe svn:895 * src/getdata.h.in: Remove GD_MAX_CARRAY_LENGTH. * src/add.c (_GD_Add) src/mod.c (_GD_Change) src/parse.c (_GD_ParseArray): Remove references to GD_MAX_CARRAY_LENGTH. * src/add.c (gd_add_raw gd_add_lincom gd_add_clincom gd_add_linterp gd_add_bit gd_add_sbit _GD_AddYoke gd_add_recip gd_add_crecip89 gd_add_polynom gd_add_cpolynom gd_add_phase gd_add_window gd_add_mplex gd_madd_lincom gd_madd_clincom gd_madd_linterp gd_madd_bit gd_madd_sbit _GD_MAddYoke gd_madd_phase gd_madd_polynom gd_madd_cpolynom gd_madd_recip gd_madd_crecip89 gd_madd_window gd_madd_mplex): Call _GD_Add in a slightly less ridiculous way. * src/encoding.c (gd_encoding_support): Added. * man/gd_encoding_support.3 test/encode_support.c: Added. 2014-04-30 D. V. Wiebe svn:890 svn:891 * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/python/test/big_test.py: Fix test 157 for DSV 10. * src/constant.c (gd_get_constant) src/string.c (gd_get_string): Fix call in the case of using a [CS]ARRAY after breaking it. * test/get_const_carray.c: Added. 2014-04-30 D. V. Wiebe svn:889 * test/parse_indir.c test/get_sindir.c test/alter_entry_sarray.c test/add_sindir.c test/getstr_sindir.c test/name_updb_sarray.c test/add_indir.c test/get_indir.c test/getstr_here.c test/alter_sindir.c test/parse_sindir.c test/alter_indir.c test/getstr_type.c test/name_updb_carray.c test/madd_sindir.c test/put_indir.c test/put_sindir.c test/madd_indir.c test/add_sarray_nil.c: Added. * test/name_updb.c test/native_const.c: Update. * src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate) src/legacy.c (GetFormat) src/getdata.c (_GD_DoField gd_getdata64) src/name.c (_GD_UpdateInputs) src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion) src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_ClearDerived _GD_DeReference _GD_Delete) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/fpos.c (_GD_GetFilePos _GD_Seek) src/parse.c (_GD_ParseFieldSpec) src/mod.c (_GD_Change) src/add.c (_GD_InvalidEntype _GD_Add): Handle INDIR and SINDIR. * src/getdata.c (_GD_IndirData _GD_DoIndir gd_getstrdata64 gd_getdata64) src/parse.c (_GD_ParseYoke) src/mod.c (_GD_AlterYoke gd_alter_indir gd_alter_sindir) src/add.c (_GD_AddYoke gd_add_indir gd_add_sindir _GD_MAddYoke gd_madd_indir gd_madd_sindir): Added. * src/common.c (_GD_BadInput): Add entry type parameter and allow non-vector input fields. * src/parse.c (_GD_ParseDivide _GD_ParseMultiply): Deleted (merged into _GD_ParseYoke). * src/mod.c (gd_alter_divide gd_alter_multiply): Call _GD_AlterYoke. * src/add.c (gd_add_multiply gd_add_divide): Call _GD_AddYoke. * src/add.c (gd_madd_multiply gd_madd_divide): Call _GD_MAddYoke. * src/errors.c: Add GD_E_FIELD_FORMAT and GD_E_FIELD_STR. * src/native.c (_GD_NativeType): Return internal type for CONST/CARRAY not storage type (ie. run it through _GD_ConstType). * src/string.c (gd_get_sarray_slice gd_get_sarray) src/mod.c (_GD_Change) src/add.c (_GD_Add): Nilify new SARRAYs on creation, not on read. * src/getdata.h.in: Bump GD_DIRFILE_STANDARDS_VERSION. Add GD_INDIR_ENTRY and GD_SINDIR_ENTRY. 2014-04-27 D. V. Wiebe svn:887 * src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate) src/legacy.c (GetFormat) src/getdata.c (_GD_DoField) src/name.c (_GD_UpdateInputs) src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion) src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_DeReference) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/fpos.c (_GD_GetFilePos _GD_Seek) src/mod.c (_GD_Change) src/add.c (_GD_InvalidEntype _GD_Add): Handle GD_SARRAY_ENTRY. * src/string.c (gd_get_sarray_slice gd_get_sarray gd_sarray_len gd_put_sarray_slice gd_put_sarray) src/mod.c (gd_alter_sarray) src/add.c (gd_add_sarraygd_madd_sarray): Added. * src/string.c (_GD_PutSarraySlice): Renamed from _GD_DoStringOut and updated to handle SARRAYs. Made static. * src/parse.c (_GD_ParseArray): Renamed from _GD_ParseCarray and updated to handle SARRAYs. * test/get_sarray.c test/add_sarray.c test/get_sarray_len.c test/get_string.c test/get_sarray_slice.c test/alter_sarray.c test/parse_sarray.c test/madd_sarray.c test/put_sarray.c test/put_sarray_slice.c test/parse_sarray_long.c: Added. * src/add.c (gd_add_string gd_madd_string): Don't call _GD_DoStringOut to set the value, just set it directly. * src/compat.c: Define AT_SYMLINK_NOFOLLOW if necessary. * src/mod.c (_GD_Change): Report AlterScalar errors for LINCOMs. * src/errors.c: Add GD_E_FLUSH_WRITE and GD_E_FLUSH_TOO_LONG. * src/flush.c (_GD_StringEscapeise): Return -1 on error; don't write anything if stream == NULL. * src/flush.c (_GD_StringEscapeise _GD_WriteFieldCode _GD_WriteConst _GD_FieldSpec _GD_FlushFragment): Report write errors. * src/flush.c (_GD_WriteFieldCode): Write a trailing space if requested. * src/flush.c (_GD_FlushFragment): Try USER if LOGNAME not available. * src/constant.c (gd_get_carray_slice _GD_PutCarraySlice gd_put_carray_slice): Make first long. 2014-04-03 D. V. Wiebe svn:883 * src/add.c (gd_add_crecip gd_madd_crecip) src/mod.c (gd_alter_crecip): Call the ...crecip89 function. * src/getdata.h.in: Fix GD_MAX_CARRAY_LENGTH computation. 2014-03-20 D. V. Wiebe svn:882 * bindings/php/getdata.c (gd_add_polynom gd_madd_polynom): Fix array size. * bindings/python/pydirfile.c (gdpy_dirfile_getentry): Fix segfault. * test/zzslim_get.c: Fix. 2014-03-10 D. V. Wiebe svn:880 * bindings/matlab/gd_move_alias.c: Deleted. * bindings/matlab/test/big_test/m: Delete test 224. 2014-02-14 D. V. Wiebe svn:877 * bindings/cxx/entry.cpp (Entry::Entry): Zero E if gd_entry call fails. * bindings/cxx/fragment.cpp (Fragment::Fragment): Handle error in gd_fragment_affixes call. * bindings/f77/fgetdata.c (GDASCA): Handle error in gd_entry call. * bindings/php/getdata.c (gdphp_data_to_array) src/types.c (_GD_ConvertType): Add missing break. * bindings/php/getdata.c (gd_error_string): Handle error in gd_error_string call. * bindings/python/pygetdata.h (PYGD_REPORT_ERROR): Added. * bindings/python/pydirfile.c (gdpy_dirfile_getentry gdpy_dirfile_getstring gdpy_dirfile_putcarray gdpy_dirfile_putdata) src/include.c (_GD_Include) src/name.c (_GD_PrepareRename) src/putdata.c (_GD_DoMplexOut) src/sie.c (_GD_SampIndWrite): Deallocate buffers on error. * bindings/python/pyentry.c (gdpy_entry_seta): Set a[i] if the pyobj is complex. * src/bzip.c (_GD_Bzip2Size): Free ptr only after we're done with it. * src/common.c (_GD_CanonicalPath): Don't let readlink overrun the buffer. Also fix double free. * src/entry.c (_GD_FreeE): Fix overrun on zeroing of in_fields. * src/entry.c (gd_linterp_tablename): Don't use field_code after free. * src/getdata.h.in: Remove __nonnull__ from parameter two of gd_verbose_prefix. * src/gzip.c (_GD_GzipOpen): Check that _GD_MakeTempFile() worked. * src/open.c (_GD_CreateDirfile _GD_Open): Close descriptors on error. * src/parse.c (_GD_ParseCarray): Return on error. * src/parse.c (_GD_ParseFieldSpec): Only resize the dot_list when necessary. Also, clean up if the resize doesn't work. * util/dirfile2ascii.c (main): Fix check for too many fields. * src/entry.c (gd_naliases): Return unsigned int and zero on error per documentation. * bindings/idl/getdata.c (gdidl_naliases) src/entry.c (gd_aliases) test/add_alias.c test/add_alias_affix.c test/add_alias_meta.c test/add_resolv.c test/add_spec_resolv.c test/alias_num.c test/alias_num_alias.c test/alias_num_missing.c test/madd_alias.c test/madd_alias_affix.c test/madd_spec_resolv.c: Handle unsigned gd_naliases. 2014-02-13 D. V. Wiebe svn:876 * bindings/python/pyfragment.c (gdpy_fragment_init): Fix typo in keyword names. 2013-12-17 D. V. Wiebe svn:875 * src/add.c (_GD_Add) src/fpos.c (_GD_GetFilePos _GD_WriteSeek _GD_Seek) src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c (_GD_MogrifyFile) src/parse.c (_GD_ParseFieldSpec) src/putdata.c (_GD_InitRawIO): Call _GD_InitRawIO with fragment = -1. * test/add_raw_sub.c test/ascii_get_sub.c test/gzip_put_sub.c test/put_sub.c test/seek_sub.c test/tell_sub.c: Added. * src/errors.c src/internal.h: Add GD_E_UNCLEAN_CALL suberror. 2013-12-12 D. V. Wiebe svn:874 * src/endian.c (_GD_CheckByteSex): Added. * src/endian.c (_GD_FileSwapBytes): Added (replacing macro in internal.h). * src/endian.c (_GD_FixEndianness): Call _GD_CheckByteSex() to check whether correction is needed. * src/getdata.c (_GD_DoRaw) src/move.c (_GD_MogrifyFile) src/putdata.c (_GD_DoRawOut): Let _GD_FixEndianness and _GD_CheckByteSex do the endianness logic. 2013-12-12 D. V. Wiebe svn:872 * configure.ac: Disable PHP bindings if we don't have a C99 compiler. * src/common.c (_GD_CInvertData): Correct algebra in C89 INVERT macro. * src/getdata.c (_GD_PolynomData): Implement correct C89 POLYNOMC macro. * src/getdata.c (_GD_CDivideData): Correct algebra in C89 DIVIDEC macro. * src/entry.c (_GD_CalculateEntry): Return success or failure separately from Dirfile error. * src/internal.h: Fix pointer arithmetic in C89 gd_cap_ macro. 2013-12-10 D. V. Wiebe svn:868 * src/getdata.h.in src/internal.h: Merge gd_entry_t members 'comp_scal' and 'hidden', plus private member 'calculated' into (public) member 'flags', and add GD_EN_CALC, GD_EN_COMPSCAL and GD_EN_HIDDEN flags. * bindings/make_parameters.c: Add entry flags. * bindings/cxx/getdata/entry.h (Entry::Flags) bindings/f77/fgetdata.c (GDENFL): Added. * bindings/f77/fgetdata.c (GDCSCL): Deleted. * bindings/f77/getdata.f90.in: Replaced comp_scal with flags in gd_entry type. * bindings/idl/getdata.c: Replaced COMP_SCAL with FLAGS member in gd_entry struct. * src/mod.c (_GD_Change): Allow hiddenness modification. * test/alter_entry_hidden.c: Update test: hiddenness should change. * test/cvlist_meta0.c: Check error. * bindings/cxx/getdata/entry.h (Entry::CompScal): Allow non-zero for RECIP, too. 2013-12-06 D. V. Wiebe svn:867 * test/add_dot.c test/alter_clincom.c test/alter_const_r2c.c test/sie_sync.c test/alter_const_r2r.c test/alter_cpolynom_null.c test/alter_crecip89_null.c test/alter_entry_lincom.c test/alter_entry_recode_recalc.c test/get_divide_s.c test/alter_entry_scalar1.c test/alter_entry_scalar3c.c test/alter_index.c test/alter_spec_polynom.c test/ascii_get_complex.c test/ascii_sync.c test/bof_bit.c test/bof_index.c test/bof_phase_neg.c test/cvlist_array0.c test/cvlist_array_free.c test/cvlist_array_meta0.c test/native_polynom_cmpin.c test/cvlist_array_meta_free.c test/cvlist_meta0.c test/del_alias.c test/del_data_enoent.c test/del_data_open.c test/del_ref.c test/desync_path.c test/encode_alter_all.c test/encode_alter_open.c test/svlist_meta0.c test/encode_recode_open.c test/endian_alter_all.c test/eof_bit.c test/flist2.c test/eof_phase_neg.c test/flist0.c test/flist_meta2.c test/flush_lincom.c test/flush_lincom1.c test/flush_mult.c test/sie_put_back.c test/put_cpolynom.c test/flush_raw_close.c test/flush_string.c test/flush_sync.c test/svlist2.c test/foffs_alter_all.c test/fragment_affix_alter_code.c test/native_recip.c test/fragment_affix_alter_nop.c test/get_cpolynom1.c test/get_cpolynom_int.c test/get_dim.c test/get_divide_ccin.c test/get_divide_crin.c test/native_raw.c test/get_divide_crinr.c test/get_divide_rcin.c test/get_index_complex.c test/get_lincom2s.c test/get_lincom3s.c test/get_lincom_mdt.c test/parse_hex.c test/get_linterp1.c test/get_linterp_abs.c test/get_linterp_complex.c test/get_linterp_empty.c test/get_mplex_complex.c test/get_mplex_s.c test/get_mplex_saved.c test/get_multiply_ccin.c test/get_multiply_crin.c test/get_multiply_crinr.c test/get_multiply_rcin.c test/get_multiply_s.c test/get_neg.c test/get_polynom_cmpin.c test/get_window_complex.c test/get_window_s.c test/get_zero_complex.c test/get_zero_float.c test/gzip_del.c test/gzip_put_back.c test/gzip_sync.c test/index_s.c test/index_subset.c test/legacy_error.c test/legacy_estring.c test/seek_mult.c test/legacy_format.c test/move_affix_meta.c test/move_affix_updb.c test/move_data_foffs_neg.c test/name_dangle.c test/name_dot.c test/name_meta.c test/name_updb_affix.c test/native_bit.c test/native_const.c test/repr_bad.c test/native_index.c test/native_lincom.c test/native_lincom_cmpin.c test/native_lincom_cmpscal.c test/native_linterp.c test/native_linterp_cmp.c test/native_mult.c test/native_mult1.c test/native_mult2.c test/native_phase.c test/native_polynom.c test/native_polynom_cmpscal.c test/native_recip_cmpin.c test/native_recip_cmpscal.c test/native_sbit.c test/native_string.c test/open_cb_rescan_alloc.c test/open_invalid.c test/open_sym_as.c test/open_sym_d.c test/open_sym_l.c test/parse_include_affix_bad.c test/parse_literal_cmpbad.c test/parse_literal_fltcmp.c test/parse_meta_frag.c test/parse_literal_fltcmp0.c test/parse_literal_intcmp.c test/sie_put_append.c test/parse_literal_intcmp0.c test/parse_literal_uintcmp.c test/sie_put_trunc.c test/parse_literal_uintcmp0.c test/parse_octal_zero.c test/protect_alter_all.c test/parse_raw_char_bad.c test/parse_utf8.c test/parse_utf8_invalid.c test/parse_utf8_zero.c test/put_carray_client.c test/put_clincom1.c test/put_crecip.c test/put_mplex_complex.c test/svlist0.c test/seek_index.c test/seek_lincom.c test/seek_phase.c test/sie_put_append2.c test/sie_put_pad.c test/sie_put_trunc2.c test/sie_put_pad0.c test/unclude_open.c: Added. * test/encode_recode.c: Renamed. * src/add.c (_GD_Add): Set the right suberror (GD_E_ENTRY_POLYORD) for poly_ord out of range. * src/add.c (gd_add_alias) src/field_list.c (_GD_EntryList): Remove duplicate check for invalid dirfile. * src/ascii.c (_GD_ScanFormat): Append a newline. * src/ascii.c (_GD_AsciiRead): Use ferror instead of feof to check for stdio errors. * src/common.c (_GD_ReadLinterpFile): Zero the LUT pointer on error. * src/mod.c (_GD_Change): reset the LUT length to force table re-read. Also, release the LUT directory. * src/common.c (_GD_CanonicalPath): Set errno to ELOOP late. * src/constant.c (_GD_PutCarraySlice): Added. * src/constant.c (gd_put_carray_slice gd_put_carray): Call _GD_PutCarraySlice. * src/del.c (_GD_Delete): Always close an open raw file, even when deleting it. * src/encoding.c (_GD_RecodeFragment): Use _GD_FiniRawIO to close raw files. Clear the internal cache of raw filenames. * src/entry.c (_GD_GetScalar): Return non-zero on error. Always call _GD_DoField. * src/entry.c (gd_entry): Return uncalculable entries rather than failing. * src/flimits.c (_GD_GetBOF): Also zero *ds if we're before sample zero. * src/flush.c (_GD_Flush): Validate input fields before trying to flush them. Don't flush the second lincom field if it's not used. * src/flush.c (_GD_StringEscapeise): Remove duplicate check for ". * src/fpos.c (_GD_Seek): Fix sign on PHASE shift. * src/fpos.c (gd_seek64): Pass index_pos=-1 to _GD_GetFilePos. * src/getdata.c (_GD_CPolynomData _GD_CMultiplyData _GD_CDivideData): Delete unused code: type is guaranteed to be complex in these calls. * src/getdata.c (_GD_CDivideData): Fix computation of complex division. * src/getdata.c (_GD_DoLinterp): Delete check for uninitialised LUT: the native type check done in DoField has already initialised the LUT. * src/index.c (_GD_GetIndex): Fix extrapolations performed when required to search for the EOF. * src/index.c (gd_framenum_subset64): Fix conversion of field_end from frames to samples. * src/legacy.c (GetFormat): Allocate Format.mplexEntries. * src/mod.c (_GD_Change): Ensure a RAW entry is calculated before trying to modify the data file. * src/mod.c (gd_alter_spec gd_malter_spec): Set move flags for POLYNOM entries to ensure co-efficients are updated. * src/getdata.h.in: Added struct gd_rename_data_. Added GD_REN_DANGLE, GD_REN_FORCE. * src/move.c (_GD_Move) src/name.c (_GD_Rename): Call _GD_PrepareRename and _GD_PerformRename to handle metadata updates resulting from name changes. * src/move.c (gd_move): Replace move_data with flags argument, which accepts the GD_REN_* flags. * src/name.c (_GD_MatchCode _GD_MakeNewCode _GD_SetNewCode _GD_UpdateInputs _GD_CleanUpRename _GD_PerformRename _GD_PrepareRename): Added. * src/name.c (_GD_InvalidateConst _GD_InvalidateVect): Deleted. (Combined into _GD_UpdateInputs). * src/name.c (_GD_UpdateScalar _GD_UpdateInField): Call _GD_MatchCode _GD_MakeNewCode _GD_SetNewCode for common code. Return non-zero on failure. Update gd_rename_data_ struct in-place. * src/name.c (_GD_MungeCode): If err_ok is 2, dont' worry at all about errors. * src/name.c (_GD_CheckCodeAffixes): Add set_error argument. Remember success or failure separately from the DIRFILE error. * src/move.c (gd_move_alias): Deleted. * src/move.c (gd_move): Don't delalias the provided field code. * bindings/cxx/dirfile.cpp (Dirfile::MoveAlias) bindings/f77/fgetdata.c (GDMOVA) bindings/f77/getdata.f90.in (fgd_move_alias) bindings/perl/simple_funcs.xsin (move_alias) bindings/php/getdata.c (gd_move_alias) bindings/python/pydirfile.c (gdpy_dirfile_movealias): Deleted. * bindings/idl/getdata.c (gdidl_move gdidl_rename): Remove keyword ALIAS; add keywords DANGLE, FORCE, UPDATEDB. * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/perl/t/big_test.t bindings/php/test/big_test.php bindings/python/test/big_test.py: Delete test 224. * src/native.c (_GD_NativeType): Don't always return GD_FLOAT64 for LINCOMs. * src/errors.c: Added GD_E_OPEN_IO. * src/open.c (_GD_Open): Throw GD_E_OPEN instead of GD_E_RAW_IO if resolving the supplied path fails. * src/parse.c (_GD_SetScalar): Allow literals in semicolon (complex) form in all cases but require a zero imaginary part for non-complex data. * src/parse.c (_GD_Tokenise): Fix parsing of \x and \u. Don't unnecessarily overwrite earlier errors with GD_E_FORMAT_UNTERM. * src/putdata.c (_GD_MplexOutData): Fix computation of complex data. * src/sie.c: Added l, have_l and bof to struct gd_siedata. Also, f->d[0] is no longer endianness corrected (ie. f->d is now simply the raw record), which means we use f->s in most places where we used f->d[0] previously. * src/sie.c (_GD_Advance): remember the previous record in f->l. Also set f->bof. * src/sie.c (_GD_SampIndSeek): check stdio calls for failure. Correctly format a padding record when write seeking past the EOF. * src/sie.c (_GD_SampIndWrite): Correctly deal with appending data, including backing up a record when necessary to check whether we need to combine the start of the new data with that record. Compose p with the output endianness. * bindings/idl/getdata.c (gdidl_rename): Fix handling of UPDATEDB. * bindings/php/getdata.c (gd_rewrite_fragment): Initalise zi. 2013-11-15 D. V. Wiebe svn:866 * test/add_add.c test/close_close.c test/del_del.c test/flush_flush.c test/include_include.c test/index_index.c test/move_move.c test/name_name.c test/nfields_nfields.c test/nframes_nframes.c test/open_open.c test/spf_raw.c: Renamed. 2013-11-13 D. V. Wiebe svn:863 * bindings/cxx/rawentry.cpp (RawEntry::RawEntry): Initialise filename. Patch from S. J. Benton. 2013-10-26 D. V. Wiebe svn:862 * src/getdata.h.in: Add GD_GETDATA_VERSION and GD_GETDATA_INT_VERSION * configure.ac cmake/CMakeLists.txt: Calculate GD_GETDATA_VERSION and GD_GETDATA_INT_VERSION. 2013-10-19 D. V. Wiebe svn:854 * src/add.c (_GD_Add) src/fpos.c (_GD_GetFilePos _GD_WriteSeek _GD_Seek) src/getdata.c (_GD_DoRaw) src/mod.c (_GD_Change) src/move.c (_GD_MogrifyFile) src/parse.c (_GD_ParseFieldSpec) src/putdata.c (_GD_DoRawOut): Compute the swap argument correctly in _GD_InitRawIO calls. * src/encoding.c (_GD_InitRawIO): Merge oop_write and temp file creation code; also, assume that the caller has figured out the swap parameter. * test/gzip_put_endian.c: Added. 2013-10-19 D. V. Wiebe svn:852 _GD_MakeTempFile patch from Seth: * src/encoding.c (_GD_InitRawIO): Let the encoding framework deal with creating temporary files. * src/ascii.c (_GD_AsciiOpen) src/gzip.c (_GD_GzipOpen) src/raw.c (_GD_RawOpen) src/sie.c (_GD_SampIndDoOpen): Call _GD_MakeTempFile when necessary. 2013-10-19 D. V. Wiebe svn:850 Merge in getdata-distutils branch: * m4/python.m4 bindings/python/test/Makefile.am bindings/python/Makefile.am configure.ac: Use distutils to build Python bindings rather than rolling our own. * bindings/python/setup.py.in: Added. 2013-10-18 D. V. Wiebe svn:848 * bindings/f77/fgetdata.c (GDASRW GDASLC GDASCL GDASPN GDASCP GDASPH GDASRC GDASCR GDASWD GDASMX GDLSPH GDLSPN GDLSCP GDLSWD _GDF_AddBitSBit GDASBT GDASSB _GDF_AlterBitSBit GDLSBT GDLSSB GDLSLC GDLSCL GDLSRC GDLSCR GDLSRW): Added. * bindings/f77/getdata.f90.in (fgd_add): Call GDAS.. instead of GDAD.. where possible. * bindings/f77/getdata.f90.in (fgd_alter_entry): Call GDLS.. instead of GDAL.. where possible. * bindings/f77/getdata.f90.in (fgd__set_field_len fgd__set_scalar_len): Added. * bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/matlab/test/big_test.m bindings/perl/t/big_test.t bindings/python/test/big_test.py: Reorganize, renumber tests. Add tests 243-269 where appropriate. * bindings/idl/getdata.c (gdidl_convert_entry_num gdidl_get_entry_num gdidl_get_entry_scalars gdidl_get_in_fields gdidl_get_entry_cmparr): Added. * bindings/idl/getdata.c (gdidl_read_idl_entry): Be less pedantic about numerical types. * bindings/idl/getdata.c (gdidl_make_idl_entry: Initialise both complex and real floating point parameters. * bindings/perl/GetData.xs (gdp_fetch_cmp_list gdp_fetch_in_fields gdp_fetch_scalars gdp_to_entry): Be less pedantic about numerical types and array sizes. * bindings/perl/typemap (T_PENTRY): Added. * bindings/php m4/php.m4: Added. * bindings/make_parameters.c (PHP): Added. * src/mod.c (_GD_Change): Fix MPLEX scalar modifying. * src/add.c (_GD_CopyScalars): Added. * src/add.c (_GD_Change): Fix scalar copying for GD_POLYNOM_ENTRY. Don't throw errors for passed members which will be ignored due to scalars (spf, numbits, bitnum). * test/add_bit_scalars.c test/add_mplex_scalars.c test/add_raw_spf_scalar.c * test/add_polynom_scalar.c: Added. * src/add.c (_GD_Change): Don't throw an error on mplex.count_val < 0. * src/errors.c src/internal.h: Remove unused GD_E_ENTRY_CNTVAL. * test/add_mplex_val.c: Deleted. * src/getdata.c (_GD_DoConst): Return len instead of 1. * src/field_list.c (gd_carrays gd_mcarrays): Update _GD_DoField calls to deal with the above. * test/get_carray_c2r.c: Added. * src/entry.c (_GD_FreeE): When priv == 0, zero free'd pointers. * bindings/perl/t/big_test.t: Added test 181. 2013-09-05 D. V. Wiebe svn:845 GetData-0.8.5 released. * src/zzslim.c: Fix for rename of gd_raw_file_. 2013-07-17 D. V. Wiebe svn:835 * bindings/python/pydirfile.c: Remove spurious debug printf. * bindings/doc/Makefile.am: Fix make clean * bindings/bindings/perl/Makefile.am: Fix make clean 2013-05-14 D. V. Wiebe svn:832 GetData-0.8.4 released. 2013-04-11 D. V. Wiebe svn:830 GetData-0.8.4rc2: * bindings/perl/Build.PL.in: make include_dirs an array. Reported by Seth. * bindings/idl/package/configure.ac bindings/matlab/package/configure.ac: Require GetData >= 0.8.4. 2013-04-10 D. V. Wiebe svn:829 GetData-0.8.4rc1. 2013-04-06 D. V. Wiebe svn:827 * bindings/cxx/getdata/entry.h (Entry::CountMax) bindings/cxx/getdata/mplexentry.h (MplexEntry::CountMax MplexEntry::SetCountMax): Added (but marked deprecated) for backwards compatibility. 2013-04-05 D. V. Wiebe svn:826 * bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/perl/t/big_test.t: Fix test 231. 2013-04-05 D. V. Wiebe svn:825 * src/getdata.h.in: Renamed gd_entry_t.count_max to gd_entry_t.period. * bindings/cxx/getdata/entry.h (Entry::Period) bindings/cxx/getdata/mplexentry.h (NplexEntry::Period): Renamed from CountMax. * bindings/cxx/mplexentry.cpp (MplexEntry::SetPeriod): Renamed from SetCountMax. * bindings/cxx/mplexentry.cpp (MplexEntry::MplexEntry) bindings/f77/fgetdata.c (GDGEMX) bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry fgd_add_mplex fgd_madd_mplex fgd_alter_mplex) bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_alter_mplex) bindings/matlab/gd_add_mplex.m bindings/matlab/gd_alter_mplex.m bindings/matlab/gd_madd_mplex.m bindings/matlab/matlab.c (gdmx_from_entry gdmx_to_entry) bindings/perl/GetData.xs (gdp_to_entry entry) bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_entry_getperiod gdpy_entry_setperiod gdpy_entry_getparms): Rename count_max to period. * src/add.c (_GD_Add): Fix range checks on MPLEX parameters. * src/getdata.c (_GD_DoMplex): The default period is 2n+1, not 2n. * src/internal.h: Rename GD_E_ENTRY_CNTMAX to GD_E_ENTRY_PERIOD. * src/errors.c: Update GD_E_ENTRY_PERIOD and GD_E_FORMAT_MPLEXVAL messages. * src/mod.c (_GD_Change): mplex.count_val = -1 is not a magic value. * src/parse.c (_GD_ParseMplex): Remove incorrect restrictions count_val <= period and count_val >= 0. * bindings/idl/getdata.c (gdidl_read_idl_entry): Properly convert an IDL MPLEX entry object. * bindings/idl/getdata.c (gdidl_alter_mplex): Handle missing COUNT_VAL. * man/dirfile-format.5: Fix and clarify MPLEX specification. 2013-03-13 D. V. Wiebe svn:819 * src/flush.c (_GD_FlushFragment): Strip affixes from field codes in /REFERENCE directives. * test/flush_ref.c test/parse_include_affix_ref.c: Added. 2013-03-12 D. V. Wiebe svn:818 * bindings/python/pydirfile.c (gdpy_dirfile_getdata): Resize the ndarray before returning it, if necessary. Also, don't try to read past the EOF in read-to-end mode. * src/fpos.c (_GD_GetFilePos): Fix computation of two input field derived types to properly return MULTIPOS when necessary. * test/tell_multidiv.c: Added. * src/fpos.c (_GD_Seek): Return error if trying to place the I/O pointer before sample zero. * test/seek_neg.c: Added. * src/gzip.c (_GD_GzipSeek): Allow seeking to sample zero. * test/gzip_get_get2.c: Added. 2013-03-12 D. V. Wiebe svn:815 GetData-0.8.3 released. 2013-03-09 D. V. Wiebe svn:807 * src/flush.c: C89-ify the GD_VERS_... constants. 2013-03-08 D. V. Wiebe svn:806 GetData-0.8.3rc1. 2013-03-08 D. V. Wiebe svn:803 * src/internal.h (gd_put_unalinged64): Fix spelling. * src/encoding.c (_GD_FiniRawIO): Don't pass NULL to gd_UnlinkAt. * man/GD_SIZE.3: Added. * configure.ac: Turn on fast unaligned access for armv[6789] per Dinar Valeev. Also add add --enable-fast-unaligned to allow users to override the check. 2013-02-15 D. V. Wiebe svn:795 * bindings/matlab/package: Added. * Makefile.am: Add matlabdist and matlabdistcheck * doc/README.matlab bindings/matlab/make_contents.sh.in bindings/matlab/Contents.m.head bindings/matlab/doc.tail: Added. * bindinag/matlab/matlab.c (gdmx_from_carrays): Added. * bindings/matlab/gd_mcarrays.c: Added. * bindings/matlab/test/big_test.m: Add test 243. * bindings/matlab/gd_include.c: Renamed from gd_include_affix.c * bindings/matlab/gd_include.m: Deleted. 2013-02-13 D. V. Wiebe svn:794 * bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t bindings/python/test/big_test.py: Add test 243. 2013-02-06 D. V. Wiebe svn:793 * src/parse.c (_GD_Tokenise): Don't falsely report an unterminated token when stopping a partial tokenisation on top of a " or \. * test/tok_arg.c test/tok_escape.c test/tok_quote.c: Added. 2013-02-02 D. V. Wiebe svn:792 * src/string.c (gd_get_string): Handle string retrieval directly instead of calling _GD_DoField. * src/string.c (_GD_DoStringOut): Moved from putdata.c. * src/string.c (gd_put_string) src/add.c (gd_add_string gd_madd_string): Call _GD_DoStringOut directly instead of _GD_DoFieldOut. * src/getdata.c (_GD_DoString): Deleted. * src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Remove string processing. 2013-02-02 D. V. Wiebe svn:790 * bindings/matlab/matlab.c: ANSI C. 2013-02-02 D. V. Wiebe svn:789 * bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj): Add missing data types. * bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_entry_setspf gdpy_entry_setbitnum gdpy_entry_setnumbits gdpy_entry_setcountval gdpy_entry_setcountmax): Fix data type in gdpy_set_scalar_from_pyobj calls. * src/entry.c (_GD_GetScalar): Handle bogus CARRAY indices. * src/mod.c (_GD_Change): Fix floating point CONST conversions. * test/add_scalar_carray_bad.c test/alter_const_c2r.c: Added. * bindings/python/test/big_test.py: Fix the part of test 35 that the previous fix broke. 2013-02-02 D. V. Wiebe svn:788 * src/debug.c (gd_colclear): Added. * src/protect.c (gd_protection gd_alter_protection): Fix error reporting for GD_E_BAD_INDEX. * m4/matlab.m4 bindings/matlab: Added. * configure.ac bindings/Makefile.am: Added MATLAB config. * bindings/make_parameters.c (MatLab): Added. * bindings/python/test/big_test.py: Fixed tests 35 and 67. 2013-01-26 D. V. Wiebe svn:787 * src/del.c (_GD_DeReference) src/entry.c (_GD_CalculateEntry) src/flush.c (_GD_FieldSpec) src/mod.c (_GD_Change): Fix data type (size) of EN(raw,spf) in function calls. 2013-01-15 D. V. Wiebe svn:785 * m4/floatordering.m4: Split from m4/compiler.m4 * src/parse.c (_GD_ParseRaw _GD_ParseMplex): Fix types in _GD_SetScalar calls. 2013-01-04 D. V. Wiebe svn:783 * configure.ac: powerpc64 also supports fast unaligned access. Reported by Dinar Valeev. 2012-12-13 D. V. Wiebe svn:775 GetData-0.8.2 released. 2012-12-12 D. V. Wiebe svn:773 * src/common.c (_GD_CanonicalPath): Don't bail early when encountering a trailing absolute symlink. * src/common.c (_GD_CanonicalPath): Strip DIRSEP along with a symlink name from res when necessary. * test/test.h test/parse_include_absolute.c test/parse_include_absrel.c test/parse_include_relabs.c: Abstract getcwd in the header. * test/open_sym_a.c test/open_sym_al.c test/open_sym_at.c test/open_sym_c.c test/open_sym_cl.c test/open_sym_ct.c test/open_sym_p.c test/open_sym_pl.c test/open_sym_pt.c: Added. 2012-11-22 D. V. Wiebe svn:772 * src/encoding.c (_GD_WriteOut): Remove unnecessary DIRFILE parameter. 2012-10-10 D. V. Wiebe svn:771 * src/getdata.c (_GD_DoMplex): Check we're at the BOF before trying to do a lookback. * src/internal.h: Only export gd_MakeFullPathOnly when using modules. 2012-08-20 D. V. Wiebe svn:767 GetData-0.8.1 released. 2012-08-15 D. V. Wiebe svn:760 * src/internal (_GD_IsDirSep): Added. * src/common.c (_GD_CanonicalPath): Call _GD_IsDirSep 2012-08-15 D. V. Wiebe svn:759 GetData-0.8.1rc1: * src/parse.c (_GD_ParseDirective _GD_ParseFragment): Remove inappropriate restrict keywords. Reported by Daniel Flanigan. 2012-08-14 D. V. Wiebe svn:757 * src/include.c (_GD_Include): Return the correct fragment index, not just D->n_fragment - 1. * test/include_sub.c: Added. 2012-08-04 D. V. Wiebe svn:755 * src/parse.c (_GD_ParseFragment): Don't resize instring unnecessarily. 2012-08-04 D. V. Wiebe svn:754 * src/parse.c (_GD_ParseDirective): Delete free reference on encountered one in a subfragment. 2012-08-02 D. V. Wiebe svn:753 * src/include.c (_GD_Include): Reject non-regular files as fragments. 2012-08-02 D. V. Wiebe svn:752 * src/globals.c (gd_dirfilename): Return the full path. * test/global_name.c: Update. * src/add.c (_GD_Add): Properly compute filebase. * src/entry.c (gd_linterp_tablename): Added. * test/table.c test/table_code. test/table_type.c: Added. * bindings/cxx/dirfile.cpp (Dirfile::LinterpTableName) bindings/perl/simple_funcs.xsin (linterp_tablename) bindings/f77/getdata.f90.in (fgd_linterp_tablename) bindings/f77/fgetdata.c (GDLTTN) bindings/idl/getdata.c (gdidl_get_linterp_tablename) bindings/python/pydirfile.c (gdpy_dirfile_linterptablename): Added. * bindings/perl/simple_funcs.pl: Handle returning malloc'd string. * bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro bindings/python/test/big_test.py: Add test 241. Update tests 21 and 80. 2012-07-26 D. V. Wiebe svn:751 * src/flush.c (_GD_FieldSpec): Write /HIDDEN directives for /ALIASes. 2012-07-26 D. V. Wiebe svn:749 * src/parse.c (_GD_SetScalar _GD_ParseLincom _GD_ParseLinterp _GD_ParseMultiply _GD_ParseRecip _GD_ParseWindow _GD_ParseMplex _GD_ParseDivide _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom _GD_ParseAlias): Store munged input fields. * src/entry.c (_GD_GetScalar) src/common.c (_GD_BadInput) src/parse.c (_GD_ResolveAlias): Don't (re-)munge field codes. * src/name.c (_GD_MungeCode): Take an additional parameter, err_ok, indicating whether missing affixes indicate an internal error or not. * src/mod.c (_GD_AlterInField) src/name.c (_GD_CheckCodeAffixes): Added. * src/mod.c (_GD_AlterScalar) src/add.c (_GD_FixName _GD_Add _GD_AddAlias): Call _GD_CheckCodeAffixes. * src/mod.c (_GD_Change): Call _GD_AlterInField to modify in_fields. * src/flush.c (_GD_WriteFieldCode): Added. * src/flush.c (_GD_PadField _GD_WriteConst _GD_FieldSpec): Call _GD_WriteFieldCode. * test/get_affix.c test/add_alias_affix.c test/add_alias_affix.c test/add_spec_affix.c test/madd_alias_affix.c test/alter_lincom_affix.c test/add_lincom_affix.c test/alter_scalar_affix.c: Added. * test/add_string_affix.c test/madd_affix.c test/add_affix.c: Update for new affix semantics. * src/mod.c (gd_alter_entry) src/add.c (gd_madd_alias): Clear error when starting. 2012-07-12 D. V. Wiebe svn:743 * bindings/f77/fgetdata.c (GDALLC): Delete unnecessary malloc. * src/fragment.c (_GD_CheckAffixes): Free subaffixes on error. * src/fragment.c (gd_desync): Free old name after reopen. * src/include.c (_GD_Include): Free sname on error. * src/add.c (_GD_Add): Free temp_buffer on error. * src/close.c (_GD_FreeD): Free tok_base and error_prefix. * src/move.c (_GD_Move): Free new_code on error. * src/parse.c (gd_strtok): Cache the string per documentation. * test/valgrind.suppressions: Added. * bindings/cxx/test/big_test.cpp test/add_affix.c test/add_meta_alias.c test/add_scalar_carray.c test/name_updb_alias.c test/name_updb_const.c test/name_updb_const_alias.c test/name_alias.c test/name_updb.c test/madd_affix.c test/add_meta.c test/add_scalar.c test/name.c test/add.c test/parse_mplex_nomax.c: Deal with memory. 2012-07-10 D. V. Wiebe svn:740 * src/common.c (_GD_CanonicalPath): Fix pointer arithmetic * src/compat.c (gd_strtod): Drop octal (not in POSIX); handle hex floating point; don't zero errno. 2012-07-04 D. V. Wiebe svn:737 GetData-0.8.0 released. 2012-07-04 D. V. Wiebe svn:736 * src/constant.c (gd_get_carray_slice gd_get_carray gd_carray_len gd_put_carray_slice gd_put_carray): Handle both CONST and CARRAY. * src/constant.c (gd_get_constant gd_put_constant): Just call the corresponding carray_slice function. 2012-06-30 D. V. Wiebe svn:732 * src/getdata.h.in configure.ac cmake/CMakeLists.txt: Fix definition of gd_off64_t. * bindings/perl/Build.PL.in: make getdata.h a dependency of lib/GetData.xs. 2012-06-29 D. V. Wiebe svn:728 * src/getdata.h.in src/internal.h src/errors.c: Merge GD_E_BAD_VERSION into GD_E_ARGUMENT. 2012-06-28 D. V. Wiebe svn:725,726 * util/checkdirfile.c: Find and report dangling aliases. * bindings/python/pydirfile.c (gdpy_dirfile_nentries gdpy_dirfile_entrylist) bindings/cxx/dirfile.cpp (Dirfile::NEntries Dirfile::EntryList) bindings/perl/GetData.xs (entry_list) : Fix signedness of "type". * bindings/idl/getdata.c (gdidl_get_field_list gdidl_get_nfields): Deal with /ALIASES. * bindings/make_parameters.c: Add GD_ALIAS_ENTRIES. * test/nentries_noalias.c test/elist_noalias.c: Renamed from ..._alias.c. * test/nentries_alias.c test/elist_alias.c: Added. * src/internal.h getdata.h.in: Move GD_ALIAS_ENTRY to public header. * src/getdata.h.in: Define GD_ALIAS_ENTRIES. * src/field_list.c (_GD_EntryIndex _GD_ListEntry) src/nfields.c (_GD_NEntries): Handle GD_ALIAS_ENTRIES. * src/common.c (_GD_CanonicalPath): Sidestep GCC warning. 2012-06-27 D. V. Wiebe svn:724 * src/name.c (_GD_UpdateScalar _GD_InvalidateConst _GD_UpdateInField _GD_InvalidateVect): Handle aliases. * src/name.c (gd_rename): Don't dereference aliases. * src/name.c (gd_rename_alias): Deleted. * test/name.c test/name_updb_const.c test/name_updb.c: Updated. * test/name_updb_const_alias.c test/name_move_alias.c test/name_alias.c test/name_updb_alias.c: Added. * test/name_after_const.c test/name_after.c: Deleted. * src/parse.c (_GD_ResolveAlias): Reset aliases if requested. * man/make_html.pl: Don't eat "**" in synopses. 2012-06-25 D. V. Wiebe svn:723 * src/flush.c (_GD_FindVersion): ALIAS means >= 9. * util/checkdirfile.c: Grammar. 2012-06-13 D. V. Wiebe svn:721 GetData-0.8.0rc2. 2012-06-04 D. V. Wiebe svn:720 * bindings/cxx/dirfile.cpp bindings/cxx/fragment.cpp bindings/cxx/getdata/dirfile.h bindings/cxx/getdata/fragment.h: off_t -> gd_off64_t. 2012-06-02 D. V. Wiebe svn:717 * src/internal.h (_GD_AbsPath): Allow s == NULL. 2012-05-25 D. V. Wiebe svn:712 * bindings/cxx/fragment.cpp (Fragment::Fragment Fragment::SetEndianness) bindings/cxx/dirfile.cpp (Dirfile::NFrames Dirfile::EoF Dirfile::BoF Dirfile::GetData Dirfile::PutData Dirfile::FrameNum Dirfile::Seek Dirfile::Tell): Call the 64-bit API. * src/getdata.h.in: Support GD_64BIT_API and use configure to define gd_off64_t. * src/internal.h bindings/cxx/getdata/dirfile.h: Define GD_64BIT_API before including getdata.h. * test/Makefile.am man/Makefile.am: Remove LFS_TRANSITIONAL_API (always enabled). * confihure.ac: Figure out a suitable type for gd_off64_t. Remove LFS_TRANSITIONAL_API conditional. 2012-05-23 D. V. Wiebe svn:710 * test/test.h: Don't redefine isnan if it's okay as-is. * src/open.c (_GD_CreateDirfile): Don't unnecessarily disable mtime acquisition. * cmake/test/CMakeLists.txt: enable desync checks. * src/compat.c (gd_strtod): Fix sign check. 2012-05-22 D. V. Wiebe svn:709 * cmake/CMakeLists.txt: Update definitons. Support GD_UTIL. * cmake/test/CMakeLists.txt: Update the list of excluded tests. * cmake/src/CMakeLists.txt: Support GD_DEBUG and conditionally build debug.c. * cmake/bindings/cxx/CMakeLists.txt: Support GD_TEST. * cmake/util/CMakeLists.txt cmake/bindings/cxx/test/CMakeLists.txt: Added. * src/internal.h: Define PRNsize_t and PRNssize_t to get around printf()s which don't recognise the "z" length modifier. Changed everywhere. Handle basename, offsetof, strtod. * src/compat.c (basename gd_strtod): Added. * src/parse.c (_GD_SetScalar) src/nan.h: Call gd_strtod. * README.win: Update. * bindings/cxx/test/big_test.cpp: Tweak includes to allow compilation with MSVC. * bindings/cxx/getdata/entry.h bindings/cxx/getdata/fragment.h: Include dirfile.h. * test/include_cb.c test/madd_window.c test/open_cb_cont.c test/open_cb_invalid.c test/include_pc.c test/test.h test/open_cb_rescan.c test/open_cb_abort.c test/open_cb_ignore.c: Tweak for compilation with MSVC. * test/add_meta_alias.c test/madd_affix.c test/parse_mplex_nomax.c test/add_meta.c: Fix gd_entry_t access. * util/checkdirfile.c: Preprocessor fixes for compilation with MSVC. 2012-04-21 D. V. Wiebe svn:706 GetData-0.8.0rc1: * bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t: Fix mplex_lookback checks. 2012-04-21 D. V. Wiebe svn:705 * man/make_html.pl: Improvements. * src/globals.c (gd_mplex_lookback): Always succeed; return void. * bindings/perl/simple_funcs.pl: Handle returning void. 2012-04-19 D. V. Wiebe svn:701 * src/add.c (_GD_Add): Don't check protection level before figuring out the fragment index. * bindings/perl/GetData.xs bindings/perl/typemap bindings/perl/simple_funcs.pl: gdpu_spf_t -> gdpu_uint_t. * bindings/perl/GetData.xs (gdp_to_entry entry): Use "in_fields" everywhere to be consistent with the C API. * bindings/perl/GetData.xs (mcarrays): Remove unpacked. Use GIMME_V instead. * bindings/perl/simple_funcs.xsin (reference alter_phase add_window alter_window alter_affixes add_mplex alter_mplex desync flags verbose_prefix): Fix parameter defaults and types. * bindings/perl/Build.PL.in: Install GetData.pm * bindings/perl/simple_funcs.xsin (include include_affex): Deleted. * bindings/perl/GetData.xs (include): Added. * doc/README.perl: Added. * bindings/perl/GetData.pm.in: POD. * bindings/cxx/test/Makefile.am bindings/f77/Makefile.am test/Makefile.am test/error_verbose.c test/error_verbose_prefix.c: Remove GNUisms. 2012-04-13 D. V. Wiebe svn:699 * src/common.c (_GD_CanonicalPath): Terminate and don't clobber string from realpath(). * bindings/make_parameters.c: Add GD_SIE_ENCODED. * bindings/cxx/getdata/fragment.h: Update encodings. * bindings/f77/fgetdata.c (GDTOKE) bindings/f77/getdata.f90.in (fgd_strtok): Drop the 'n' parameter: just do what the C API does. * bindings/idl/getdata.c (gdidl_getdata gdidl_putdata): Drop /HERE: just use the absense of FIRST_FRAME and FIRST_SAMPLE. * bindings/idl/getdata.c (gdidl_add_mplex): Make the MAX parameter optional. 2012-04-01 D. V. Wiebe svn:696 * src/compat.c (_GD_ReadDir): Renamed from gd_readdir(). 2012-04-01 D. V. Wiebe svn:694 * src/getdata.h.in: Deprecate gd_bit_t and gd_spf_t. Remove gd_count_t. * src/getdata.h.in bindings/make_parameters.c: Remove GD_COUNT_MAX. * cmake/CMakeLists.txt: Remove DEFINE_gd_int16_t and DEFINE_gd_uint16_t. * src/internal.h: Calculate GD_INT_TYPE and GD_UINT_TYPE. * src/entry.c (_GD_CalculateEntry) src/flush.c (_GD_FieldSpec) src/getdata.c (_GD_DoMplex) src/putdata.c (_GD_DoMplexOut gd_putdata64) src/del.c (_GD_DeReference) src/parse.c (_GD_ParseMplex _GD_ParseBit) src/mod.c (_GD_Change): Use GD_INT_TYPE when dealing with bitnum, numbits, count_max, and count_val. * src/add.c (gd_add_bit gd_add_sbit gd_add_mplex gd_madd_bit gd_madd_sbit gd_madd_mplex) src/mod.c (gd_alter_bit gd_alter_sbit gd_alter_mplex) bindings/python/pyentry.c (gdpy_entry_setnumbits gdpy_entry_setbitnum gdpy_entry_setcountval gdpy_entry_setcountmax) bindings/cxx/mplexentry.cpp (MplexEntry::MplexEntry MplexEntry::SetCountVal MplexEntry::SetCountMax) bindings/cxx/sbitentry.cpp (SBitEntry::SBitEntry SBitEntry::SetFirstBit SBitEntry::SetNumBits) bindings/cxx/test/big_test.cpp bindings/cxx/bitentry.cpp (BitEntry::BitEntry BitEntry::SetFirstBit BitEntry::SetNumBits) bindings/cxx/getdata/bitentry.h (FirstBit NumBits) bindings/cxx/getdata/entry.h (FirstBit NumBits CountVal CountMax) bindings/cxx/getdata/mplexentry.h (CountVal CountMax) bindings/cxx/getdata/sbitentry.h (FirstBit NumBits) bindings/perl/GetData.xs bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/f77/fgetdata.c (GDADBT GDADSB GDMDBT GDMDSB GDALBT GDALSB) bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry gdidl_add_mplex gdidl_alter_mplex): gd_bit_t, gd_count_t -> int. * src/fpos.c (_GD_Seek) src/getdata.c (_GD_MultiplyData _GD_CMultiplyData _GD_DivideData _GD_CDivideData _GD_WindowData _GD_CDivideData _GD_MplexData _GD_DoLincom _GD_DoMultiply _GD_DoDivide _GD_DoWindow _GD_DoMplex gd_getdata64) src/putdata.c (_GD_MplexOutData gd_putdata64) src/flimits.c (_GD_GetEOF _GD_GetBOF gd_bof64) src/common.c (_GD_LinterpData _GD_LincomData) src/add.c (gd_add_raw) src/spf.c (_GD_GetSPF gd_spf) src/mod.c (_GD_SPFConvert) src/mod.c (gd_alter_entry) src/index.c (gd_framenum_subset64) bindings/python/pyentry.c (gdpy_entry_setspf) bindings/python/pydirfile.c (gdpy_dirfile_getdata) bindings/cxx/rawentry.cpp (RawEntry::RawEntry RawEntry::SetSamplesPerFrame) bindings/cxx/getdata/rawentry.h (SamplesPerFrame) bindings/perl/GetData.xs bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/f77/fgetdata.c (GDADRW GDALRW) util/dirfile2ascii.c: gd_spf_t -> unsigned int. * src/flush.c (_GD_WriteConst) src/mod.c (_GD_AlterScalar): Add missing integer types. * src/parse.c (_GD_ParseMplex): Make count_max optional. * src/getdata.c (_GD_DoMplex) src/add.c (_GD_Add): Handle count_max == 0. * src/getdata.h.in: Mark GD_FLOAT and GD_DOUBLE as deprecated. * src/encoding.c (_GD_FiniRawIO): Handle short writes and IO errors. * src/getdata.c (_GD_DoMplex): use D->lookback to determine how far to search backwards. Also, read data in chunks of size GD_BUFFER_SIZE. * src/open.c (_GD_Open): Initialise D->lookback. * src/globals.c (gd_mplex_lookback): Added. * bindings/cxx/dirfile.cpp (Dirfile::MplexLookback) bindings/perl/simple_funcs.xsin (mplex_lookback) bindings/f77/getdata.f90.in (fgd_mplex_lookback) bindings/f77/fgetdata.c (GDMXLB) bindings/idl/getdata.c (gdidl_mplex_lookback): Added. * src/parse.c (gd_strtok): Renamed from gd_tokenise to avoid regional spelling variations. Bindings renamed accordingly (except for the F77 bindings). * bindings/python/pygetdata.c: Add GD_E_EXISTS exception. * bindings/python/pydirfile.h: Add mplex_lookback and verbose_prefix to gdpy_constant_t. * bindings/python/pydirfile.c (gdpy_dirfile_delete): Delete verbose_prefix. * bindings/python/pydirfile.c (gdpy_dirfile_create): Initialise mplex_lookback and verbose_prefix. * bindings/python/pydirfile.c (gdpy_dirfile_verbose_prefix): Deleted. * bindings/python/pydirfile.c (gdpy_dirfile_getverboseprefix gdpy_dirfile_setverboseprefix gdpy_dirfile_getmplexlookback gdpy_dirfile_setmplexlookback): Added. * bindings/Makefile.am: add src/gd_config.h to the prerequisites of make_parameters. * src/flush.c (_GD_FlushFragment): Write /ENCODING for zzip and zzslim. * src/meta_list.c: Merged into src/field_list.c * src/nmeta.c: Merged into src/nfields.c * src/add.c (_GD_InvalidEntype): Added. * src/internal.h: Add entry_list and entry_list_flags to DIRFILE and private_entry. * src/internal.h (_GD_EntryIndex): Deleted. * src/field_list.c (_GD_EntryIndex _GD_EntryList gd_entry_list): Added. * src/field_list.c (_GD_ListEntry): Handle GD_ENTRIES_... flags. * src/field_list.c (gd_field_list_by_type gd_vector_list gd_field_list gd_mfield_list_by_type gd_mfield_list): Reimplement via gd_entry_list(). * src/nfields.c (_GD_NEntries gd_nentries): Added. * src/nfields.c (gd_nfields gd_nvectors gd_nfields_by_type gd_nmfields gd_nmvectors gd_nmfields_by_type): Reimplement via gd_nentries(). * src/field_list.c (gd_constants gd_carrays gd_strings gd_mconstants gd_mcarrays gd_mstrings): Call _GD_NEntries for counts. * src/entry.c (gd_hide gd_unhide) src/del.c (_GD_Delete) src/include.c (gd_uninclude) src/add.c (_GD_Add): Delete count updates. * src/name.c (_GD_Rename) src/del.c (_GD_Delete) src/include.c (gd_uninclude) src/add.c (_GD_Add _GD_AddAlias): Invalidate metafield lists too. * src/entry.c (_GD_FreeE) src/close.c (_GD_FreeD): Delete entry_lists. * src/globals.c (gd_flags): Don't check GD_INVALID. * bindings/python/pydirfile.c (gdpy_dirfile_nentries gdpy_dirfile_entrylist) bindings/perl/GetData.xs (entry_list) bindings/cxx/dirfile.cpp (Dirfile::NEntries Dirfile::EntryList) bindings/f77/getdata.f90.in (fgd_nentries fgd_entry_name_max fgd_entry_list) bindings/f77/fgetdata.c (GDNENT GDENTX GDENTN): Added. * bindings/idl/getdata.c (gdidl_get_field_list gdidl_get_nfields)): Convert to bindings for gd_entry_list and gd_nentries. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests 237 through 240. * test/elist_alias.c test/elist_hidden.c test/elist_scalar.c test/get_lincom_null.c test/get_mplex_lball.c test/get_mplex_nolb.c test/nentries_alias.c test/nentries_hidden.c test/nentries_scalar.c test/parse_malias_meta.c test/parse_mplex_nomax.c: Added. * man/: Updated. 2012-03-28 D. V. Wiebe svn:691 * src/flush.c (_GD_FieldSpec) src/parse.c (_GD_ParseMplex): Swap order of fields in MPLEX specification. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro test/entry_mplex_scalar.c test/get_mplex.c test/alter_mplex.c test/put_mplex.c test/get_mplex_lb.ctest/entry_mplex.c: Update for Standards change. 2012-03-28 D. V. Wiebe svn:690 * m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Fix test program. * bindings/idl/getdata.c (gdidl_alter_mplex): Fix uninitialised variable. 2012-03-28 D. V. Wiebe svn:689 * m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Added. * src/parse.c src/internal.h: Work around deficiencies in the GCC-3.4 C99 compliance. 2012-03-22 D. V. Wiebe svn:683 * src/sie.c (_GD_SampIndWrite): Fix file size calculation during truncation. * bindings/python/pydirfile.c (gdpy_dirfile_getdata): Make return_type and num_ optional. 2012-03-16 D. V. Wiebe svn:680 * src/globals.c (gd_flags gd_verbose_prefix): Added. * src/errors.c (_GD_SetError): Print verbose prefix, if present. * make_parameters.c: Promote GD_VERBOSE and GD_PRETTY_PRINT. * bindings/cxx/dirfile.cpp (Dirfile::Flags Dirfile::VerbosePrefix) bindings/python/pydirfile.c (gdpy_dirfile_getflags gdpy_dirfile_setflags gdpy_dirfile_verbose_prefix) bindings/perl/simple_funcs.xsin (flags verbose_prefix) bindings/f77/fgetdata.c (GDFLAG GDVBPX) bindings/f77/getdata.f90.in (fgd_flags fgd_verbose_prefix) bindings/idl/getdata.c (gdidl_flags gdidl_verbose_prefix): Added. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests 235, 236. * src/open.c (_GD_Open): Reset errno to prevent spurious error messages. * src/flush.c (_GD_FlushFragment): Avoid FPE. * test/global_flags.c test/error_verbose.c test/error_verbose_prefix.c: Added. * bindings/idl/getdata.c (gdidl_open): Add missing IGNORE_REFS, PRETTY_PRINT, TRUNCSUB. * bindings/f77/fgetdata.c (_GDF_CString): Take care of the malloc'ing rather than forcing the caller to do it. 2012-03-16 D. V. Wiebe svn:678 * src/errors.c src/getdata.h.in: Add GD_E_EXISTS * src/open.c (_GD_CreateDirfile): Replace GD_E_CREAT:GD_E_CREAT_EXCL with GD_E_EXISTS. 2012-03-16 D. V. Wiebe svn:676 * configure.ac bindings/idl/package/configure.ac src/include.h bindings/make_parameters.c bindings/cxx/internal.h bindings/idl/getdata.c test/test.h util/dirfile2ascii.c util/checkdirfile.c: Renamed config.h to gd_config.h to get around lossage in the Perl CORE public headers. * bindings/perl/test: Renamed from t. * bindings/perl/MANIFEST.in: Renamed from MANIFEST. * bindings/perl Makefile.am bindings/f77/test/Makefile.am: VPATH fixes. * src/fragment.c (gd_desync): dup the dirfile fd before closing. * test/desync_reopen.c test/desync_reopen_inv.c: Added. * bindings/idl/package/configure.ac bindings/idl/package/README: Bump GetData min version. 2012-03-15 D. V. Wiebe svn:675 * src/internal.h: Add fragment->mtime, dirfile->open_flags. Deconst fragment->sname. * src/close.c (_GD_FreeD _GD_ShutdownDirfile): Add new parameter (keep_dirfile) to prohibit deallocating the dirfile struct itself. De-staticked _GD_ShutdownDirfile. * src/include.c (_GD_Include): Compute the path relative to the parent of fragment and store it in fragment->sname. Store mtime. * src/close.c (_GD_FreeD): Free fragment->sname. * src/flush.c (_GD_FlushFragment): Remove unnecessary strdup: we already cache the basename. Update mtime. * src/open.c (_GD_CreateDirfile): Return mtime. * src/open.c (_GD_Open): Renamed from gd_cbopen; optionally take an existing dirfd and DIRFILE pointer. Fix the dirfd/dirfile race condition by canonicalising dirfile first. * src/fragment.c (gd_desync) src/open.c (gd_cbopen): Added. * src/getdata.h.in: Added GD_DESYNC_PATHCHECK GD_DESYNC_REOPEN. * test/desync.c test/desync_flush.c: Added. * src/internal.h (offsetof): Added. * src/compat.c (gd_readdir): Added. * src/open.c (_GD_TruncDir): Use a thread-safe readdir where possible. * src/include.c (gd_include_affix): Don't call do stuff before validating the dirfile. * bindings/make_parameters.c: Add desync flags. * bindings/python/pydirfile.c (gdpy_dirfile_desync) bindings/cxx/dirfile.cpp (Dirfile::DeSync) bindings/perl/simple_funcs.xsin (desync) bindings/f77/getdata.f90.in (fgd_desync) bindings/f77/fgetdata.c (GDDSYN) bindings/idl/getdata.c (gdidl_desync): Added. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added test 234. * bindings/cxx/test/big_test.cpp: Functionise to reduce compilation work. * bindings/perl/Makefile.am: Tweak yet some more. 2012-03-14 D. V. Wiebe svn:674 * src/open.c (gd_cbopen): Handle failure of _GD_CanonicalPath better. 2012-03-14 D. V. Wiebe svn:671 * src/flush.c (_GD_FlushFragment): Write SIE encoding directives. * src/sie.c (_GD_SampIndOpen): Initialise file->pos to 0 to avoid issues with _GD_GetFilePos. * src/sie.c (_GD_SampIndSeek): Don't short circuit if no record is loaded. * src/flush.c (_GD_Flush _GD_SyncOrClose): Make syncing optional with a new parameter (syn). * src/flush.c (gd_raw_close): Added. * src/clsoe.c (_GD_ShutdownDirfile) src/include.c (gd_uninclude): Don't sync, just close raw files. * bindings/python/pydirfile.c (gdpy_dirfile_raw_close) bindings/cxx/dirfile.cpp (Dirfile::RawClose) bindings/perl/simple_funcs.xsin (raw_close) bindings/f77/fgetdata.c (GDRCLO) bindings/f77/getdata.f90.in (fgd_raw_close): Added. * bindings/idl/getdata.c (gdidl_flush): Add /NOSYNC. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90: Added test 233. * bindings/perl/Build.PL.in: subclass Module::Build to properly handle simple_funcs.xs dependency tracking. 2012-03-06 D. V. Wiebe svn:667 * src/errors.c: Change prefix on verbose output to "libgetdata". * src/add.c (_GD_FixName): Added. * src/add.c (_GD_Add _GD_AddAlias): Call _GD_FixName. * test/add_alias_meta.c: Added. * src/open.c (_GD_TruncDir): Fix subdirectory truncation. * src/internal.h: Remove conditional defition of AT_SYMLINK_NOFOLLOW. * src/compat.c (gd_StatAt): Check for definition of AT_SYMLINK_NOFOLLOW before use. 2012-03-03 D. V. Wiebe svn:665 * src/getdata.h.in bindings/make_parameters.c: Added GD_TRUNCSUB open flag. * src/open.c (_GD_TruncDir): Added. * src/open.c (_GD_CreateDirfile): Call _GD_TruncDir. * test/trunc_dir.c test/trunc_truncsub.c: Added. * src/fragment.c (gd_alter_affixes): Handle GD_E_ACCMODE and GD_E_PROTECTED errors. * bindings/f77/fgetdata.c (GDDELA): Correct call to gd_delete_alias. 2012-03-02 D. V. Wiebe svn:664 * src/errors.c: Added GD_E_ARGUMENT:GD_E_ARG_NODATA. * src/parse.c (_GD_Tokenise): Take number of columns to return. * src/parse.c (gd_tokenise): Added. * src/internal.h: Added _GD_DIRFILE->tok_pos. * src/parse.c (_GD_CheckParent): Destatickify, and modify for use by _GD_Add. * src/add.c (_GD_Add): Call _GD_CheckParent to automatically allow parent/meta style metafield addition via gd_add[_](). * bindings/python/pydirfile.c (gdpy_dirfile_tokenise) bindings/cxx/dirfile.cpp (Dirfile::Tokenise) bindings/perl/GetData.xs (tokenise) bindings/f77/getdata.f90.in (fgd_tokenise) bindings/f77/fgetdata.c (GDTOKE) bindings/idl/getdata.c (gdidl_tokenise): Added. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add test #232. * bindings/f77/getdata.f90.in (fgd_fragment_affixes): Fix GDFRAF call. * bindings/f77/fgetdata.c (_GDF_SetDirfile _GDF_Callback GDCOPN GDCLBK): Don't cast between data and code pointers. Encapsulate the F77 callback function in a container. * bindings/f77/fgetdata.c (GDNOCB): Added. * bindings/f77/test/gdcopn.f: Add GDCLBK and GDNOCB tests. * test/ascii_get.c test/ascii_put.c test/ascii_get_get.c test/ascii_nframes.c: Delete FOPEN_TEXT. * test/add_meta.c test/add_meta_alias.c: Added. 2012-02-16 D. V. Wiebe svn:658 * src/getdata.c (_GD_DoLincom): Get the correct SPFs. * test/get_lincom_spf.c: Added. * src/open.c (_GD_CreateDirfile): When truncating, don't delete and then recreate the format file; just truncate it. (This helps kst not get confused when monitoring a dirfile which gets truncated.) 2012-02-14 D. V. Wiebe svn:656 svn:657 * src/putdata.c (gd_putdata): Return early if num_samp == 0. * test/put_zero.c: Added. 2012-02-01 D. V. Wiebe svn:652 * configure.ac: Figure out the directory separator (ie. '/' on POSIX). * src/open.c (_GD_CreateDirfile): Handle DIRSEP. * src/internal.h (_GD_Root): Added. * src/common.c (_GD_CanonicalPath): Handle WIN32/DOS paths. * src/open.c (gd_cbopen): Temporarily store the full path in D->name so that _GD_CreateDirfile can use it when needed. * src/spf.c (_GD_GetSPF): De const-ify E. * src/common.c (_GD_FindField): Fix buffer length calculation. * test/file.c test/fragment_name.c bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90: Handle DIRSEP. * bindings/f77/test/test_getdata.f.in: Added. 2012-01-18 D. V. Wiebe svn:650 * src/getdata.h.in src/internal.h: Define GD_ENC_ZZSLIM GD_ZZSLIM_ENCODED. * src/zzslim.c: Added. * src/encoding.c: In the initialisation of _gd_ef, differentiate things that are willing to use the Generic functions from those that aren't. Added zzslim. * src/common.c (_GD_CanonicalPath): Don't truncate on ENOENT. * src/slim.c (_GD_SlimOpen): The slimdopen in slimlib-2.6.5 doesn't interact well with slim's own zzip support, so let's ignore it for now. * bindings/make_parameters.c: Convert F77 encoding parameters to the form GDE_xx. * configure.ac: zzslim tests. Always look for a C++ compiler. * m4/encoding.m4: Separate LIBS from LDFLAGS; fix some underquoting. 2012-01-11 D. V. Wiebe svn:644 * src/getdata.h.in: Added GD_MPLEX_ENTRY. Updated gd_entry_t. Defined GD_COUNT_MAX. * src/legacy.c (CopyMplexEntry) src/getdata.c (_GD_MplexData _GD_DoMplex) src/putdata.c (_GD_MplexOutData _GD_DoMplexOut) src/parse.c (_GD_ParseMplex) src/add.c (gd_add_mplex gd_madd_mplex) src/mod.c (gd_alter_mplex): Added. * src/internal.h: Define GD_MPLEX_LOOKBACK * src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry gd_validate) src/flush.c (_GD_Flush _GD_FieldSpec _GD_FindVersion) src/fpos.c (_GD_GetFilePos _GD_WriteSeek) src/legacy.c (GetFormat) src/getdata.c (_GD_DoField) src/name.c (_GD_InvalidateConst _GD_InvalidateVect) src/native.c (_GD_NativeType) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_ClearDerived _GD_DeReference) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/parse.c (_GD_ParseFieldSpec) src/add.c (_GD_Add) src/spf.c (_GD_GetSPF) src/mod.c (_GD_Change): Handle MPLEX. * src/fpos.c (_GD_Seek): De-statickify. * src/legacy.c (CopyWindowEntry): Report as MPLEX. * src/getdata_legacy.h: Fix mplex list in FormatType. * src/errors.c: Rename GD_E_BAD_ENTRY_* suberrors to GD_E_ENTRY_* for brevity. Added GD_E_FORMAT_MPLEXVAL, GD_E_ENTRY_CNTVAL, GD_E_ENTRY_CNTMAX. * src/field_list.c (_GD_ListEntry): Move the alias check down so that hidden and meta alias are handled properly. * internal.h src/common.c (_GD_Malloc _GD_Realloc _GD_Strdup): Moved from internal.h. * bindings/make_parameters.c: Define MPLEX_ENTRY, E_FORMAT_MPLEXVAL, COUNT_MAX. * bindings/cxx/mplexentry.cpp bindings/cxx/getdata/mplexentry.h: Added. * bindings/python/pyentry.c (gdpy_entry_getcountval gdpy_entry_setcountval gdpy_entry_getcountmax gdpy_entry_setcountmax) bindings/cxx/getdata/entry.h (Entry::CountVal Entry::CountMax) bindings/f77/getdata.f90.in (fgd_add_mplex fgd_madd_mplex fgd_alter_mplex) bindings/f77/fgetdata.c (GDGEMX GDADMX GDMDMX GDALMX) bindings/idl/getdata.c (gdidl_add_mplex gdidl_alter_mplex): Added. * bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_set_entry_from_dict gdpy_entry_getinfields gdpy_entry_setinfields gdpy_entry_getparms) bindings/cxx/entry.cpp (CheckIndex scalar_ok) bindings/cxx/dirfile.cpp (Dirfile::Entry) bindings/cxx/getdata/dirfile.h bindings/perl/GetData.xs (gdp_to_entry entry) bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd) bindings/f77/fgetdata.c (GDASCA GDMDWD) bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry): MPLEX bindings. * bindings/perl/simple_funcs.xsin: Add add_mplex, alter_mplex, madd_mplex. * bindings/perl/simple_funcs.pl: Handle gd_count_t. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests 228-231. * bindings/cxx/windowentry.cpp bindings/cxx/getdata/windowentry.h bindings/idl/getdata.c (gdidl_alter_window): Get rid of Check stuff: just use Input, for consistency. * test/add_mplex.c test/add_mplex_val.c test/alter_mplex.c test/entry_mplex.c test/entry_mplex_scalar.c test/get_mplex.c test/get_mplex_lb.c test/madd_mplex.c test/parse_mplex.c test/parse_mplex_ncols.c test/parse_mplex_scalar.c test/put_mplex.c: Added. 2011-12-31 D. V. Wiebe svn:643 * bindings/python/pyentry.c (gdpy_set_entry_from_dict): Add missing INCREF. 2011-12-29 D. V. Wiebe svn:641 * src/internal.h src/encoding.c (_GD_GenericName): Added fragment->enc_data. Pass enc_data to gd_ef->name. Flag encodings that use enc_data with GD_EF_EDAT. * src/parse.c (_GD_ParseDirective): Allow an optional second parameter to /ENCODING of encoding-specific data. * src/entry.c (_GD_ResolveEncoding): Pass in enc_data. * src/zzip.c (_GD_ZzipName): Use enc_data to specify archive name. 2011-12-29 D. V. Wiebe svn:640 * configure.ac: zzip encoding check. * src/getdata.h.in src/internal.h: GD_ZZIP_ENCODED / GD_ENC_ZZIP; Added name to encoding_t. * src/zzip.c: Added. * src/encoding.c: Add Zzip encoding; gd_ef_name_t. * src/encoding.c (_GD_GenericName): Renamed from _GD_SetEncodedName and pushed down into the encoding framework. * src/encoding.c (_GD_MissingFramework): Handle GD_EF_NAME. * src/encoding.c (_GD_ResolveEncoding): Handle external name functions. * src/entry.c (gd_raw_filename) src/encoding.c (_GD_InitRawIO _GD_RecodeFragment) src/move.c (_GD_MogrifyFile) src/name.c (_GD_Rename) src/del.c (_GD_Delete) src/flimits.c (_GD_GetEOF): Call _gd_ef->name. * test/zzip_get.c test/zzip_get_get.c test/zzip_nframes.c: Added. 2011-12-27 D. V. Wiebe svn:639 * src/add.c (gd_madd_lincom gd_madd_clincom gd_madd_linterp gd_madd_bit gd_madd_sbit gd_madd_multiply gd_madd_phase gd_madd_polynom gd_madd_cpolynom gd_madd_string gd_madd_const gd_madd_carray): Zero entry before initialisation. * src/fragment.c (gd_alter_affixes): Allow {pre,suf}fix == NULL to indicate no change. * src/entry.c (_GD_FreeE): Handle aliases. * src/close.c (_GD_FreeD): Free fragment affixes. * src/debug.c (gd_colnil gd_coladd gd_colsub): Export debugging symbols. * src/field_list.c (_GD_ListEntry): Added. * src/field_list.c (gd_constants gd_carrays gd_strings gd_field_list_by_type gd_vector_list gd_field_list) src/meta_list.c (gd_mconstants gd_mcarrays gd_mstrings gd_mfield_list_by_type gd_mvector_list gd_mfield_list): Call _GD_ListEntry. * bindings/python/pyentry.c bindings/python/pyfragment.c bindings/python/pydirfile.c: Update for DSV9. * bindings/cxx/fragment.cpp bindings/cxx/entry.cpp bindings/cxx/dirfile.cpp bindings/cxx/getdata/entry.h bindings/cxx/getdata/dirfile.h: Update for DSV9. * bindings/cxx/windowentry.cpp bindings/cxx/getdata/windowentry.h: Added. * bindings/perl/GetData.xs bindings/perl/simple_funcs.xsin: Update for DSV9. * bindings/f77/fgetdata.c bindings/f77/getdata.f90.in: Update for DSV9. * bindings/idl/getdata.c: Update for DSV9. Removed most of the function aliases. * bindings/make_parameters.c: Update for DSV9. Add missing GD_E_UNKNWON_ENCODING. * bindings/python/pygetdata.c (initpygetdata): Handle gaps in gdpy_exception_list. Fix exception list. * bindings/python/pyentry.c (gdpy_entry_settable): Set correct parameter. * test/vlist_alias.c: Added. 2011-12-20 D. V. Wiebe svn:638 * src/entry.c (_GD_GetScalar _GD_CalculateEntry) src/common.c (_GD_GetRepr _GD_BadInput _GD_FindFieldAndRepr: Optionally prohibit setting errors (for use by the post-rename update stuff). * src/errors.c: Added GD_E_FORMAT_ALIAS, GD_E_DEL_ALIAS. * src/flush.c (_GD_FieldSpec): Write aliases. Also tweaked to allow slashed metafield specification with DSV7. * src/del.c (_GD_ClearDerived): Handle aliases. * src/parse.c (_GD_CheckParent _GD_ParseAlias _GD_ResolveAlias _GD_UpdateAliases) src/add.c (_GD_AddAlias gd_add_alias gd_madd_alias): Added. * src/parse.c (_GD_ParseFieldSpec): Call _GD_CheckParent. * src/parse.c (_GD_ParseDirective): Use a switch to reduce the number of strcmps done. Handle /ALIAS. * src/parse.c (_GD_ParseFragment): Optionally call _GD_UpdateAliases to resolve aliases. * src/add.c (_GD_Add gd_madd_spec gd_add_spec): Update aliases after addition. * src/common.c (_GD_FindField): Optionally dealias names. * src/del.c (_GD_Delete): Renamed from gd_delete(). * src/del.c (gd_delete gd_delete_alias): Added. * src/name.c (_GD_UpdateScalar _GD_InvalidateConst _GD_UpdateInField _GD_InvalidateVect): Added. * src/name.c (_GD_Rename): Renamed from gd_rename(). Handle cleaning up after the rename. * src/move.c (_GD_Move): Renamed from gd_move(). * src/name.c (_GD_ValidateField): Permit is_dot = NULL. * src/entry.c (gd_alias_target gd_aliases gd_naliases gd_hidden) src/move.c (gd_move gd_move_alias) src/name.c (gd_rename gd_rename_alias): Added. * src/alias.c (gd_fragment_index gd_hide gd_unhide): Call _GD_FindField instead of _GD_FindFieldAndRepr to avoid resolving aliases. As a side effect, these function will no long ignore representation suffices. * src/flush.c (_GD_StringEscapeise): Handle writing slashed meta-fields. * src/spf.c (_GD_GetSPF): Ensure return is zero on error. * test/alias_num_missing.c alias_target_missing.c spf_alias_missing.c alias_list.c del_derived_after.c madd_spec_resolv.c parse_alias_meta.c entry_type_alias.c spf_alias.c name_after_const.c parse_malias_dup.c add_alias.c alias_target.c alias_list_alias.c add_resolv.c spf_alias_meta.c move_alias.c name_after.c parse_meta_jump.c parse_alias_missing.c name_update_const.c madd_alias.c parse_alias_dup.c fragment_index_alias.c add_spec_resolv.c alias_target_alias.c name_update.c hide_hidden.c alias_num_alias.c parse_malias.c parse_alias_code.c parse_alias.c alias_num.c parse_meta_malias.c parse_meta_alias.c alias_list_missing.c: Added. * test/fragment_parent.c: Renamed from test/parent.c. * test/fragment_num.c: Renamed from test/nfragments.c. * test/version_9_write.c: Update. 2011-12-13 D. V. Wiebe svn:637 * test/fragment_affix_alter2.c test/fragment_affix_alter.c test/fragment_affix_dup.c test/fragment_affix.c test/include_affix.c: Added. * src/move.c (_GD_StrCmpNull): Renamed from strcmpnull and de-statickified. * src/name.c (_GD_MungeFromFrag): Added. * src/name.c (_GD_MungeCode): Converted into a swiss army munger handling both enmunging and demunging. Most old, simple, uses of this function now call _GD_MungeFromFrag (which calls this) instead. * src/flush.c (_GD_DeMungeCode): Deleted in favour of the new _GD_MungeCode. * src/fragment.c (gd_fragment_affixes _GD_CheckAffixes _GD_ChangeAffixes gd_alter_affixes): Added. * src/include.c (gd_include_affix): Renamed from gd_include. * src/include.c (gd_include): Added. 2011-12-11 D. V. Wiebe svn:635 * test/add_string_affix.c test/name_affix_bad.c test/move_affix.c test/alter_entry_affix.c test/alter_entry_affix.c test/madd_affix.c test/parse_meta_affix.c test/madd_index.c test/name_affix.c test/alter_mspec_affix.c test/name_dup.c test/parse_meta_implicit_affix.c test/add_affix.c test/alter_spec_affix.c: Added. * test/version_9_strict.c test/version_9_write.c: Expanded. * src/open.c (gd_cbopen): Set errors for _GD_CanonicalPath. * src/errors.c: Distingish missing codes from invalid codes for GD_E_BAD_CODE. * src/name.c (gd_rename): Validate the new name first and then DeMunge it if it's not a meta field. * src/move.c (gd_move): Compose the new field name by remunging it for the new fragment. Also compose the new names of all its metafield early, if necessary. * src/parse.c (_GD_ParseFieldSpec _GD_ParseDirective): Munge field codes before lookup. Also munge the reference field. * src/mod.c (gd_alter_spec gd_malter_spec): The parser will end up reapplying affixes to the field name, so undo that. * src/add.c (_GD_Add gd_add_string gd_add_const gd_add_const gd_madd_string gd_madd_const gd_madd_carray): _GD_Add() returns the added entry on success. This saves a field lookup in the others. * src/add.c (_GD_Add): Munge field name earlier. * src/name.c (gd_rename): Flag fragment as modified. * src/flush.c (_GD_FieldSpec): Properly write /HIDDEN directives. 2011-12-09 D. V. Wiebe svn:634 * test/parse_include_preprefix.c test/version_9_strict.c test/version_9.c test/parse_include_suffix.c test/parse_include_loop.c test/version_9_write.c test/parse_include_sufsuffix.c test/parse_include_prefix.c test/parse_include_prefix_dup.c test/get_phase_affix.c: Added. * test/add_sort.c test/add_scalar_carray.c test/add_code.c test/add_type.c test/add_invalid.c test/put_carray.c test/add_scalar.c test/madd.c test/add_format.c: Remove dirfile before starting. * test/version_8_strict.c: Fix initialisation. * test/version_6_write.c: Test whitespace in field names. * test/test.h: Armour plate macros. * src/internal.h: Add prefix and suffix to gd_fragment_t. * src/name.c (_GD_MungeCode) src/flush.c (_GD_DeMungeCode) src/include.c (_GD_SetFieldAffixes): Added. * src/flush.c (_GD_StringEscapeise): Handle null tokens. Escape spaces rather than assuming the caller will quote the token (which it wasn't doing). * src/entry.c (_GD_GetScalar) src/name.c (gd_rename) src/add.c (_GD_Add) src/commonc. (_GD_BadInput): Munge field code before use. * src/flush.c (_GD_PadField): Demunge field code before writing. * src/flush.c (_GD_WriteConst): Properly demunge and escapeise scalar names. * src/name.c (_GD_ValidateField): This function no longer takes care of malloc'ing. Modified to return integer true on error. * src/name.c (_GD_FlushFragment): Add prefix and suffix to INCLUDE when present. * src/parse.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp _GD_ParseMultiply _GD_ParseRecip _GD_ParseLincom _GD_ParseWindow _GD_ParseDivide _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom _GD_ParseConst _GD_ParseCarray _GD_ParseString): Munge field code on parsing. * include.c (_GD_Include): Handle affixes. * src/common.c (_GD_EntryCmp): Moved from src/internal.h and deinlined, destatickified. Given that the only use of this function is to pass it to qsort, making it static inline only ensured that it got replaced once per translation unit that referred to it. * include.c (_GD_Include): Replaced the old filename comparison stage with a simple recursion counter. * src/parse.c (_GD_Tokenise): Handle token-initial escaped character. Handle "\[ux#]##\...". * src/flush.c (_GD_FindVersion): Prefix or suffix implies DSV >= 9. * src/parse.c (_GD_SetScalar): Handle bad malloc. * src/name.c (_GD_FieldSpec): Properly escapeise input field codes. * src/errors.c: Distinguish GD_E_RECURSE_CODE from GD_E_RECURSE_INCLUDE. * src/internal.h (_GD_Malloc _GD_Realloc _GD_Strdup): Added. * src/commonc. (_GD_MakeFullPath): Set error if requested. * src/common.c (_GD_MakeFullPathOnly): Added. This is a wrapper around _GD_MakeFullPath which ensures the DIRFILE is not modified. Used by the compatibility functions and the slim encoding framework (ie. things that have at best a tenuous connection to the DIRFILE object). * src/internal.h: Define GD_MULTISTANDARD. * src/include.c (_GD_Include): Set GD_MULTISTANDARD if moving into/out of DSV >= 9. * src/open.c (gd_cbopen): If the metadata contain multiple standards, figure out a single one for the whole dirfile. 2011-12-08 D. V. Wiebe svn:633 * test/svlist_hidden.c test/svlist_meta_hidden.c test/hide.c test/flist_hidden.c test/nfields_hidden.c test/parse_version_89.c test/nmeta_type_hidden.c test/parse_version_98.c test/nmeta_vectors_hidden.c test/nmeta_hidden.c test/alter_entry_hidden.c test/parse_version_p8.c test/parse_version_p9.c test/hide_unhide.c test/cvlist_meta_hidden.c test/nfields_type_hidden.c test/vlist_hidden.c test/flist_meta_hidden.c test/vlist_meta_hidden.c test/flist_type_meta_hidden.c test/parse_hidden_meta.c test/cvlist_array_hidden.c test/parse_meta_meta.c test/nfields_vector_hidden.c test/parse_hidden.c test/parse_hidden_field.c test/cvlist_hidden.c test/cvlist_array_meta_hidden.c test/flist_type_hidden.c: Added. * test/nfields_vector.c test/nfields_vector_invalid.c: Renamed from nvectors* * src/parse.c (_GD_ParseDirective): Parse /HIDDEN directives. * src/entry.c (gd_hide gd_unhide): Added. * src/nmeta.c (gd_nmfields gd_nmvectors gd_nmfields_by_type) src/nfields.c (gd_nfields gd_nvectors gd_nfields_by_type) src/field_list.c (gd_constants gd_carrays gd_strings gd_field_list_by_type gd_vector_list gd_field_list) src/meta_list (gd_mconstants gd_mcarrays gd_mstrings gd_mfield_list_by_type gd_mvector_list gd_mfield_list): Compensate for hidden fields. * src/flush.c (_GD_FieldSpec): Write /HIDDEN directives. * src/flush.c (_GD_FindVersion): Consider hidden entries. * src/mod.c (_GD_Change): Prohibit changing hiddenness via gd_alter_entry(). * src/parse.c (_GD_ParseDirective): Forbid a metafield code from appearing as a parent in /META directives. * src/internal.h: Record the number of each type of field, rather than just for the scalar field types. * src/internal.h (_GD_EntryIndex): Added. * src/open.c (gd_cbopen): Initialise D->n[INDEX_ENTRY]. * src/nmeta.c (gd_nmvectors gd_nmfields_by_type) src/nfields.c (gd_nvectors gd_nfields_by_type) src/field_list.c (gd_constants gd_carrays gd_strings gd_field_list_by_type gd_vector_list) src/meta_list.c (gd_mconstants gd_mcarrays gd_mstrings gd_mfield_list_by_type gd_mvector_list): Use type counts. * src/del.c (gd_delete) src/parse.c (_GD_ParseFieldSpec) src/include.c (gd_uninclude) src/add.c (_GD_Add): Update type counts. * src/field_list.c (_gd_entype_index): Deleted. * src/include.c (_GD_Include): Remember incoming Standards Version and parser mode, and restore them on exit if the new DSV >=9 or the old mode is pedantic and the old DSV >= 9. This is an attempt to stave the "version leak" problem experienced in earlier DSVs. * src/internal.h: Renamed GD_E_FORMAT_NO_PARENT to GD_E_FORMAT_NO_FIELD. 2011-12-06 D. V. Wiebe svn:632 * test/get_window_ne.c test/get_window.c test/parse_window_scalar.c test/alter_window.c test/parse_window.c test/madd_window.c test/parse_window_ncols.c test/add_window.c test/put_window.c test/get_window_set.c test/get_window_gt.c test/get_window_ge.c test/parse_window_op.c test/entry_window.c test/entry_window_scalar.c test/add_window_op.c test/get_window_lt.c test/get_window_clr.c test/get_window_le.c: Added. * test/madd_phase.c: Fix check. * test/version_6.c test/version_7.c test/version_8.c: Update for Version 9. * cmake/CMakeLists.txt configure.ac: Define gd_int64_t. * src/getdata.h.in: Add GD_WINDOW_ENTRY, gd_windop_t, gd_triplet_t. * src/entry.c (_GD_FreeE _GD_CalculateEntry gd_entry) legacy.c (GetFormat) src/getdata.c (_GD_DoField) src/errors.c src/flush.c (_GD_Flush _GD_FieldSpec) src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_ClearDerived _GD_DeReference) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/fpos.c (_GD_GetFilePos _GD_Seek) src/parse.c (_GD_ParseFieldSpec) src/field_list.c src/mod.c (_GD_Change) src/add.c (_GD_Add): Update for WINDOW. * src/legacy.c (CopyWindowEntry) src/getdata.c (_GD_WindowData _GD_DoWindow) src/flush.c (_GD_WindopName) src/parse.c (_GD_WindOp _GD_ParseWindow) src/mod.c (gd_alter_window) src/internal.h (_GD_BadWindop) src/add.c (gd_add_window gd_madd_window): Added. * src/flush.c (_GD_WriteConst): Write GD_UINT64. * src/flush.c (_GD_WriteConst): Fix writing of RECIP fields. * src/parse.c (_GD_ParseRecip _GD_ParsePhase): Fail if SetScalar fails. * src/parse.c (_GD_SetScalar): Don't bother trying to decode an imaginary part before failing if we're not interested in complex numbers. * src/parse.c (_GD_SetScalar): Call strto[u]ll with base=0 for Version >= 9 to allow automatic parsing of 0x[hex] and 0[octal] numbers in format files. * src/getdata.h.in: Increment GD_DIRFILE_STANDARDS_VERSION. * src/flush.c (_GD_FindVersion): Update for Version 9. 2011-12-05 D. V. Wiebe svn:630 * python/test/callback.pl python/test/big_test.py cxx/test/big_test.cpp f77/test/big_test.f f77/test/big_test95.f90: Fix path checks. * f77/test/big_test.f f77/test/big_test95.f90: Use check functions. * src/flush.c (_GD_Flush): Don't call sync on a file opened read-only. * configure.ac: Look for Availability.h * src/internal.h: Fix lstat64 on OS X 10.6+ * src/common.c (_GD_CanonicalPath): Don't run past the end of the work buffer. 2011-12-03 D. V. Wiebe svn:629 * test/test.h (CHECKEOS): Added. * test/file.c test/fragment_name.c: Only check the end of the returned string since we don't know what the full path is. * src/internal.h: Define PATH_MAX, if necessary. * src/common.c (_GD_CanonicalPath): Added. * src/open.c (gd_cbopen): Canonicalise filedir. * src/common.c (_GD_MakeFullPath): Canonicalise path. Handle dirfd < 0. * src/common.c (_GD_GrabDir): Let _GD_MakeFullPath hande canonicalising absolute paths. * configure.ac: Check for lstat(3). * src/compat.c (gd_StatAt): Don't use lstat if the platform doesn't have it. * src/internal.h: Move library includes into header. 2011-12-01 D. V. Wiebe svn:628 * src/flush.c (_GD_FlushFragment): Write "/PROTECT data" when appropriate. Bug report from Alexandra Rahlin. 2011-11-13 D. V. Wiebe svn:626 * src/entry.c (gd_raw_filename): Revert r613 changes. * src/gzip.c: Move OOP code out of gzip layer. * src/encoding.c (_GD_FiniRawIO _GD_InitRawIO) src/fpos.c (_GD_WriteSeek): Handle OOP writes. * src/encoding.c (_GD_WriteOut): Added. * src/mod.c (_GD_Change) src/putdata.c (_GD_DoRawOut): Call _GD_WriteSeek and _GD_WriteOut * src/putdata.c (_GD_DoRawOut): Correctly handle write errors. * configure.ac: Fix x86_64 host check. 2011-11-10 D. V. Wiebe svn:622 * configure.ac: Figure out whether unaligned memory access will work. * src/internal.h: Deal with UNALIGNED_ACCESS_OK * src/sie.c (_GD_SampIndWrite): Handle unaligned memory access. 2011-11-08 D. V. Wiebe svn:615 * test/add_scalar_carray.c: Added. * src/add.c (_GD_Add): Copy scalar_ind when copying scalars. Patch from S. J. Benton. 2011-11-08 D. V. Wiebe svn:614 * test/gzip_put_get.c test/gzip_move_to.c test/gzip_add.c test/gzip_get_put.c test/gzip_put.c: Handle TEST_GZIP && !USE_GZIP. * src/encoding.c (_GD_FiniRawIO): Don't change error code if already set. * src/sie.c (_GD_SampIndSize): Fix descriptor leak. 2011-11-05 D. V. Wiebe svn:610 * test/gzip_put_get.c test/ascii_add.c test/get_rofs.c test/gzip_move_to.c test/gzip_add.c test/endian_alter_sie.c test/gzip_get_put.c: Added. * test/gzip_put.c: Update. * m4/encoding.m4: Add a AC_CHECK_FUNCS call. * src/slim.c (_GD_SlimOpen): Update for the (non-existant) slimdopen(). * src/getdata.h.in: Renamed GD_SEEK_PAD to GD_SEEK_WRITE to better reflect its purpose. * bindings/idl/getdata.c (gdidl_seek): Update keywords for same. * src/flush.c (_GD_Flush): Add a third parameter, clo, to distinguish sync from sync-and-close. * src/flush.c (_GD_SyncOrClose): Renamed from gd_flush. * src/flush.c (gd_sync gd_flush): Added. * src/internal.h: Added _gd_raw_file.mode. Replaced encoding_t.ecor with encoding_t.flags; * src/encoding.c: Deleted touch, topen, tmove, tunlink from the encoding framework. Changed signature of open and seek. * src/encoding.c (_GD_MoveOver): Renamed from _GD_GenericTMove. * src/encoding.c (_GD_FiniRawIO) src/fpos.c (_GD_WriteSeek): Added. * src/gzip.c (_GD_GzipOpen _GD_GzipSeek _GD_GzipClose) src/encoding.c (_GD_InitRawIO): Update for out-of-place writes. * src/endian.c (_GD_ByteSwapFragment) src/name.c (gd_rename) src/flush.c (_GD_Flush) src/encoding.c (_GD_RecodeFragment) src/del.c (gd_delete) src/flimits.c (_GD_ShiftFragment): Use _GD_FiniRawIO to clean up. * src/encoding.c (_GD_GenericTouch) src/ascii.c (_GD_AsciiTOpen _GD_AsciiTUnlink) src/sie.c (_GD_SampIndTOpen _GD_SampIndTUnlink) src/raw.c (_GD_RawTOpen _GD_RawTUnlink): Deleted. * src/move.c (_GD_MogrifyFile) src/mod.c (_GD_Change): Use _GD_FiniRawIO and _GD_InitRawIO. * src/parse.c (_GD_ParseFieldSpec) add.c (_GD_Add): Use _GD_InitRawIO for touch. * src/gzip.c (_GD_GzipOpen) src/ascii.c (_GD_AsciiOpen) src/sie.c (_GD_SampIndDoOpen _GD_SampIndOpen) src/raw.c (_GD_RawOpen): Handle temp file opens. * src/putdata.c (_GD_DoRawOut) src/fpos.c (_GD_Seek): Use _GD_WriteSeek. * src/fpos.c (_GD_GetFilePos): Only try to open the file if necessary. * src/gzip.c (_GD_GzipWrite _GD_GzipSync): Added. 2011-10-20 D. V. Wiebe svn:609 * test/get_here_foffs.c test/seek_foffs.c: Added. * src/getdata.c (_GD_DoRaw): Update file->pos after calling FillZero. * src/fpos.c (_GD_GetFilePos): Adjust for SPF. * src/fpos.c (_GD_Seek): If seeking before FRAMEOFFSET, set file->pos < 0. * bindings/python/pydirfile.c (gdpy_dirfile_seek): Fix type of frame_num, sample_num. * bindings/perl/typemap: off64_t is signed. * bindings/f77/fgetdata.c (GDCONS GDMCOS GDSTRS GDMSTS GDSTRX GDMSTX): Added. * bindings/f77/getdata.f90.in (fgd_constants_i1 fgd_constants_i2 fgd_constants_i4 fgd_constants_i8 fgd_constants_r4 fgd_constants_r8 fgd_constants_c8 fgd_constants_c16 fgd_mconstants_i1 fgd_mconstants_i2 fgd_mconstants_i4 fgd_mconstants_i8 fgd_mconstants_r4 fgd_mconstants_r8 fgd_mconstants_c8 fgd_mconstants_c16 fgd_string_value_max fgd_strings fgd_mstring_value_max fgd_mstrings): Added. * bindings/idl/getdata.c (gdidl_getdata gdidl_putdata): Add /HERE. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/perl/t/big_test.t bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added tests 183-204. 2011-10-18 D. V. Wiebe svn:607 * man/gd_seek.3 man/gd_tell.3: Added. * src/spf.c (gd_spf): Throw GD_E_DIMENSION on scalar field specified per documentation. * src/fpos.c (gd_tell64 gd_seek64): Ditto. * src/putdata.c (_GD_DoFieldOut): Don't return on error from _GD_GetFilePos; a better error will be generated later. * bindings/make_parameters.c: Add GD_E_ARGUMENT, GD_SEEK_*, GD_HERE. * bindings/python/pydirfile.c (gdpy_dirfile_seek gdpy_dirfile_tell) bindings/cxx/dirfile.cpp (Dirfile::Seek Dirfile::Tell) bindings/perl/simple_funcs.xsin (seek tell) bindings/f77/fgetdata.c (GDSEEK GDTELL) bindings/f77/getdata.f90.in (fgd_seek fgd_tell) bindings/idl/getdata.c (gdidl_seek gdidl_tell): Added. 2011-10-13 D. V. Wiebe svn:606 * test/entry_divide.c test/entry_recip.c test/get_here.c test/get_heres.c test/put_here.c test/put_heres.c test/seek64.c test/seek_cur.c test/seek_end.c test/seek_set.c test/tell.c test/tell64.c: Added. * test/legacy_put.c test/put_complex128.c test/put_complex64.c test/put_float32.c test/put_float64.c test/put_ff.c test/put_foffs.c test/put_fs.c test/put_int16.c test/put_int32.c test/put_int64.c test/put_int8.c test/put_lincom1.c test/put_linterp.c test/put_linterp_reverse.c test/put_off64.c test/put_phase.c test/put_polynom1.c test/put_recip.c test/put_sf.c test/put_ss.c test/put_uint16.c test/put_uint32.c test/put_uint64.c: Don't perform unnecessary tests in the event the data file wasn't created. * src/getdata.h.in: Combine GD_E_BAD_ENDIANNESS and GD_E_BAD_PROTECTION into GD_ARGUMENT. The former are kept as aliases of the new symbol. * src/endian.c (gd_alter_endianness) src/errors.c src/protect.c (gd_alter_protection): Update for GD_E_ARGUMENT. * src/internal.h: Add .pos to _gd_raw_file. Add .u.index_pos to _gd_private_entry. * src/ascii.c (_GD_AsciiOpen _GD_AsciiSeek _GD_AsciiRead _GD_AsciiTOpen _GD_AsciiTUnlink) src/gzip.c (_GD_GzipOpen _GD_GzipSeek _GD_GzipRead) src/lzma.c (_GD_LzmaOpen _GD_LzmaSeek _GD_LzmaRead) src/sie.c (_GD_SampIndOpen _GD_SampIndSeek _GD_SampIndRead _GD_SampIndWrite _GD_SampIndTOpen) src/raw.c (_GD_RawOpen _GD_RawSeek _GD_RawRead _GD_RawWrite _GD_RawTOpen): Track file position. * src/encoding.c (_GD_InitRawIO): Added. * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Call _GD_InitRawIO. * src/fpos.c: Added. * src/flimits.c (_GD_GetEOF): Publicise. * src/getdata.c (gd_getdata64) src/putdata.c (gd_putdata64): Regularise use of GD_HERE. Also, only call _GD_GetSPF when necessary. * src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Resolve instances of GD_HERE. * bindings/python/Makefile.am bindings/cxx/Makefile.am bindings/f77/Makefile.am: Remove some unnecessary linking. * bindings/idl/package/Makefile.am: Add $(DEFS) to the make_parameters rule to ensure it builds properly. 2011-08-23 D. V. Wiebe svn:600 * test/error_error.c: Simplify test. * test/test.h (CHECKSp): Added. * src/errors.c src/internal.h: Added GD_E_CREAT_OPEN. * src/open.c (_GD_CreateDirfile): Distinguish GD_E_CREAT_DIR from GD_E_CREAT_OPEN. * src/internal.h: When linking to the MSVCRT, define GD_NO_DIR_OPEN to indicate that the MSVCRT's open() prohibits openind directories. (This is referred to as "the non-POSIX case". * src/open.c (_GD_CreateDirfile): Take dirfile, a malloc'd copy instead of filedir itself. In the non-POSIX case, this has the full pathname. Also, handle non-POSIX computation of dirfd. * src/open.c (gd_cbopen): In the non-POSIX case, prepend the CWD to filedir if it's not absolute, and pass that string to _GD_CreateDirfile. Also need to stat the directory in this case, in lieu of trying to open it. * src/close.c (_GD_ShutdownDirfile): Don't try to close the dirfds in the non-POSIX case. * src/common.c (_GD_DirName): In the non-POSIX case, the dirfd parameter simply contains the index into the dir array, so no need to search. * src/common.c (_GD_GrabDir _GD_ReleaseDir): In the non-POSIX case, don't try to open or close the directory: it just contains the index into dir, so no need to search for it either. * src/compat.c (gd_OpenAt): Or flags with O_BINARY for operation on Win32. * src/open.c (gd_cbopen): Close dirfd on error. * src/bzip.c (_GD_Bzip2Seek): Return -1 on error. * src/internal.h (_GD_AbsPath): Added. * src/internal.h (gd_swap64): Fix doubled backslashes. * configure.ac: Fix perl check to properly exclude the bindings when necessary. 2011-08-20 D. V. Wiebe svn:599 * src/open.c (gd_cbopen): Properly initialise bname; also check for malloc errors. * sie/sie.c (_GD_SampIndWrite): Update the current record to reflect the updated position of the file pointer. 2011-08-20 D. V. Wiebe svn:597 * src/internal.h: Added bname to fragment struct holding the basename of the file. * src/open.c (gd_cbopen) src/include.c (_GD_Include): Initialise fragment->bname. * src/close.c (_GD_FreeD) src/include.c (gd_uninclude): Deallocate fragment->bname. 2011-08-19 D. V. Wiebe svn:596 * src/open.c (gd_invalid_dirfile gd_cbopen): If allocating the DIRFILE itself fails, return NULL instead of segfaulting. * src/nmeta.c (gd_nmfields_by_type): Throw GD_E_BAD_ENTRY on encountering GD_NO_ENTRY. * src/index.c (gd_framenum_subset64): Throw GD_E_DIMENSION if the caller supplies the field code for a scalar. * src/errors.c: Added GD_E_BOUNDS and GD_E_LINE_TOO_LONG. * src/encoding.c (_GD_ResolveEncoding): Don't segfault on malloc error. * src/flimits.c (_GD_GetBOF): Throw GD_INTERNAL_ERROR instead of GD_E_BAD_FIELD_TYPE when encountering GD_NO_ENTRY. * src/parse.c (_GD_UTF8Encode): Renamed from utf8encode for consistency. * src/sie.c (_GD_SampIndTUnlink) src/include.c (gd_uninclude): Use gd_UnlinkAt instead of bare unlink(). * man/make_html.pl: Handle multiparagraph .TPs. 2011-08-11 D. V. Wiebe svn:595 * src/internal.h: In cases where no explicitly 64-bit stat struct can be found, don't bother trying to use explicitly 64-bit stat functions. 2011-08-11 D. V. Wiebe svn:594 * test/sie_nframes_big.c test/sie_get_big.c test/sie_get_little.c test/sie_nframes_little.c test/sie_move_to.c test/sie_put_little.c test/sie_move_from.c test/sie_put_big.c: Added. * configure.ac src/internal.h: Handle missing fstat64, ftruncate64, and byte swapping routines. * src/internal.h src/errors.c: Differentiate GD_E_UNKNOWN_ENCODING errors arising from existing, unknown encodings on disk from errors arising from attempts to convert to an unknown encoding. * src/endian.c (_GD_FixEndianness): Use standard system byte-swapping routines, where possible, with the assumption that they're not slower than our old implementation. * src/encoding.c: Redo the way _gd_ef is initialised to try and make it a little easier to maintain. * src/internal.h: In struct _gd_raw_file, rename .fp to .idata and .encoding to .subenc to reduce code obfuscation. * src/encoding.c: Added SIE encoding hooks. * src/sie.c: Added. * src/internal.h (_GD_FileSwapBytes): Added. * src/internal.h: _gd_ef->open(), ->size(), ->touch(), and ->topen() now take a "swap" parameter, indicating whether bytes are opposite-endian. * src/internal.h: Split _gd_ef->temp() into ->topen, ->tmove, and ->tunlink. Also typedef all the framework method prototypes. * src/ascii.c (_GD_AsciiTOpen _GD_AsciiTUnlink) src/raw.c (_GD_RawTOpen _GD_RawTUnlink): Added. * src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Deleted. * src/encoding.c (_GD_GenericTMove): Added. * src/endian.c (_GD_ByteSwapFragment) src/encoding.c (_GD_MissingFramework _GD_RecodeFragment) src/move.c (_GD_MogrifyFile) src/flimits.c (_GD_ShiftFragment) src/mod.c (_GD_Change): Replace _gd_ef->temp() calls with t{open|move|unlink} calls. * src/move.c (_GD_MogrifyFile) src/mod.c (_GD_Change): Call _GD_MakeTempFile before calling _gd_ef->topen. 2011-08-10 D. V. Wiebe svn:593 * bindings/perl/t/big_test.t: Convert to TAP. 2011-06-13 D. V. Wiebe svn:588 * src/errors.c: Don't append strerror to the GD_E_CREAT_EXCL message. * m4/perl.m4: Fix perl CFLAGS. 2011-05-05 D. V. Wiebe svn:587 * src/open.c (_GD_CreateDirfile): Handle missing fdopendir. 2011-05-05 D. V. Wiebe svn:586 * src/internal.h: The encoding framework has changed: open, touch, size, move, unlink, and temp now all take the dirfd. Furthermore, to allow operation on non-POSIX.1-2008 systems, we hide the DIRFILE pointer in _gd_raw_file, so callback can be made to the compatibility layer. All framework callers have been updated to pass dirfds. fragment->sname is no longer malloc'd and is now marked const; also, fragments now carry their dirfd. D->dir and D->ndir added. * src/encoding.c (gd_MakeTempFile) src/compat.c (gd_OpenAt gd_RenameAt gd_StatAt gd_StatAt64 gd_UnlinkAt) src/common.c (_GD_DirName _GD_MakeFullPath _GD_GrabDir _GD_ReleaseDir): Added. * src/open.c (gd_cbopen): Open the dirfile directory as soon as possible, then work as much as possible with the descriptor instead of the path itself. * src/open.c (_GD_CreateDirfile): Use the dirfd produced by cb_open() instead of relying on the pathname except with GD_CREAT. As a side effect, no longer need to compute fullname when truncating. * src/entry.c (_GD_FreeE): Release LUT directory. This requires passing the DIRFILE to this function. * src/close.c (_GD_FreeD): Don't free fragment->sname (it's no longer malloc'd). Free D->dir. * src/close.c (_GD_ShutdownDirfile): Close all open directories. * src/flush.c (_GD_FlushFragment): Call gd_MakeTempFile instead of mkstemp. * src/encoding.c (_GD_SetEncodedName): set file->D to the DIRFILE pointer, so the encoding framework has access to it. * src/encoding.c (_GD_ResolveEncoding): Take dirfd for I/O purposes. * src/move.c (_GD_MogrifyFile): Consider changes in dirfd. * src/parse.c (_GD_ParseRaw): E->e->u.raw.filebase is a copy of E->field now, (and could be removed, except we'll need it shortly). The fragment index (me) is no longer needed in this function. * src/mod.c (_GD_Change): Release the LUT directory if it changes. * src/include.c (_GD_Include): Open the grab the included fragment's directory and store it in fragment->dirfd. fragment->sname is now just the value returned by _GD_DirName, and not malloc'd. * src/include.c (gd_uninclude): Release the directory. * src/compat.c (mkstemp _GD_Rename): Removed. * src/common.c (_GD_SetTablePath): Open the directory. table_path is replaced with table_file. * src/encoding.c (_GD_GenericTouch _GD_GenericUnlink _GD_GenericMove) src/slim.c (_GD_SlimOpen _GD_SlimSize) src/gzip.c (_GD_GzipOpen _GD_GzipSize) src/ascii.c (_GD_AsciiOpen _GD_AsciiSize _GD_AsciiTemp) src/lzma.c (_GD_LzmaOpen _GD_LzmaSize) src/bzip.c (_GD_Bzip2Open _GD_Bzip2Size): Update for changes in the encoding framework. * src/slim.c (_GD_SlimOpen _GD_SlimSize): Slimlib doesn't accept file descriptors, so compute the full path before calling it. This has the potential for breakage. * src/gzip.c (_GD_GzipOpen _GD_GzipSize): Use gzdopen instead of gzopen. * src/lzma.c (_GD_LzmaDoOpen) src/bzip.c (_GD_Bzip2DoOpen): Use dirfd to create stream. * src/legacy.c (_GD_GetDirfile) src/name.c (gd_rename) src/encoding.c (_GD_MissingFramework _GD_ResolveEncoding) src/move.c (gd_move) src/include.c (_GD_Include) src/add.c (_GD_Add): Remove the FILENAME_MAX crutch. * src/add.c (_GD_Add): Fix memory leak of new_ref. * src/entry.c (gd_raw_filename): Return a malloc'd string. * configure.ac: Fix am__fastdepCXX_* for --disable-cplusplus. This is presumably a autotools bug. Look for ...at() functions. 2011-04-21 D. V. Wiebe svn:581 * bindings/python/pydirfile.c (gdpy_dirfile_geterrorcount): Added. * bindings/cxx/dirfile.cpp (Dirfile::ErrorCount): Added. * bindings/f77/fgetdata.c (GDECNT): Added. * bindings/f77/fgetdata.f90.in (fgd_error_count): Added. * bindings/idl/getdata.c (gdidl_error_count): Added. * bindings/perl/GetData.xs (gdp_to_entry): Fix initialisation of n for LINCOM and POLYNOM. * bindings/perl/GetData.pm.in: add constants and functions export tags. * bindings/make_parameters.c (Perl): Don't insert unnecessary newlines. * bindings/perl/Makefile.am: Use perl to generate funclist.sed. 2011-04-20 D. V. Wiebe svn:580 * test/error_num.c: Added. * src/errors.c (gd_error_count): Added. * man/gd_error_count.3: Added. 2011-04-06 D. V. Wiebe svn:574 * test/: Remove the unnecessarily baroque (rococo?) __TEST__ macro. Add rmdirfile() to the top of each test before creating the test dirfile. Shift definitions to the top of the files for C89 compliance. A few other minor fixes. * cmake/test/CMakeLists.txt: Remove __TEST__ (and __TEST_SLASH__?); no longer needed. * src/mod.c (gd_alter_crecip89): Accept cdividend=NULL for cdividend=(0,0) 2011-04-05 D. V. Wiebe svn:573 Merge in updates from 0.7 branch, r512 and subsequent: * test/alter_crecip_zero.c test/alter_recip_zero.c: Added. * src/mod.c (_GD_Change): If [c]dividend is zero, don't change it, per documentation. * src/encoding.c (_GD_MissingFramework): Properly compute the module path. * src/flush.c (_GD_FieldSpec): For Standards Version >= 8, use new-style metafield syntax. * src/entry.c (gd_raw_filename): Clear dirfile error on entry. * test/move_data_enc_ar.c test/entry_phase.c test/get_ss.c test/alter_raw_type.c: Actually fail on error. * m4/version.m4 configure.ac: Fix library soversion defines. * m4/python.m4: Use the BSD `jot' if the Linux/Plan 9 `seq' is not found. Also, look for python2.7. Added --with-python-module-dir. * src/add.c (_GD_Add): strdup ref_name when propagating upwards to prevent double-free when _GD_FreeD() is called. * test/add_raw_include.c: Added. * src/include.c (gd_include): If GD_CREAT is specified, but no encoding, inherit encoding from parent. * test/test.h: Explicitly use long long format types in the checks. Write paths properly under WIN32/WIN64. * src/legacy.c (GetFormat): Fix memset call. * src/common.c (_GD_GetLine): Remove unused first_char. * src/raw.c (_GD_RawSeek): nread is a ssize_t. * bindings/python/pydirfile.c (gdpy_dirfile_putcarray): Remove unused ns. * bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/f77/test/gdcopn.f bindings/f77/getdata.f90.in: Explicity specify constant kinds to stop the ridiculous complaints from Fedora's gfortran. * bindings/idl/Makefile.am: Don't needlessly rebuild sublist.c. * src/getdata.h.in: Replace #undefs with @DEFINE_...@ tokens. Define gd_off64_t instead of polluting the namespace. Remove MSCRT specal casing for the gd_*int*_t types. * configure.ac: Update for changes to getdata.h.in. Run getdata.h.in through config.status twice, first as an AC_CONFIG_FILE to replace all the @DEFINE...@s, second as an AC_CONFIG_HEADER as a NOP, just to get the change check. * cmake/CMakeLists.txt: Add DEFINE_... variables. * configure.ac: Check for _strtoi64() and _strtoui64() * src/internal.h: Use MSCRT's _strto[u]i64 for strto[u]ll when found. * cmake/CMakeLists.txt: Add -DHAVE__STRTOI64 -DHAVE__STRTOUI64 * test/parse_include_absrel.c test/parse_include_relabs.c test/parse_include_absolute.c: Free cwd. * configure.ac: check for "slimdata" in addition to "slim", which is what the binary is called under Fedora. * m4/encoding.m4 (GD_CHECK_ENCODING): Handle multiple binary names in $5 and $6. * src/parse.c (_GD_ParseFieldSpec): Fix GD_E_FORMAT_DUPLICATE error data. * src/internal.h: Define S_ISREG and S_ISDIR if missing. * test/parse_include_absolute.c test/parse_include_absrel.c test/parse_include_relabs.c test/parse_include_relrel.c: Added. * src/include.c (_GD_Include): Handle absolute paths in /INCLUDE directives. The sname now contains D->name when appropriate. * src/add.c (_GD_Add) src/parse.c (_GD_ParseRaw) src/move.c (gd_move): Fix computation of filebase for new sname. 2011-03-25 D. V. Wiebe svn:566 * src/perl.m4: Added. * configure.ac: Perl tests. * bindings/make_parameters.c (Perl): Added. * Bindings/perl: Added. 2011-03-25 D. V. Wiebe svn:561 * util/checkdirfile.c: Zero-terminate option list. Patch from Matthew Truch. 2011-03-22 Peter Kümmel svn:538 * merge from 0.7 branch strtoll/strtoull replacement with gd_* functions 2011-03-17 Peter Kümmel * use _stat64 and struct _stat64 with msvc * fix tests by removing the content of dirfile * guard definitions of macros in C++ binding * build tests with C89 API 2011-03-03 D. V. Wiebe svn:510 * m4/idl.m4: Munge IDL_LIBS to convert "-m " into "-m" since libtool seems to delete if that's not the case. * m4/version.m4: Added. * bindings/idl/package: Added. * bindings/idl/Makefile.am bindings/idl/getdata.c: Update for external build. * configure.ac: Shipped version stuff off into m4/version.m4 * Makefile.am: Add rules for making idl_getdata package. * bindings/idl/makedlm.sh.in: Handle missing keyword "KEYWORD" better. 2011-02-26 D. V. Wiebe svn:507 * m4/python.m4 m4/encoding.m4 m4/idl.m4 configure.ac: Fix double quoting of brackets. * m4/win32.m4 m4/idl.m4: Fix some non-critical errors for OS X 10.5. * src/configure.ac: Added --with-module-dir. * src/Makefile.am: Install modules in $moduledir. -DGETDATA_MODULEDIR. * src/encoding.c (_GD_MissingFramework): Look for modules in GETDATA_MODULEDIR, but fall back to the default searchpath if that fails. Also removed support for unversioned modules. * bindings/python/test/big_test.py: Instead of whining, just delete the dirfile at the end. * src/encoding.c (_GD_MissingFramework): Release the mutex and zero _gd_ef[].provides on failure to find a module. 2010-12-13 Peter Kümmel svn 499 - 504 * cmake folder: CMake build system for Windows using MinGW or MS Visual Studio * src/msvc: files not available in MSVC, patched MinGW files * src/getdata.h.in: patches for MinGW and MSVC 2010-12-08 D. V. Wiebe svn:498 * src/getdata.h.in: Add meaningless stuff after #undef's to appease msys's config.status. 2010-12-08 D. V. Wiebe svn:497 * m4/encoding.m4: Replace TEST_ AM_CONDITIONALs with a preprocessor symbols. * test/Makefile.am: Remove TEST_ conditionals. * test/gzip_move_from.c test/bzip_get_get.c test/gzip_get_get.c test/gzip_get.c test/xz_nframes.c test/slim_nframes.c test/lzma_nframes.c test/slim_get.c test/lzma_get.c test/bzip_move_from.c test/xz_get.c: If helper binaries are unavailable, just skip these tests. * test/test.h: MSVC mkdir() patch from Peter Kümmel. 2010-12-07 D. V. Wiebe svn:494 MSVC fixes from Peter: * test/*.c: Remove unistd.h include. (It will be included in internal.h when needed.) * src/flush.c: No need to make the GD_VERS_* macros long longs. * src/putdata.c (_GD_DoConstOut): Cast to char* before performing pointer arithmetic. * src/mod.c (_gd_max): Renamed from max for better encapsulation. * src/internal.h: Conditionalise inclusion of non-ANSI unistd.h and stdint.h. Various _MSC_VER specific code. Also, define gd_stat64 and gd_stat64_t to plausibly useful things by default. * src/getdata.h.in: Remove unistd.h. Add math.h and some _MSC_VER specific code. (There are still unresolved MSVC issues with this file.) * bindings/cxx/*.cpp: Fix constructor inhertiance. * configure.ac: Check for unistd.h and stdint.h. 2010-12-06 D. V. Wiebe svn:493 GetData-0.7.1 released. 2010-11-30 D. V. Wiebe svn:488 GetData-0.7.1rc1: * src/del.c (gd_delete): Fix order of tests to avoid accessing out-of-bounds memory. * src/parse.c (_GD_ParseDirective): Don't update the version list if _GD_Include failed. * src/common.c (_GD_GetRepr): Don't attempt to find a representation suffix on field codes which are too short to contain them. * src/add.c (_GD_Add): Zero memory allocated for a CARRAY or CONST so behaviour is deterministic when creating these fields via gd_[m]add(). 2010-11-28 D. V. Wiebe svn:487 * src/ test/ bindings/: Separate declarations from statements; * src/common.c (_GD_SetTablePath): Don't use fixed length buffers. 2010-11-27 D. V. Wiebe svn:486 * bindings/cxx/test/big_test.cpp: Delete stuff. 2010-11-27 D. V. Wiebe svn:485 * test/alter_polynom_coeff.c test/include_ignore.c test/alter_entry.c test/entry_linterp.c test/entry_multiply.c test/move_data_enc_ar.c test/gzip_move_from.c test/include_ref.c test/global_name.c test/entry_phase.c test/move_data_foffs.c test/entry_raw_scalar.c test/alter_entry_scalar3.c test/move_data_endian.c test/move.c test/entry_raw.c test/move_data_nop.c test/alter_entry_scalar4.c test/entry_polynom_scalar.c test/move_index.c test/header_complex.c test/alter_entry_recode.c test/entry_bit_scalar.c test/entry_scalar_repr.c test/entry_polynom.c test/file.c test/entry_lincom.c test/name_move.c test/fragment_name.c test/move_data_enc_ra.c test/move_protect.c test/alter_entry_scalar2n.c test/move_subdir.c test/entry_lincom_scalar.c test/entry_phase_scalar.c test/alter_crecip89.c test/bzip_move_from.c test/move_meta.c test/name.c test/entry_bit.c test/alter_entry_scalar2a.c test/alter_linterp.c test/global_ref_set.c test/global_ref.c test/include_auto.c: Free strings. * test/trunc_rofs.c test/open_notdirfile.c test/open_nonexistent.c: Close dirfiles. * src/entry.c (_GD_FreeE): Free LUT. * src/open.c (_GD_CreateDirfile): Close DIR after truncation. * src/close.c (_GD_FreeD): Free dot list. * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Free databuffer on error. * src/lzma.c (_GD_LzmaSize) src/bzip.c (_GD_Bzip2Size): Close file. * src/move.c (_GD_MogrifyFile): Free new_filebase if necessary. * src/parse.c (_GD_ParseFieldSpec): Free entry on duplicate field name. * src/mod.c (_GD_Change): Transfer the old file structure to the new entry in the case of RAW fields. Don't forget to free the old CONST storage, if necessary. * src/include.c (gd_include): Always free ref_name. * src/raw.c (_GD_RawTemp): Call the right close function on error. * src/mod.c (gd_alter_crecip89): For some reason, intialise scalar_ind[0]. * src/parse.c (_GD_ParseFragment _GD_ParseFieldSpec): Handle GD_IGNORE_DUPS inside _GD_ParseFieldSpec, which eliminates the spurious error message if GD_VERBOSE is given. 2010-11-26 D. V. Wiebe svn:484 * test/ascii_get_get.c: Added. * src/ascii.c (_GD_AsciiRead): Update fp as necessary so we don't get lost. * bindings/python/pygetdata.c (gdpy_convert_from_pylist): Don't type-pun the return array into a gdpy_quadruple_value. * src/open.c (gd_cbopen): Don't allocate error string buffers. * src/errors.c (_GD_SetError): Use strdup to copy error strings. * bindings/f77/fgetdata.c (GDASCA): Clean-up. * src/del.c (gd_delete): Alloc the correct del_list for metafields. * src/common.c (_GD_GetLine): Deallocate the line before returning NULL. * src/entry.c (_GD_FreeE): Free p.meta_entry when appropriate. * src/nan.h: Added. * src/internal.h: Removed NAN code. * util/dirfile2ascii.c: Add missing -u option. Allow cart-before-horse arguments (ie. "dirfile2ascii -e field dirfile"). Handle running past the end-of-field nicelier (added -z option). Complain on no dirfile. 2010-11-22 D. V. Wiebe svn:480 GetData 0.7.0 released. 2010-11-20 D. V. Wiebe svn:478 * bindings/idl/getdata.c: Properly terminate IDL keyword lists. 2010-11-17 D. V. Wiebe svn:476 * bindings/python/pydirfile.c (gdpy_dirfile_init) bindings/cxx/getdata/dirfile.h: Open dirfiles read-only by default (for compatibility with the C API. 2010-11-16 D. V. Wiebe svn:475 * bindings/python/pydirfile.c (gdpy_dirfile_getdata): If neither num_samples or num_frames are specified, raise ValueError. 2010-11-06 D. V. Wiebe svn:473 GetData-0.7.0rc4: * src/errors.c (_GD_SetError): Rename variable.o * bindings/python/pygetdata.c (gdpy_type_from_npytype): Explicitly cast the computed types. 2010-11-06 D. V. Wiebe svn:472 * src/ascii.c (_GD_AsciiOpen _GD_AsciiSize _GD_AsciiTemp) src/common.c (_GD_ReadLinterpFile): Open text files in binary mode. * src/internal.h: Define EOVERFLOW if necessary. Also handle missing fseeko64 and ftello64. * src/compat.c (getdelim): Work around the bizarre behaviour of MSVCRT's standard I/O. 2010-11-06 D. V. Wiebe svn:470 * src/getdata.h.in: Rename 'cons' to 'scalar' in the unified entry struct. * src/internal.h: Remove GD_ANON from the private entry struct. 2010-11-06 D. V. Wiebe svn:469 * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added tests 158 through 181. * test/put_carray_slice.c test/cvlist_array_meta.c test/del_carray.c test/get_carray_slice.c test/cvlist_array.c test/del_carray_deref.c test/nmeta_vectors_del.c test/get_carray.c test/parse_carray.c test/madd_carray.c test/add_carray.c test/put_carray.c test/get_carray_len.c test/parse_carray_long.c test/alter_carray_len.c test/alter_carray_type.c: Added. * test/madd.c: Remove gd_get_constant call. * test/parse_const.c: Actually test what is advertised. * bindings/python/pydirfile.c (gdpy_dirfile_getcarray gdpy_dirfile_carraylen gdpy_dirfile_carrays gdpy_dirfile_mcarrays gdpy_dirfile_putcarray) bindings/python/pyentry.c (gdpy_entry_getarraylen gdpy_entry_setarraylen): Added. * bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_set_entry_from_dict gdpy_entry_getinfields gdpy_entry_getdatatypename gdpy_entry_getdatatype): Update for CARRAY. * bindings/cxx/bitentry.cpp (BitEntry::ScalarIndex) bindings/cxx/entry.cpp (scalar_ok Entry::ScalarIndex Entry::SetScalar) bindings/cxx/lincomentry.cpp (LincomEntry::ScalarIndex) bindings/cxx/dirfile.cpp (Dirfile::Carrays Dirfile::CarrayLen Dirfile::MCarrays Dirfile::GetCarray Dirfile::PutCarray) bindings/cxx/polynomentry.cpp (PolynomEntry::ScalarIndex) bindings/cxx/sbitentry.cpp (SBitEntry::ScalarIndex) bindings/cxx/getdata/rawentry.h (ScalarIndex) bindings/cxx/getdata/recipentry.h (ScalarIndex): Added. * bindings/cxx/bitentry.cpp (BitEntry::SetFirstBit BitEntry::SetNumBits) bindings/cxx/lincomentry.cpp (LincomEntry::SetScale LincomEntry::SetOffset) bindings/cxx/polynomentry.cpp (PolynomEntry::SetCoefficient) bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift) bindings/cxx/sbitentry.cpp (SBitEntry::SetFirstBit SBitEntry::SetNumBits) bindings/cxx/recipentry.cpp (RecipEntry::SetDividend): Call Entry::SetScalar. * bindings/cxx/entry.cpp (Entry::Scalar): Call scalar_ok. * bindings/cxx/carrayentry.cpp bindings/cxx/getdata/carrayentry.h: Added. * bindings/cxx/dirfile.cpp (Dirfile::ErrorString): Let the C library malloc the string. Also added a prototype with no parameters. * bindings/f77/fgetdata.c (GDGECA GDADCA GDGTCA GDGCAS GDCALN GDPTCA GDPCAS GDALCA): * bindings/f77/fgetdata.c (GDGTCO GDPTCO): Removed the returned integer. * bindings/f77/fgetdata.c (GDGSCA GDASCA): Deal with scalar index. * bindings/f77/getdata.f90.in (fgd_get_constant_n fgd_get_constant_i1 fgd_get_constant_i2 fgd_get_constant_i4 fgd_get_constant_i8 fgd_get_constant_r4 fgd_get_constant_r8 fgd_get_constant_c8 fgd_get_constant_c16 fgd_put_constant_i1 fgd_put_constant_i2 fgd_put_constant_i4 fgd_put_constant_i8 fgd_put_constant_r4 fgd_put_constant_r8 fgd_put_constant_c8 fgd_put_constant_c16): Convert to subroutines. * bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry): Update for CARRAY. * bindings/f77/getdata.f90.in (fgd_get_carray_n fgd_get_carray_i1 fgd_get_carray_i2 fgd_get_carray_i4 fgd_get_carray_i8 fgd_get_carray_c16 fgd_put_carray_i1 fgd_put_carray_i2 fgd_put_carray_i4 fgd_put_carray_i8 fgd_put_carray_r4 fgd_put_carray_r8 fgd_put_carray_c8 fgd_put_carray_c16 fgd_carray_len fgd_add_carray fgd_madd_carray fgd_alter_carray): Added. * bindings/idl/getdata.c (gdidl_make_idl_entry): Update for CARRAY. * bindings/idl/getdata.c (gdidl_add_const): fix handling of data values * bindings/idl/getdata.c (gdidl_add_carray gdidl_alter_carray gdidl_get_carray gdidl_carray_len gdidl_put_carray): Added. * bindings/idl/getdata.c (gdidl_getdata): Free data on error. * bindings/idl/getdata.c (gdidl_get_constant): Free data on return. * src/interna.h: Replace the const data union with a void pointer. * src/getdata.h.in: Define GD_MAX_CARRAY_LENGTH. * src/common.c (_GD_GetLine): Call getdelim. Return string length not string itself. * src/parse.c (_GD_ParseFragment): Handle n_cols < 2. Raise GD_E_LINE_TOO_LONG on overflow. * src/parse.c (_GD_ParseFragment) mod.c (gd_alter_spec gd_malter_spec) src/add.c (gd_add_spec gd_madd_spec): Don't provide buffers for instring and outstring: they will be malloc'd by others. * src/parse.c (_GD_Tokenise): Dynamically allocate outstring. Also, remember position, so tokenising can resume. * src/parse.c (_GD_ParseFieldSpec _GD_ParseDirective): Pass through tok_pos and outstring. * src/compat.c (getdelim): Added. * src/parse.c (_GD_ParseFragment): Permit the parser callback to re-malloc pdata.line. Also pass it the current length of pdata.line. * src/entry.c (_GD_FreeE) src/nmeta.c (gd_nmvectors gd_nmfields_by_type) src/close.c (_GD_FreeD) src/flush.c (_GD_FieldSpec) src/nfields.c (gd_nvectors gd_nfields_by_type) src/native.c (_GD_NativeType) src/del.c (gd_delete) src/parse.c (_GD_ParseFieldSpec) src/mod.c (_GD_Change) src/add.c (_GD_Add): Update for CARRAY. * src/getdata.c (_GD_DoConst) src/putdata.c (_GD_DoConstOut) src/flush.c (_GD_WriteConst): Handle both CONST and CARRAY. * src/constant.c (gd_get_carray_slice gd_get_carray gd_carray_len gd_put_carray_slice gd_put_carray) src/parse.c (_GD_ConstType _GD_ParseCarray) gd_field_lists (gd_carrays) src/mod.c (gd_alter_carray) src/meta_list.c (gd_mcarrays) src/add.c (gd_add_carray gd_madd_carray): Added. * src/parse.c (_GD_ParseConst): Storage for constant value is now dynamic. * src/del.c (gd_delete): Update parent when deleting a metafield. * src/ascii.c (_GD_AsciiSize) src/common.c (_GD_ReadLinterpFile): Call getdelim. * src/flush.c (_GD_FlushFragment): Skip writing and /ENCODING directive if not known. * src/errors.c (gd_error_string): malloc a suitably sized buffer for the string if passed buffer=NULL. * src/name.c (gd_rename) src/del.c (gd_delete) src/include.c (gd_uninclude): Invalidate the field lists. * src/flush.c (_GD_StringEscapeise _GD_PadField) _GD_FieldSpec: Write directly to the stream, rathen than an intermediate buffer. * src/entry.c (_GD_GetScalar) parse.c (_GD_SetScalar) src/mod.c (_GD_AlterScalar): Handle the scalar index. * src/legacy.c (_GD_CopyGlobalError): Dynamically handle error strings, rather than using _GD_GlobalErrorString and _GD_GlobalErrorFile. 2010-10-28 D. V. Wiebe svn:468 * src/legacy.c (GetFormat): Fix counting of POLYNOM fields. 2010-10-22 D. V. Wiebe svn:463 GetData-0.7.0rc3: * src/parse.c (_GD_ParseDirective): Update passed flags, not D->flags after /INCLUDE. * src/common.c (lutcmp): Don't rely on typecasting to retain the -0+ distiction. 2010-10-22 D. V. Wiebe svn:462 * configure.ac m4/encoding.m4: Compute PRIVATE_LIBS * src/getdata.pc: Correct private libs. 2010-10-22 D. V. Wiebe svn:461 * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added tests 156 and 157. * bindings/python/pydirfile.c (gdpy_dirfile_init): Allow name=None to create an invalid dirfile. * bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard): Don't check dirfile error on success. * bindings/python/pygetdata.c: Add missing exceptions. * bindings/python/pydirfile.c bindings/python/pyfragment.c: Update docs. * bindings/make_parameters.c: GD_ARM_ENDIAN and GD_NOT_ARM_ENDIAN are type 2 constants. Exclude unnecessary constants in Python and IDL. GD_VERSION_* added. * bindings/cxx/dirfile.cpp (Dirfile::Dirfile): Create the invalid dirfile using gd_invalid_dirfile(). * bindings/python/pydirfile.c (gdpy_dirfile_getstandards gdpy_dirfile_setstandards) bindings/f77/fgetdata.c (GDINVD GDSTDV) bindings/f77/getdata.f90.in (fgd_invalid_dirfile fgd_dirfile_standards) bindings/idl/getdata.c (gdidl_invalid_dirfile gdidl_dirfile_standards) bindings/cxx/dirfile.cpp (Dirfile::Standards): Added. * bindings/idl/getdata.c: Fix for GD_NOT_ARM_ENDIAN. 2010-10-21 D. V. Wiebe svn:460 * test/endian_get.c: Test ARM endianness. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Fix test 79 on middle-ended platforms. * src/getdata.h.in: Added GD_NOT_ARM_ENDIAN and conditionally figure out whether it or GD_ARM_ENDIAN should be zero. * bindings/make_parameters.c: Added GD_NOT_ARM_ENDIAN. * src/internal.h: compute GD_ARM_FLAG. * src/endian.c (_GD_ByteSwapFragment) src/open.c (gd_cbopen) src/getdata.c (_GD_DoRaw) src/flush.c (_GD_FlushFragment) src/putdata.c (_GD_DoRawOut) src/parse.c (_GD_ParseDirective): Fix handling of ARM flag. * src/move.c (_GD_MogrifyFile): Only apply the ARM fix to double precision data. Also fixed the count in byte swapping calls. * src/flush.c (_GD_FindVersion): Fix logic for ARM endianness. Fix ordering of fragment metadata tests. * src/flush.c (_GD_FindVersion) src/errors.c: Better script for GD_E_BAD_VERSION. Differentiate between a non-conformant dirfile and an invalid version number. 2010-10-20 D. V. Wiebe svn:459 * test/version_5.c: Fix for WORDS_BIGENDIAN. * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Fix _GD_FixEndianness test. * src/flush.c (_GD_FindVersion): Native byte sex is assumed in early versions. 2010-10-19 D. V. Wiebe svn:457 * legacy.c (_GD_GetDirfile): On error, set *error_code (now passed as a parameter), copy the error, discard the bad dirfile, and return NULL. 2010-10-18 D. V. Wiebe svn:456 GetData-0.7.0rc2: * encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Fix types for USE_MODULES. 2010-10-17 D. V. Wiebe svn:455 GetData-0.7.0rc1: * configure.ac: update library interface numbers. Removed --disable-checkdirfile. * MEWS: Update. 2010-10-16 D. V. Wiebe svn:453 * configure.ac: Generate Makefiles even for bindings we're not using (so we can still run maintainer tasks on them.) 2010-10-16 D. V. Wiebe svn:452 * src/getdata.h.in: Keep anonymous structs and unions in C99-mode. * src/internal.h: Helper macros for C99/C89 differences. * test/ src/ bindings/: Update for changes. 2010-09-18 D. V. Wiebe svn:448 * bindings/python/pydirfile.c (gdpy_dirfile_close gdpy_dirfile_discard) bindings/cxx/dirfile.cpp (Dirfile::Discard Dirfile::Close) bindings/f77/fgetdata.c (_GDF_InitDirfiles) bindings/idl/getdata.c (gdidl_init_dirfile): Call gd_invalid_dirfile() instead of using GetData C internals. * src/open.c (gd_invalid_dirfile): Added. * bindings/cxx/: Declare const member functions. * configure.ac: Fix mkdir check for C++ compilers masquerading as C compilers. * src/legacy.c: Humanely initialise _GD_GlobalErrors when possible. 2010-09-17 D. V. Wiebe svn:447 * test/Makefile.am src/Makefile.am bindings/python/Makefile.am bindings/cxx/Makefile.am bindings/f77/test/Makefile.am bindings/f77/Makefile.am bindings/idl/Makefile.am util/Makefile.am: Remove hardcoded -Wall. * m4/compiler.m4 (GD_PROG_CC_WALL GD_PROG_CXX_WALL GD_PROG_FC_WALL GD_PROG_F77_WALL): Added. * configure.ac: Check whether the compilers accept -Wall * bindings/cxx/big_test.cpp: Fix for renamed functions. 2010-09-15 D. V. Wiebe svn:446 * bindings/cxx/dirfile.cpp (Dirfile::EoF Dirfile::BoF): Renamed. 2010-09-11 D. V. Wiebe svn:445 * bindings/f77/fgetdata.c (GDFNSS): Don't call the explicitly 64-bit version of gd_framenum_subset. * util/dirfile2ascii.c: Unroll type_data initialisation some more. 2010-09-11 D. V. Wiebe svn:444 * test/ src/ bindings/ util/: ANSI-C-ify. * src/getdata.h.in: Define GD_NO_C99_API when the C99-compliant API has been disabled at build time. * src/getdata.h.in src/internal.h: ANSI C does not permit anonymous union and structures, so name all the sub-bits of gd_entry_t and gd_private_entry. * src/getdata.h.in: Encompass everything in an extern "C" block for C++ compilers. * src/: include gd_throw in definition of functions. * src/debug.c src/common.c src/Makefile.am: Move gd_col_count and gd_debug_col to common.c to remove the need for GDLIB. * test/legacy_get_rofs.c test/legacy_get.c test/legacy_nonexistent.c test/legacy_put.c: Fix skip test. * test/flush_spec.c: Skip the blank line. * test/slim_nframes.c: Add missing r. * bindings/idl/test/Makefile.am: Use DL_LIBRARY_PATH in TESTS_ENVIRONMENT. * configure.ac: Add --enable-ansi-c, which will disable Python and IDL. A fail of AC_PROG_CC_C99 will also cause this to be asserted. * configure.ac: Fix lfs_transitional_api check. 2010-08-10 D. V. Wiebe svn:443 * src/common.c (_GD_BadInput): Check the propper entry for scalarness. 2010-08-10 D. V. Wiebe svn:442 * bindings/cxx/getdata/linterpentry.h bindings/cxx/getdata/bitentry.h bindings/cxx/getdata/entry.h bindings/cxx/getdata/sbitentry.h: Remove __gd_unused. * src/endian.c (_GD_ByteSwapFragment) src/encoding.c (_GD_RecodeFragment) src/move.c (gd_move) src/flimits.c (_GD_ShiftFragment) src/mod.c (_GD_Change) src/globals.c (gd_reference) src/add.c (_GD_Add gd_madd_spec gd_add_spec): Clear GD_HAVE_VERSION. * src/mod.c (gd_alter_spec gd_malter_spec): Use the standards version of the open dirfile rather than GD_DIRFILE_STANDARDS_VERSION. * src/include.c (gd_include): Calculate the opend dirfile's version if necessary, and use this instead of GD_DIRFILE_STANDARDS_VERSION. Clear GD_HAVE_VERSION at the end. * src/getdata.c (gd_getdata64) src/putdata.c (gd_putdata64) src/flimits.c (_GD_GetEOF _GD_GetBOF): Return GD_E_DIMENSION instead of GD_E_BAD_FIELD_TYPE on scalar field. * src/errors.c: Add GD_E_DIMENSION errors. * src/internal.h: Add GD_E_DIMENSION suberrors. * src/getdata.h.in src/errors.c: Rename GD_E_OPEN_INCLUDE to GD_E_OPEN_FRAGMENT. * bindings/make_parameters.c: Add GD_E_OPEN_FRAGMENT (in addition to the legacy GD_E_OPEN_INCLUDE, which remains). * src/getdata.h.in configure.ac: Rename GETDATA_LEGACY_API, NO_GETDATA_LEGACY_API, GETDATA_C89_API, GETDATA_FUNCTION_ALIASES, DIRFILE_STANDARDS_VERSION to GD_LEGACY_API, GD_NO_LEGACY_API, GD_C89_API, GD_FUNCTION_ALIASES, GD_DIRFILE_STANDARDS_VERSION. * util/checkdirfile.c: Fix pluralisations. 2010-07-20 D. V. Wiebe svn:441 * src/flush.c (_GD_FlushMeta gd_metaflush gd_rewrite_fragment): Return error on read-only dirfile. 2010-07-20 D. V. Wiebe svn:440 * util/checkdirfile.c: Fix reporting of conformant Standards Versions. 2010-07-20 D. V. Wiebe svn:439 * test/version_0_write.c test/version_1_write.c test/version_2_write.c test/version_3_write.c test/version_4_write.c test/version_5_write.c test/version_6_write.c test/version_7_write.c test/version_8_write.c: Added. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/f77/test/big_test95.f90 bindings/f77/test/big_test.f bindings/idl/test/big_test.pro: Add test 155. * bindings/python/pyfragment.c (gdpy_fragment_rewrite): Added. * bindings/cxx/fragment.cpp (Fragment::ReWrite): Added. * bindings/f77/fgetdata.c (GDRFRG): Added. * bindings/f77/getdata.f90.in (fgd_rewrite_fragment): Added. * bindings/idl/getdata.c (gdidl_gd_rewrite_fragment): Added. * src/flush.c (_GD_OldTypeName): Added * src/flush.c (_GD_StringEscapeise _GD_PadField): Avoid escaping on early versions. * src/flush.c (_GD_FieldSpec _GD_FlushFragment): Write the specified version metadata. * src/flush.c (_GD_FlushMeta): Add force parameter. * src/flush.c (gd_rewrite_fragment): Added. * src/flush.c (_GD_FindVersion): Remove the REFERENCE check: it can be wrong. 2010-07-17 D. V. Wiebe svn:438 * test/version_0.c test/version_1.c test/version_2.c test/version_3.ctest/version_4.c: Weed out version 8. * test/add_spec_directive.c: The test works again in version 8, so try it in version 7. * test/version_8_strict.c: Test syntax removed in version 8. * bindings/idl/getdata.c (gdidl_gd_alter_endianness gdidl_gd_include gdidl_gd_open): Handle ARM_ENDIAN and PERMISSIVE. * bindings/make_parameters.c: Add GD_ARM_ENDIAN and GD_PERMISSIVE. * src/add.c (gd_madd_spec gd_add_spec): Use the current version rather than DIRFILE_STANDARDS_VERSION when calling the parser. * src/name.c (_GD_ValidateField): Allow directives as field names in version 8 * src/endian.c (_GD_ByteSwapFragment) src/move.c (_GD_MogrifyFile): Handle ARM ended floats. * src/flush.c (_GD_FindVersion): Directives are permitted as field names in version 8. * src/parse.c (_GD_RawType): Single character types aren't permitted in version 8. * src/parse.c (_GD_ParseDirective): Slash is mandatory in version 8. * src/open.c (gd_cbopen) getdata.c (_GD_DoRaw) putdata.c (_GD_DoRawOut: Merge byte_sex and float_sex. * src/flush.c (_GD_FlushFragment) src/parse.c (_GD_ParseDirective): Allow only "arm" as float sex in format. 2010-07-15 D. V. Wiebe svn:436 * bindings/f77/test/big_test.f: Added tests 143-154 * bindings/f77/test/big_test95.f90: Added tests 143, 145-154 * bindings/cxx/test/big_test.cpp: Added tests 143, 145-148, 152, 153 * bindings/idl/test/big_test.pro: Added tests 143, 145, 146, 148, 152, 153 * bindings/python/test/big_test.py: Added tests 143, 145, 146, 149, 151 * bindings/f77/fgetdata.c (GDGEDV GDGERC GDGECR GDADDV GDADRC GDADCR GDMDDV GDMDRC GDMDCR GDALDV GDALRC GDALCR): Added. * bindings/f77/fgetdata.c (GDGSCA GDASCA): Update for DIVIDE and RECIP. * bindings/f77/getdata.f90.in (fgd_entry fgd_add fgd_madd fgd_alter_entry): Update for DIVIDE and RECIP. * bindings/f77/getdata.f90.in (fgd_add_divide fgd_add_recip fgd_add_crecip fgd_madd_divide fgd_madd_recip fgd_madd_crecip): Added. * bindings/cxx/entry.cpp (Entry::CheckIndex Entry::Scalar) bindings/cxx/dirfile.cpp (Dirfile::Entry) bindings/cxx/getdata/entry.h: Update for DIVIDE and RECIP. * bindings/cxx/entry.cpp (Entry::Scalar): Don't reject valid indicies. * bindings/cxx/recipentry.cpp bindings/cxx/divideentry.cpp bindings/cxx/getdata/recipentry.h bindings/cxx/getdata/divideentry.h: Added. * bindings/python/pyentry.c (gdpy_entry_getdividend gdpy_entry_setdividend): Added. * bindings/python/pyentry.c (gdpy_set_entry_from_tuple gdpy_set_entry_from_dict gdpy_entry_getinfields gdpy_entry_setinfields gdpy_entry_getparms): Update for DIVIDE and RECIP. * bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry): Update for DIVIDE and RECIP. * bindings/idl/getdata.c (gdidl_gd_add_divide gdidl_gd_add_recip gdidl_gd_alter_divide gdidl_gd_alter_recip): Added. * bindings/python/pydirfile.c: Doc updates. * bindings/python/pyentry.c (gdpy_entry_getshift): Properly handle non-literal scalar fields. * bindings/make_parameters.c: Update. * test/dfes_recip.c test/get_recip.c test/parse_recip.c test/alter_recip.c test/put_recip.c test/spf_recip.c test/version_8.c test/get_recip_const.c test/alter_crecip89.c test/alter_crecip.c: Update for swapped parameters. * src/parse.c (_GD_ParseRecip): Swap order of parameters in spec line to agree with other derived fields. Initalise comp_scal. * src/debug.c: Export the shift buffer. 2010-07-11 D. V. Wiebe svn:435 The Great Renaming, part 2: removed get_ from many public function names. 2010-07-10 D. V. Wiebe svn:434 * test/madd_crecip.c test/add_recip.c test/add_crecip.c test/dfes_recip.c test/get_recip.c test/spf_divide.c test/parse_recip.c test/alter_recip.c test/put_recip.c test/spf_recip.c test/version_8.c test/madd_recip.c test/madd_crecip89.c test/dfes_divide.c test/get_recip_const.c test/alter_crecip89.c test/get_divide.c test/parse_divide.c test/version_8_strict.c test/add_divide_invalid.c test/madd_divide.c test/add_divide.c test/put_divide.c test/add_crecip89.c test/alter_crecip.c: Added. * src/entry.c (_GD_FreeE _GD_CalculateEntry gd_get_entry gd_validate) src/getdata.c (_GD_DoField) src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_DeReference _GD_ClearDerived) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/mod.c (_GD_Change) src/add.c (_GD_Add): Split RECIP from DIVIDE. * src/legacy.c (CopyMultDivEntry CopyMultiplyEntry): Renamed CopyMultiplyEntry to CopyMultDivEntry. * src/getdata.c (_GD_DoRecip) src/parse.c (_GD_ParseRecip _GD_ParseDivide) src/mod.c (gd_alter_recip gd_alter_crecip gd_alter_crecip89 gd_alter_divide) src/add.c (gd_add_divide gd_add_recip gd_add_crecip gd_add_crecip89 gd_madd_divide gd_madd_recip gd_madd_crecip gd_madd_crecip89): Added. * src/getdata.h.in: Bump standards version to Version 8. Add GD_RECIP_ENTRY. Fix unified entry struct for RECIP. * src/parse.c (_GD_ParseFieldSpec): Recognise DIVIDE and RECIP. * src/flush.c (_GD_FindVersion): Add Version 8. * src/putdata.c (_GD_DoDivideOut _GD_DoRecipOut): Renamed _GD_DoDivideOut to _GD_DoRecipOut. * src/getdata.c (DIVIDE): Swap divisor and dividend in entry struct. * test/version_6.c test/version_7.c: Update for Standards Version 8. * test/convert_float64_int8.c test/eof_lincom.c: Delete the test dirfile. * configure.ac m4/encoding.m4: Add --without-external-libraries switch. 2010-07-08 D. V. Wiebe svn:433 * test/alter_lincom_32.c: Added. * src/native.c (_GD_NativeType): Fix computation of MULTIPLY. * src/mod.c (_GD_Change): Fix memory leaks in LINCOM. * src/putdata.c (_GD_DoLincomOut): Remove unnecessary error check. * src/entry.c (_GD_FreeE _GD_CalculateEntry gd_get_entry gd_validate) src/getdata.c (_GD_DoField) src/native.c (_GD_NativeType) src/spf.c (_GD_GetSPF) src/putdata.c (_GD_DoFieldOut) src/del.c (_GD_DeReference _GD_ClearDerived) src/flimits.c (_GD_GetEOF _GD_GetBOF) src/mod.c (_GD_Change) src/add.c (_GD_Add): Handle DIVIDE. * src/getdata.c (_GD_DivideData _GD_CDivideData _GD_DoDivide) src/putdata.c (_GD_DoDivideOut) src/common.c (_GD_InvertData _GD_CInvertData): Added. * src/nfields.c (gd_get_nfields_by_type): Use a default case. * src/getdata.h.in: Add GD_DIVIDE_ENTRY and DIVIDE entries to the entry struct. * src/legacy.c (CopyReciprocalEntry): Added. * src/legacy.c (GetFormat): Store DIVIDEs as LINCOMs or MULTIPLYs. * src/getdata.c: Combine MULTIPLY() and CMULTIPLY() macros. 2010-07-07 D. V. Wiebe svn:432 * src/common.c (_GD_ReadLinterpFile): Only sort if necessary. 2010-07-07 D. V. Wiebe svn:431 * test/get_linterp_notab.c: Test for dummy linterp creation. * src/common.c (_GD_MakeDummyLinterp): Deleted. * src/common.c (_GD_ReadLinterpFile): Don't make a dummy LUT on error. 2010-07-07 D. V. Wiebe svn:430 * test/bof_lincom.c: Fix. * test/get_linterp_sort.c test/put_linterp_reverse.c test/put_linterp_nomono.c: Added. * src/getdata.c (_GD_DoLinterp): Update call to _GD_LinterpData. * src/putdata.c (_GD_DoLinterpOut): Reject non-monotonic LUTs. Update for new LUT struct. * src/common.c (_GD_LinterpData): Handle both complex and real tables. * src/common.c (_GD_CLinterpData): Deleted. * src/common.c (_GD_ReadLinterpFile): Sort the LUT. * src/internal.h: GD_E_DOMAIN_ANTITONIC added. Define new LUT struct. * src/common.c (_GD_ReadLinterpFile): Don't read the file twice, instead dynamically resize the LUT buffer. * src/common.c (_GD_GetLine): Abort early on EOF. * src/flimits.c (_GD_GetEOF): Fix INDEX check in PHASE. 2010-07-07 D. V. Wiebe svn:428 * bindings/cxx/test/addentry.cpp bindings/cxx/test/getdata.cpp bindings/cxx/test/nframes.cpp bindings/cxx/test/spf.cpp bindings/cxx/test/putdata.cpp: Deleted; coverage duplicated by big_test. 2010-07-06 D. V. Wiebe svn:427 * test/eof_phase.c test/eof.c test/eof_lincom.c test/eof_index.c: Renamed from nsamples*.c * test/bof.c test/bof_lincom.c test/bof_phase.c: Added. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add a new test 86 and also add test 142. * bindings/cxx/dirfile.cpp (Dirfile::EOF Dirfile::BOF): Added. * bindings/python/pydirfile.c (gdpy_dirfile_getbof gdpy_dirfile_geteof): Added. * bindings/f77/fgetdata.c (GDGBOF GDGEOF): Added. * bindings/f77/getdata.f90.in (fgd_get_bof fgd_get_eof): Added. * bindings/idl/getdata.c (gdidl_get_bof gdidl_get_eof): Added. * bindings/idl/makedlm.sh.in: Sort the subroutine list. * src/flimits.c (gd_get_bof gd_get_bof64 _GD_GetBOF): Added. * src/flimits.c (gd_get_eof gd_get_eof64 _GD_GetEOF): Renamed. Proper INDEX handling added. * src/foffs.c src/flimits.c src/nsamples.c: foffs.c and nsamples.c merged and renamed flimits.c. 2010-06-30 D. V. Wiebe svn:425 svn:426 * test/nsamples.c test/nsamples_index.c test/nsamples_lincom.c test/nsamples_phase.c: Added. * src/nsamples.c: Added. 2010-06-30 D. V. Wiebe svn:420 * src/errors.c: Update for GD_E_BAD_VERSION and GD_E_FLUSH. * src/flush.c (_GD_FlushFragment): Replace GD_E_OPEN_INCLUDE errors with GD_E_FLUSH for more sensical error reporting. * src/getdata.h.in: Added GD_E_FLUSH. * src/internal.h: Added GD_E_FLUSH suberrors. 2010-06-30 D. V. Wiebe svn:419 * src/mod.c (_GD_SPFConvert): _GD_AddData is only used by _GD_Change to convert SPFs, so pare it down and rename. * src/common.c (_GD_AddData): Moved to src/mod.c and renamed _GD_SPFConvert. 2010-06-29 D. V. Wiebe svn:418 * m4/compiler.m4 (GD_CHECK_LFS_TYPE): Added. * configure.ac: Better tests for LFS Transitional API types. Don't rely on the `complex' macro when checking types. Move the MSCVRT test back to the proper place. 2010-06-28 D. V. Wiebe svn:414 Merged in changes from the ARM branch, revision 385: * bindings/make_parameters.c: Don't include the legacy API. * test/put_endian_float32_big.c test/put_endian_float64_big.c test/put_endian_complex64_little.c test/put_endian_float32_arm.c test/put_endian_float64_arm.c test/get_endian_complex64_big.c test/put_endian_float32_little.c test/put_endian_complex64_big.c test/endian_get.c test/get_endian_complex64_arm.c test/put_endian_complex64_arm.c test/put_endian_complex128_big.c test/get_endian_float32_little.c test/put_endian_complex128_arm.c test/get_endian_complex128_big.c test/get_endian_float32_big.c test/get_endian_float64_big.c test/get_endian_complex128_little.c test/get_endian_complex128_arm.c test/get_endian_float32_arm.c test/get_endian_float64_arm.c test/get_endian_complex64_little.c test/put_endian_float64_little.c test/put_endian_complex128_little.c test/get_endian_float64_little.c: Added. * test/put_endian_float32.c test/get_endian_float64.c test/put_endian_complex128.c test/put_endian_complex64.c test/put_endian_float64.c test/get_endian_complex64.c test/get_endian_complex128.c test/get_endian_float32.c: Removed. * src/parse.c (_GD_ParseDirective): Handle missing second parameter to /ENDIAN. * m4/python.m4: Don't specify -L unless needed. * bindings/idl/getdata.c (gdidl_read_idl_entry): Fix compiler warning. * configure.ac: Calculate BUILDCC * bindings/Makefile.am: use BUILDCC * bindings/make_parameters.c (main): Return zero. * src/open.c (dirfile_cbopen): Fix default float_sex. * test/endian_get.c: Test both sexes. * configure.ac: Calculate BUILDCC * bindings/Makefile.am: use BUILDCC * configure.ac: Call GD_C_FLOATORDERING. * m4/compiler.m4 (GD_C_FLOATORDERING): Added. * configure.ac bindings/f77/Makefile.am: Handle missing diff gracefully. * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Call _GD_ArmEndianise when appropriate. Check float_sex when appropriate. * src/endian.c (_GD_ArmEndianise): Added. * bindings/cxx/Makefile.am bindings/cxx/test/Makefile.am bindings/f77/Makefile.am bindings/f77/test/Makefile.am src/Makefile.am test/Makefile.am util/Makefile.am: use *_WEXTRA conditionals. * configure.ac: Call GD_PROG_CC_WEXTRA, GD_PROG_CXX_WEXTRA, GD_PROG_F77_WEXTRA, GD_PROG_FC_WEXTRA; don't bother checking compilers we aren't going to use. * compiler.m4: Renamed from intel.m4. * compiler.m4 (GD_PROG_CC_WEXTRA GD_PROG_CXX_WEXTRA GD_PROG_F77_WEXTRA GD_PROG_FC_WEXTRA): Added. 2010-06-27 D. V. Wiebe svn:410 * src/internal.h: Only use the MSVCRT aliases when appropriate. Handle no complex.h, but with complex support in GCC (for Cygwin). Deal with Cygwin 64-bit stat. * src/getdata.h.in: Define LFS transitional functions under Cygwin. * configure.ac: Disable Python and IDL tests for both Cygwin and MinGW. Only conditionally define _LARGEFILE64_SOURCE. 2010-06-26 D. V. Wiebe svn:409 * configure.ac: Fix test for struct stat64. Restore accidentally deleted AC_SUBST. 2010-06-25 D. V. Wiebe svn:408 * test/: Include O_BINARY in open() calls. Write "#\n" instead of "\n" in empty fragments. * test/test.h (gd_system): Added. Use PRIxxx codes for format specifiers. * test/trunc_rofs.c test/open_eaccess.c: Skip the test if the FS doesn't honour access permissions. * test/ascii_put.c: Read data as ints. * test/legacy_put.c: Skip the stat() check. * src/open.c (_GD_CreateDirfile): Use mode "rb" in fopen() call. * src/gzip.c (_GD_GzipSize) src/encoding.c (_GD_GenericTouch) src/include.c (_GD_Include) src/raw.c (_GD_RawOpen): Include O_BINARY in open() calls. * src/errors.c (gd_error_string): Handle STRERROR_R_CHAR_P. * src/flush.c (_GD_FlushFragment): Skip fchmod() call unless HAVE_FCHMOD defined. * src/flush.c (_GD_FlushFragment) src/mod.c (_GD_Change) src/encoding.c (_GD_GenericMove) src/raw.c (_GD_RawTemp): Replaced rename() with _GD_Rename(). * src/encoding.c (_GD_ResolveEncoding) src/raw.c (_GD_RawSize): Use gd_stat64_t and gd_stat64(). * src/ascii.c (_GD_AsciiOpen _GD_AsciiSize _GD_AsciiTemp): Use O_TEXT in open call. * src/ascii.c (_GD_ScanFormat _GD_AsciiRead): Handle NO_8BIT_INT_PREFIX. * src/internal.h: Include for Win32. Define O_BINARY, O_TEXT if necessary. Define NO_8BIT_INT_PREFIX when appropriate. Handle Win32 function aliases. * src/compat.c: Added. * src/common.c (GD_ReadLinterpFile): Call fopen() with FOPEN_TEXT. * bindings/cxx/test/big_test.cpp bindings/cxx/test/putdata.cpp bindings/cxx/test/spf.cpp bindings/cxx/test/getdata.cpp bindings/cxx/test/nframes.cpp: Handle Win32 stuff. * configure.ac: Call GD_MSYS_SHELL. Add various Win32 checks. * m4/win32.m4: Added. 2010-05-22 D. V. Wiebe svn:401 svn:402 svn:403 The Great Renaming: * test/: Update for new function names. Modernise error reporting. * test/test.h: Added. * test/add_many.h test/global_ref_get.c: Deleted. * util/dirfile2ascii.c util/checkdirfile.c: Update for new function names. * util/checkdirfile.c: Report standards version compliance. * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Remove test 86. * bindings/python/*.c: Update for new function names. * bindings/cxx/*.cxx: Ditto. * bindigns/f77/fgetdata.c: Ditto. * bindings/f77/getdata.f90.in: Ditto. * bindings/idl/getdata.c: Ditto. * src/: Use the gd_ namespace for all public functions. * src/getdata.h.in: Add function aliases. * src/legacy.c: Fix lengths of global error buffers. * src/getdata_legacy.h src/getdata.h.in: Fix function attributes to work with gcc but a non-gnu libc. * bindings/cxx/fragment.cpp: Remove dependence on the LFS transitional API. * src/configure.ac: Remove obsolete Darwin check. * src/globals.c (get_reference): Deleted. 2010-05-17 D. V. Wiebe svn:400 * src/flush.c (_GD_FlushFragment): malloc temp_file. * src/internal.h: Fix handling of !defined(HAVE_OFF64_T). * src/getdata.h.in: __APPLE__ specifics. * configure.ac: Set DL_LIBRARY_PATH based on $host. * bindings/python/test/Makefile.am: Use DL_LIBRARY_PATH * bindings/python/pydirfile.c bindings/python/pyfragment.c: De-LFSise. * bindings/python/pydirfile.h: Define _FILE_OFFSET_BITS. * bindings/cxx/fragment.cpp: De-LFSise. * bindings/cxx/getdata/indexentry.h bindings/cxx/getdata/rawentry.h bindings/cxx/getdata/dirfile.h bindings/cxx/getdata/linterpentry.h bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/bitentry.h bindings/cxx/getdata/entry.h bindings/cxx/getdata/multiplyentry.h bindings/cxx/getdata/phaseentry.h bindings/cxx/getdata/fragment.h bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/sbitentry.h bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h: Define _FILE_OFFSET_BITS. * util/dirfile2ascii.c: Define off64_t if not present. 2010-04-24 D. V. Wiebe svn:390 * bindings/python/pydirfile.c (gdpy_dirfile_getdata): Use numpy to allocate the data buffer, instead of doing it ourselves, to avoid memory hassles. Also, only retrieve spf when needed. * bindings/python/pygetdata.c (gdpy_type_from_npytype): Fix debug message. * bindings/python/pygetdata.h: Undef Python's SIZEOF_OFF_T. * bindings/make_parameters.c (main): Don't fall off the end. 2010-03-17 D. V. Wiebe svn:387 * configure.ac src/getdata.h.in: Disable LFS transitional API on Darwin. * bindings/f77/Makefile.am: Change order of sed arguments to work with Darwin sed. 2010-03-05 D. V. Wiebe svn:386 * test/version_0.c test/version_1.c test/version_2.c test/version_3.c test/version_4.c test/version_5.c test/version_6.c test/version_7.c: Call dirfile_standards(). * test/parse_version_include.c: Use GD_PERMISSIVE. * src/internal.h: Add GD_HAVE_VERSION. * src/getdata.h.in: Add GD_E_BAD_VERSION, GD_VERSION_* * src/flush.c (_GD_FindVersion dirfile_standards): Added. * src/open.c (dirfile_cbopen): Clear GD_PERMISSIVE if GD_PEDANTIC is set. Clear GD_IGNORE_REFS if set. If necessary, determine the standards conformance of the dirfile. * src/parse.c (_GD_ParseDirective): Set proper flags when calling _GD_Include. Propagate pedantry back up. Enumerate fragment versions. * src/include.c (_GD_Include): Take a pointer to the flags, to permit propagation of pedantry. Enumerate fragment versions. * src/parse.c (_GD_ParseFragment): Take a pointer to the flags, to permit propagation of pedantry. * src/name.c (_GD_ValidateField): Prohibit characters < 0x20 in field names. * src/parse.c (_GD_ParseDirective): Remove unnecessary first_fragment parameter. 2010-03-02 D. V. Wiebe svn:380 * test/version_0.c test/version_1.c test/version_2.c test/version_6_strict.c test/version_3.c test/version_4.c test/version_5.c test/version_6.c test/parse_version_permissive.c test/version_7_strict.c test/version_7.c test/version_5_strict.c: Added. * test/parse_version_pedantic.c: Removed. * test/parse_name.c: Update. * test/put_foffs.c test/parse_version.c test/parse_version_slash.c test/get_bad_code.c test/parse_name_ext.c: Better error reporting. * src/getdata.h.in: Add GD_PERMISSIVE. * src/name.c src/internal.h: move entry_cmp() to header as a static inline. * src/internal.h: Add n_dot, dot_list, standards to _GD_DIRFILE. * src/common.c (_GD_FindField): Pass the list and count as parameters. If looking for FILEFRAM in early versions, look for INDEX instead. * src/common.c (_GD_FindFieldAndRepr): Added. * src/entry.c (_GD_GetScalar get_entry get_entry_type get_fragment_index dirfile_validate): Call _GD_FindFieldAndRepr instead of _GD_GetRepr and _GD_FindField. * src/index.c (get_framenum_subset64): Ditto. * src/getdata.c (getdata64): Ditto. * src/flush.c (dirfile_flush): Ditto. * src/native.c (get_native_type): Ditto. * src/spf.c (get_spf): Ditto. * src/constant.c (get_constant put_constant): Ditto. * src/putdata.c (putdata64): Ditto. * src/del.c (dirfile_delete): Ditto. * src/entry.c (get_raw_filename): Remove the representation from the input by calling _GD_FindFieldAndRepr. * src/name.c (_GD_ValidateField): Behave differently with different versions. Also set *is_dot on permitted '.' in field name. * src/parse.c (_GD_RawType _GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp _GD_ParseMultiply _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom _GD_ParseConst _GD_ParseString _GD_ParseFragment): Behave differently with different versions. * src/parse.c (_GD_ParseFieldSpec): Behave differently with different versions. Make FILEFRAM a reserved field name in early versions. * src/parse.c (_GD_ParseDirective): Behave differently with different versions. Try to allow fields with directive names when it wouldn't confuse us, and not in pedantic mode. Set GD_PEDANTIC on encountering a VERSION directive unless GD_PERMISSIVE was specified. * src/name.c (dirfile_rename): Update the dot list when necessary. * src/add.c (_GD_Add): Ditto. * src/open.c (dirfile_cbopen): Initialise D->standards. 2010-03-02 D. V. Wiebe svn:379 * util/dirfile2ascii.c: Fix missing break statement per Matthew Truch. 2010-02-19 D. V. Wiebe svn:377 * util/dirfile2ascii.c: Add -a, -A, -F, -u. Read UINT64 when appropriate. Add --version and other long options. Increase BUF_LEN to GD_MAX_LINE_LENGTH. Turn off default verbose. Make ff an off64_t. * m4/python.m4 m4/idl.m4: Fix typos in help strings. 2010-02-17 D. V. Wiebe svn:375 Merged in changes from the 0.6 branch, revision 373: * src/ascii.c (_GD_AsciiSize): Don't trample on the file name. * test/ascii_nframes.c: Update to test for same. 2010-02-15 D. V. Wiebe svn:362 * util/dirfile2ascii.c: Added Matthew Truch's ASCII conversion utility. 2010-02-12 D. V. Wiebe svn:361 GetData 0.6.1 released. 2010-02-09 D. V. Wiebe svn:358 GetData-0.6.1rc2: * src/legacy.c: Fix length of global error string buffers. * configure.ac: Bump GETDATA_IMPL_REVISION. * configure.ac: Fix diff check. * man/get_native_type.3 man/put_string.3: Typos. 2010-02-04 D. V. Wiebe svn:349 * bindings/cxx/test/getdata.cpp: Also fix the mkdir() bug here. 2010-02-03 D. V. Wiebe svn:346 GetData-0.6.1rc1: * test/convert_complex128_float64.c test/add_cpolynom.c test/convert_float32_complex128.c test/get_const_complex.c test/get_complex128.c test/convert_float64_complex128.c test/repr_uint64.c test/repr_real_m.c test/convert_complex64_uint64.c test/add_clincom.c test/repr_float32.c test/convert_int16_complex64.c test/repr_i.c test/get_complex64.c test/repr_int32.c test/put_complex128.c test/convert_uint8_complex64.c test/get_cpolynom.c test/repr_int16.c test/convert_float64_complex64.c test/convert_complex64_complex128.c test/convert_float32_complex64.c test/repr_real_a.c test/repr_int64.c test/convert_complex128_int64.c test/convert_complex64_int64.c test/put_endian_complex128.c test/put_endian_complex64.c test/repr_a.c test/convert_uint16_complex128.c test/repr_m.c test/put_complex64.c test/convert_uint16_complex64.c test/repr_real_r.c test/repr_int8.c test/convert_int64_complex64.c test/get_endian_complex64.c test/repr_uint8.c test/convert_int32_complex64.c test/convert_int8_complex128.c test/convert_int16_complex128.c test/madd_clincom.c test/repr_float64.c test/convert_complex128_complex64.c test/convert_int8_complex64.c test/convert_complex128_uint64.c test/convert_uint32_complex128.c test/repr_uint32.c test/get_endian_complex128.c test/madd_cpolynom.c test/convert_uint64_complex64.c test/repr_uint16.c test/convert_int32_complex128.c test/get_clincom.c test/convert_uint32_complex64.c test/convert_uint8_complex128.c test/repr_r.c test/alter_cpolynom.c test/convert_uint64_complex128.c test/get_const_repr.c test/convert_complex64_float64.c test/repr_real_i.c test/convert_int64_complex128.c: Include complex.h. * m4/encoding.m4 (GD_HIDE_LTDL_SYM): Removed. * m4/ltdl.m4: Removed. * src/gd_ltdl.c src/gd_ltdl.h: Removed. * configure.ac: Update for libtool 2.x. Remove support for the internal ltdl. * bindings/f77/test/Makefile.am bindings/f77/Makefile.am: Removed the libtool 1.5.x hack. * bindings/idl/getdata.c (gdidl_dirfile_alter_entry gdidl_dirfile_move gdidl_dirfile_rename gdidl_dirfile_uninclude): Initialise kw.error and kw.estr. * bindings/cxx/test/big_test.cpp: Include headers to declare mkdir(). Bug report from Matthew Truch. 2009-11-13 D. V. Wiebe svn:345 * src/getdata.h.in: Don't include ; use _Complex directly. 2009-11-03 D. V. Wiebe svn:340 GetData 0.6.0 released. 2009-11-01 D. V. Wiebe svn:334 GetData-0.6.0rc4: * test/header_complex.c: Added. * test/repr_real_m.c test/repr_i.c test/repr_real_a.c test/repr_m.c test/repr_real_r.c test/repr_a.c test/repr_real_i.c: Replaced M_PI with a literal. * configure.ac: Determine types for gd_bit_t, gd_spf_t, and gd_shift_t. Fix NumPy test. * m4/intel.m4: Better tests for Fortran compilers. * src/getdata.h.in: Export a C-89 compliant API if GETDATA_C89_API is set. Include only if needed. typedef gd_bit_t, gd_spf_t, gd_shift_t, and use them in the public API. * src/entry.c (_GD_GetScalar): Use correct types in call to _GD_DoField. * src/entry.c (_GD_CalculateEntry): Use correct types in call to _GD_GetScalar. * src/flush.c (_GD_WriteConst _GD_FieldSpec): Use correct types and C-99 printf codes. * src/del.c (_GD_DeReference): Use correct types in call to _GD_DeReferenceOne. * src/parse.c (_GD_ParseRaw _GD_ParseBit _GD_ParsePhase): Remove unnecessary periphrasis in calls to _GD_SetScalar. * bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj): Use proper types. * bindings/cxx/bitentry.cpp (BitEntry::SetFirstBit BitEntry::SetNumBits): Remove periphrasis in calls to get_constant. * bindings/cxx/rawentry.cpp (RawEntry::SetSamplesPerFrame): Remove periphrasis in call to get_constant. * bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift): Remove periphrasis in call to get_constant. * bindings/cxx/sbitentry.cpp (SBitEntry::SetFirstBit SBitEntry::SetNumBits): Remove periphrasis in calls to get_constant. * src/index.c (_GD_GetIndex): Explicit typecast. * src/getdata.c (EXTRACT_REPR MULTIPLY): Explicit typecasts. * src/getdata.c (CMULTIPLY): Added. * src/native.c (_GD_NativeType): Return GD_UNKNOWN on recursion error. * src/add.c (_GD_Add): Properly set comp_scal for POLYNOM. * src/getdata.c (_GD_DoBit): Remove unnecessary call to _GD_GetSPF. * bindings/python/pydirfile.c: Allow compilation without NumPy. * bindings/cxx/lincomentry.cpp bindings/cxx/polynomentry.cpp: Use C++ complex class. * bindings/cxx/tests/big_test.cpp: Use C++ complex class. * bindings/cxx/getdata/indexentry.h bindings/cxx/getdata/rawentry.h bindings/cxx/getdata/dirfile.hbindings/cxx/getdata/linterpentry.h bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/bitentry.h bindings/cxx/getdata/entry.h bindings/cxx/getdata/multiplyentry.h bindings/cxx/getdata/phaseentry.h bindings/cxx/getdata/fragment.h bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/sbitentry.h bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h: Use the C-89 GetData API. * bindings/f77/test/Makefile.am: If using ifort, pass -assume byterecl * bindings/f77/test/big_test95.f90: replace realpart() and imagpart() with real(real()) and real(aimag()) 2009-10-29 D. V. Wiebe svn:332 * bindings/cxx/test/addentry.cpp bindings/cxx/test/big_test.cpp bindings/cxx/test/getdata.cpp bindings/cxx/test/nframes.cpp bindings/cxx/test/putdata.cpp bindings/cxx/test/spf.cpp: Fix dirfile initialisation. 2009-10-29 D. V. Wiebe svn:331 * src/entry.c (_GD_FreeE): Free E->e->filebase. Reported by CBN. * bindings/cxx/dirfile.cpp (Dirfile::~Dirfile): Fix call to dirfile_close(). Previously it only called dirfile_close() on NULL pointers. Reported by CBN. 2009-10-29 D. V. Wiebe svn:329 * bindings/python/test/big_test.py: NumPy tests. * configure.ac: Detect NumPy. * bindings/python/pygetdata.h: #include * bindings/python/pygetdata.c (gdpy_type_from_npytype gdpy_npytype_from_type): Added. * bindings/python/pygetdata.c (initpygetdata): Call import_array(). Add "__numpy_supported__" to Python module. * bindings/python/pydirfile.c (gdpy_dirfile_getdata): Add "as_list" parameter. Return NumPy array. * bindings/python/pydirfile.c (gdpy_dirfile_putdata): Handle NumPy arrays. 2009-10-23 D. V. Wiebe svn:327 * test/entry_scalar_repr.c: Added. * test/put_endian_complex128.c test/put_endian_complex64.c test/get_endian_complex64.c test/get_endian_complex128.c: Fix checks.o * src/entry.c (_GD_GetScalar): Handle representations: call _GD_DoField instead of _GD_DoConst * src/del.c (_GD_DeReferenceOne): Added. * src/del.c (_GD_DeReference): Handle representations: call _GD_DoField. * src/getdata.c (_GD_DoConst): Make static. Callers should use _GD_DoField so that the representation is properly handled. * src/flush.c (_GD_StringEscapeise): Preprocessor check for unsigned char. * src/flush.c (_GD_WriteConst): Handle long int for PHASE shift. * src/parse.c (_GD_SetScalar): Don't convert everything willy-nilly to double first. Properly handle types. * src/parse.c (_GD_ParseRaw _GD_ParseBit _GD_ParsePhase): Call _GD_SetScalar with an intermediary. * src/parse.c (_GD_ParseConst): Call _GD_SetScalar with the right type code. * bindings/python/pydirfile.c (gdpy_dirfile_getdata): Use correct integer types and codes in PyArg_ParseTupleAndKeywords call. * bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj): Fix type for PHASE shift. * bindings/f77/fgetdata.c (GDASCA): Fix scalar_l type. Reject index = 0. * bindings/f77/test/Makefile.am bindings/python/Makefile.am bindings/Makefile.am man/Makefile.am: noinst_ flag built files. 2009-10-19 D. V. Wiebe svn:325 GetData-0.6.0rc3: * test/repr_real_m.c test/repr_i.c test/repr_real_a.c test/repr_m.c test/repr_real_r.c test/repr_a.c test/repr_r.c test/repr_real_i.c: Made more rigorous. * src/getdata.c (_GD_ExtractRepr): Work with any input data type. * src/getdata.c (_GD_DoField): Properly handle representations of real data. * src/flush.c (_GD_Flush): Remove third argument by moving the E == NULL test to dirfile_flush(). * src/flush.c (dirfile_flush): Discard representation. * src/encoding.c: Add missing punctuation. * bindings/python/pygetdata.c bindings/python/pydirfile.c bindings/python/pyentry.c: Add module documentation. * bindings/python/pydirfile.c (gdpy_dirfile_alter): Require field_code, like the C API. * bindings/python/pydirfile.c (gdpy_dirfile_delentry): Make flags optional. * bindings/python/pydirfile.c (gdpy_dirfile_getfieldlist gdpy_dirfile_getfieldlistbytype): Combine. * bindings/python/pydirfile.c (gdpy_dirfile_getmfieldlist gdpy_dirfile_getmfieldlistbytype): Combine. * bindings/python/pydirfile.c (gdpy_dirfile_getnfields gdpy_dirfile_getnfieldsbytype): Combine. * bindings/python/pydirfile.c (gdpy_dirfile_getnmfields gdpy_dirfile_getnmfieldsbytype): Combine. * bindings/python/pyentry.c (gdpy_entry_getscalars): Deleted. * bindings/make_parameters.c: Add E_FORMAT_LITERAL (=GDF_LT). * bindings/idl/getdata.c: Make SHIFT long. * bindings/idl/getdata.c (gdidl_dirfile_alter_encoding gdidl_dirfile_alter_endianness gdidl_dirfile_alter_frameoffset gdidl_dirfile_protect): fragment_index is GD_ALL_FRAGMENTS by default. * doc/README.f77 doc/README.f95 doc/README.cxx doc/README.python: Update. * doc/README.idl: Added. * man/get_native_type.3 man/dirfile_alter_entry.3 man/get_framenum_subset.3 man/put_string.3 man/get_string.3 man/getdata.3 man/put_constant.3 man/get_fragment_index.3 man/get_entry_type.3 man/putdata.3 man/dirfile_alter_bit.3 man/dirfile_move.3 man/dirfile_rename.3 man/get_spf.3 man/get_raw_filename.3 man/dirfile_reference.3 man/dirfile_delete.3 man/dirfile-format.5 man/dirfile_flush.3 man/dirfile_validate.3 NEWS: Update. * man/get_framenum_subset64.3: Added. 2009-10-17 D. V. Wiebe svn:324 * src/entry.c (_GD_Calculate): Memory leak. * src/entry.c (get_entry get_entry_type get_fragment_index dirfile_validate): Throw GD_E_BAD_REPR when necessary. * src/native.c (_GD_NativeType): Only calculate the entry if needed. Properly calculate LINTERP and MULTIPLY native types. * man/get_native_type.3 man/get_framenum_subset.3 man/dirfile_validate.3: Added. 2009-10-16 D. V. Wiebe svn:323 * src/internal.h: Fix spelling of GD_E_FORMAT_LITERAL. * src/errors.c src/parse.c: Ditto. * src/putdata.c: Don't assume size_t is signed. 2009-10-16 D. V. Wiebe svn:322 * test/madd.c: Properly initialise E. * src/getdata.c (_GD_DoRaw): Don't assume size_t is signed. * src/flush.c (_GD_FlushFragment): Don't justify field names if they're very long. * bindings/f77/test/big_test95.f90: Use fixed width strings in array initialisations. * man/dirfile_alter_entry.3 man/dirfile_add_bit.3 man/get_mfield_list_by_type.3 man/get_entry_type.3 man/get_nvectors.3 man/dirfile_alter_bit.3 man/dirfile_cbopen.3 man/dirfile_rename.3 man/dirfile_include.3 man/dirfile_add.3 man/dirfile-format.5 man/get_field_list_by_type.3 man/get_mvector_list.3 man/dirfile_flush.3 man/get_vector_list.3 man/get_entry.3 man/dirfile_madd_bit.3 man/dirfile-encoding.5: Update. 2009-10-14 D. V. Wiebe svn:321 * internal.h: Add .ffname member to encoding_t. * parse.c (_GD_ParseDirective): Run through _gd_ef instead of hard-coding encoding names. 2009-10-14 D. V. Wiebe svn:319 GetData-0.6.0rc2: * bindings/f77/test/big_test.f: Fix typos. * bindings/idl/test/big_test.pro: Add scalar members to structure initialisations in tests 125 and 126. * bindings/idl/Makefile.am: Make sure .libs exists. 2009-10-13 D. V. Wiebe svn:318 * test/alter_polynom_coeff.c test/entry_raw_scalar.c test/entry_polynom_scalar.c test/entry_bit_scalar.c test/add.c test/entry_lincom_scalar.c test/entry_phase_scalar.c test/entry_bit.c: Update for scalar[] in gd_entry_t. * test/add_phase.c test/madd_phase.c test/get_phase.c: Update for long shift. * test/add_scalar.c alter_entry_scalar3.c alter_entry_scalar4.c alter_entry_scalar2n.c alter_entry_scalar2a.c: Added. * src/getdata.h.in: Use long int for phase shift in gd_entry_t. * src/parse.c (_GD_SetScalar): Use INT64 for shift internally. * src/internal.h src/getdata.h.in: Make scalar[] array public: moved from _gd_private_entry to gd_entry_t. * src/entry.c (_GD_FreeE _GD_CalculateEntry): Update for above. * src/del.c (_GD_DeReference): Ditto. * src/parse.c (_GD_SetScalar _GD_ParseLincom _GD_ParseBit _GD_ParsePhase _GD_ParsePolynom _GD_ParseRaw): Ditto. * src/mod.c (dirfile_alter_raw dirfile_alter_lincom dirfile_alter_clincom dirfile_alter_linterp dirfile_alter_bit dirfile_alter_sbit dirfile_alter_phase dirfile_alter_polynom dirfile_alter_cpolynom): Initialise E.scalar[]. * src/add.c (_GD_Add): Allow adding of non-literal scalars via dirfile_add. * src/mod.c (_GD_AlterScalar): Added. * src/mod.c (_GD_Change): Call _GD_AlterScalar to allow scalar modifications. * src/entry.c (_GD_GetScalar): Assume 16 bit integers for int types. * src/internal.h: Encodings and byte_sex are unsigned longs. * src/getdata.h.in: Renumber some open flags. * src/encoding.c (_GD_ResolveEncoding): Return unsigned long. * src/move.c (_GD_MogrifyFile): Parameters encoding and bye_sex are unsigned longs. * src/parse.c (_GD_ParseDirective _GD_ParseFragment): Parameter flags is unsigned long. * src/internal.h: typedef unsigned int as _gd_spf_t for use as internal representation for SPFs. In the external API, unsigned int is still explicitly used. * src/index.c (get_framenum_subset64): Use _gd_spf_t. * src/getdata.c (_GD_MultiplyData _GD_CMultiplyData _GD_DoLincom _GD_DoMultiply getdata64): Use _gd_spf_t internally. * src/spf.c (_GD_GetSPF get_spf): Use _gd_spf_t internally. * src/putdata.c (putdata64): Use _gd_spf_t internally. * src/common.c (_GD_AddData _GD_LincomData _GD_CLincomData): Use _gd_spf_t. * src/getdata.h.in: Added GD_PRETTY_PRINT. * src/flush.c (_GD_PadField): Added. * src/flush.c (_GD_FieldSpec): Pad field specs if requested. * src/flush.c (_GD_FlushFragment): Compute max and mean field lengths if pretty printing. * bindings/make_parameters.c: Add GD_PRETTY_PRINT. * src/getdata.h.in: Bump standards version. * src/globals.c (dirfilename dirfile_reference): Clear error on success. * bindings/python/test/big_test.py: Test adding/modifying scalars. * bindings/python/pyentry.c (gdpy_set_scalar_from_pyobj gdpy_entry_getscalars): Added. * bindings/python/pyentry.c (gdpy_set_entry_from_tuple): Update for scalar[]. * bindings/python/pyentry.c (gdpy_entry_setspf gdpy_entry_setm gdpy_entry_setb gdpy_entry_setbitnum gdpy_entry_setnumbits gdpy_entry_setshift gdpy_entry_seta): Allow non-literal CONST names. * bindings/python/pyentry.c (gdpy_entry_getspf gdpy_entry_getm gdpy_entry_getb gdpy_entry_getbitnum gdpy_entry_getnumbits gdpy_entry_getshift gdpy_entry_geta): Return non-literal CONST names. * bindings/cxx/bitentry.cpp (BitEntry::Scalar): Added. * bindings/cxx/bitentry.cpp (BitEntry::SetFirstBit BitEntry::SetNumBits): Add CONST name versions. * bindings/cxx/sbitentry.cpp (SBitEntry::Scalar): Added. * bindings/cxx/sbitentry.cpp (SBitEntry::SetFirstBit BitEntry::SetNumBits): Add CONST name versions. * bindings/cxx/entry.cpp (Entry::Scalar): Added. * bindings/cxx/lincomentry.cpp (LincomEntry::SetScale LincomEntry::SetOffset): Add CONST name versions. * bindings/cxx/lincomentry.cpp (LincomEntry::Scalar): Added. * bindings/cxx/rawentry.cpp (RawEntry::SetSamplesPerFrame): Add CONST name version. * bindings/cxx/polynomentry.cpp (PolynomEntry::SetCoefficient): Add CONST name version. * bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift): Add CONST name version. * bindings/cxx/getdata/rawentry.h (Scalar): Added. * bindings/cxx/getdata/phaseentry.h (Scalar): Added. * bindings/cxx/phaseentry.cpp (PhaseEntry::SetShift): shift is long int. * bindings/cxx/getdata/entry.h (PhaseEntry::Shift): shift is long int. * bindings/cxx/getdata/phaseentry.h (PhaseEntry::Shift): shift is long int. * bindings/cxx/dirfile.cpp (Dirfile::Dirfile Dirfile::Include): Flags is unsigned long. * bindings/f77/fgetdata.c (GDCLOS GDDSCD): Don't close dirfile unit #0. * bindings/f77/fgetdata.c (GDGSCA GDASCA): Added. * bindings/f77/test/big_test.f: Test GDGSCA and GDASCA. * bindings/f77/getdata.f90.in: Add scalar member. to gd_entry. * bindings/f77/getdata.f90.in (fget_entry): Call GDGSCA to fill scalar members. * bindings/idl/getdata.c: Add SCALAR to GD_ENTRY structure. * bindings/idl/getdata.c (gdidl_make_idl_entry gdidl_read_idl_entry): Copy SCALAR members. * bindings/idl/getdata.c (gdidl_dirfile_close): Don't close dirfile unit #0. 2009-10-07 D. V. Wiebe svn:316 * configure.ac: Update interface version info. * m4/python.m4: Fix no Python assignment. * configure.ac: Don't compute BUILD_DATE if it's not needed. * bindings/f77/test/big_test.f: Use constant length strings in array constructors. 2009-10-06 D. V. Wiebe svn:315 GetData-0.6.0rc1: * test/move_meta.c: Added. * m4/idl.m4: Add --with-idl-dlm-dir argument; needed by distcheck. * src/ascii.c: Explicitly cast edata to (FILE*) to fix compiler warnings. Reported by Josh Netterfield. * src/move.c (dirfile_move): Update metafield entries on parent move. * src/mod.c (dirfile_malter_spec): Fix "filename" in _GD_Tokenise call. * bindings/python/pygetdata.c: Add GETDATA_VERSION_SUFFIX to version tuple. * bindings/f77/fgetdata.c (_GDF_Callback): Fix debug message. * bindings/make_parameters.c: Moved from f77 subdir, and updated to handle both IDL and Python bindings as well. * bindings/python/pyconstants.c: Removed; now automatically generated by make_parameters. * bindings/python/test/callback.py: Clean-up after test.o * bindings/python/test/Makefile.am: Fix for rpath builds. * bindings/idl/test: Added. * bindings/idl/getdata.c (gdidl_clear_dirfile gdidl_cmp_to_c99 gdidl_get_frameoffset gdidl_get_string): Added. * bindings/idl/getdata.c (gdidl_make_idl_entry): Initialise N_FIELDS and POLY_ORD. Fix initialisation of CM, CB, CA. * bindings/idl/getdata.c (gdidl_read_idl_entry): Allow proper use for dirfile_alter, by conditionally handling missing structure elements. * bindings/idl/getdata.c (gdidl_convert_encoding): If the encoding is numeric, assume it's a proper GD__ENCODED value. * bindings/idl/getdata.c (gdidl_dirfile_add_bit gdidl_dirfile_add_const gdidl_dirfile_add_lincom gdidl_dirfile_add_linterp gdidl_dirfile_add_multiply gdidl_dirfile_add_phase gdidl_dirfile_add_polynom gdidl_dirfile_add_sbit gdidl_dirfile_add_string): Fix dirfile_madd_() calls. * bindings/idl/getdata.c: IDL 6 appears to be adding INT type keyword paramters to the existing value, instead of replacing them. Fix the bindings to allow for this. * bindings/idl/getdata.c (gdidl_dirfile_alter_lincom gdidl_dirfile_alter_polynom): Initialise n_fields/poly_ord if necessary. Fix complex data conversion. * bindings/idl/getdata.c (gdidl_dirfile_close): Add the "/DISCARD" keyword to call dirfile_discard(). Remove the dirfile from the internal list on success. * bindings/idl/getdata.c (gdidl_dirfile_discard): Removed. * bindings/idl/getdata.c (gdidl_get_entry): Handle look-up failure. * bindings/idl/getdata.c (IDL_Load): Initialise the GD_CONSTANTS structure. * configure.ac: Add getdata_extra macro.o * man/dirfile_alter_encoding.3.in man/dirfile_alter_entry.3 man/getdata.3 man/dirfile_add_bit.3 man/dirfile_alter_bit.3 man/dirfile_cbopen.3 man/dirfile_add.3 man/dirfile-format.5 man/dirfile.5 man/get_constant.3 man/dirfile_add_spec.3 man/dirfile_madd_bit.3 man/dirfile-encoding.5: Update. * man/dirfile-complex.5: Added. 2009-09-30 D. V. Wiebe svn:314 * test/convert_complex128_float64.c test/get_const_complex.c test/madd_lincom.c test/madd_polynom.c test/repr_real_m.c test/repr_i.c test/put_repr.c test/repr_real_a.c test/repr_m.c test/repr_real_r.c test/get_const.c test/madd_string.c test/add_string.c test/repr_a.c test/convert_complex128_complex64.c test/repr_r.c test/get_const_repr.c test/convert_complex64_float64.c test/repr_real_i.c: Clean compiler warnings. * src/open.c (dirfile_parser_callback): Changed the parser callback protoype again. This is hopefully less likely to break things in the future. * src/getdata.h.in: Define two new types: gd_parser_data_t, a structure of getdata data passed to the callback function, and gd_parser_callback_t, the callback function itself. * src/parse.c (_GD_ParseFragment): Call the new parser callback. * test/open_cb_invalid.c test/include_cb.c test/open_cb_rescan.c test/open_cb_ignore.c test/include_pc.c test/open_cb_cont.c test/open_cb_abort.c bindings/python/test/callback.py bindings/python/pydirfile.c bindings/cxx/dirfile.cpp bindings/cxx/getdata/dirfile.h bindings/f77/fgetdata.c: Update for new callback prototype. * configure.ac: Attempt to compile a minimal F90 program with a .f90 extension. This should tip us off to any old G77s which are pretending to be "Fortran" compilers. * util/checkdirfile.c: A significant overhaul to add more functionality: reports all the lines with syntax errors, calls dirfile_validate() on all fields. 2009-09-29 D. V. Wiebe svn:313 * test/madd_spec.c test/madd_polynom.c test/get_polynom.c test/entry_polynom.c test/entry_lincom.c test/add_string.c test/madd_phase.c test/madd_sbit.c test/madd_linterp.c test/alter_linterp.c test/madd_multiply.c: Make tests more rigorous. * test/convert_complex128_float64.c test/parse_meta_implicit.c test/convert_float32_complex128.c test/parse_meta_implicit2.c test/get_const_complex.c test/get_complex128.c test/alter_spec_meta.c test/convert_float64_complex128.c test/repr_uint64.c test/repr_real_m.c test/convert_complex64_uint64.c test/repr_float32.c test/convert_int16_complex64.c test/repr_i.c test/get_complex64.c test/repr_int32.c test/put_complex128.c test/convert_uint8_complex64.c test/alter_lincom_23.c test/get_cpolynom.c test/repr_int16.c test/convert_float64_complex64.c test/put_repr.c test/convert_complex64_complex128.c test/convert_float32_complex64.c test/repr_real_a.c test/convert_complex128_int64.c test/convert_complex64_int64.c test/put_endian_complex128.c test/put_endian_complex64.c test/convert_uint16_complex128.c test/repr_m.c test/convert_uint16_complex64.c test/repr_real_r.c test/convert_int64_complex64.c test/get_const.c test/parse_meta_index2.c test/get_endian_complex64.c test/repr_uint8.c test/convert_int32_complex64.c test/convert_int8_complex128.c test/convert_int16_complex128.c test/madd_string.c test/repr_float64.c test/convert_complex128_complex64.c test/convert_int8_complex64.c test/repr_int64.c test/convert_complex128_uint64.c test/convert_uint32_complex128.c test/repr_a.c test/put_complex64.c test/repr_int8.c test/repr_uint32.c test/get_endian_complex128.c test/madd_cpolynom.c test/convert_uint64_complex64.c test/add_spec_meta.c test/repr_uint16.c test/convert_int32_complex128.c test/get_clincom.c test/convert_uint32_complex64.c test/convert_uint8_complex128.c test/repr_r.c test/alter_cpolynom.c test/convert_uint64_complex128.c test/get_const_repr.c test/convert_complex64_float64.c test/repr_real_i.c test/convert_int64_complex128.c: Added. * bindings/python/test/big_test.py: Added. * bindings/python/test/tst_getdata.py: Deleted. * bindings/cxx/test/big_test.cpp: Added. * bindings/cxx/test/entry.cpp: Deleted. * bindings/f77/test/big_test95.f90: Added. * bindings/f77/test/big_test.f: Completed. * bindings/f77/test/fget_field_list.f90 bindings/f77/test/fget_entry.f90 bindings/f77/test/gdfget.f bindings/f77/test/fgetdata.f90: Deleted. * index.c (get_framenum_subset64): Multiply user-supplied frame limits by spf. * getdata.c (_GD_DoField): Don't pass the user-supplie represenation when calculating the native type. * errors.c: Fix error strings for GD_E_DELETE. * encoding.c (_GD_EncodingUnderstood): Add GD_LZMA_ENCODED. * constant.c (get_constant): specify num_samp=1 in _GD_DoField call to ensure correct repr handling. * putdata.c (_GD_DoRawOut): Properly handle byte swapping for complex data. * putdata.c (putdata64): Remove spurious free(). * parse.c: Remove bogus const specifier from in_cols. * internal.h: Add table_len to private entry struct. * parse.c (_GD_ParseLinterp): Don't store the computed path in E->table. * mod.c (_GD_Change): ditto. Reset Qe.table_path instead. Furthermore, if moving the table, recompute table_path, first. * common.c (_GD_SetTablePath): Added. * common.c (_GD_ReadLinterpFile): Update for table_path. * common.c (_GD_ReadLinterpFile): Close the file after reading it. * mod.c (_GD_Change): Fix the limits on the scalar free. * mod.c (dirfile_alter_cpolynom): Move invariant code out of the loop. * parse.c (_GD_ParseFieldSpec): Parse a "Barth"-style meta field specification. * parse.c (_GD_ParseFieldSpec): Allow "INDEX" as a metafield name. * mod.c (_GD_Change): Recompute comp_scal, instead of just using the input. * add.c (_GD_Add): ditto. * add.c (dirfile_madd_string): Search for the correct field code. * common.c (_GD_Alloc): Return early on n=0. * bindings/python: Renamed module to pygetdata. * bindings/python/pydirfile.c (gdpy_dirfile_alter gdpy_dirfile_getfragmentindex gdpy_dirfile_getrawfilename gdpy_dirfile_move gdpy_dirfile_rename): Added. * bindings/python/pyentry.c (gdpy_set_entry_from_tuple): Fix initialisation of PHASE->shift. * bindings/python/pyentry.c (gdpy_set_entry_from_dict): Fix RAW keys. * bindings/python/pyentry.c (gdpy_entry_init): Make the parameter list optional for STRING entries. * bindings/python/pyentry.c (gdpy_entry_getbitnum gdpy_entry_setbitnum gdpy_entry_getshift gdpy_entry_setshift): Fix field_type check. * bindings/cxx/entry.cpp (Entry::Rename): Properly handle renaming metafields. * bindings/cxx/entry.cpp (Entry::SetName Entry::SetFragmentIndex): Added. * bindings/cxx/getdata/entry.h (Entry::Associated Entry::Dissociate Entry::Name Entry::ComplexScalars Entry::ConstType): Added. * bindings/cxx/fragment.cpp (Fragment::SetEncoding): Fix dirfile_alter_encoding call. * bindings/cxx/lincomentry.cpp (LincomEntry::SetScale LincomEntry::SetOffset): Add complex versions. * bindings/cxx/polynomentry.cpp (PolynomEntry::SetCoefficient): ditto. * bindings/cxx/dirfile.cpp (Dirfile::Dirfile): Add empty constructor. * bindings/cxx/dirfile.cpp (Dirfile::FragmentIndex Dirfile::Name): Added. * bindings/cxx/getdata/rawentry.h bindings/cxx/getdata/linterpentry.h bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/bitentry.h bindings/cxx/getdata/multiplyentry.h bindings/cxx/getdata/phaseentry.h bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/sbitentry.h bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h: Added empty constructors. * bindings/cxx/getdata/dirfile.h: Include all the other headers. * bindings/cxx/getdata.entry.h (Entry::Coefficient Entry::CCoefficient Entry::Input): Fix calls for POLYNOM entries. * bindigns/f77/fgetdata.c (_GDF_CString): Return a empty string instead of NULL on l=0. * bindings/f77/fgetdata.c (_GDF_GetDirfile): Don't crash on index out of range. * bindings/f77/fgetdata.c (gdgtst gdptst): Report a length one less than the C API. * bindings/f77/getdata.f90.in: Don't overload gd_entry%n_fields: use gd_entry%poly_ord when necessary. * bindings/f77/getdata.f90.in (fget_nmfields): Call the right F77 function. * bindings/f77/getdata.f90.in (fget_mvector_list): Fix gdmven call. * bindings/f77/getdata.f90.in (fget_entry): Call the right F77 function for PHASE entries. * bindings/f77/getdata.f90.in (fdirfile_add_multiply fdirfile_add_phase fdirfile_madd_multiply fdirfile_madd_phase fdirfile_alter_multiply fdirfile_alter_phase): Fix name. * bindings/f77/getdata.f90.in (fdirfile_madd_sbit fdirfilename): Added. 2009-09-26 D. V. Wiebe svn:312 * bindings/idl/getdata.c: Fixed typo in DLM magic for gdidl_get_raw_filename. * configure.ac: Remove spurious AC_SUBST. 2009-09-21 D. V. Wiebe svn:311 * src/getdata.h.in: complex_scalars member shortened to comp_scal. * test/add_cpolynom.c test/add_clincom.c test/index.c test/index_range.c test/madd_clincom.c test/index_domain.c test/madd_const.c: Added. * test/madd_bit.c test/madd_lincom.c test/add_lincom.c test/add_phase.c test/add_multiply.c test/add_bit.c test/add_const.c test/add_linterp.c test/add.c test/add_sbit.c test/madd.c test/add_raw.c test/add_polynom.c test/add_spec.c: Make more rigourous tests for success. * src/entry.c (dirfile_validate): Added. * src/getdata.c (_GD_DoField): removed the largely unnecessary field_code argument. All callers changed. * src/putdata.c (_GD_DoFieldOut): ditto. * src/legacy.c (CopyPolynomEntry GetFormat): Report POLYNOMs and LINCOMs. Similarly, report SBITs as BITs. * src/index.c: Added. * src/getdata.c (_GD_DoLincom _GD_DoPolynom): Select complex versions of the calculation functions based on E->comp_scal, not the native type. * src/errors.c (get_error_string): Properly report success. * src/getdata.c src/internal.h: Moved the NAN() function to the header. * src/getdata.h.in: Removed a number of GNUisms. * src/add.c (_GD_Add): Set E->comp_scal for LINCOMs and POLYNOMs. Fix copying of POLYNOM parameters. * src/add.c (dirfile_madd_clincom): Set comp_scal correctly. * src/add.c (dirfile_madd_const): Search for the correct field code. * bindings/python/test/callback.py bindings/python/test/tst_getdata.py: Added. * bindings/python/pygetdata.c bindings/python/pyconstants.c bindings/python/pydirfile.c bindings/python/pygetdata.h bindings/python/pyentry.c: Update for get_framenum() and complex values. * bindings/cxx/dirfile.cpp (Dirfile::NativeType Dirfile::Validate Dirfile::FrameNum): Added. * bindings/cxx/lincomentry.cpp bindings/cxx/polynomentry.cpp bindings/cxx/getdata/polynomentry.h: Update for complex values. * bindings/f77/test/big_test.f: Added. * bindings/f77/fgetdata.c (_GDF_FString): Don't unnecessarily cut of the last character of the string. Also, don't corrupt memory. * bindings/f77/fgetdata.c (GDFLDN GDMFDN): Check for field_num < 0. * bindings/f77/fgetdata.c (GDESTR): Properly space-pad the string. * bindings/f77/fgetdata.c (GDGERW GDGELC GDGEPN GDGECP GDGEBT GDGESB GDGEMT GDGEPH GDGECO): Fix crash-on-error due to indiscriminate use of dirfile_free_entry_strings(). * bindings/f77/fgetdata.c (GDGEPN): Fix multiple bugs resulting from improper translationg from GDGELC. * bindings/f77/fgetdata.c (GDGECL GDGECP GDADCL GDADCP GDMDCL GDMDCP GDALCL GDALCP GDNTYP GDCSCL GDVLDT GDFNUM GDFNSS): Added. * bindings/f77/getdata.f90.in (fgetdata_c8 fgetdata_c16 fget_constant_c8 fget_constant_c16 fputdata_c8 fputdata_c16 fput_constant_c8 fput_constant_c16 fdirfile_add_clincom fdirfile_add_cpolynom fdirfile_madd_clincom fdirfile_madd_cpolynom fdirfile_alter_clincom fdirfile_alter_cpolynom fget_native_type fdirfile_validate fget_framenum fget_framenum_subset): Added. * bindings/idl/getdata.c: Update. 2009-09-21 D. V. Wiebe svn:309 * src/meta_list.c (get_mstrings): Properly terminate the list. Bug report from Matthew Truch. * test/svlist_meta.c: Be more verbose. 2009-09-03 D. V. Wiebe svn:308 * test/put_sbit.c: Ensure data is signed. * src/internal.h: Add repr, complex_table, cy, cconst to _gd_private_entry; added representation stuff. * src/getdata.h.in: Add GD_E_BAD_REPR, GD_E_FORMAT_LITTERAL, GD_COMPLEX64, GD_COMPLEX128. Add complex_scalars, cm, cb, ca to _gd_unified_entry. * src/entry.c (_GD_GetScalar): Set complex_scalars. * src/entry.c (_GD_CalculateEntry): Retrieve all scalars as GD_COMPLEX, and then realify back down. * src/types.c (_GD_ConvertType): Handle complex types. * src/getdata.c (_GD_FillFileFrame _GD_PolynomData _GD_MultiplyData): Handle complex types. * src/getdata.c (_GD_DoRaw): Handle complex data endianness correction properly. * src/getdata.c (_GD_CPolynomData _GD_CMultiplyData): Added. * src/getdata.c (_GD_DoMultiply _GD_DoPolynom): Handle complex input fields. * src/getdata.c (_GD_DoLinterp): Permit complex y-valued LUTs. * src/getdata.c (_GD_DoConst): Handle complex valued scalars. * src/flush.c (_GD_TypeName): Add GD_COMPLEX64 and GD_COMPLEX128. * src/flush.c (_GD_WriteConst): Write a complex literal. * src/flush.c (_GD_FieldSpec): Handle complex valued literals. * src/ascii.c (_GD_ScanFormat _GD_AsciiRead _GD_AsciiWrite): Handle complex data. * src/putdata.c (_GD_DoLinterpOut _GD_DoLincomOut _GD_DoPolynomOut _GD_DoConstOut): Handle complex writes. * src/del.c (_GD_DeReference): Handle complex scalars. * src/parse.c (_GD_RawType): Add GD_COMPLEX64 and GD_COMPLEX128. * src/parse.c (_GD_SetScalar): Handle complex literals. This may now through the FORMAT suberror GD_E_FORMAT_LITTERAL. Callers updated. * src/parse.c (_GD_ParseLincom _GD_ParsePolynom _GD_ParseConst): Handle complex literals. * src/mod.c (_GD_Change): Handle complex scalars. * src/mod.c (dirfile_alter_clincom dirfile_alter_cpolynom): Added. * src/add.c (_GD_Add): Handle complex scalars. * src/add.c (dirfile_add_clincom dirfile_add_cpolynom dirfile_madd_clincom dirfile_madd_cpolynom): Added. * src/common.c (_GD_ReadLinterpFile): Allow complex y-values. * src/common.c (_GD_LinterpData): Handle complex return types. * src/common.c (_GD_CLinterpData): Added. * src/native.c: Added. * src/entry.c (get_entry get_entry_type get_fragment_index): Discard any represenation in the input field code. * src/getdata.c (_GD_ExtractRepr): Added. * src/getdata.c (_GD_DoField): Handle represenations for both complex and real types. * src/getdata.c (getdata64): Decode the input representation. * src/name.c (_GD_ValidateField): Don't allow representation suffixes in field names. * src/spf.c (get_spf): Discard any represenation in the input field code. * src/constant.c (get_constant put_constant): Handle representations. * src/putdata.c (_GD_DoFieldOut): Complain on getting a representation. * src/putdata.c (putdata64): Decode the input representation. * src/common.c (_GD_GetRepr): Added. * src/errors.c: Add errors for GD_E_FORMAT_LITTERAL and GD_E_BAD_REPRs. * src/legacy.c: Add GD_E_BAD_REPR to GD_ERROR_CODES. * src/getdata.c (_GD_FillZero): Let the caller deal with s0. * src/getdata.c (_GD_DoLincom _GD_DoMultiply _GD_DoBit _GD_DoPhase _GD_DoLinterp _GD_DoPolynom): Use _GD_BadInput. * src/spf.c (_GD_GetSPF): Use _GD_BadInput. * src/common.c (_GD_BadInput): Added. * src/constant.c (put_constant): Return -1 on error. * src/getdata.c (_GD_DoLincom): Rewrote for better optimisation. Includes Matthew Truch's m=1 b=0 short circuit. * src/common.c (_GD_ScaleData): Deleted. * src/commonc. (_GD_LincomData _GD_CLincomData): Added. * src/common.c (_GD_Alloc): Throw GD_E_ALLOC on malloc error. * src/flush.c (_GD_FlushFragment): Add the missing encoding types, and write something to the file on an unhandled type. * src/putdata.c (_GD_DoRawOut): Check malloc return. * src/getdata.c (_GD_DoRaw _GD_DoLincom _GD_DoMultiply _GD_DoBit _GD_DoPhase _GD_DoLinterp _GD_DoPolynom _GD_DoField getdata64): Only the user cares about first_frame, and num_frames. Convert to pure samples early in getdata64(). * src/putdata.c (_GD_DoRawOut _GD_DoLincomOut _GD_DoBitOut _GD_DoPhaseOut _GD_DoLinterpOut _GD_DoPolynomOut _GD_DoFieldOut putdata64): Ditto in putdata64(). 2009-08-17 D. V. Wiebe svn:306 * src/getdata.c (_GD_DoMultiply): Load the second field as GD_DOUBLE. * src/getdata.c (_GD_MultiplyData): Compute MULTIPLYs in double precision, rather than the return_type. 2009-08-13 D. V. Wiebe svn:305 GetData license changed to GNU LGPLv2.1+. All documentation updated. 2009-08-04 D. V. Wiebe svn:304 * m4/ax_compare_version.m4 m4/idl.m4: Added. * m4/idl.m4: Added. * bindings/idl: Added. * src/getdata.h.in: Renamed GD_MAX_POLYNOM to GD_MAX_POLYORD to remove confusion as to what this actually is. * bindings/f77/fgetdata.c: Ensure the f77dirfiles array is initialised before we try to read from it, even if the caller hasn't opened a dirfile yet. 2009-07-20 D. V. Wiebe svn:302 * test/open_cb_invalid.c test/include_cb.c test/open_cb_rescan.c test/open_cb_ignore.c test/include_pc.c test/open_cb_cont.c test/open_cb_abort.c: Update for new sehandler. * test/flush_spec.c: Fix compiler warinings. 2009-07-20 D. V. Wiebe svn:301 * util/: moved from bin/ * test/flush_spec.c: Added. * src/flush.c (_GD_StringEscapeise): Properly handle bytex 0x80-0xFF. * src/flush.c (_GD_WriteConst): Added. * src/flush.c (_GD_FieldSpec): Write CONST field parameters, where appropriate. * src/parse.c (_GD_ParseBit): Fix check for CONST field in error checks for numbits and bitnum. * m4/python.m4: Added. * bindings/python/: Added. * configure.ac: Python tests. * src/open.c (dirfile_parser_callback dirfile_cbopen): Pass an opaque pointer as a fourth argument to the parser callback handler. * src/parse.c (_GD_ParseFragment): Pass the fourth, opaque pointer to the callback. * bindings/cxx/dirfile.cpp: Update for fourth argument to callback. * bindings/f77/fgetdata.c: Use fourth argument to callback to support per-dirfile callback functions. Removed _gdf_f77_callback global. * src/mod.c (_GD_Change): Fix _GD_SetError calls for GD_E_BAD_TYPE errors. * src/add.c (_GD_Add): Ditto. * src/add.c (dirfile_add_spec dirfile_madd_spec): Flag fragment as modified on parser success. * src/foffs.c: Remove spurious newlines from debugging trace messages. * src/types.c (_GD_ConvertType): return propper error on bad out_type * src/getdata.h.in: Changed the value of GD_SCALAR_ENTRY * bindings/cxx/entry.cpp bindings/cxx/dirfile.cpp bindings/cxx/getdata/dirfile.h bindings/cxx/getdata/entry.h: Update for SBIT and POLYNOM. * bindings/cxx/polynomentry.cpp bindings/cxx/sbitentry.cpp bindings/cxx/getdata/polynomentry.h bindings/cxx/getdata/sbitentry.h: Added. * bindings/f77/fgetdata.c (GDGEPN GDGESB GDADPN GDADSB GDMDPN GDMDSB GDALSB GDALPN): Added. * bindings/f77/make_parameters.c: Added GD_LZMA_ENCODED GD_POLYNOM_ENTRY GD_SBIT_ENTRY. * bindings/f77/getdata.f90.in (fget_entry fdirfile_add fdirfile_madd fdirfile_alter_entry): Update for SBIT and POLYNOM. * bindings/f77/getdata.f90.in (fdirfile_add_sbit fdirfile_add_polynom fdirfile_madd_polynom fdirfile_alter_sbit fdirfile_alter_polynom): Added. * bindings/cxx/test/fragment.h: Add the Index() method. * bindings/cxx/lincomentry.cpp (LincomEntry::SetNFields): Fix initialisation of new terms. * man/dirfile_uninclude.3 man/dirfile_include.3 man/get_entry.3: Typoes. 2009-06-23 D. V. Wiebe svn:298 * test/get_sbit.c test/parse_sbit.c test/add_sbit.c test/put_sbit.c test/madd_sbit.c: Added. * src/getdata.h.in: define GD_SBIT_ENTRY. * src/entry.c (_GD_FreeE _GD_CalculateEntry get_entry): Update for SBIT. * src/getdata.c (_GD_DoBit): Add is_signed parameter and calculates signed bitfields when needed. * src/getdata.c (_GD_DoField): Update for SBIT. * src/flush.c (_GD_FieldSpec _GD_Flush): Update for SBIT. * src/nfields.c (get_nfields_by_type): Update for SBIT. * src/putdata.c (_GD_DoFieldOut): Update for SBIT. * src/del.c (_GD_ClearDerived _GD_DeReference): Update for SBIT. * src/parse.c (_GD_ParseBit): Add is_signed parameter and parse SBIT. * src/parse.c (_GD_ParseFieldSpec): Update for SBIT. * src/field_list.c: Add GD_SBIT_ENTRY to _gd_entype_index. * src/mod.c (dirfile_alter_sbit): Added. * src/mod.c (_GD_Change): Update for SBIT. * src/add.c (_GD_Add): Update for SBIT. * src/add.c (dirfile_add_sbit dirfile_madd_sbit): Added. 2009-06-18 D. V. Wiebe svn:297 * configure.ac: Move AM_CONDITIONALS to a block near the end to avoid testing them too soon. 2009-06-16 D. V. Wiebe svn:295 * test/xz_nframes.c test/lzma_nframes.c test/lzma_get.c test/xz_get.c: Added. * m4/encoding.m4 (GD_CHECK_ENCODING): Fix to allow an empty 6th parameter. * configure.ac: Add LZMA/xz encoding framework check. * src/lzma.c: Added. * src/encoding.c: Add entries to _gd_ef for the LZMA schemes. * src/internal.h: Add GD_ENC_LZMA_RAW and GD_ENC_XZ_RAW. * src/getdata.h.in: Add GD_LZMA_ENCODED. * src/bzip.c (_GD_Bzip2Read): Fix length count. 2009-06-11 D. V. Wiebe svn:292 * test/get_lincom_non.c test/parse_lincom_non_ncols.c test/parse_lincom_non.c: Added. * src/parse.c (_GD_ParseLincom): Make optional. 2009-06-11 D. V. Wiebe svn:291 * test/alter_polynom_coeff.c test/get_polynom_noin.c test/parse_polynom_scalar.c test/put_polynom1.c test/alter_polynom_input.c test/put_polynom2.c test/madd_polynom.c test/entry_polynom_scalar.c test/parse_polynom_ncols1.c test/parse_polynom.c test/add_polynom.c test/spf_polynom.c test/parse_polynom_ncols2.c test/put_polynom_noin.c test/alter_polynom_ord.c test/get_polynom.c test/entry_polynom.c: Added. * src/getdata.c (_GD_DoField): Fix call to _GD_DoPolynom. * src/parse.c (_GD_ParsePolynom): Fix off-by-one error. * src/mod.c (_GD_Change): Handle poly_ord = 0 properly. * src/mod.c (dirfile_alter_polynom): Fix off-by-one error. * src/getdata.h.in: Declare polynom API. * src/add.c (_GD_Add): Only copy the first polynom in_field. 2009-06-09 D. V. Wiebe svn:290 * src/internal.h: Add GD_E_BAD_ENTRY_POLYORD. * src/getdata.h.in: Define GD_MAX_POLYNOM and GD_POLYNOM_ENTRY. Increment GD_N_ENTYPES. Add POLYNOM struct to the entry struct. * src/entry.c (_GD_FreeE _GD_CalculateEntry get_entry): Add case for GD_POLYNOM_ENTRY. * src/getdata.c (_GD_DoField): Add case for GD_POLYNOM_ENTRY. * src/flush.c (_GD_Flush _GD_FieldSpec): Add case for GD_POLYNOM_ENTRY. * src/nfields.c (get_nfields_by_type): Add case for GD_POLYNOM_ENTRY. * src/spf.c (_GD_GetSPF): Add case for GD_POLYNOM_ENTRY. * src/putdata.c (_GD_DoFieldOut): Add case for GD_POLYNOM_ENTRY. * src/del.c (_GD_ClearDerived _GD_DeReference): Add case for GD_POLYNOM_ENTRY. * src/mod.c (_GD_Change): Add case for GD_POLYNOM_ENTRY. * src/add.c (_GD_Add): Add case for GD_POLYNOM_ENTRY. * src/getdata.c (_GD_PolynomData _GD_DoPolynom): Added. * src/putdata.c (_GD_DoPolynomOut): Added. * src/parse.c (_GD_ParsePolynom): Added. * src/mod.c (dirfile_alter_polynom): Added. * src/add.c (dirfile_add_polynom dirfile_madd_polynom): Added. * src/entry.c (_GD_FreeE): GD_MAX_LINCOM -> GD_MAX_POLYNOM in limits. * src/mod.c (_GD_Change): GD_MAX_LINCOM -> GD_MAX_POLYNOM in limits. * src/internal.h: GD_MAX_LINCOM -> GD_MAX_POLYNOM in limits. * src/parse.c (_GD_ParseFieldSpec): Handle POLYNOM field type. * src/errors.c: Add GD_E_BAD_ENTRY_POLYORD suberror under GD_E_BAD_ENTRY. * src/field_list.c: Add GD_POLYNOM_ENTRY to _gd_entype_index. * src/mod.c (dirfile_alter_entry): For POLYNOM, also set move. * src/mod.c (_GD_Change): Fix scalar_free flags for LINCOM. * src/mod.c (dirfile_alter_lincom): Rename "move" to "flags" to avoid obfuscating the purpose of this variable. * src/mod.c (dirfile_alter_lincom): Check validity of n_fields before use. * src/add.c (_GD_Add dirfile_add_lincom dirfile_madd_lincom): Check validity of n_fields before use. 2009-01-16 D. V. Wiebe svn:285 GetData 0.5.0 released. 2009-01-13 D. V. Wiebe svn:283 GetData-0.5.0rc4: * test/endian_move.c test/encode_move.c test/endian_alter.c: Fix more big-endian errors reported by Matthew Truch. * bindings/f77/fgetdata.c (gdcopn gdclbk): Properly check the callback parameter for NULL. Reported by Matthew Truch. * bindings/f77/fgetdata.c bindings/f77/Makefile.am: Add debugging tracing. 2009-01-09 D. V. Wiebe svn:281 GetData-0.5.0rc3: * test/encode_move.c test/move_data_endian.c test/endian_get.c test/endian_alter.c: Fix for correct operation on big endian architectures. * src/gzip.c (_GD_GzipSize): Byte swap size on big endian machines. * src/flush.c (_GD_FlushFragment): Static. * bindings/cxx/dirfile.cpp (Dirfile::Add Dirfile::MAdd): Don't return before setting the dirfile for the entry. * bindings/f77/fgetdata.c (_GDF_Callback): Static. * bindings/f77/fgetdata.h: Fix function names. 2009-01-08 D. V. Wiebe svn:279 GetData-0.5.0rc2: * src/encoding.c src/endian.c src/foffs.c src/getdata.c src/name.c src/flush.c src/encoding.c src/putdata.c src/del.c src/move.c src/parse.c src/mod.c src/internal.h src/nframes.c: Hide internal symbols. * src/internal.h src/Makefile.am Makefile.am configure.ac: Use an embeded ltdl if no system ltdl is found. * m4/encdoing.m4: Hide ltdl symbols. * m4/ltdl.m4 src/gd_ltdl.c src/gd_ltdl.h: Added. These are taken unmodified from the libtool distribution. 2008-12-23 D. V. Wiebe svn:277 GetData-0.5.0rc1: * NEWS README: Updated. * src/slim.c (_GD_SlimOpen _GD_SlimSize): Remove filebase stuff. 2008-12-21 D. V. Wiebe svn:276 * bindings/cxx/linterpentry.cpp bindings/cxx/bitentry.cpp bindings/cxx/multiplyentry.cpp bindings/cxx/lincomentry.cpp bindings/cxx/fragment.cpp bindings/cxx/constentry.cpp bindings/cxx/rawentry.cpp bindings/cxx/phaseentry.cpp bindings/cxx/getdata/indexentry.h bindings/cxx/getdata/getdata/rawentry.h bindigns/cxx/getdata/linterpentry.h bindings/cxx/getdata/bitentry.h bindings/cxx/getdata/multiplyentry.h bindings/cxx/getdata/phaseentry.h bindings/cxx/getdata/lincomentry.h bindings/cxx/getdata/fragment.h bindings/cxx/getdata/constentry.h bindings/cxx/getdata/stringentry.h bindings/cxx/stringentry.cpp bindings/cxx/indexentry.cpp: Added. * bindings/cxx/dirfile.cpp bindings/cxx/getdata/dirfile.h bindings/cxx/entry.cpp bindings/cxx/getdata/entry.h: Updated C++ bindings for the new functions. * bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/getdata.f90.in: Update for get_entry_type and get_fragment_index. * test/fragment_index.c test/entry_type.c: Added. * src/entry.c (get_entry_type get_fragment_index): Added. * src/name.c (dirfile_rename): Prohibit renaming INDEX. * src/move.c (dirfile_move): Prohibit moving INDEX. 2008-12-19 D. V. Wiebe svn:274 * bindings/f77/getdata.f90.in doc/README.F95: Add Fortran 95 bindings for new functions, and for the dirfile_[m]add_ functions. * bindings/f77/getdata.f90.in: Fix call to gdadsp and gdmdsp 2008-12-19 D. V. Wiebe svn:273 * src/protect.c (dirfile_protect): Swap order of arguments for consistency with the dirfile_alter_ functions. * bindings/f77/fgetdata.c (_GDF_CString _GDF_FString): Use Fortran string length = 0 as a proxy for a C NULL pointer. * bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f.in doc/README.f77: Add Fortran 77 bindings for new functions. 2008-12-18 D. V. Wiebe svn:272 * test/include_pc.c test/include_cb.c test/include_syntax.c: Added. * src/open.c (dirfile_parser_callback): Added. 2008-12-18 D. V. Wiebe svn:270 * test/global_ref_get.c: Added. * src/globals.c (get_reference): Added. * bindings/f77/test/gdcopn.f: Added. * bindings/f77/fgetdata.c (_GDF_ClearDirfile): Let caller close dirfile. * bindings/f77/fgetdata.c (_GDF_FString): Fix off-by-one error. * bindings/f77/fgetdata.c (_GDF_Callback): Added. * bindings/f77/fgetdata.c: Add bindings for dirfile_cbopen and dirfile_discard. * bindings/f77/make_parameters.c: Add delete flags, protect levels, callback actions, syntax suberrors, GD_MAX_LINE_LENGTH, GD_ALL_FRAGMENTS, DIRFILE_STANDARDS_VERSION. 2008-12-18 D. V. Wiebe svn:269 * bindings/f77/make_parameters.c: Update for GD_E_BAD_PROTECTION and GD_E_UNCLEAN_DB. * bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/fgetdata.h bindings/f77/getdata.f90.in README.f77 bindings/f77/test/gdfget.f: Convert all Fortran-77 function names from GDFxxx to GDxxxx. * test/alter_mspec.c test/alter_spec.c: Added. * src/mod.c (dirfile_alter_spec dirfile_malter_spec): Call _GD_ParseFieldSpec with creat = 0. 2008-12-17 D. V. Wiebe svn:267 * test/name_move.c test/protect_alter.c test/move_subdir.c test/file_code.c test/protect_get.c test/name.c test/unclude_del.c test/unclude.c test/file_type.c test/parent.c test/file.c test/unclude_move.c: Added. * doc/unclean_database_recovery.txt: Added. * COPYING.DOC: Added. * man/dirfile_alter_encoding.3.in man/dirfile_alter_endianness.3.in man/dirfile_alter_frameoffset.3in configure.ac: Build mans with paths. * src/getdata.h.in src/error.c: Added GD_E_UNCLEAN_DB. * src/endian.c (_GD_ByteSwapFragment) src/foffs.c (_GD_ShiftFragment) src/encoding.c (_GD_RecodeFragment): Return the dreaded GD_E_UNCLEAN_DB if finalisation fails. * src/entry.c (get_raw_filename): Call _GD_SetEncodedName. * src/flush.c (_GD_FlushFragment): Added. * src/flush.c (_GD_FlushMeta): Call _GD_FlushFragment. * src/internal.h: Add parent field to private entry. * src/parse.c (_GD_ParseFieldSpec): Record parent. * src/parse.c (_GD_Tokenise): Gracefully handle lines without terminating newlines. * src/include.c (dirfile_uninclude _GD_CollectFragments _GD_ContainsFragment): Added. * src/parse.c src/open.c: Split open.c * src/move.c (_GD_MogrifyFile dirfile_move): Perform mogrification if filebase has changed. * src/move.c (strcmpnull): Added. * src/fragment.c (get_parent_fragment): Added. * src/fragment.c: Prperly clear error in public functions. * src/fragment.c: Renamed from format_list.c * src/name.c (_GD_ValidateField): Moved from encoding.c. * src/name.c src/protect.c: Added. * src/getdata.h.in src/error.c: Added GD_E_BAD_PROTECTION. * src/getdata.h.in src/internal.h: Move GD_PROTECT macros to public header. * src/encoding.c src/internal.h: Add move method to encoding framework. * src/encoding.c (_GD_GenericMove): Added. 2008-12-10 D. V. Wiebe svn:266 * bindings/cxx/dirfile.cpp (Dirfile::ReferenceFilename): Added. 2008-12-10 D. V. Wiebe svn:265 * src/encoding.c (_GD_EncodingUnderstood): Understand GD_TEXT_ENCODED. * src/encoding.c (_GD_RecodeFragment): Properly handle moving the temporary file and deleting the old file. * src/encoding.c (get_encoding): Determine encoding if needed. Report GD_ENC_UNSUPPORTED if encoding is not understood. 2008-12-09 D. V. Wiebe svn:264 * test/endian_move.c test/endian_get.c test/endian_alter.c: Added. * src/endian.c: Use unsigned long for byte_sex parameters. * src/endian.c (_GD_ByteSwapFragment) src/open.c (dirfile_cbopen) src/include.c (_GD_Include): Canonicalise byte sex as soon as possible. * src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Check for valid field name before trying move. * src/endian.c (_GD_ByteSwapFragment): Don't bother checking encoding ecor before calling _GD_Mogrify. * src/endian.c (get_endianness): Return unsigned long and 0 on error. 2008-12-08 D. V. Wiebe svn:263 * test/foffs_move.c test/foffs_get.c test/foffs_alter.c: Added. 2008-12-08 D. V. Wiebe svn:261 * test/alter_multiply.c test/alter_entry.c test/alter_phase.c test/alter_linterp_move.c test/alter_lincom_input.c test/alter_lincom_slope.c test/alter_linterp.c test/alter_const.c test/alter_raw_type.c test/alter_entry_recode.c test/alter_bit_bitnum.c test/alter_raw_spf.c test/alter_bit_numbits.c test/alter_lincom_offset.c: Added. * src/flush.c (_GD_FlushMeta): Preserve access mode for fragments. * src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Preserve access mode. * src/mod.c (_GD_Change): Don't initialise enc until subencoding is determined. Fully determine LUT table paths. Type convert CONST data as needed. Fix lincom argument handling. * src/mod.c (dirfile_alter_raw): Swap order of spf and data type arguments to correspond to dirfile_add_raw(). * src/mod.c (dirfile_alter_lincom): Set n_fields properly, potentially by finding the field to be changed first. Fix checks for NULL arguments. * src/mod.c (dirfile_alter_multiply): Set correct field type. * src/mod.c (dirfile_malter_spec): Swap order of line and parent arguments to correspond to dirfile_madd_spec(). 2008-12-06 D. V. Wiebe svn:260 * src/endian.c (dirfile_alter_endianness): Renamed from put_endianness. * src/foffs.c (dirfile_alter_frameoffset64 dirfile_alter_frameoffset): Renamed from put_frameoffset64 and put_frameoffset. * src/encoding.c (dirfile_alter_encoding): Renamed from put_encoding. * src/mod.c (dirfile_alter_raw dirfile_alter_lincom dirfile_alter_linterp dirfile_alter_bit dirfile_alter_multiply dirfile_alter_phase dirfile_alter_const dirfile_alter_spec dirfile_malter_spec): Renamed from dirfile_change_*. * src/mod.c (dirfile_alter_entry): Renamed from dirfile_change. 2008-12-03 D. V. Wiebe svn:258 * src/open.c (_GD_ParseDirective): Handle bzip and gzip ENCODING directives. * src/encoding.c: Fix bzip2 non-module framework. * src/ascii.c (_GD_AsciiRead): Don't throw an error on EOF. * src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Don't overwrite the main file. * src/bzip.c (_GD_Bzip2Seek _GD_Bzip2Read): Intelligently handle EOF. * src/move.c (_GD_MogrifyData): Handle new_filebase internally. Don't check the input encoding before determining it. Always use temp files, even when changing encodings. Error handling fixes. * test/move_data_enc_ar.c test/gzip_move_from.c test/move_data_enc_ra.c test/move_data_foffs.c test/move_data_endian.c test/bzip_move_from.c test/move_data_nop.c: Added. 2008-12-03 D. V. Wiebe svn:254 * src/move.c (dirfile_move): Don't bother checking whether the encoding is understood if we're not moving the data. Also, update the fragment index for the field and mark both the old and new fragments as dirty. * test/move.c test/move_protect.c test/move_index.c: Added. 2008-12-01 D. V. Wiebe svn:253 * src/ascii.c src/bzip.c src/encoding.c src/gzip.c src/raw.c: Initialise filename in the library directly instead of passing that off on the encoding framework. * man/dirfile_move.3: Added. * src/getdata.h.in: Add GD_IGNORE_REFS. * src/include.c (dirfile_include): Handle both explicit and implicit reference field declarations, along with GD_IGNORE_REFS. * test/include_ignore.c test/include_ref.c test/include_auto.c: Added. * man/dirfile_include.3: Update. * test/global_ref_empty.c test/global_ref_set.c test/global_ref.c: Added. * man/dirfile_reference.3: Added. * add.c (_GD_Add): Don't modify the dirfile until we're sure to succeed. * src/add.c (_GD_Add) src/entry.c (_GD_GetScalar) src/legacy.c (_GD_GetDirfile GetFormat) src/open.c (_GD_ParseFieldSpec) src/globals.c (dirfile_reference): Properly check realloc for error before use. * src/slim.c src/encoding.c: Fix symbols for slim module. * src/del.c (dirfile_delete): If the reference field is deleted, do something sensible. * src/open.c (dirfile_cbopen dirfile_open) src/include.c (dirfile_include): Flags are long. * m4/encoding.m4: Fix library check for extra prefix. * src/common.c (_GD_FindField): index should be unsigned. * bindings/f77/make_parameters.c README.f77: Update for new symbols. 2008-11-28 D. V. Wiebe svn:252 * man/dirfile_include.3: Updated for calback. * man/dirfile_close.3: Updated for dirfile_discard. * src/getdata.h.in: Sorted. * src/Makefile.am: Correct flags for bzip2 module. * src/globals.c (dirfile_reference): Renamed from put_reference and merged with get_reference. * test/close_discard.c: Added. * src/encoding.c src/internal.h: Removed the per-dirfile encoding frameworks. Renamed encoding_framework ef and made non static and non const. * src/encoding.c (_GD_InitialiseFramework): Reimplemented to initialise global framework. * src/open.c (dirfile_cbopen): Call _GD_InitialiseFramework to initialise global framework. * src/close.c (_GD_ShutdownDirfile): Don't call lt_dlexit(); * src/close.c (_GD_ShutdownDirfile): Renamed from dirfile_close and added the flush_meta parameter. * src/close.c (dirfile_close dirfile_discard): Added. 2008-11-28 D. V. Wiebe svn:251 * test/del.c test/del_meta.c test/del_meta_force.c test/del_const.c test/del_const_deref.c test/del_const_force.c test/del_data.c test/del_derived.c test/del_derived_force.c test/open_cb_invalid.c: Added. * man/dirfile_delete.3: Added. * src/spf.c (_GD_GetSPF): Calculate RAW fields, if requried. * src/del.c (dirfile_delete): Multiple bug fixes. * src/getdata.h.in: Remove GD_DEL_NONE 2008-11-27 D. V. Wiebe svn:250 * test/open_cb_ignore.c test/open_cb_cont.c test/open_cb_abort.c test/open_cb_rescan.c: Added. * src/open.c (_GD_ParseFragment): Properly ABORT or RESCAN. * src/internal.h src/getdata.h.in: GD_SYNTAX_* macros should be public. * src/getdata.h.in: dirfile_cbopen() forward declaration. 2008-11-27 D. V. Wiebe svn:248 svn:249 * test/global_name.c: Added. * src/open.c (_GD_ParseFragment): Fail with GD_E_CALLBACK on invalid callback response. * src/open.c (dirfile_cbopen): Check malloc. * man/dirfilename.3: Added. 2008-11-27 D. V. Wiebe svn:247 * test/bzip_put.c test/bzip_get_get.c test/bzip_nframes.c test/bzip_get.c: Added. * m4/encodings.m4: Always AC_SUBST the Makefile variables. Differentiate between internal and external encodings. * src/bzip.c: Added. * src/encoding.c: Add bzip2 framework. * src/gzip.c (_GD_GzipSeek): Return samples not bytes. * src/configure.ac: Add --enable-modules with checks. * src/Makefile.am: Add rules for USE_MODULES * src/encoding.c: Initialise encoding framework for USE_MODULES * src/open.c (dirfile_cbopen) src/close.c (dirfile_close) src/slim.c src/gzip.c src/encoding.c: Wrap ltdl stuff in USE_MODULES 2008-11-25 D. V. Wiebe svn:246 * m4/encoding.m4: Check for executables needed for tests even if the library isn't found. * test/slim_nframes.c test/slim_get.c test/gzip_get_get.c test/gzip_get.c test/gzip_nframes.c: Allow proper execution in the absence of the corresponding encoding support. 2008-11-25 D. V. Wiebe svn:244 * configure.ac: Reduce code duplication with the introduction of the GD_CHECK_ENCODING macro. * m4/encoding.m4: Added. * src/common.c: Replaced the only assert() in the library with an internal library error. * configure.ac src/internal.h: Removed assert-related checks. 2008-11-24 D. V. Wiebe svn:243 * configure.ac: Fix pthread check. 2008-11-24 D. V. Wiebe svn:242 * src/encoding.c (_GD_ValidateField): Moved from open.c because it needs the global encoding framework array. * src/internal.h: Add local encoding framework array to DIRFILE struct. Most functions now use this. (GD_SetEncodedName is a notable exception.) * src/encoding.c (_GD_InitialiseFramework): Added. * test/gzip_get_get: Added. * src/encoding.c (_GD_ResolveSymbol _GD_MissingFramework): Use ltdl to dynamically load libraries instead of calling dlopen directly. * src/gzip.c src/slim.c: Export ltdl symbols. * src/open.c (dirfile_cbopen): Call lt_dlinit(). * src/close.c (dirfile_close): Call lt_dlexit(). * configure.ac: ltdl checks. * Makefile.am: conditionally descend into libltdl. * src/Makefile.am: Pass -export-dynamic -module and -dlopen to libtool as appropriate. * configure.ac: remove --disable-pkg-config. * src/Makefile.am: always install getdata.pc. * man/Makefile.am: Properly link to dirfile_madd_bit.3 2008-11-23 D. V. Wiebe svn:241 * src/add.c (_GD_Add) src/include.c (_GD_Include) open.c (_GD_ParseRaw): Don't unnecessarily add "/./" to paths. * src/gzip.c: Added. * src/encoding.c src/getdata.h.in: Add GD_GZIP_ENCODING. * test/gzip_get.c test/gzip_nframes.c test/gzip_put.c: Added. * conigure.ac Makefile.am src/Makefile.am: Add gzip support. * src/entry.c (_GD_FreeE): fix de-allocation of gd_raw_file objects. * configure.ac: Check for -ldl. * src/encoding.c (_GD_ResolveSymbol): Added. * src/encoding.c (_GD_MissingFramework): dlopen an encoding sublibrary if required. Made non-static. * src/encoding.c (GD_SetEncodedName): Remove initial underscore to enable exporting because sublibraries may need it. * src/Makefile.am: Compile slim.c into a stand-alone "sublibrary" libgetdataslim.la. * src/raw.c (_GD_RawWrite): Return samples, not bytes. * src/move.c (_GD_MogrifyFile): Add encoding recoding. Fix endianness conversion calculation. * src/encoding.c (_GD_RecodeFragment): Replaced the heavy lifting with a call to _GD_MogrifyFile. 2008-11-21 D. V. Wiebe svn:240 * src/move.c: Added. * src/foffs.c (_GD_ShiftFragment) src/endian.c (_GD_ByteSwapFragment): Call _GD_MogrifyFile (in move.c) instead of handling the file translation directly. * src/encoding.c (_GD_RecodeFragment): Reset subencodings when not moving files. 2008-11-21 D. V. Wiebe svn:239 * src/mod.c (dirfile_change_spec dirfile_mchange_spec): Added. * src/open.c (_GD_ParseFieldSpec): Add insert parameter to indicate whether the parsed entry should be inserted into the dirfile. * sr/mod.c (_GD_Change): Remove unnecessary intermediate variables. Properly handle scalars. 2008-11-21 D. V. Wiebe svn:238 * src/common.c (_GD_AddData): Moved from getdata.c and made non-static. * src/mod.c: Added. 2008-11-20 D. V. Wiebe svn:237 * configure.ac: Use AC_PROG_CC_C99 again, bump AC_PREREQ to 2.63. * m4/c99.m4: Removed. 2008-11-20 D. V. Wiebe svn:236 * src/endian.c (_GD_FixEndianness): Moved from types.c. * src/endian.c: Added. * src/encoding.c (_GD_RecodeFragment put_encoding get_encoding): Added. * src/foffs.c (_GD_ShiftFragment): Check for GD_EF_SEEK. Only open the input file if not already open. Check seek success. Seek on both files. * src/getdata.h.in legacy.c: Add GD_E_BAD_ENDIANNESS. * src/putdata.c (_GD_DoRawOut): Don't divide n_wrote by size. * src/slim.c (_GD_SlimSeek) src/raw.c (_GD_RawSeek): Return samples, not bytes. * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Check seek success. * src/internal.h: Split the unnecessarily difficult fragment->flags into fragment->encoding and fragment->byte_sex. 2008-11-18 D. V. Wiebe svn:232 * src/open.c (_GD_ParseFragment): Added GD_IGNORE_DUPS flags. * test/parse_duplicate_ignore.c: Added. * src/internal.h src/getdata.h.in: Moved gd_entry_t->size to _gd_private_entry. * src/foffs.c (_GD_ShiftFragment): Do the move and cleanup. * src/ascii.c (_GD_AsciiTemp) src/raw.c (_GD_RawTemp): Added. * src/foffs.c (put_frameoffset64): Check offset parameter for range. * src/encoding.c (_GD_SetEncodedName): Added. * src/slim.c (_GD_SlimUnlink) src/ascii.c (_GD_AsciiUnlink) src/raw.c (_GD_RawUnlink): Removed and replaced by _GD_GenericUnlink. * src/ascii.c (_GD_AsciiTouch) src/raw.c (_GD_RawTouch): Removed and replaced by _GD_GenericTouch. * src/internal.h: Created the _gd_raw_file object. Renamed _gd_private_entry->file to _gd_private_entry->filebase. * src/encoding.c: Encoding framework updated to work on _gd_raw_file objects. * src/entry.c (get_raw_filename): Use cached filename. 2008-11-18 D. V. Wiebe svn:228 Merged in changes from the 0.4.x branch, revision 223: * src/flush.c (_GD_Flush): Fix SEGV. * src/getdata.c (_GD_DoRaw): don't divide samples_read by data size. * src/raw.c (_GD_RawRead): divide nread by data size. * test/slim_get.c test/slim_nframes.c: Test with uint16_t to check for above bug. Invoke slim binary with -k (force). * src/legacy.c (GetFormat): Remove const from return * src/getdata_legacy.h: wrap all function declarations in extern "C" * src/legacy.c: Trace function calls. * src/Makefile.am: add symbolic link getdata_struct.h -> getdata.h for better legacy API support. * src/include.c (_GD_Include) src/open.c (dirfile_open): Initialise protection level for fragments. 2008-11-17 D. V. Wiebe svn:224 * src/getdata.h.in src/internal.h: Rename MAX_LINE_LENGTH to GD_MAX_LINE_LENGTH and move to public header. * src/getdata.h.in src/internal.h: Clean up GD_E_FORMAT_* suberrors and move to public header. GD_E_FORMAT_N_COLS renamed to GD_E_FORMAT_N_TOK. GD_E_FORMAT_MAX_I, GD_E_FORMAT_N_RAW, removed. All codes renumbered. * src/internal.h: _gd_private_entry->stream renamed to edata. * src/entry.c (_GD_GetScalar): Call _GD_DoConst() directly instead of _GD_DoField(). * src/getdata.c (_GD_DoConst): No longer static. * src/errors.c: Correct typo in GD_E_FORMAT:GD_E_FORMAT_CHARACTER string. * src/entry.c (get_raw_filename): Added. * src/encoding.c (_GD_Supports): Added. * src/encoding.c (_GD_ResolveEncoding): Make static. * src/open.c (_GD_ParseFieldSpec) src/putdata.c (_GD_DoRawOut) src/getdata.c (_GD_DoRaw) src/add.c (_GD_Add) src/nframes.c (get_nframes64): Replace encoding checks with _GD_Supports call. * src/common.c (_GD_FindField): Rename argument next to index. * src/encoding.c (_GD_GenericUnlink _GD_GenericTouch): Added. * src/slim.c (_GD_SlimUnlink) src/ascii.c (_GD_AsciiUnlink) src/raw.c (_GD_RawUnlink): Added. * src/ascii.c (_GD_AsciiTouch) src/raw.c (_GD_RawTouch): Call _GD_GenericTouch(). * src/open.c (dirfile_cbopen): Renamed from dirfile_open * src/open.c (dirfile_open): Added. * src/open.c (_GD_ParseFragment): Call sehandler. * src/slim.c: Trace. * src/foffs.c: Added. * src/del.c: Added. * src/globals.c: Added. * src/encoding.c: Split from getdata.c. 2008-11-14 D. V. Wiebe svn:216 Fork GetData-0.4. 2008-11-07 D. V. Wiebe svn:211 * src/open.c (_GD_ValidateField _GD_Tokeniser): Replace slow strchr calls with explicit tests. * src/open.c (_GD_ValidateField): Conditionally allow "." in field names, but prohibit encoding extensions in this case. * test/parse_name_dot.c test/parse_name_ext.c test/parse_name_pedantic.c: Added. * src/open.c (_GD_ParseRaw): Don't set fragment->ref_name: it will be done later. * src/entry.c (_GD_FreeE): Free the file string for RAW fields. * src/close.c (_GD_FreeD): Call _GD_FreeE instead of de-allocating entries explicitly. A few other missing free calls added. * src/getdata.c src/internal.h src/ascii.c: Add _GD_AsciiTouch. 2008-10-31 D. V. Wiebe svn:206 GetData-0.4.0 released. 2008-10-28 D. V. Wiebe svn:204 GetData-0.4.0rc4: * src/nframes.c (get_nframes): Don't divide by the datatype size twice. * bindings/cxx/test/entry.cpp bindings/cxx/test/putdata.cpp bindings/cxx/test/spf.cpp bindings/cxx/test/getdata.cpp bindings/cxx/test/addentry.cp bindings/cxx/test/nframes.cpp: Update for new header locations. 2008-10-28 D. V. Wiebe svn:200 GetData-0.4.0rc3: * src/field_list.c (get_field_list get_vector_list get_field_list_by_type get_strings) src/meta_list.c (get_mfield_list get_mvector_list get_mfield_list_by_type get_mstrings): Return a valid list even if there are zero elements. * src/field_list.c (get_mfield_list_by_type): Return the correct list in all cases. 2008-10-22 D. V. Wiebe svn:197 GetData-0.4.0rc2: * src/putdata.c (_GD_DoRawOut): Figure out the encoding scheme before attempting to check whether idem needs byte-swapping. Bug report from Matthew Truch. 2008-10-21 D. V. Wiebe svn:185 GetData-0.4.0rc1: * src/include.c: Remove duplicate accessmode check. 2008-10-21 D. V. Wiebe svn:184 * src/open.c: Fix PROTECT parsing. * src/putdata.c: Check protection for STRING, not PHASE. * src/putdata.c (_GD_DoStringOut): Don't de-allocate old string until new string is successful. * src/internal.h: Don't mix CONST data and client list. * src/flush.c (_GD_FlushMeta): Don't write INDEX. * src/add.c (_GD_Add): Split format and data protection checks. 2008-10-21 D. V. Wiebe svn:180 * src/internal.h: Add protection, ref_name, and frame_offset to gd_fragment_t. Remove first_field, first_fragment from same. Remove frame_offset from DIRFILE. * src/open.c (_GD_DoRaw): Set the first field stuff after attempting to create the new file. * src/open.c (_GD_ParseDirective): FRAMEOFFSET is fragment local. Parse PROTECT. * src/open.c (_GD_ParseFragment): Set reference name. * src/flush.c (_GD_FlushMeta): Write PROTECT, REFERENCE, FRAMEOFFSET. Don't worry about first fields any more. * src/add.c (_GD_Add dirfile_add_spec dirfile_madd_spec) src/putdata.c (_GD_DoRawOut _GD_DoConstOut _GD_DoStringOut): Check protection. * src/getdata.c (_GD_DoRaw _GD_DoRawOut): frame_offset is fragment local. * src/include.c (dirfile_include): check access mode and protection. 2008-10-21 D. V. Wiebe svn:179 * src/internal.h: Renamed D->include_list, D->n_include, and D->first_field to D->fragment, D->n_fragment, and D->reference_field. Also removed E->e->first and D->fragment[].first and added D->fragment[].first_field and D->fragment[].first_fragment. * src/getdata.h.in bindings/f77/make_parameters.c: Added GD_E_BAD_REFERENCE. * src/open.c (_GD_ParseFieldSpec): Return a pointer to the gd_entry_t just created if it's a RAW field (or else NULL). Also, it no longer gets passed &have_first. * src/open.c (_GD_ParseDirective): Update ref_name instead of have_first. Parse REFERENCE directive. * src/open.c (_GD_ParseFragment): Renamed from _GD_ParseFormatFile. Returns the ref_name. Sets fragment->first_fragment and fragment->first_raw. * src/flush.c (_GD_FlushMeta): Updated for new first field stuff. * src/include.c (_GD_Include): Accept and return ref_name to caller. * src/include.c (dirfile_include) open.c (dirfile_open): Resolve REFERENCE after parsing completes. * man/dirfile_include.3 man/dirfile_open.3 dirfile-format.5: Update for REFERENCE. * src/flush.c (_GD_FlushMeta): Write global metadata at the end so it will take precedence. * src/flush.c (_GD_FieldSpec): String escapeise the field name. 2008-10-19 D. V. Wiebe svn:173 * src/errors.c (_GD_SetError) src/getdata.h.in: Added GD_VERBOSE flag. * src/flush.c (_GD_Flush): Use encoding framework to flush and close raw files. * src/open.c (_GD_Tokenise): Properly handle trailing backslash. * test/parse_eol.c test/parse_quote_mismatch.c: Added. 2008-10-17 D. V. Wiebe svn:169 * src/getdata.c (_GD_DoRaw) src/putdata.c (_GD_DoRawOut): Some encodings need no endianness correction. 2008-10-17 D. V. Wiebe svn:165 * src/nmeta.c: Renamed get_nmetafields, get_nmetavectors, and get_nmetafields_by_type to get_nmfields, get_nmvectors, and get_nmfields_by_type. * src/field_list.c: Renamed get_constant_values and get_string_values to get_constants and get_strings. * src/flush.c: Renamed dirfile_flush_metadata to dirfile_metaflush * src/meta_list.c: Renamed get_metaconstant_values, get_metastring_values, get_metafield_list_by_type, get_metavector_list, and get_metafield_list to get_mconstants, get_mstrings, get_mfield_list_by_type, get_mvector_list, and get_mfield_list. * src/add.c: Renamed dirfile_add_metaspec, dirfile_add_meta, dirfile_add_metalincom, dirfile_add_metalinterp, dirfile_add_metabit, dirfile_add_metamultiply, dirfile_add_metaphase, dirfile_add_metastring, and dirfile_add_metaconst to dirfile_madd_spec, dirfile_madd, dirfile_madd_lincom, dirfile_madd_linterp, dirfile_madd_bit, dirfile_madd_multiply, dirfile_madd_phase, dirfile_madd_string, and dirfile_madd_const. * bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h: Updated C++ bindings accordingly. * bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/fgetdata.h bindings/f77/getdata.f90.in: Updated Fortran 77 and 95 bindings accordingly. * test/add_meta_linterp_invalid.c test/add_meta_lincom_invalid.c test/add_meta_phase_invalid.c test/add_meta_phase.c test/add_meta_multiply.c test/add_meta_spec_invalid.c test/add_meta_spec.c test/add_meta_linterp.c test/add_meta_lincom.c test/add_meta_spec_directive.c test/add_meta_bit_invalid.c test/add_meta_bit.c test/add_meta.c test/add_meta_multiply_invalid.c: Removed. * test/madd_bit.c test/madd_lincom_invalid.c test/madd_lincom.c test/madd_spec.c test/madd_phase.c test/madd.c test/madd_linterp_invalid.c test/madd_bit_invalid.c test/madd_linterp.c test/madd_spec_invalid.c test/madd_spec_directive.c test/madd_multiply_invalid.c test/madd_multiply.c test/madd_phase_invalid.c: Added. * test/nmeta_type.c test/vlist_meta.c test/cvlist_invalid.c test/nmeta_vectors_parent.c test/svlist_invalid.c test/cvlist.c test/svlist.c test/nmeta_parent.c test/nmeta_vectors.c test/cvlist_meta_invalid.c test/flist_meta_invalid.c test/svlist_meta_invalid.c test/cvlist_meta.c test/nmeta_type_invalid.c test/vlist_meta_invalid.c test/flush_meta.c test/svlist_meta.c test/nmeta_invalid.c test/nmeta.c test/flist_type_meta_invalid.c test/flist_type_meta.c test/nmeta_vectors_invalid.c test/nmeta_type_parent.c test/flist_meta.c: Updated. 2008-10-17 D. V. Wiebe svn:164 * src/open.c src/putdata.c src/getdata.c src/flush.c src/getdata.h.in src/add.c src/nframes.c: Rename format_file in gd_entry_t to fragment_index, also similar function parameters. * bindings/cxx/entry.cpp bindings/cxx/entry.h bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/fgetdata.h bindings/f77/getdata.f90.in: Update bindings to match. * test/add_rdonly.c test/add_invalid.ca test/add.c test/add_code.c test/add_duplicate.c test/add_type.c test/add_meta.c test/add_format.c: Updated. * src/open.c (_GD_ParseRaw): Use me instead of E->fragment_index, since the latter hasn't been initialised yet. * test/format_filename.c test/nformats.c test/format_filename_oor.c: Removed. * test/fragmentname.c test/nfragments.c test/fragmentname_oor.c: Added. 2008-10-17 D. V. Wiebe svn:163 * src/getdata.c (_GD_DoString) src/string.c (get_string): Add one to string length to account for terminating NUL. * src/putdata.c (_GD_DoStringOut) src/string.c (put_string): Return string length. * src/format_list.c: Renamed get_format_filename to get_fragmentname and get_nformats to get_nfragments. Bindings changed. * src/constant.c (get_constant put_constant): Reutrn -1 on error. 2008-10-16 D. V. Wiebe svn:161 * src/meta_list.c src/nmeta.c: Fail if the specified parent is itself a metafield. 2008-10-16 D. V. Wiebe svn:155 * src/open.c: Moved meta field enumeration to _GD_ParseFieldSpec from _GD_ParseDirective to allow dirfile_add_metaspec to benefit seamlessly. * src/add.c (dirfile_add_metaspec dirfile_add_spec): Reversed parameters. It's better to keep the order consistent with the other dirfile_add functions rather than having it consistent with the format file. * bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f90.in README.cxx README.f95 README.f77: Ditto for bindings. * src/add.c (dirfile_add_metaspec dirfile_add_spec): Fail on a read-only dirfile or format_file out of range. * src/add.c (dirfile_add_metaspec): Pass parent to _GD_ParseFieldSpec. * test/add_meta_spec_invalid.c test/add_meta_spec.c test/add_meta_spec_directive.c: Added. 2008-10-15 D. V. Wiebe svn:151 * src/add.c src/flush.c src/getdata.c src/include.c src/internal.h src/nframes.c src/open.c src/putdata.c man/dirfile-format.5: Made endianness fragment-local. * man/dirfile_include.3: Added. 2008-10-15 D. V. Wiebe svn:148 * src/include.c (dirfile_include): Throw GD_E_ACCMODE if GD_CREAT or GD_TRUNC are passed to a read-only dirfile. * test/include.c test/include_invalid.c test/include_accmode.c test/include_creat.c test/include_nonexistent.c: Added. 2008-10-15 D. V. Wiebe svn:147 * README.f77 bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f.in: Add more Fortran 77 bindings. * README.f95 bindings/f77/fgetdata.f90.in: Added Fortran 95 bindings for the new public functions. 2008-10-14 D. V. Wiebe svn:146 * bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f90.in: Renamed GDFNFT to GDFNFO. * README.f77 bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f.in bindings/f77/make_parameters.c: Added Fortran 77 bindings for the new public functions. 2008-10-14 D. V. Wiebe svn:143 * test/nframes_empty.c: Correct for removal of GD_E_EMPTY. * README.cxx bindings/cxx/dirfile.h bindings/cxx/dirfile.cpp bindings/cxx/entry.h: Added C++ bindings for new public functions. * src/constant.c: get_constant returns size_t, not ssize_t, like the other get_() functions. * src/getdata.h.in: Add some missing public prototypes. * src/nfields.c src/nmeta.c: Removed the _ after nmeta in public function names. * test/nmeta_type.c test/nmeta_vectors_parent.c test/nmeta_parent.c test/add_meta_phase.c test/add_meta_multiply.c test/nmeta_type_invalid.c test/add_meta_linterp.c test/add_meta_lincom.c test/nmeta_invalid.c test/nmeta.c test/nmeta_vectors_invalid.c test/add_meta_bit.c test/add_meta.c test/nmeta_type_parent.c: Updated. * src/close.c (_GD_FreeD) src/entry.c (_GD_FreeE) src/field_list.c src/internal.h src/meta_list.c: Replaced get_constant_list() and get_string_list() with get_field_list_by_type(), which reduces the amount of duplicated code and provides a more flexible interface. Similarly with the META versions. * test/clist.c test/clist_invalid.c test/clist_meta.c test/clist_meta_invalid.c test/slist.c test/slist_invalid.c test/slist_meta.c test/slist_meta_invalid.c: Removed. * test/flist_type.c test/flist_type_invalid.c test/flist_type_meta.c test/flist_type_meta_invalid.c: Added. * src/open.c: Reduce paranoia by not re-zeroing memory already memset to zero. 2008-10-14 D. V. Wiebe svn:140 * src/legacy.c src/errors.c src/nframes.c (get_nframes64): GD_E_EMPTY is no-longer an error. (Per discussion with Barth.) * bindings/f77/make_parameters.c: Updated. 2008-10-14 D. V. Wiebe svn:139 * bindings/f77/test/fget_field_list.f90: Fix for new list and count function behaviour. * bindings/cxx/test/addentry.cpp: Fix for new get_nfields behaviour and properly clean-up dirfile. * src/entry.c (_GD_FreeE) src/internal.h: Add calculated and scalar[] array. * src/open.c (_GD_SetScalar): Added. * src/open.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp _GD_ParseMultiply _GD_ParseBit _GD_ParsePhase _GD_ParseConst _GD_ParsePhase): Record non-numeric scalar tokens for deferred calculation. Numeric tokens are detected using strtod(). * src/entry.c (_GD_GetScalar _GD_CalculateEntry): Added. * src/entry.c (get_entry) src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut): Call _GD_CalculateEntry when necessary. * src/constant.c (put_constant): Reset clients after changing the constant. * src/add.c (_GD_Add) src/open.c (_GD_ParseConst): Initialise client list. * test/entry_bit_scalar.c test/entry_lincom_scalar.c test/entry_phase_scalar.c test/entry_raw_scalar.c test/parse_bit_scalar.c test/parse_lincom_scalar.c test/parse_phase_scalar.c test/parse_raw_scalar.c test/entry_raw_scalar_code test/entry_raw_scalar_type: Added. 2008-10-14 D. V. Wiebe svn:138 * src/field_list.c (get_string_values): Fix array out of bounds crash. * src/internal.h: Remove errant ; on _GD_InternalError macro. * src/open.c (dirfile_open): Gave INDEX it's own explicit entry. This automatically allows defining /META fields for INDEX, per Barth's request. This entry has the special type GD_INDEX_ENTRY. Some other simplifications/complications result. First among these is that the list functions and the counting functions now may include INDEX, as appropriate. * test/add_lincom.c test/add_sort.c test/add_spec_directive.c test/add_phase.c test/add_string.c test/add_multiply.c test/add_bit_numbits.c test/add_bit_bitsize.c test/flist.c test/vlist.c test/add_raw.c test/add_bit.c test/add_code.c test/add_duplicate.c test/add_const.c test/nvectors.c test/add_type.c test/add_meta.c test/parse_sort.c test/add_linterp.c test/add_format.c test/add_spec.c: Update for new list and counting function behaviour. * test/parse_meta_index.c: Added. * src/common.c (_GD_GetEntry): Removed (no longer needed). Callers call _GD_FindField directly now, and must throw their own errors. * src/getdata.c (_GD_DoField) src/putdata.c (_GD_DoFieldOut) src/spf.c (_Get_SPF): Replaced INDEX special-casing with GD_INDEX_ENTRY handling. 2008-10-13 D. V. Wiebe svn:137 * src/add.c (_GD_Add): Properly initialise the private entry after creating it. Crash report from Matthew Truch. * test/add_meta_linterp_invalid.c test/add_meta_lincom_invalid.c test/add_raw_invalid.c test/nmeta_vectors_parent.c test/nmeta_parent.c test/add_meta_phase_invalid.c test/add_invalid.c test/add_phase_invalid.c test/add_string.c test/add_linterp_invalid.c test/add_bit_invalid.c test/add_lincom_invalid.c test/add_meta_bit_invalid.c test/add_multiply_invalid.c test/add_meta_multiply_invalid.c test/add_spec_invalid.c test/nmeta_type_parent.c: Fix compiler warning. * getdata.h.in: Add declarations for dirfile_add_string() and dirfile_add_const(). 2008-10-12 D. V. Wiebe svn:136 * src/add.c (_GD_Add): Prohibit declaring METAs in a fragment not containing its parent. * src/open.c (_GD_ParseDirective): Ditto. * src/getdata.h.in: GD_FORMAT_AUTO is no longer needed. * src/internal.h src/open.c: MAX_IN_COLS moved to header. * src/add.c (dirfile_add_metaspec dirfile_add_spec): Added. * src/internal.h: Store subdir (sname) in include list. * src/close.c (_GD_FreeD): free sname. * src/open.c (_GD_ParseRaw _GD_ParseFieldSpec _GD_ParseDirective): Derive subdir and other relevant information from the include_list, where possible. * src/open.c (_GD_Tokenise): Allow specification of the empty string as "". * src/open.c (_GD_ValidateField): Prohibit reserved words and the empty string. * src/add.c (_GD_Add): Provide defaults for CONST and STRING; properly enumerate types. * src/add.c: Add GD_INVALID checks to all public functions. * src/add.c (dirfile_add_metalincom dirfile_add_metalinterp dirfile_add_metabit dirfile_add_metamultiply dirfile_add_metaphase): Put parent parameter before field_code to mimic the field spec order. * src/flush.c (_GD_FieldSpec _GD_FlushMeta): Properly handle META fields. * src/getdata.h.in: dirfile_add_raw dirfile_add dirfile_add_spec dirfile_add_metaspec may all potentially call I/O functions; ergo, don't mark them with THROW.o * test/Makefile.am: Re-organise tests. * test/add_meta_linterp_invalid.c test/add_meta_lincom_invalid.c test/vlist_invalid.c test/add_raw_invalid.c test/vlist_meta.c test/cvlist_invalid.c test/svlist_invalid.c test/cvlist.c test/svlist.c test/add_meta_phase_invalid.c test/add_invalid.c test/add_meta_phase.c test/add_phase_invalid.c test/add_spec_directive.c test/add_string.c test/clist_invalid.c test/add_linterp_invalid.c test/add_meta_multiply.c test/slist_invalid.c test/clist.c test/cvlist_meta_invalid.c test/flist_meta_invalid.c test/slist.c test/svlist_meta_invalid.c test/cvlist_meta.c test/vlist_meta_invalid.c test/svlist_meta.c test/parse_string_null.c test/add_meta_linterp.c test/add_meta_lincom.c test/vlist.c test/add_bit_invalid.c test/add_lincom_invalid.c test/add_meta_bit_invalid.c test/add_meta_bit.c test/add_multiply_invalid.c test/add_const.c test/add_meta_multiply_invalid.c test/clist_meta_invalid.c test/add_meta.c test/add_spec_invalid.c test/slist_meta_invalid.c test/clist_meta.c test/add_spec.c test/slist_meta.c test/flist_meta.c: Added tests for the list functions, add_spec, and add_meta. * src/include.c (_GD_Include): Extracted include file handler from _GD_ParseDirective in src/open.c. * src/include.c (dirfile_include): Added. * src/add.c (_GD_Add) src/getdata.c (_GD_DoRaw) src/include.c (_GD_Include) src/nframes.c (get_nframes64) src/putdata.c (_GD_DoRawOut): Make encodings fragment specific. * src/flush.c (_GD_FlushMeta): Write /ENCODING. 2008-10-11 D. V. Wiebe svn:135 * src/open.c (_GD_Tokenise _GD_ParseDirective _GD_ParseFieldSpec _GD_ParseFormatFile): Okay, the parser is now in three pieces: tokeniser, directive parser (formerly _GD_ParseFormatLine), and field spec parser, all called from _GD_ParseFormatFile, which handles looping through a format file. This should be sufficiently functional for the upcoming features. 2008-10-11 D. V. Wiebe svn:133 * src/open.c (_GD_Tokenise _GD_ParseFormatLine): Split tokeniser from line parser. 2008-10-10 D. V. Wiebe svn:132 * src/open.c (_GD_ParseFormatFile _GD_ParseFormatLine dirfile_open): Properly propagate standards. 2008-10-10 D. V. Wiebe svn:131 * src/open.c (_GD_ParseFieldSpec): Properly propagate have_first to caller. * src/open.c (_GD_ParseFormatFile _GD_ParseFormatLine): Split line parsing (now in _GD_ParseFormatLine) from the format file loop (the little bit remaining in _GD_ParseFormatFile). * bindings/cxx/test/Makefile.am: Properly clean up after tests. 2008-10-10 D. V. Wiebe svn:130 * src/getdata.h.in: Incorporate a GD_SCALAR_ENTRY flag in gd_entype_t. * src/field_list.c (get_nvectors) src/meta_list.c (get_nmeta_vectors): Use GD_SCALAR_ENTRY. * src/add.c (_GD_Add): Properly initialise the meta field lists in the private entry to prevent crash on error. (Reported by Matthew Truch) * src/raw.c (_GD_RawTouch): Add mode to open call (patch from Matthew Truch). * src/getdata.h.in: Add GD_E_DIMENSION * src/getdata.c src/putdata.c src/spf.c: Detect and fail if a vector type contains an input field that's a scalar. * src/spf.c (_GD_GetSPF): Removed redundant field_code parameter. * src/common.c (_GD_GetEntry): Removed FILEFRAM as an alias for INDEX per discussion with Barth. 2008-10-10 D. V. Wiebe svn:128 svn:129 * src/entry.c (_GD_FreeE): Renamed from dirfile_free_entry_strings (for which a new boilerplate function has been created). Separated cleaning up internal and externally created entries. Internally, the library now uses this function in all places where it used to call dirfile_free_entry_strings. * src/open.c (_GD_ParseRaw): n_meta should be zero. * src/open.c (_GD_ParseFormatFile): fix duplicates check * test/add_sort.c test/nfields_type.c test/nfields_type_invalid.c test/nmeta.c test/nmeta_invalid.c test/nmeta_parent.c test/nmeta_type.c test/nmeta_type_invalid.c test/nmeta_type_parent.c test/nmeta_vectors.c test/nmeta_vectors_invalid.c test/nmeta_vectors_parent.c test/nvectors.c test/nvectors_invalid.c test/parse_const.c test/parse_const_ncols.c test/parse_duplicate.c test/parse_meta.c test/parse_meta_parent.c test/parse_meta_raw.c test/parse_quote.c test/parse_sort.c test/parse_string.c test/parse_string_ncols.c test/parse_whitespace.c: Added. * src/add.c (_GD_Add): Encapsulate the file creation with a call to an encoding specific *touch() function. * src/raw.c (_GD_RawTouch): Added. (Also used for the ASCII encoding). * src/meta_list.c: Added (META version of field_list.c) * src/field_list.c: Call _GD_ClearError in all public functions. * src/nmeta.c: Added (META version of nfields.c) * src/open.c (_GD_ParseFieldSpec): Moved some repeated code out of the ParseFoo functions and into this one. Also, don't count META fields in n_string or n_cost. 2008-10-09 D. V. Wiebe svn:127 * src/open.c (_GD_ValidateField): Now takes a pointer to the parent, rather than the parent's name, and generates the "/" demarcation itself. * src/open.c (_GD_ParseFormatFile): Determine META field's parent entry. * src/open.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp _GD_ParseBit _GD_ParsePhase _GD_ParseConst _GD_ParseString _GD_ParseFieldSpec): Pass around the parent's pointer, rather than its name. * src/add.c (_GD_Add) src/open.c (_GD_ParseRaw): Remember the full path name. * src/getdata.c (_GD_DoRaw) src/nframes.c (_GD_NFrames) src/putdata.c (_GD_DoRawOut): No need to compose file name. * src/open.c (_GD_ParseFieldSpec): Simplify the switch() code. Also, check for duplicates. * src/common.c (_GD_InsertSort): Added. * src/open.c (_GD_ParseFormatFile): Automatically handle /u and /ooo out of range. * src/close.c (_GD_FreeD): Clean up include_list[0], too. * src/close.c (dirfile_close): Call _GD_FlushMeta(). 2008-10-08 D. V. Wiebe svn:125 * src/open.c (_GD_ParseRaw): Prohibit META RAW fields. * src/add.c (_GD_Add): Ditto. * src/add.c (dirfile_add_metaraw): Deleted. 2008-10-08 D. V. Wiebe svn:124 * src/open.c (_GD_ValidateField): Malloc one more byte for the terminating NULL. Crash report from Matthew Truch. * test/add_many.c: Add test-case for same (from Matthew Truch). * src/internal.h: Removed all instances of ierror and user_error in the DIRFILE struct. * src/add.c (_GD_Add): Properly compose metafield codes. Always create the empty binary file. 2008-10-08 D. V. Wiebe svn:123 * src/add.c: Fix debugging messages 2008-10-08 D. V. Wiebe svn:122 * man/Makefile.am: Fix install target (patch from Matthew Truch) 2008-10-08 D. V. Wiebe svn:121 * src/getdata.h.in: Add forward declarations for public functions. 2008-10-08 D. V. Wiebe svn:120 * src/putdata.c (putdata64): Fail if passed a CONST or STRING field code. * src/string.c (put_string): Added. * src/constant.c (put_constant): Added. * src/add.c (_GD_Add): Renamed from dirfile_add, which is now a boilerplate stub for this internal function. Added meta field support. * src/add.c (dirfile_add_meta dirfile_add_metaraw dirfile_add_metalincom dirfile_add_metalinterp dirfile_add_metabit dirfile_add_metamultiply dirfile_add_metaphase dirfile_add_metastring dirfile_add_metaconst): Added. * src/add.c (_GD_Add): create an empty raw file, when necessary. 2008-10-07 D. V. Wiebe svn:119 * src/add.c (dirfile_add_string dirfile_add_const): Added. * man/dirfile_add_raw: Updated for dirfile_add_string and dirfile_add_const. 2008-10-07 D. V. Wiebe svn:118 * src/flush.c: Add hostname to comments at the top of the format file. * src/nfields (get_nvectors get_nfields_by_type): Added. * man/get_nvectors.3 man/get_nfields_by_type.3: Added. 2008-10-07 D. V. Wiebe svn:115 * src/open.c: Record whether a field is meta. * src/open.c: Count strings, constants and meta fields. * src/open.c (_GD_CreateDirfile): If creating (or truncating) a dirfile, assume GD_UNENCODED if GD_AUTO_ENCODED was specified. * src/putdata.c (_GD_DoRawOut): Set GD_E_UNKNOWN_ENCODING instead of GD_UNSUPPORTED if the encoding can't be figured out. * src/field_list.c (get_constant_values get_constant_list get_string_values get_string_list get_vector_list): Added. * src/field_list.c (get_field_list): Don't return meta fields in the list. * src/nfields.c: Return the number of non-meta fields. * src/constant.c: Renamed from src/get_constant.c * src/string.c: Renamed from src/get_string.c * src/getdata.c (_GD_DoString): If num_samp == 0 or data_out is NULL, don't copy the string. * src/errors.c (dirfile_user_error): Removed per discussion with Barth. * man/get_constant.3 man/get_error.3 man/get_string.3: Added. 2008-10-06 D. V. Wiebe svn:114 * test/error_error.c: Added. * test/flush_recurse.c: Removed. _GD_Flush no longer resolves input fields. * src/common.c (_GD_GetEntry): Added a _GD_FindField wrapper that properly handles INDEX/FILEFRAM. * src/open.c (_GD_ValidateField): Add field prefix needed for META fields. * src/open.c (_GD_ParseFieldSpec): Split from _GD_ParseFormatFile to handle both META and regular field specs. * src/open.c (_GD_ParseFormatFile): Add /META support. * src/open.c (_GD_ParseFormatFile): Fix the parser bug introduced in svn:113. * src/open.c (_GD_CreateDirfile): Report the dirfile path not the format file path in error strings. * src/flush.c src/getdata.c src/putdata.c src/spf.c: Use pre-cached entry pointers. * src/get_constant.c src/get_string.c: Added. * src/getdata.c (getdata64): Prevent calling getdata() with CONST or STRING fields. * src/errors.c: Got rid of the positional parameter C99 desecration which GCC 4.3 complains about. get_error_string() now builds the string itself. * src/format_list.c (get_format_filename): make the index parameter unsigned. 2008-10-05 D. V. Wiebe svn:113 * src/add.c src/close.c src/entry.c src/flush.c src/getdata.c src/getdata.h.in src/open.c src/putdata.: Add support for CONST, STRING, and ENCODING. * src/common.c src/open.c: Added escape sequence and quoted token support. * src/flush.c src/getdata.c src/putdata.c src/spf.c: Functions that check recurse_level now also take care of incrementing and decrementing it. * man/dirfile-format.5: Update for standards version six. 2008-10-02 D. V. Wiebe svn:112 * configure.ac: Locate `slim' and `unslim' binaries needed for slimlib tests. * test/Makefile.am test/ascii_get.c test/ascii_nframes.c test/ascii_put.c test/slim_get.c test/slim_nframes.c test/slim_put.c: Add tests for ASCII and slimlib encodings. (slim_put is currently always skipped.) * src/ascii.c: Bug fixes. 2008-10-01 D. V. Wiebe svn:111 * src/entry.c: Properly initialise the private data in the gd_entry_t object returned. * bindings/cxx/test/putdata.cpp: Fix constructor call. * bindings/f77/make_parameters.c: Add encoding framework parameters. 2008-10-01 D. V. Wiebe svn:110 * src/internal.h: Moved config.h inclusion to internal.h * src/open.c: Added "." to the list of prohibited field code characters. * src/getdata.h.in, src/internal.h: Hide dirfile implementation from the public. * src/errors.c: Added get_error() and dirfile_user_error() * src/getdata.c src/internal.h src/nframes.c src/open.c src/putdata.c src/raw.c: Added encoding framework. * src/getdata.c src/slim.c: Add slimlib encoding. * src/ascii.c src/getdata.c: Add ASCII encoding. 2008-09-28 D. V. Wiebe svn:109 * bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/cxx/entry.cpp bindings/cxx/entry.h test/Makefile.am test/addentry.cpp: Add C++ support for dirfile_add(), dirfile_flush_metadata(), get_format_filename(), and get_nformats(). * bindings/f77/fgetdata.c bindings/f77/fgetdata.h bindings/f77/getdata.f.in bindings/f77/getdata.f90.in bindings/f77/make_parameters.c: Add F77 and F95 bindings for dirfile_add(), dirfile_flush_metadata(), get_format_filename(), and get_nformats(). * src/add.c (dirfile_add_raw): swap spf and data_type to correspond to the ordering in the format file. 2008-09-28 D. V. Wiebe svn:108 * man/dirfile_add.3 man/dirfile_add_raw.3: Added. * man/Makefile.am: Install all the mans previously forgotten about. Also, link to aliases. * src/add.c (dirfile_add_lincom): Don't use a variadic function, since in obfuscates data typing. * src/add.c (dirfile_add): Add suberror codes for GD_E_BAD_ENTRY. Initialise internal data. Initialise the first RAW field, if necessary. * src/close.c src/flush.c src/open.c: Distinguish between "canonical" format file names (i.e. the full path used to open the file) and "external" names (i.e. the relative path written to the parent format file). * src/errors.c: Add strings for dirfile_add(). * src/getdata.h.in: Move FILENAME_MAX stuff into internal.h since it doesn't need to be public anymore. * src/internal.h: Always define MAX_LINE_LENGTH to 4096. * test/Makefile.am test/add.c test/add_bit.c test/add_bit.c test/add_bit_bitnum.c test/add_bit_bitsize.c test/add_bit_numbits.c test/add_code.c test/add_duplicate.c test/add_format.c test/add_lincom.c test/add_lincom_nfields.c test/add_linterp.c test/add_multiply.c test/add_phase.c test/add_raw.c test/add_raw_spf.c test/add_raw_type.c test/add_rdonly.c test/add_type.c test/error.c test/error_short.c test/flush_meta.c test/format_filename.c test/format_filename_oor.c test/nformats.c: Added tests for dirfile_add() and alternates, get_error_string(), dirfile_flush_metadata(), get_format_filename(), and get_nformats(). * test/Makefile.am: test put_linterp_noin, which has been around for a while, but missing from the Makefile. * test/trunc_readonly.c: Deleted. (An old copy of trunc_rdonly.c) 2008-09-27 D. V. Wiebe svn:106 * src/flush.c (_GD_Flush): Don't call fsync on read-only dirfiles. * src/open.c (_GD_ParseFormatFile dirfile_open): Don't find the first raw field at the end, but rather do it as we're scanning raw fields. Also, record some format file metadata: whether it contains the first raw field, and whether it is modified. * src/close.c (_GD_FreeD): free the include_list. * src/internal.h: Minimum format file line length is 4096 characters. * src/flish.c (_GD_FlushMeta dirfile_flush_metadata): flush metadata changes to disk (i.e. write format files). Includes public function. * src/add.c (dirfile_add): prevent adding to read-only dirfiles 2008-09-26 D. V. Wiebe svn:105 * man/get_entry.3 src/add.c src/getdata.h.in src/open.c: Expose include_list to the public. Add include index to each entry. * man/get_format_filename.3 man/get_nformats.3 src/format_list.c src/getdata.h.in: Add public functions get_nformats() and get_format_filename(). 2008-09-25 D. V. Wiebe svn:103 * src/open.c (_GD_ParseRaw _GD_ParseLincom _GD_ParseLinterp _GD_ParseMultiply _GD_ParseBit _GD_ParsePhase): Fixed memory leaks * src/errors.c (_GD_ClearError): Replaced with a macro of the same name defined in internal.h. * src/add.c src/getdata.h.in: First part of dirfile_add(): input validation and add to DIRFILE list. 2008-09-22 D. V. Wiebe svn:99 GetData-0.3.1 released. 2008-09-22 D. V. Wiebe svn:97 * configure.ac bindings/cxx/Makefile.am bindings/cxx/test/Makefile.am: Call the C++ bindings libgetdata++ instead of libdirfile to be a little more explicit about what it is. This also allows installation alongside TK's libdirfile. 2008-09-22 D. V. Wiebe svn:94 * bindings/cxx/entry.cpp: Use instead of . Patch from Matthew Truch. 2008-09-18 D. V. Wiebe svn:90 * src/legacy.c (_GD_GetDirfile) test/legacy_get_rofs.c test/legacy_get_put.c: Open dirfiles read-only unless called via PutData(). Re-open read-only dirfile read-write when necessary. Added two test-cases for same. * test/Makefile.am: Conditionally compile legacy tests. 2008-09-15 D. V. Wiebe svn:86 * src/errors.c: Fix GD_E_RAW_IO error string. 2008-09-15 D. V. Wiebe svn:84 GetData-0.3.0 released. 2008-09-05 D. V. Wiebe svn:77 * m4/c99.m4 configure.ac Makefile.am: Re-implement AC_PROG_CC_C99 as GD_PROG_CC_C99 to fix `deprecated -c99' warning with icc. * bindings/cxx/dirfile.h bindings/cxx/entry.h bindings/cxx/test/getdata.cpp bindings/cxx/test/putdata.cpp bindings/f77/fgetdata.h test/convert_float32_float64.c test/convert_float32_int16.c test/convert_float32_int32.c test/convert_float32_int64.c test/convert_float32_int8.c test/convert_float32_uint16.c test/convert_float32_uint32.c test/convert_float32_uint64.c test/convert_float32_uint8.c test/convert_float64_float32.c test/convert_int16_float32.c test/convert_int16_float64.c test/convert_int16_int32.c test/convert_int16_int64.c test/convert_int16_int8.c test/convert_int16_uint16.c test/convert_int16_uint32.c test/convert_int16_uint64.c test/convert_int16_uint8.c test/convert_int32_float32.c test/convert_int32_float64.c test/convert_int64_float32.c test/convert_int64_float64.c test/convert_int8_float32.c test/convert_int8_float64.c test/convert_int8_int16.c test/convert_int8_int32.c test/convert_int8_int64.c test/convert_int8_uint16.c test/convert_int8_uint32.c test/convert_int8_uint64.c test/convert_int8_uint8.c test/convert_uint16_float32.c test/convert_uint16_float64.c test/convert_uint16_int16.c test/convert_uint16_int32.c test/convert_uint16_int64.c test/convert_uint16_int8.c test/convert_uint16_uint32.c test/convert_uint16_uint64.c test/convert_uint16_uint8.c test/convert_uint32_float32.c test/convert_uint32_float64.c test/convert_uint64_float32.c test/convert_uint64_float64.c test/convert_uint8_float32.c test/convert_uint8_float64.c test/convert_uint8_int16.c test/convert_uint8_int32.c test/convert_uint8_int64.c test/convert_uint8_int8.c test/convert_uint8_uint16.c test/convert_uint8_uint32.c test/convert_uint8_uint64.c test/dfes_phase.c test/dfes_raw.c test/flush.c test/flush_all.c test/get64.c test/get_bit.c test/get_char.c test/get_endian16.c test/get_endian32.c test/get_endian64.c test/get_endian8.c test/get_endian_float32.c test/get_endian_float64.c test/get_ff.c test/get_float32.c test/get_float64.c test/get_foffs.c test/get_fs.c test/get_int16.c test/get_int8.c test/get_lincom1.c test/get_lincom2.c test/get_lincom3.c test/get_linterp.c test/get_linterp_noin.c test/get_linterp_notab.c test/get_multiply.c test/get_multiply_noin.c test/get_nonexistent.c test/get_null.c test/get_off64.c test/get_phase.c test/get_sf.c test/get_ss.c test/get_type.c test/get_uint16.c test/legacy_get.c test/legacy_put.c test/nframes_spf.c test/put64.c test/put_bit.c test/put_char.c test/put_endian16.c test/put_endian32.c test/put_endian64.c test/put_endian8.c test/put_endian_float32.c test/put_endian_float64.c test/put_ff.c test/put_float32.c test/put_float64.c test/put_foffs.c test/put_fs.c test/put_int16.c test/put_int8.c test/put_lincom1.c test/put_lincom2.c test/put_lincom_noin.c test/put_linterp.c test/put_linterp_noin.c test/put_linterp_notab.c test/put_multiply.c test/put_off64.c test/put_phase.c test/put_phase_noin.c test/put_sf.c test/put_ss.c test/put_uint16.c: Fix compiler warnings 2008-09-05 D. V. Wiebe svn:75 * man/get_field_list.3 src/field_list.c: NULL terminate the list. * src/field_list.c (get_field_list): Return GD_E_ALLOC on malloc error. 2008-09-04 D. V. Wiebe svn:73 * bindings/cxx/entry.h (Entry::Scale Entry::Offset): fix return. * src/flush.c (_GD_Flush): Handle GD_NO_ENTRY in switch * test/dfes_bit.c test/dfes_linterp test/dfes_lincom test/dfes_multiply test/dfes_phase test/dfes_raw test/flist test/flush_invalid test/flush_bad_code test/flush_recurse: Remove unused variables * test/entry_lincom: Include math.h 2008-09-04 D. V. Wiebe svn:68 * src/getdata_legacy.h src/legacy.c: Go through all the bother to reconstruct the former FormatType for callers who use GetFormat() * src/close.c (_GD_FreeD): Handle GD_NO_ENTRY in switch * configure.ac: Use modern AM_INIT_AUTOMAKE invocation so as not to have to repeat package name and package version. * Makefile.am: Require automake 1.6 * NEWS: added 2008-09-04 D. V. Wiebe svn:67 * bindings/cxx/Makefile.am: Fix include dir * bindings/f77/fgetdata.c (GDFELC): Return nfield = 0 on error * bindings/f77/getdata.f90.in: Make field an array * Makefile.am: Add ChangeLog to dist. * README.cxx README.f77 README.f95: Update for get_entry() bindings 2008-09-04 D. V. Wiebe svn:66 * test/Makefile.am test/dfes_bit.c test/dfes_lincom.c test/dfes_linterp.c test/dfes_multiply.c test/dfes_null.c test/dfes_phase.c test/dfes_raw.c test/dfes_zero.c test/entry_bad_code.c test/entry_bit.c test/entry_invalid.c test/entry_lincom.c test/entry_linterp.c test/entry_multiply.c test/entry_phase.c test/entry_raw.c: Add test suite for dirfile_free_entry_strings() and get_entry() * bindings/cxx/entry.h bindings/cxx/test/entry.cpp bindings/f77/fgetdata.c bindings/f77/getdata.f90.in bindings/f77/test/fget_entry.f90 man/get_entry.3 src/entry.c src/getdata.h.in: RAW filename should be internal * bindings/f77/make_parameters.c: Fix parentheses around F77 parameters * man/Makefile.am: install get_entry.3 2008-09-03 D. V. Wiebe svn:64 svn:65 * src/entry.c (dirfile_free_entry_strings): Fix double free * bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h: Use the GetData namespace * bindings/cxx/Makefile.am bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/cxx/entry.cpp bindings/cxx/entry.h bindings/cxx/test/Makefile.am bindings/cxx/test/entry.cpp: Add GetData::Entry class to abstractise gd_entry_t as well as C++ bindings for get_entry(). * bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/getdata.f90.in bindings/f77/make_parameters.c bindings/f77/test/fget_entry.f90: Add Fortran bindings for get_entry() 2008-09-03 D. V. Wiebe svn:63 * src/getdata.h.in: add a GD_NO_ENTRY entry type * man/dirfile_free_entry_strings man/get_entry.3 src/entry.c src/getdata.h.in: add dirfile_free_entry_strings() 2008-09-02 D. V. Wiebe svn:62 * bindings/f77/test/Makefile.am: fix include directory * src/getdata.h.in src/close.c src/common.c src/getdata.c src/nframes.c src/open.c src/putdata.c src/spf.c: re-organised gd_entry_t again * src/getdata.c (_GD_DoLincom): ensure we return 0 on error * src/close.c (dirfile_close): return -1 instead of 1 on error * src/entry.c (get_entry): instead of returning the library's internal gd_entry_t, copy the relevant bits to a caller supplied object. This should be significantly more bullet proof against unintentional metadata corruption * man/get_entry.3: update * test/Makefile.am: clean up after tests 2009-09-02 D. V. Wiebe svn:61 * man/get_entry.3 src/Makefile.am src/entry.c src/getdata.h.in: added get_entry() * src/close.c src/flush.c: Split flush.c from close.c * src/field_list.c src/nfields.c: Split nfields.c from field_list.c * src/common.c src/open.c: Moved _GD_GetLine to common.c * src/Makefile.am: Don't export internal symbols 2009-09-02 D. V. Wiebe svn:60 * README src/getdata.h.in: Add NO_GETDATA_LEGACY_API to getdata.h to permit callers to not include the legacy API. 2009-09-02 D. V. Wiebe svn:59 * configure.ac: disable all Fortran bindings with one option. Rename the bindings options. 2008-09-01 D. V. Wiebe svn:58 * src/getdata_legacy.c src/legacy.c: Re-implement GetFormat(); * src/getdata.h.in: store frame offset as off64_t * man/dirfile_flush.3: added * man/dirfile_close.3: corrected for changes made in revision 57 2008-09-01 D. V. Wiebe svn:57 * man/get_error_string.3 src/errors.c: Renamed getdata_error_string to get_error_string so people don't think its relevance is exclusive to getdata() * src/internal.h: Suberror codes may not = 0. * README.cxx README.f77 README.f95 bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/f77/fgetdata.c bindings/f77/getdata.f.in bindings/f77/getdata.f90.in man/Makefile.am man/dirfile_close.3 src/close.c src/getdata.h.in test/Makefile.am test/close.c test/close_bad.c test/close_null.c test/flush.c test/flush_all.c test/flush_bad_code.c test/flush_invalid.c test/flush_recurse.c: Added public function dirfile_flush() along with corresponding C++, F77 and F95 bindings. dirfile_close calls dirfile_flush and might now fail (if fsync(2) or close(2) returns with an error); ergo, it now returns an integer success value, since D->error can't be checked if the call was successful. * src/close.c (dirfile_close): per the man page, now always succeeds when passed NULL. * man/dirfile-format.5 src/open.c test/Makefile.am test/parse_endian_slash.c test/parse_foffs_slash.c test/parse_include_slash.c test/parse_version_slash.c: reserved words in the format file may now have an initial '/' to ensure they're treated as such. * man/dirfile-format.5 src/errors.c src/open.c test/Makefile.am test/parse_name.c: prohibit / \ < > # & | ; in field names. Of these, / would confuse the filesystem (and is now used to optionally demarcate reserved words), # is already cast out by GetLine(). We reserve the others for future use. Most of these are bash(1) metacharacters; ( and ) are the other non-whitespace metacharacters in bash, but GetData allows them in field names. 2008-09-01 D. V. Wiebe svn:56 * src/open.c src/close.c: split up dirfile_open.c * src/getdata.c src/types.c src/common.c: split up getdata.c 2008-08-30 D. V. Wiebe svn:54 * field_list.c: renamed get_n_fields() to get_nfields() * nframes.c: renamed get_n_frames() to get_nframes() * spf.c: renamed get_samples_per_frame() to get_spf() 2008-08-30 D. V. Wiebe svn:52 svn:53 * bindings/f77/Makefile.am bindings/f77/getdata.f90.in bindings/f77/test/Makefile.am bindings/f77/test/fget_field_list.f90 bindings/f77/test/fgetdata.f90: Use .f90 instead of .f95 for free-form Fortran source code 2008-08-29 D. V. Wiebe svn:51 * man/README.cxx man/README.f77 bindings/cxx/dirfile.cpp bindings/cxx/dirfile.h bindings/f77/fgetdata.c bindings/f77/getdata.f: added get_n_fields and get_field_list to C++ and F77 bindings. * bindings/f77/Makefile.am bindings/f77/getdata.f.in bindings/f77/make_parameters.c : automatically generate parameters * README.f95 bindings/f77/Makefile.am bindings/f77/getdata.f95.in bindings/f77/test/Makefile.am bindings/f77/test/fget_field_list.f95 bindings/f77/test/fgetdata.f95 configure.ac: Added Fortran 95 bindings 2008-08-29 D. V. Wiebe svn:50 * man/dirfile-format.5: Fix a rather egregious omission 2008-08-29 D. V. Wiebe svn:49 * src/getdata.h.in: Change GD_UNKNOWN 2008-08-26 D. V. Wiebe svn:47 svn:48 * man/Makefile.am man/get_field_list.3 man/get_n_fields.3 src/Makefile.am src/dirfile_open.c src/field_list.c src/getdata.h.in test/Makefile.am test/flist.c test/flist_invalid.c test/nfields.c test/nfields_invalid.c: Add get_n_fields and get_field_list functions * man/dirfile_open.3: Add BUGS section 2008-08-25 D. V. Wiebe svn:45 * configure.ac src/Makefile.am src/debug.c src/dirfile_open.c src/errors.c src/getdata.c src/internal.h src/nframes.c src/putdata.c src/spf.c: tracing in debug mode 2008-08-25 D. V. Wiebe svn:41 svn:42 svn:43 svn:44 * src/getdata_internal.h: renamed to internal.h * README.cxx README.f77: add 2008-08-25 D. V. Wiebe svn:40 * src/errors.c (getdata_error_string): Rewrote to get rid of the nested switches and to collect the strings. * src/errors.c src/getdata.h.in src/getdata_legacy.h src/legacy.c: Move GD_ERROR_CODES to legacy.c and deprecate. * src/dirfile_open.c src/getdata.c src/nframes.c src/putdata.c: Cleaned up error reporting code 2008-08-25 D. V. Wiebe svn:38 * src/dirfile_open.c src/getdata.c src/getdata.h.in src/getdata_internal.h nframes.c putdata.c spf.c: Replace the various different EntryType structs with a single, unified one. This also gets rid of the ENTRY() craziness. 2008-08-25 D. V. Wiebe svn:36 svn:37 * src/getdata.c src/getdata_internal.h src/putdata.c src/spf.c: Add _GD_InternalError() * src/errors.c: Rename _GD_SetGetDataError and _GD_ClearGetDataError to _GD_SetError and _GD_ClearError 2008-08-25 D. V. Wiebe svn:35 * bindings/f77/fgetdata.c (_GDF_ClearDirfile): Don't accidentally close dirfile unit zero 2008-08-21 D. V. Wiebe svn:34 * bindings/f77/fgetdata.c configure.ac src/dirfile_open.c src/getdata.c src/getdata.h.in src/getdata_internal.h src/getdata_legacy.h src/putdata.c: Fixes for compilation with icc, mostly concerning type casting. * configure.ac: AC_PREREQ([2.60]) * Makefile.am: don't include getdata.h in the tarball 2008-08-21 D. V. Wiebe svn:33 * src/getdata.h.in: Be less clever defining stuff. 2008-08-20 D. V. Wiebe svn:32 * bindings/f77/getdata.f: Add EXTERNAL function declarations 2008-08-19 D. V. Wiebe svn:30 * bindings/f77/test/gdfget.f: Remove references to TRIM 2008-08-19 D. V. Wiebe svn:26 svn:27 * README: add * Makefile.am: Remove explicit -lm 2008-08-19 D. V. Wiebe svn:25 * test/: Fix test suite for VPATH builds 2008-08-18 D. V. Wiebe svn:24 * Makefile.am configure.ac bindings/: Add C++ and Fortran 77 bindings. 2008-08-17 D. V. Wiebe svn:20 svn:21 * configure.ac getdata.h.in: Use AC_CONFIG_HEADERS with getdata.h * INSTALL: This is the generic autoconf/libtool INSTALL document. 2008-08-17 D. V. Wiebe svn:19 * Makefile.am configure.ac bin/Makefile.am bin/checkdirfile.c: add checkdirfile util 2008-08-17 D. V. Wiebe svn:18 * getdata_internal.h: If FILENAME_MAX is unreasonably small, still permit roomy format file lines. 2008-08-17 D. V. Wiebe svn:16 * Makefile.am test/: added test suite * man/get_n_frames64.3 man/getdata64.3 man/putdata.3 man/putdata64.3: added * man/getdata.3: Added .SH LIMITATIONS * src/dirfile_open.c src/errors.c src/getdata.c src/nframes.c src/spf.c: split getdata.c into smaller pieces * src/putdata.c (putdata): add support for access mode and frame offset 2008-08-12 D. V. Wiebe svn:13 * src/getdata.c src/getdata.h.in: rm unused error codes 2008-08-12 D. V. Wiebe svn:10 svn:11 svn:12 * configure.ac man/getdata.3 man/get_n_frames.3 src/getdata.c src/getdata.h.in src/getdata_internal.h src/legacy.c src/putdata.c: LFS support 2008-08-12 D. V. Wiebe svn:8 * src/getdata.c src/getdata.h.in: remove GD_E_ENDIAN_ERROR * src/putdata.c (_GD_DoBitOut): Multibit putdata 2008-08-12 D. V. Wiebe svn:7 * man/dirfile_open.3: modern symbol 2008-08-12 D. V. Wiebe svn:6 * src/getdata.c (_GD_SetGetDataError): don't crash on NULL * src/putdata.c (_GD_DoPhaseOut): add 2008-08-12 D. V. Wiebe svn:5 * src/legacy.c: Don't SEGV on bad dirfiles * src/getdata.c src/getdata_internal.h src/putdata.c: Check for invalid DIRFILEs 2008-08-12 D. V. Wiebe svn:4 * configure.ac: --enable-debug * src/getdata.c src/legacy.c src/putdata.c: rename DIRFILE_DEBUG to GETDATA_DEBUG 2008-08-12 D. V. Wiebe svn:2 * AUTHORS COPYING Makefile.am configure.ac man/Makefile.am man/dirfile-format.5 man/dirfile.5 man/dirfile_close.3 man/dirfile_open.3 get_n_frames.3 man/get_samples_per_frame.3 man/getdata.3 man/getdata_error_string.3 src/Makefile.am src/getdata.c src/getdata.h.in src/getdata_internal.h src/getdata_legacy.h src/legacy.c src/putdata.c: Initial import of getdata for sourceforge.net. Previous history for getdata can be found in the KDE subversion repository, for the kst project. libgetdata-0.9.0/ltmain.sh0000640000175000017500000117077312614323564015644 0ustar alastairalastair#! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # 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 this program. If not, see . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.6 package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # 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. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES FOR A PARTICULAR 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! 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 # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! 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 ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_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 # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_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 '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. 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. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # 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 "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # 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" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_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 "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # 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. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # 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 "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_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 "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_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_append 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_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || 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_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd 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 -z "$func_relative_path_tlibdir"; 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 -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # 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 () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_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. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # 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). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet 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 () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" 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 () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2014-01-07.03; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do eval $_G_hook '"$@"' # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift done func_quote_for_eval ${1+"$@"} func_run_hooks_result=$func_quote_for_eval_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, remove any # options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # func_quote_for_eval ${1+"$@"} # my_options_prep_result=$func_quote_for_eval_result # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # ;; # *) set dummy "$_G_opt" "$*"; shift; break ;; # esac # done # # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # func_quote_for_eval ${1+"$@"} # my_option_validation_result=$func_quote_for_eval_result # } # func_add_hook func_validate_options my_option_validation # # You'll alse need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd func_options_prep ${1+"$@"} eval func_parse_options \ ${func_options_prep_result+"$func_options_prep_result"} eval func_validate_options \ ${func_parse_options_result+"$func_parse_options_result"} eval func_run_hooks func_options \ ${func_validate_options_result+"$func_validate_options_result"} # save modified positional parameters for caller func_options_result=$func_run_hooks_result } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propogate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning. func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= func_run_hooks func_options_prep ${1+"$@"} # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. func_run_hooks func_parse_options ${1+"$@"} # Adjust func_parse_options positional parameters to match eval set dummy "$func_run_hooks_result"; shift # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) test $# = 0 && func_missing_arg $_G_opt && break case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" func_run_hooks func_validate_options ${1+"$@"} # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # 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. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --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 --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_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) version: $progname (GNU libtool) 2.4.6 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "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 yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; 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 } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= # 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 # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 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 $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;; esac done # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # 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 test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; 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." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. 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= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # 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 | func_generated_by_libtool_p } # 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 yes = "$lalib_p" } # 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 () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # 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 () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs 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 () { $debug_cmd 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 () { $debug_cmd 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 yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; 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 "$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 () { $debug_cmd # 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 () { $debug_cmd 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 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd $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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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 () { $debug_cmd 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_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # 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 yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot 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 yes = "$build_old_libs"; 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 no = "$pic_mode" && test pass_all != "$deplibs_check_method"; 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 no = "$compiler_c_o"; 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 yes = "$need_locks"; 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 warn = "$need_locks"; 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 yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; 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 warn = "$need_locks" && 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 yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; 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 warn = "$need_locks" && 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 no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && 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 -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -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 () { $debug_cmd # 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 $opt_dry_run; then # 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 else 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 fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd 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_quiet && 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 finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # 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=false 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=: ;; -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-m = "X$prev" && 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=: if $isdir; 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 ;; os2*) 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 yes = "$build_old_libs"; 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=: 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'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; 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_quiet || { 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 install = "$opt_mode" && 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 () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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) $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 can'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 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; 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 func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' 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[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi 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" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; 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" "${nlist}I"' # 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_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 () { $debug_cmd 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 () { $debug_cmd 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_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 () { $debug_cmd 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 case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) 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 } }'` ;; esac 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 () { $debug_cmd 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 () { $debug_cmd 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 that possess that section. Heuristic: eliminate # all those that 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_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 () { $debug_cmd 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 () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; 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 yes = "$lock_old_archive_extraction"; 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 () { $debug_cmd 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` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result 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 "$sed_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 where 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) $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/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that 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) $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 yes = "$fast_install"; 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 yes = "$shlibpath_overrides_runpath" && 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 #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* 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_platform || defined ... */ #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 #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 (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]; size_t 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 = (size_t) (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 (STREQ (str, pat)) *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 size_t 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) { size_t orig_value_len = strlen (orig_value); size_t 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 #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\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 () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd 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 # what 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 that 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= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false 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 yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && 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) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; 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 ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. 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 none = "$pic_object" && test none = "$non_pic_object"; 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 none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; 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 none != "$non_pic_object"; 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 none = "$pic_object"; 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 ;; os2dllname) os2dllname=$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 rpath = "$prev"; 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-export-symbols = "X$arg"; 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-lc = "X$arg" || test X-lm = "X$arg"; 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-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && 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-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm 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 ;; -os2dllname) prev=os2dllname 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 # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -stdlib=* select c++ std lib with clang -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*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*) 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 ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # 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 none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; 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 dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; 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 none = "$pic_object"; 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 dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; 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 yes = "$export_dynamic" && 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\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" 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 lib = "$linkmode"; 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=false 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 lib,link = "$linkmode,$pass"; 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; 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 dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; 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 .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; 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 conv = "$pass" && 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 conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; 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 link = "$pass"; 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 conv = "$pass"; 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=false 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=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else 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." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; 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=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # 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 lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; 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 prog != "$linkmode" && test lib != "$linkmode"; 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 yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; 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 dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" 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 yes = "$installed"; 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 yes = "$hardcode_automatic" && 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 dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; 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 lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; 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 prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: 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 $linkalldeplibs; 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 prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || 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 $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && 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 built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; 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 yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; 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 lib = "$linkmode" && test yes = "$hardcode_into_libs"; 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* | *os2*) 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 prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; 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 cannot # 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 no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; 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 yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; 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 prog = "$linkmode"; 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 yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; 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 prog = "$linkmode"; 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 prog = "$linkmode"; 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 unsupported != "$hardcode_direct"; 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 yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; 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 cannot 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 yes = "$module"; 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 no = "$build_old_libs"; 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 lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; 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 no = "$link_static" && 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 no != "$link_all_deplibs"; 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 link = "$pass"; then if test prog = "$linkmode"; 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 dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # 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= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=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 # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # 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 prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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 no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; 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 pass_all != "$deplibs_check_method"; 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 no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; 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 # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|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" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; 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 0 -ne "$loop"; 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 0 -ne "$loop"; 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 ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. 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 no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; 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 -n "$precious_files_regex"; 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 yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; 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 yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; 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 yes = "$build_libtool_libs"; 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 yes = "$build_libtool_need_lc"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 yes = "$allow_libtool_libs_with_static_runtimes"; 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 none = "$deplibs_check_method"; 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 yes = "$droppeddeps"; then if test yes = "$module"; 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 no = "$build_old_libs"; 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 no = "$allow_undefined"; 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 no = "$build_old_libs"; 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 yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || 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 relink = "$opt_mode" || 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 func_dll_def_p "$export_symbols" || { # 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 ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || 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 yes = "$try_normal_branch" \ && { 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 : != "$skipped_export"; 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 : != "$skipped_export" && 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 yes = "$compiler_needs_object" && 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 yes = "$thread_safe" && 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 relink = "$opt_mode"; 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 yes = "$module" && 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 : != "$skipped_export" && 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 : != "$skipped_export" && test yes = "$with_gnu_ld"; 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 : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; 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 -z "$objlist" || 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 1 -eq "$k"; 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 ${skipped_export-false} && { 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 } 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_quiet || { 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 relink = "$opt_mode"; 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 ${skipped_export-false} && { 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 } 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 yes = "$module" && 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=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { 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 relink = "$opt_mode"; 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 relink = "$opt_mode"; 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 yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; 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= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags 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 yes = "$build_libtool_libs" || 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 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 test yes = "$build_libtool_libs" || { 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 } if test -n "$pic_flag" || test default != "$pic_mode"; 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" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && 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 CXX = "$tagname"; 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 yes = "$build_old_libs"; 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@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # 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 } 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 yes = "$no_install"; 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 case $hardcode_action,$fast_install in relink,*) # 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" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # 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 case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac 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 yes = "$build_libtool_libs"; 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 -z "$oldobjs"; 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 yes = "$build_old_libs" && 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 yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; 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 -n "$bindir"; 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) $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 cannot 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 no,yes = "$installed,$need_relink"; 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 } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false 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=: ;; -*) 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 . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; 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 $rmforce; 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" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || 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 none != "$pic_object"; 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 none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; 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 yes = "$fast_install" && 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 } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi 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 # where 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: libgetdata-0.9.0/TODO0000640000175000017500000000022212614323564014470 0ustar alastairalastair* Locking * Hashed compressed files * linterp table path munging [MH] * Make webpage suck less * Fused multiply-add [CBN] * Entry list regex [AR] libgetdata-0.9.0/README0000640000175000017500000002747612614323564014704 0ustar alastairalastairTHE GETDATA PROJECT =================== The GetData Project is the reference implementation of the Dirfile Standards. The Dirfile database format is designed to provide a fast, simple format for storing and reading binary time-ordered data. The Dirfile Standards are described in detail in three Unix manual pages distributed with this package: dirfile(5), dirfile-format(5) and dirfile-encoding(5), which may be read before installation by running: $ man man/dirfile.5 $ man man/dirfile-format.5 $ man man/dirfile-encoding.5 from the top GetData Project directory (the directory containing this README file). After installation, they can be read with the standard man command: $ man dirfile $ man dirfile-format $ man dirfile-encoding More information on the GetData Project and the Dirfile database format may be found on the World Wide Web: http://getdata.sourceforge.net/ WARRANTY AND REDISTRIBUTION =========================== GetData 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. GetData is distributed in the hope that 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 GetData in a file called `COPYING'; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. CONTENTS ======== This package provides: * the Dirfile Standards documents (three Unix manual pages) * the C GetData library (libgetdata) including Unix manual pages * Several utitilities, which also serve as examples of use: - checkdirfile, which checks the metadata of a dirfile for problems - dirfile2ascii, which can convert all or part of a dirfile to ASCII text * several bindings to the library from other languages: - C++ (libgetdata++) - Fortran 77 (libfgetdata) - Fortran 95 (libf95getdata) - the Interactive Data Language (IDL; idl_getdata) - MATLAB (libgetdata-matlab and associated MEX files) - Perl (GetData.pm) - Python (pygetdata) Documentation for the various bindings, if present, can be found in files named `README.' in the doc/ directory. The C interface is described in this document and the associated man pages. A full list of features new to this release of GetData may be found in the file called `NEWS'. DIRFILE STANDARDS VERSION 9 =========================== The 0.8.0 release of the GetData Library (July 2012) is the first release to provide suuport the latest version of the Dirfile Standards, known as Standards Version 9. Standards Version 9 introduces the following: * Two new field types: MPLEX and WINDOW, both meant to deal with extracting a subset of their input. * Field name munging via /INCLUDEs, aliases, and "hidden" names. * Support for zzip-compressed dirfiles, as well as simple compression via an in-built scheme called Sample Index Encoding. This is the first update to the Dirfile Standards since Standards Version 8 (November 2010). A full history of the Dirfile Standards can be found in the dirfile-format(5) man page. BUILDING THE LIBRARY ==================== This package may be configured and built using the GNU autotools. Generic installation instructions are provided in the file called `INSTALL'. A brief summary follows. A C99-compliant compiler is required to build (but not to use) the package, although a compatible library with reduced functionality can be built with any ANSI C compiler. Most users should be able to build the package by simply executing: $ ./configure $ make from the top GetData Project directory (the directory containing this README file). After the project has been built, you may (optionally) test the build by executing: $ make check which will run a series of self-tests. Finally, $ make install will install the utilities, libraries, bindings, and documentation. The package configuration can be changed, if the default configuration is insufficient, before building it by passing options to ./configure. Running $ ./configure --help will display a brief help message summarising available options. PREREQUISITES ============= The only library required to build GetData is the C Standard Library. Several other external will be used if found by ./configure to provide support for various data encodings (typically compression schemes). These are: - the slim compression library by Joseph Fowler; - the zlib library by Jean-loup Gailly and Mark Adler; - the bzip2 compression library by Julian Seward; - the lzma library, part of the XZ Utils suite by Lasse Collin, Ville Koskinen, and Igor Pavlov; and, - the zzip library by Tomi Ollila and Guido Draheim. If these libraries are not found by configure, GetData will lack support for the associated encoding scheme and fail gracefully if encountering dirfiles so encoded. Building bindings requires appropriate compilers/interpreters and libraries for the various languages. In particular: - the C++ bindings require a C++90 compliant compiler - the Fortran-77 bindings require a Fortran-77 compliant compiler - the Fortran-95 bindings require both a Fortran-95 compliant compiler and a Fortran-77 compiler (because the Fortran-95 bindings are built on top of the Fortran-77 bindings) - the IDL bindings require a licenced IDL interpreter, version 5.5 or later; they will not work on an unlicenced interpreter in timed demo mode - the MATLAB bindings require both a MATLAB interpreter and a MEX compiler - the Perl bindings require a Perl5 interpreter version 5.6 or later, as well as the Math::Complex and Module::Build modules. - the Python bindings require Python 2.3 or later. NumPy is also highly recommended for efficient use. USING THE LIBRARY ================= To use the library in C programs, the header file getdata.h should be included. This file declares all the various APIs provided by th library. Programs linking to static versions of the GetData library need to be linked against the C Standard Math Library, in addition to GetData itself, plus any other libraries required for encodings supported by the library, e.g. using `-lgetdata -lm '. The various small programs in the `util' subdirectory of the package provide examples of use. The checkdirfile utility was designed to report syntax errors in the format file(s) of the large, complex dirfiles used in the analysis of the BLAST experiment data. This utility will report all syntax errors it find in the supplied dirfile, plus any problems in the metadata itself. Bindings exist for using the GetData library in languages other than C. If language bindings exist for your particular library, a README. file explaining its use should be present in the `doc' subdirectory. If no bindings exist for your language of choice, you will have to write your own. If you are willing to have these bindings redistributed under identical terms as the GetData Project, we encourage you to submit them for inclusion in the package. USING MODULES ============= Starting with GetData 0.5.0, encoding schemes which rely on optional external libraries (slim, gzip, bzip2, &c.) may be built as stand-alone library modules which will be dynamically loaded, as needed, at runtime by the core GetData library. This architecture is provided to permit packaging the core GetData library separately from the parts of the library requiring the optional external libraries without having to give up the functionality these extra libraries provide. To enable this behaviour, pass `--enable-modules' to ./configure. The modules are dynamically loaded via GNU libtool's portable dlopen wrapper library, libltdl. The libltdl library permits dynamic loading of modules on at least Solaris, Linux, BSD, HP-UX, Win16, Win32, BeOS, Darwin, MacOS X. The libltdl library is no longer distributed with GetData. It can usually be found as part of the GNU libtool package on any modern GNU system, or else obtained for free from the GNU Project. GetData will fail gracefully if a library module is not found or cannot be opened at runtime. In this case, the call which triggered the attempt to load the module will fail with the GD_E_UNSUPPORTED error. The dlopen library (and, by extension, libltdl) is notoriously not thread safe. As a result, if a POSIX thread implementation can be found, calls to the dynamic loader will be wrapped in a mutex. THE GETDATA HEADER FILE ======================= The GetData header file, `getdata.h', installed in ${prefix}/include, declares the new API. It also includes `getdata_legacy.h' (also installed) which declares the legacy API. The legacy header should never be included directly. Defining the preprocessor symbol `GD_NO_LEGACY_API' before including getdata.h will prevent the legacy API from being declared. In cases when the legacy API is declared, getdata.h will define the symbol GD_LEGACY_API, which can be used by callers to determine whether the legacy API is present at compile time. If the legacy API is not built (as a result of passing `--disable-legacy-api' to ./configure), getdata_legacy.h will not be installed, and the legacy API will never be declared. The default GetData API makes use of C99 features. An ANSI C API is also available and can be used by defining GD_C89_API before including getdata.h. If GetData was built without a C99-compliant compiler, the C99 API will be missing. In this case, the ANSI C API will be enabled by default (as if GD_C89_API were always defined) and, furthermore, getdata.h will define the symbol GD_NO_C99_API to indicate this. LARGEFILE SUPPORT ================= When built on a platform using the GNU C Library, or another compatible C Library, the new GetData API will respect the feature test macros _LARGEFILE64_SOURCE and _FILE_OFFSET_BITS affecting largefile (> 2 GB) support. If one or the other of these are to be used, they must be defined before including getdata.h or any Standard C Library header file. The first of these, _LARGEFILE64_SOURCE, if defined before including getdata.h, will enable the obsolete, transitional largefile extensions defined by the LFS. This will enable explicit support for large files through the definition of the 64-bit explicit type `off64_t', and result in GetData defining the explicitly 64-bit interfaces `gd_getdata64', `gd_putdata64', `gd_get_nframes64', &c. This macro is largely obsolete, and using _FILE_OFFSET_BITS is preferred, if supported. The second macro, _FILE_OFFSET_BITS, determines the size of `off_t'. If not defined, or defined to `32', `off_t' will be the old 32-bit type. If, instead, this macro is defined to `64', `off_t' will be the largefile supporting 64-bit type, and calls to gd_getdata, gd_putdata, &c. will intrinsically have largefile support. On 64-bit systems this macro has no effect, since a 64-bit `off_t' is used all the time. If your system uses the GNU C Library, the feature_test_macros(7) man page will provide further explanation. On systems where these macros are unsupported, the gd_getdata64, &c. interfaces will never be defined, and the size of `off_t' will be system dependent. In this case, GetData will likely lack largefile support. If you build GetData against a C Library that lacks largefile support, the GetData library will not support large files either, no matter what you do with these macros. AUTHOR ====== The Dirfile Standards and the GetData library were conceived and written by C. B. Netterfield . Since Standards Version 3 (January 2006), the Dirfile Standards and GetData have been maintained by D. V. Wiebe . A full list of contributors is given in the file called `AUTHORS'. libgetdata-0.9.0/depcomp0000740000175000017500000005601612614323564015367 0ustar alastairalastair#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # 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" echo >> "$depfile" # make sure the fragment doesn't end with a backslash 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: libgetdata-0.9.0/aclocal.m40000640000175000017500000135224312614323564015656 0ustar alastairalastair# generated automatically by aclocal 1.14.1 -*- 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 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-2001, 2003-2015 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) 2014 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 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 this program. If not, see . ]) # serial 58 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.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK 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_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _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 m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that 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 set != "${COLLECT_NAMES+set}"; 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 0 = "$lt_write_fail" && 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 yes = "$silent" && 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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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) 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' 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 0 = "$_lt_result"; 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 0 = "$_lt_result" && $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 yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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 no = "$lt_cv_ld_force_load"; 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 yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; 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 yes != "$lt_cv_apple_cc_single_mod"; 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 set = "${lt_cv_aix_libpath+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 that will find a shell with a builtin # printf (that 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], [AS_HELP_STRING([--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 yes = "$GCC"; 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 where 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 no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; 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 bitrig* | 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "[$]$2"; 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 yes = "[$]$2"; 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # 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" && \ test undefined != "$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 17 != "$i" # 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 yes = "$cross_compiling"; 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 -fvisibility=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 yes != "$enable_dlopen"; 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 ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$lt_cv_dlopen_self"; 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 no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; 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 no = "$hard_links"; 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 where 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 yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; 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 relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; 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_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _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 m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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 AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _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], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that 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 that 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 no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [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 # that 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. if ( 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 ;; 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 | 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* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; 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 -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) 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 one 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 yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported 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};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 can'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* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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 yes = "$pipe_works"; 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_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _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_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _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 yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; 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 ia64 != "$host_cpu"; 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 | 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 yes = "$GCC"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; 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 ;; 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' case $cc_basename in 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' ;; esac ;; 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']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; 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 | 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' ;; tcc*) # Fabrice Bellard et al's Tiny 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)='-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\ 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 that 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. 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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) 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 yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/([^)]\+)\s\+//' 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 ia64 != "$host_cpu"; 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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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 ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" 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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-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 yes = "$supports_anon_versioning"; 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 tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; 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 yes = "$supports_anon_versioning"; 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 cannot *** 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 no = "$_LT_TAGVAR(ld_shlibs, $1)"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. 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) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 yes = "$with_gnu_ld"; 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 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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 yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes = "$GCC"; 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 yes = "$lt_cv_irix_exported_symbol"; 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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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* | bitrig*) 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__`"; 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 _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' 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 shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes,yes = "$GCC,$enable_shared"; 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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); 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 yes != "$_lt_caught_CXX_error"; 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 yes = "$GXX"; 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 yes = "$GXX"; 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 yes = "$with_gnu_ld"; 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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 yes = "$with_gnu_ld"; 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 _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); 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) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; 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 ;; 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 "x$output_objdir/$soname" = "x$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 yes = "$GXX"; 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 "x$output_objdir/$soname" = "x$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 no = "$with_gnu_ld"; 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 yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 | 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 yes = "$supports_anon_versioning"; 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 ;; openbsd* | bitrig*) 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__`"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 $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 $wl-h $wl$soname -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 $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 $wl-h $wl$soname -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 CANNOT 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 no = "$_LT_TAGVAR(ld_shlibs, $1)" && 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 yes != "$_lt_caught_CXX_error" 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 @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@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 x-L = "$p" || test x-R = "$p"; 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 no = "$pre_test_object_deps_done"; 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 no = "$pre_test_object_deps_done"; 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)= ;; 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 no = "$F77"; 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 yes != "$_lt_disable_F77"; 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 yes != "$_lt_disable_F77" 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 no = "$FC"; 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 yes != "$_lt_disable_FC"; 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 yes != "$_lt_disable_FC" 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 set = "${GCJFLAGS+set}" || 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 10 -lt "$lt_ac_count" && 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], [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_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what 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-2009, 2011-2015 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 8 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_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4], [_LT_WITH_AIX_SONAME([aix])]) ]) ])# _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_AIX_SONAME([DEFAULT]) # ---------------------------------- # implement the --with-aix-soname flag, and support the `aix-soname=aix' # and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT # is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'. m4_define([_LT_WITH_AIX_SONAME], [m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[[5-9]]*,yes) AC_MSG_CHECKING([which variant of shared library versioning to provide]) AC_ARG_WITH([aix-soname], [AS_HELP_STRING([--with-aix-soname=aix|svr4|both], [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])], [case $withval in aix|svr4|both) ;; *) AC_MSG_ERROR([Unknown argument to --with-aix-soname]) ;; esac lt_cv_with_aix_soname=$with_aix_soname], [AC_CACHE_VAL([lt_cv_with_aix_soname], [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT) with_aix_soname=$lt_cv_with_aix_soname]) AC_MSG_RESULT([$with_aix_soname]) if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac _LT_DECL([], [shared_archive_member_spec], [0], [Shared archive member basename, for filename based shared library versioning on AIX])dnl ])# _LT_WITH_AIX_SONAME LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])]) LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])]) # _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=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, 2011-2015 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, 2011-2015 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 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _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, 2011-2015 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.14' 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.14.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.14.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- 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_PROG_AS # ---------- AC_DEFUN([AM_PROG_AS], [# By default we simply use the C compiler to build assembly code. AC_REQUIRE([AC_PROG_CC]) test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS AC_ARG_VAR([CCAS], [assembler compiler command (defaults to CC)]) AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)]) _AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])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. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # 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 # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) 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])]) # 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])]) # 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_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # 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_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 2.0 are not dnl supported. (2.0 was released on October 16, 2000). m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python3 python3.3 python3.2 python3.1 python3.0 python2.7 dnl python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0]) AC_ARG_VAR([PYTHON], [the Python interpreter]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version is >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_MSG_ERROR([Python interpreter is too old])]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version[[:3]])"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) # Just factor out some code duplication. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility # with python 3.x. See automake bug#10227. try: import sysconfig except ImportError: can_use_sysconfig = 0 else: can_use_sysconfig = 1 # Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: # try: from platform import python_implementation if python_implementation() == 'CPython' and sys.version[[:3]] == '2.7': can_use_sysconfig = 0 except ImportError: pass" dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [if test "x$prefix" = xNONE then am_py_prefix=$ac_default_prefix else am_py_prefix=$prefix fi am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pythondir in $am_py_prefix*) am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` ;; *) case $am_py_prefix in /usr|/System*) ;; *) am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [if test "x$exec_prefix" = xNONE then am_py_exec_prefix=$am_py_prefix else am_py_exec_prefix=$exec_prefix fi am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) else: from distutils import sysconfig sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` case $am_cv_python_pyexecdir in $am_py_exec_prefix*) am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` ;; *) case $am_py_exec_prefix in /usr|/System*) ;; *) am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages ;; esac ;; esac ]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # This supports Python 2.0 or higher. (2.0 was released on October 16, 2000). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # 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_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # 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}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} 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/ax_compare_version.m4]) m4_include([m4/compiler.m4]) m4_include([m4/encoding.m4]) m4_include([m4/floatordering.m4]) m4_include([m4/idl.m4]) m4_include([m4/matlab.m4]) m4_include([m4/perl.m4]) m4_include([m4/php.m4]) m4_include([m4/python.m4]) m4_include([m4/win32.m4]) libgetdata-0.9.0/m4/0000740000175000017500000000000012614323564014322 5ustar alastairalastairlibgetdata-0.9.0/m4/ax_compare_version.m40000640000175000017500000001454512614323564020462 0ustar alastairalastair# =========================================================================== # http://www.nongnu.org/autoconf-archive/ax_compare_version.html # =========================================================================== # # SYNOPSIS # # AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # # DESCRIPTION # # This macro compares two version strings. Due to the various number of # minor-version numbers that can exist, and the fact that string # comparisons are not compatible with numeric comparisons, this is not # necessarily trivial to do in a autoconf script. This macro makes doing # these comparisons easy. # # The six basic comparisons are available, as well as checking equality # limited to a certain number of minor-version levels. # # The operator OP determines what type of comparison to do, and can be one # of: # # eq - equal (test A == B) # ne - not equal (test A != B) # le - less than or equal (test A <= B) # ge - greater than or equal (test A >= B) # lt - less than (test A < B) # gt - greater than (test A > B) # # Additionally, the eq and ne operator can have a number after it to limit # the test to that number of minor versions. # # eq0 - equal up to the length of the shorter version # ne0 - not equal up to the length of the shorter version # eqN - equal up to N sub-version levels # neN - not equal up to N sub-version levels # # When the condition is true, shell commands ACTION-IF-TRUE are run, # otherwise shell commands ACTION-IF-FALSE are run. The environment # variable 'ax_compare_version' is always set to either 'true' or 'false' # as well. # # Examples: # # AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) # AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) # # would both be true. # # AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) # AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) # # would both be false. # # AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) # # would be true because it is only comparing two minor versions. # # AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) # # would be true because it is only comparing the lesser number of minor # versions of the two values. # # Note: The characters that separate the version numbers do not matter. An # empty string is the same as version 0. OP is evaluated by autoconf, not # configure, so must be a string, not a variable. # # The author would like to acknowledge Guido Draheim whose advice about # the m4_case and m4_ifvaln functions make this macro only include the # portions necessary to perform the specific comparison specified by the # OP argument in the final configure script. # # LICENSE # # Copyright (c) 2008 Tim Toolan # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. dnl ######################################################################### AC_DEFUN([AX_COMPARE_VERSION], [ AC_REQUIRE([AC_PROG_AWK]) # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. AS_VAR_PUSHDEF([A],[ax_compare_version_A]) A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` AS_VAR_PUSHDEF([B],[ax_compare_version_B]) B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ -e 's/[[^0-9]]//g'` dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary dnl # then the first line is used to determine if the condition is true. dnl # The sed right after the echo is to remove any indented white space. m4_case(m4_tolower($2), [lt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [gt],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` ], [le],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` ], [ge],[ ax_compare_version=`echo "x$A x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` ],[ dnl Split the operator from the subversion count if present. m4_bmatch(m4_substr($2,2), [0],[ # A count of zero means use the length of the shorter version. # Determine the number of characters in A and B. ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` # Set A to no more than B's length and B to no more than A's length. A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` ], [[0-9]+],[ # A count greater than zero means use only that many subversions A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` ], [.+],[ AC_WARNING( [illegal OP numeric parameter: $2]) ],[]) # Pad zeros at end of numbers to make same length. ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" B="$B`echo $A | sed 's/./0/g'`" A="$ax_compare_version_tmp_A" # Check for equality or inequality as necessary. m4_case(m4_tolower(m4_substr($2,0,2)), [eq],[ test "x$A" = "x$B" && ax_compare_version=true ], [ne],[ test "x$A" != "x$B" && ax_compare_version=true ],[ AC_WARNING([illegal OP parameter: $2]) ]) ]) AS_VAR_POPDEF([A])dnl AS_VAR_POPDEF([B])dnl dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. if test "$ax_compare_version" = "true" ; then m4_ifvaln([$4],[$4],[:])dnl m4_ifvaln([$5],[else $5])dnl fi ]) dnl AX_COMPARE_VERSION libgetdata-0.9.0/m4/floatordering.m40000640000175000017500000000464412614323564017435 0ustar alastairalastairdnl Copyright (C) 2010 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_C_FLOATORDERING dnl ----------------------------------------------------------- dnl Attempt to determine the ordering of double precision floats AC_DEFUN([GD_C_FLOATORDERING], [AC_CACHE_CHECK([floating point endianness], [gd_cv_c_floatordering], [gd_cv_c_floatordering=unknown # check for arm middle endianness AC_COMPILE_IFELSE([AC_LANG_SOURCE( [[#if ! (defined __arm__ && ! (defined __VFP_FP__ || defined __MAVERICK___)) not arm middle endian #endif ]])], [gd_cv_c_floatordering=arm], [# not middle-endian arm, check for __FLOAT_WORD_ORDER AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[#ifndef __FLOAT_WORD_ORDER no __FLOAT_WORD_ORDER defined #endif ]])], [# __FLOAT_WORD_ORDER is defined; is it BIG_ENDIAN? AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[#include ]], [[#if __FLOAT_WORD_ORDER != BIG_ENDIAN not big endian #endif ]])], [gd_cv_c_floatordering="big"], [gd_cv_c_floatordering="little"])], [# no __FLOAT_WORD_ORDER defined; so we just assume it's the same as the # integer ordering AC_COMPILE_IFELSE( [AC_LANG_SOURCE( [[#ifndef WORDS_BIGENDIAN not big endian #endif ]])], [gd_cv_c_floatordering="big"], [gd_cv_c_floatordering="little"])])])]) if test $gd_cv_c_floatordering = "arm"; then AC_DEFINE([ARM_ENDIAN_DOUBLES], [1], [ Define to 1 if your processor stores double-precision floats in the old ARM middle-endian format ]) elif test $gd_cv_c_floatordering = "big"; then AC_DEFINE([FLOATS_BIGENDIAN], [1], [ Define to 1 if your processor stores double-precision floats in big-endian order]) fi]) libgetdata-0.9.0/m4/encoding.m40000640000175000017500000001207512614323564016361 0ustar alastairalastairdnl Copyright (C) 2008-2013 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_CHECK_ENCODING dnl ------------------------------------------------------------- dnl Run a bunch of checks to see if we can build and test encodings dnl based on an external library. This function is easily broken. AC_DEFUN([GD_CHECK_ENCODING], [ have_this_header= have_this_lib= m4_define([gd_encoding], [$1]) AC_ARG_WITH([lib$2], AS_HELP_STRING([--with-lib$2=PREFIX], [use the lib$2 installed in PREFIX [default: autodetect]]), [ case "${withval}" in no) use_[]gd_encoding="no" ;; yes) use_[]gd_encoding="yes"; gd_encoding[]_prefix= ;; *) use_[]gd_encoding="yes"; gd_encoding[]_prefix="${withval}" ;; esac ], [ use_[]gd_encoding="yes"; gd_encoding[]_prefix=; ]) m4_divert_once([HELP_WITH], AS_HELP_STRING([--without-lib$2], [disable encodings supported by lib$2, even if the library is present])) echo echo "*** Configuring gd_encoding support" echo if test "x$no_extern" = "xyes"; then use_[]gd_encoding="no"; fi if test "x$use_[]gd_encoding" = "xyes"; then dnl search for library saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$gd_encoding[]_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$gd_encoding[]_prefix/lib" fi AC_CHECK_LIB([$2],[$3],[have_this_lib=yes LIBS="$LIBS -l$2"] AC_DEFINE(AS_TR_CPP([HAVE_LIB$2]), 1, [Define to 1 if you have the `$2' library (-l$2).])) ifelse(`x$7', `x',,[ AC_CHECK_FUNCS([$7]) ]) LDFLAGS=$saved_ldflags LIBS=$saved_libs dnl search for header saved_cppflags=$CPPFLAGS if test "x$gd_encoding[]_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$gd_encoding[]_prefix/include" fi AC_CHECK_HEADERS([$4],[have_this_header=yes]) CPPFLAGS=$saved_cppflags fi dnl cleanup AS_TR_CPP(gd_encoding[_CPPFLAGS])= AS_TR_CPP(gd_encoding[_LDFLAGS])= AS_TR_CPP(gd_encoding[_LIBS])= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$gd_encoding[]_prefix" = "x"; then AS_TR_CPP(gd_encoding[_LIBS])="-l$2" AS_TR_CPP(gd_encoding[_SEARCHPATH])="$PATH" else AS_TR_CPP(gd_encoding[_CPPFLAGS])="-I$gd_encoding[]_prefix/include" AS_TR_CPP(gd_encoding[_LDFLAGS])="-L$gd_encoding[]_prefix/lib" AS_TR_CPP(gd_encoding[_LIBS])="-l$2" AS_TR_CPP(gd_encoding[_SEARCHPATH])="$gd_encoding[]_prefix/bin:$PATH" fi AC_DEFINE(AS_TR_CPP([USE_]gd_encoding), [], [ Define to enable ]gd_encoding[ support ]) else use_[]gd_encoding="no"; AS_TR_CPP(gd_encoding[_SEARCHPATH])="$PATH" fi AC_SUBST(AS_TR_CPP(gd_encoding[_CPPFLAGS])) AC_SUBST(AS_TR_CPP(gd_encoding[_LDFLAGS])) AC_SUBST(AS_TR_CPP(gd_encoding[_LIBS])) dnl executables needed for tests m4_define([gd_progname], regexp([$5 ], [^\([^ ]*\) ], [\1])) AC_PATH_PROGS([path_]gd_progname, [$5], [not found], [$AS_TR_CPP(gd_encoding[_SEARCHPATH])]) if test "x$path_[]gd_progname" != "xnot found"; then AC_DEFINE_UNQUOTED(AS_TR_CPP(gd_progname), ["$path_]gd_progname["], [ Define to the full path to the `]gd_progname[' binary ]) fi ifelse(`x$6', `x',,[ m4_define([gd_unprogname], regexp([$6 ], [^\([^ ]*\) ], [\1])) AC_PATH_PROGS([path_]gd_unprogname, [$6], [not found], [$AS_TR_CPP(gd_encoding[_SEARCHPATH])]) if test "x$path_[]gd_unprogname" != "xnot found"; then AC_DEFINE_UNQUOTED(AS_TR_CPP(gd_unprogname), ["$path_]gd_unprogname["], [ Define to the full path to the `]gd_unprogname[' binary ]) fi ]) AM_CONDITIONAL(AS_TR_CPP([USE_]gd_encoding), [test "x$use_]gd_encoding[" = "xyes"]) if test "x$path_[]gd_progname" != "xnot found" -a \ "x$path_[]gd_unprogname" != "xnot found"; then AC_DEFINE(AS_TR_CPP([TEST_]gd_encoding), [], [ Define to enable ]gd_encoding[ tests ]) fi dnl add to summary and private lib list if test "x$use_[]gd_encoding" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} gd_encoding"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} gd_encoding"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="[$]AS_TR_CPP(gd_encoding[_LDFLAGS]) [$]AS_TR_CPP(gd_encoding[_LIBS])" else PRIVATE_LIBS="[$]AS_TR_CPP(gd_encoding[_LDFLAGS]) $PRIVATE_LIBS [$]AS_TR_CPP(gd_encoding[_LIBS])" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} gd_encoding"; fi ]) libgetdata-0.9.0/m4/perl.m40000640000175000017500000001402212614323564015527 0ustar alastairalastairdnl Copyright (C) 2011-2013 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_PERL_CONFIG dnl --------------------------------------------------------------- dnl query perl for the specified configuration value and store it in the dnl supplied local variable AC_DEFUN([GD_PERL_CONFIG], [ ifelse(`$#', `2', [perl_int=$PERL], [perl_int=$3]) # 3=$3 $1=`$perl_int -V::$2: | sed -e "s/'//g" | sed -e "s/[ \t]*$//"` ]) dnl GD_PERL_CHECK_VERSION dnl --------------------------------------------------------------- dnl Define PERL_VERSION to the version of the idl interpreter AC_DEFUN([GD_PERL_CHECK_VERSION], [ perl_version_ok="no" GD_PERL_CONFIG([PERL_VERSION], [version], [$1]) AX_COMPARE_VERSION([$PERL_VERSION],[ge],[$2],[perl_version_ok="yes"]) if test "x$perl_version_ok" = "xyes"; then $3 true else $4 true fi ]) dnl GD_PERL_MAN3EXT dnl --------------------------------------------------------------- dnl Define PERL_MAN3EXT to the section 3 manual extension used by Module::Build AC_DEFUN([GD_PERL_MAN3EXT], [ AC_MSG_CHECKING([for the section 3 manual page extension]) PERL_MAN3EXT=`$PERL -MModule::Build -e 'print "\n>>GD ", Module::Build->new(module_name=>"conftest",dist_version=>0)->config('man3ext'), " GD<<";' | $AWK '/>>GD .* GD< if the specified module exists AC_DEFUN([GD_PERL_CHECK_MODULE], [ AC_MSG_CHECKING([for $1]) if $PERL -M$1 -e 'exit' > /dev/null 2>&1; then AS_TR_SH([HAVE_$1])=yes else AS_TR_SH([HAVE_$1])=no fi AC_MSG_RESULT([${AS_TR_SH([HAVE_$1])}]) ]) dnl GD_PERL dnl --------------------------------------------------------------- dnl Look for perl5. Then determine whether we can build XSUBs. AC_DEFUN([GD_PERL], [ first_perl=5.8.0 perl_prog_list="perl perl5 \ perl5.14 perl5.12 perl5.10 perl5.8 \ perl5.14.0 \ perl5.12.3 perl5.12.2 perl5.12.1 perl5.12.0 \ perl5.10.1 perl5.10.0 \ perl5.8.9 perl5.8.8 perl5.8.7 perl5.8.6 perl5.8.5 perl5.8.4 perl5.8.3 \ perl5.8.2 perl5.8.1 perl5.8.0" dnl --without-perl basically does the same as --disable-perl AC_ARG_WITH([perl], AS_HELP_STRING([--with-perl=PATH], [use the Perl interpreter located in PATH. [default: autodetect]]), [ case "${withval}" in no) have_perl="no" ;; yes) user_perl= ; have_perl= ;; *) user_perl="${withval}"; have_perl= ;; esac ], [ user_perl=; have_perl= ]) if test "x${have_perl}" != "xno"; then dnl try to find a sufficiently new perl. if test "x$user_perl" != "x"; then AC_MSG_CHECKING([whether $user_perl version >= $first_perl]) GD_PERL_CHECK_VERSION([$user_perl], [$first_perl], [AC_MSG_RESULT([yes]) PERL=$user_perl], [AC_MSG_RESULT([no]) PERL="not found"]) else AC_MSG_CHECKING([for Perl interpreter version >= $first_perl]) PERL="not found" for perl in $perl_prog_list; do _AS_PATH_WALK([$PATH], [for exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$perl$exec_ext"]); then GD_PERL_CHECK_VERSION( ["$as_dir/$perl$exec_ext"], [$first_perl], [ PERL="$as_dir/$perl$exec_ext"; break 3] ) fi done]) done AC_MSG_RESULT([$PERL]) fi if test "x$PERL" = "xnot found"; then have_perl="no" PERL= fi AC_SUBST([PERL]) fi if test "x${have_perl}" != "xno"; then dnl perl version AC_MSG_CHECKING([$PERL version]) GD_PERL_CONFIG([PERL_VERSION], [version]) AC_MSG_RESULT([$PERL_VERSION]) fi AC_ARG_WITH([perl-dir], AS_HELP_STRING([--with-perl-dir=PATH], [ Install Perl bindings in PATH. If PATH is the special word `vendor', install Perl bindings into the default vendor-specific module directory (if present). If PATH is the special word `site', install Perl bindings into the default site-specific module directory. [default: site] ]), [ case "${withval}" in vendor|site) perl_inst_type="${withval}" ;; no) perl_inst_type="site" ;; *) perl_inst_type="local"; local_perl_path="${withval}" ;; esac ], [ perl_inst_type="site" ]) if test "x${have_perl}" != "xno"; then GD_PERL_CHECK_MODULE([Math::Complex]) GD_PERL_CHECK_MODULE([Module::Build]) GD_PERL_CHECK_MODULE([Test::Harness]) fi if test "$HAVE_Math__Complex$HAVE_Module__Build" != "yesyes"; then have_perl=no fi if test "x${have_perl}" != "xno"; then dnl calculate the extension module directory AC_MSG_CHECKING([Perl module directory]) if test $perl_inst_type = "vendor"; then GD_PERL_CONFIG([perldir], [vendorarchexp]) GD_PERL_CONFIG([perlmandir], [vendorman3direxp]) if test perldir = "UNKNOWN"; then perl_inst_type = "site"; fi fi if test $perl_inst_type = "site"; then GD_PERL_CONFIG([perldir], [sitearchexp]) GD_PERL_CONFIG([perlmandir], [siteman3direxp]) elif test $perl_inst_type != "vendor"; then perldir="${local_perl_path}" perlmandir="${man3dir}" fi if test $perlmandir = "UNKNOWN"; then perlmandir="${mandir}" fi AC_SUBST([perldir]) AC_MSG_RESULT([$perldir]) AC_MSG_CHECKING([Perl man directory]) AC_SUBST([perlmandir]) AC_MSG_RESULT([$perlmandir]) GD_PERL_MAN3EXT fi ]) libgetdata-0.9.0/m4/php.m40000640000175000017500000000624312614323564015362 0ustar alastairalastairdnl Copyright (C) 2013, 2015 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_PHP_CONFIG dnl --------------------------------------------------------------- dnl Get a PHP configuration option and store it in the supplied local dnl variable. AC_DEFUN([GD_PHP_CONFIG], [ $1=`${PHP_CONFIG} --$2` ifelse(`x$3', `x',,[ if test "x${$1}" = "x"; then $1="$3"; have_php="no"; elif test "x${$1}" = "xNONE"; then have_php="no"; fi ]) ]) dnl GD_PHP dnl --------------------------------------------------------------- dnl Look for PHP. AC_DEFUN([GD_PHP], [ have_php="yes" AC_ARG_WITH([php-config], AS_HELP_STRING([--with-php-config=PATH], [use PATH as php-config. [default: autodetect]]), [ case "${withval}" in no) have_php="no" ;; yes) user_php_config= ;; *) user_php_config="${withval}" ;; esac ], [ user_php_config= ]) if test "x${have_php}" != "xno"; then dnl try to find php AC_PATH_PROGS(PHP_CONFIG, [$user_php_config php5-config php-config], [not found]) if test "x$PHP_CONFIG" = "xnot found"; then have_php="no" PHP_CONFIG= fi AC_SUBST([PHP_CONFIG]) fi dnl extension dir AC_ARG_WITH([php-dir], AS_HELP_STRING([--with-php-dir=DIR], [install the GetData PHP extension into DIR [default: autodetect]]), [ if test "x${withval}" = "xno"; then phpdir=UNKNOWN; else phpdir=${withval}; fi ], [phpdir=UNKNOWN]) dnl php CLI if test "x${have_php}" != "xno"; then AC_MSG_CHECKING([PHP interpreter path]) GD_PHP_CONFIG([PHP], [php-binary], [UNKNOWN]) AC_MSG_RESULT([$PHP]) fi if test "x${have_php}" != "xno"; then AC_SUBST([PHP]) AC_MSG_CHECKING([the PHP extension directory]) if test "x${phpdir}" = "xUNKNOWN"; then GD_PHP_CONFIG([phpdir], [extension-dir], [UNKNOWN]) fi AC_MSG_RESULT([$phpdir]) if test "x${phpdir}" = "xUNKNOWN"; then have_php=no fi AC_SUBST([phpdir]) AC_MSG_CHECKING([PHP CPPFLAGS]) GD_PHP_CONFIG([PHP_CPPFLAGS], [includes]) AC_MSG_RESULT([$PHP_CPPFLAGS]) AC_SUBST([PHP_CPPFLAGS]) AC_MSG_CHECKING([PHP LDFLAGS]) GD_PHP_CONFIG([PHP_LDFLAGS], [ldflags]) AC_MSG_RESULT([$PHP_LDFLAGS]) AC_SUBST([PHP_ldflags]) AC_MSG_CHECKING([PHP LIBS]) GD_PHP_CONFIG([PHP_LIBS], [libs]) AC_MSG_RESULT([$PHP_LIBS]) AC_SUBST([PHP_libs]) fi ]) libgetdata-0.9.0/m4/idl.m40000640000175000017500000001035012614323564015335 0ustar alastairalastairdnl Copyright (C) 2009, 2011, 2012, 2013 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_IDL_CHECK_VERSION dnl --------------------------------------------------------------- dnl Define IDL_VERSION to the version of the idl interpreter AC_DEFUN([GD_IDL_CHECK_VERSION], [ idl_version_ok="no" idl_header=`( echo | $1 2>&1 )` #'' IDL_VERSION="unknown" if echo $idl_header | grep -q "IDL Version"; then IDL_VERSION=`echo $idl_header | grep Version | sed -e 's/IDL Version \(@<:@^ @:>@*\).*/\1/'` #' AX_COMPARE_VERSION([$IDL_VERSION],[ge],[$2],[idl_version_ok="yes"]) fi if test "x$idl_version_ok" = "xyes"; then $3 true else $4 true fi ]) dnl GD_IDL dnl --------------------------------------------------------------- dnl Look for idl. Then determine whether we can build an IDL module. AC_DEFUN([GD_IDL], [ idl_min_version=$1 AC_ARG_WITH([idl], AS_HELP_STRING([--with-idl=PATH], [use the IDL interpreter located in PATH [default: autodetect]]), [ case "${withval}" in no) have_idl="no" ;; yes) user_idl= ; have_idl= ;; *) user_idl="${withval}"; have_idl= ;; esac ], [ user_idl=; have_idl= ]) AC_ARG_WITH([idl-dlm-dir], AS_HELP_STRING([--with-idl-dlm-dir=PATH], [install the IDL bindings into PATH [default: autodetect]]), [ case "${withval}" in no) local_idl_dlm_path= ;; *) local_idl_dlm_path="${withval}" esac ], [ local_idl_dlm_path= ]) if test "x${have_idl}" != "xno"; then dnl try to find a sufficiently new IDL. if test "x$user_idl" != "x"; then AC_MSG_CHECKING([whether $user_idl is an IDL interpreter version >= $idl_min_version]) GD_IDL_CHECK_VERSION([$user_idl], [$idl_min_version], [AC_MSG_RESULT([yes]) IDL=$user_idl], [AC_MSG_RESULT([no]) IDL="not found"]) else AC_MSG_CHECKING([for an IDL interpreter version >= $idl_min_version]) IDL="not found" for prog in idl idl7 idl6 idl5; do _AS_PATH_WALK([$PATH], [for exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$prog$exec_ext"]); then GD_IDL_CHECK_VERSION( ["$as_dir/$prog$exec_ext"], [$idl_min_version], [ IDL="$as_dir/$prog$exec_ext"; break 3] ) fi done]) done AC_MSG_RESULT([$IDL]) fi if test "x$IDL" = "xnot found"; then have_idl="no" IDL= fi AC_SUBST([IDL]) fi if test "x${have_idl}" != "xno"; then dnl idl version AC_MSG_CHECKING([$IDL version]) AC_MSG_RESULT([$IDL_VERSION]) dnl calculate idl CPPFLAGS and LIBS AC_MSG_CHECKING([for $IDL DLM directory]) if test "x${local_idl_dlm_path}" = "x"; then idldir=`(echo 'print,"@@@"+!DLM_PATH' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@\(@<:@^:@:>@*\)/\1/'` else idldir="$local_idl_dlm_path" fi AC_MSG_RESULT([$idldir]) AC_SUBST([idldir]) AC_MSG_CHECKING([IDL compiler flags]) IDL_CFLAGS=`(echo 'print,"@@@"+!MAKE_DLL.CC' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@.*%X \(.*\) %C.*/\1/' | sed -e 's/\(.* \)-c\(.*\)/\1\2/' | sed -e 's/"//g'` AC_MSG_RESULT([$IDL_CFLAGS]) AC_SUBST([IDL_CFLAGS]) AC_SUBST([IDL_CFLAGS]) IDL_LIBS=`(echo 'print,"@@@"+!MAKE_DLL.LD' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@@<:@^ @:>@* \(.*\?\) -o.*/\1/' | sed -e 's/-m \?[\w]*//g'` AC_MSG_CHECKING([IDL linker flags]) AC_MSG_RESULT([$IDL_LIBS]) AC_SUBST([IDL_LIBS]) dnl header check saved_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} ${IDL_CFLAGS}" AC_CHECK_HEADERS(idl_export.h,,[have_idl="no"]) CPPFLAGS=${saved_CPPFLAGS} fi ]) libgetdata-0.9.0/m4/version.m40000640000175000017500000000331712614323564016257 0ustar alastairalastairdnl Copyright (C) 2011-2013 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA m4_define(getdata_major, 0) m4_define(getdata_minor, 9) m4_define(getdata_revision, 0) m4_define(getdata_extra, []) m4_define(getdata_version, getdata_major.getdata_minor.getdata_revision[]getdata_extra) dnl libgetdata current interface version m4_define(getdata_iface_version, 7) dnl libgetdata current interface implementation revision m4_define(getdata_impl_revision, 0) dnl libgetdata interface age (current interface - oldest supported interface) m4_define(getdata_iface_age, 0) dnl libgetdata++ interface version info m4_define(getdataxx_version, 6:0:0) dnl libfgetdata interface version info m4_define(fgetdata_version, 5:0:0) dnl libf95getdata interface version info m4_define(f95getdata_version, 6:0:0) dnl libgetdata-matlab interface version info m4_define(matlabgetdata_version, 1:0:1) libgetdata-0.9.0/m4/python.m40000640000175000017500000001110612614323564016106 0ustar alastairalastairdnl Copyright (C) 2009, 2011, 2013 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_PYTHON dnl --------------------------------------------------------------- dnl Look for python. Then determine whether we can build extension modules. AC_DEFUN([GD_PYTHON], [ last_python=2.7 first_python=$1 if test "x$SEQ" == "xnot found"; then if test "x$JOT" == "xnot found"; then python_prog_list="python python2" else python_prog_list="python python2 dnl `$JOT -w 'python%.1f' - $last_python $first_python -0.1`" #' fi else python_prog_list="python python2 dnl `$SEQ -f 'python%.1f' $last_python -0.1 $first_python`" #' fi dnl --without-python basically does the same as --disable-python AC_ARG_WITH([python], AS_HELP_STRING([--with-python=PATH], [use the Python interpreter located in PATH [default: autodetect]]), [ case "${withval}" in no) have_python="no" ;; yes) user_python= ; have_python= ;; *) user_python="${withval}"; have_python= ;; esac ], [ user_python=; have_python= ]) AC_ARG_WITH([python-module-dir], AS_HELP_STRING([--with-python-module-dir=PATH], [install the Python bindings into PATH [default: autodetect]]), [ case "${withval}" in no) local_python_modpath= ;; *) local_python_modpath="${withval}" esac ], [ local_python_modpath= ]) if test "x${have_python}" != "xno"; then dnl try to find a sufficiently new python. if test "x$user_python" != "x"; then AC_MSG_CHECKING([whether $user_python version >= $first_python]) AM_PYTHON_CHECK_VERSION([$user_python], [$first_python], [AC_MSG_RESULT([yes]) PYTHON=$user_python], [AC_MSG_RESULT([no]) PYTHON="not found"]) else AC_MSG_CHECKING([for Python interpreter version >= $first_python]) PYTHON="not found" for py in $python_prog_list; do _AS_PATH_WALK([$PATH], [for exec_ext in '' $ac_executable_extensions; do if AS_EXECUTABLE_P(["$as_dir/$py$exec_ext"]); then AM_PYTHON_CHECK_VERSION( ["$as_dir/$py$exec_ext"], [$first_python], [ PYTHON="$as_dir/$py$exec_ext"; break 3] ) fi done]) done AC_MSG_RESULT([$PYTHON]) fi if test "x$PYTHON" = "xnot found"; then have_python="no" PYTHON= fi AC_SUBST([PYTHON]) fi if test "x${have_python}" != "xno"; then dnl python version AC_MSG_CHECKING([$PYTHON version]) PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[[:3]]"` AC_MSG_RESULT([$PYTHON_VERSION]) AC_SUBST([PYTHON_VERSION]) dnl calculate python CPPFLAGS AC_MSG_CHECKING([Python includes]) if test -x $PYTHON-config; then PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null` else python_prefix=`$PYTHON -c "import sys; print sys.prefix"` python_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}" fi AC_MSG_RESULT([$PYTHON_CPPFLAGS]) dnl figure out the platform name AC_MSG_CHECKING([Python platform name]) PYTHON_PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"` AC_MSG_RESULT([$PYTHON_PLATFORM]) AC_SUBST([PYTHON_PLATFORM]) dnl calculate the exec prefix pyexec_prefix=$exec_prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix dnl calculate the extension module directory AC_MSG_CHECKING([Python extension module directory]) if test "x${local_python_modpath}" = "x"; then pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${pyexec_prefix}')" 2>/dev/null || echo "${pyexec_prefix}/lib/python${PYTHON_VERSION}/site-packages"` else pythondir=$local_python_modpath fi AC_SUBST([pythondir]) AC_MSG_RESULT([$pythondir]) fi ]) libgetdata-0.9.0/m4/matlab.m40000640000175000017500000001162512614323564016033 0ustar alastairalastairdnl Copyright (C) 2013, 2014 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_MATLAB dnl --------------------------------------------------------------- dnl Look for mex; sets and substs MEX on success AC_DEFUN([GD_MEX], [ dnl --without-mex basically does the same as --disable-matlab AC_ARG_WITH([mex], AS_HELP_STRING([--with-mex=PATH], [use the MATLAB MEX compiler located at PATH. ] [[default: autodetect]]), [ case "${withval}" in no) have_matlab="no" ;; yes) user_mex= ;; *) user_mex="${withval}";; esac ], [ user_mex= ]) dnl try to find mex MEX="not found" if test "x$user_mex" != "x"; then MEX=$user_mex else AC_PATH_PROG([MEX], [mex], [not found]) fi if test "x$MEX" != "xnot found"; then AC_MSG_CHECKING([if $MEX is a MATLAB mex compiler]) mex_out=`$MEX 2>&1` mex_status=$? if test $mex_status -eq 1; then if ! echo $mex_out | grep -q 'consult the MATLAB External Interfaces Guide'; then MEX="not found"; fi fi if test "x$MEX" = "xnot found"; then AC_MSG_RESULT([no]) else AC_MSG_RESULT([yes]) fi fi if test "x$MEX" = "xnot found"; then have_matlab="no" MEX= fi AC_SUBST([MEX]) ]) dnl GD_MEX_VAR dnl --------------------------------------------------------------- dnl Determine a MEX variable and store it in the supplied local dnl variable AC_DEFUN([GD_MEX_VAR], [ $1=`$MEX -v 2>/dev/null | ${AWK} '/$2 *=/ { print @S|@4 }'` ]) dnl GD_MATLAB_EVAL dnl --------------------------------------------------------------- dnl Evaluate something in MATLAB and store it in the supplied local dnl variable AC_DEFUN([GD_MATLAB_EVAL], [ ifelse(`$#', `2', [matlab_int=$MATLAB], [matlab_int=$3]) $1=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', $2); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print @S|@2 }'` ]) dnl GD_MATLAB dnl --------------------------------------------------------------- dnl Look for matlab, &c. dnl AC_DEFUN([GD_MATLAB], [ dnl --without-matlab basically does the same as --disable-matlab AC_ARG_WITH([matlab], AS_HELP_STRING([--with-matlab=PATH], [use the MATLAB interpreter located at PATH. ] [[default: autodetect]]), [ case "${withval}" in no) have_matlab="no" ;; yes) user_matlab= ; have_matlab= ;; *) user_matlab="${withval}"; have_matlab= ;; esac ], [ user_matlab=; have_matlab= ]) dnl find MEX first if test "x${have_matlab}" != "xno"; then GD_MEX fi dnl find matlab if test "x${have_matlab}" != "xno"; then dnl try to find matlab if test "x$user_matlab" != "x"; then MATLAB=$user_matlab; else AC_PATH_PROG([MATLAB], [matlab], [not found]) fi if test "x$MATLAB" != "xnot found"; then AC_MSG_CHECKING([$MATLAB version]) GD_MATLAB_EVAL([MATLAB_VERSION], [version], [$MATLAB]) if test "x$MATLAB_VERSION" = "x"; then AC_MSG_RESULT([none]) MATLAB="not found" else AC_MSG_RESULT([$MATLAB_VERSION]) fi fi if test "x$MATLAB" = "xnot found"; then have_matlab=no MATLAB= fi AC_SUBST([MATLAB]) fi if test "x${have_matlab}" != "xno"; then dnl installdir default_matlabbasedir=$libdir/getdata/matlab AC_ARG_WITH([matlab-dir], AS_HELP_STRING([--with-matlab-dir=PATH], [ Install Matlab bindings in PATH/getdata. ] [[default: LIBDIR/getdata/matlab]]), [ case "${withval}" in no) matlabbasedir=$default_matlabbasedir ;; *) matlabbasedir="${withval}" ;; esac ], [ matlabbasedir=$default_matlabbasedir ]) AC_MSG_CHECKING([matlab install directory]) AC_MSG_RESULT([$matlabbasedir]) AC_SUBST([matlabbasedir]) dnl mex extension AC_MSG_CHECKING([MEX extension]) GD_MATLAB_EVAL([mexext], [mexext]) AC_MSG_RESULT([.$mexext]) AC_SUBST([mexext]) dnl flags AC_MSG_CHECKING([MatLab CPPFLAGS]) GD_MEX_VAR([matlab_prefix], [MATLAB]) MATLAB_CPPFLAGS="-I${matlab_prefix}/extern/include" AC_MSG_RESULT([$MATLAB_CPPFLAGS]) AC_SUBST([MATLAB_CPPFLAGS]) fi ]) libgetdata-0.9.0/m4/win32.m40000640000175000017500000000317512614323564015536 0ustar alastairalastairdnl Copyright (C) 2010, 2011 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_MSYS_SHELL dnl --------------------------------------------------------------- dnl Find the Win32 path to the MSYS shell. AC_DEFUN([GD_MSYS_SHELL], [ AC_MSG_CHECKING([whether we're running under Msys]) if test "x`uname -o 2> /dev/null`" = "xMsys"; then this_is_msys=yes else this_is_msys=no fi AC_MSG_RESULT([$this_is_msys]) if test "$this_is_msys" = "yes"; then AC_MSG_CHECKING([for the Win32 MSYS shell]) msys_root=`mount | ${GREP} 'on / ' | awk '{print [$]1}'` msys_shell1="$msys_root`echo $SHELL | ${SED} -e 's/\//\\\\/g'`.exe" msys_shell=`echo "$msys_shell1" | ${SED} -e 's/\\\\/\\\\\\\\/g'` AC_MSG_RESULT([$msys_shell1]) AC_DEFINE_UNQUOTED([MSYS_SHELL], ["$msys_shell"], [ Define to the full Win32 path to the `sh.exe' binary ]) fi ]) libgetdata-0.9.0/m4/compiler.m40000640000175000017500000001764512614323564016415 0ustar alastairalastairdnl Copyright (C) 2008-2010, 2012, 2013, 2015 D. V. Wiebe dnl dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll dnl dnl This file is part of the GetData project. dnl dnl GetData is free software; you can redistribute it and/or modify it under dnl the terms of the GNU Lesser General Public License as published by the dnl Free Software Foundation; either version 2.1 of the License, or (at your dnl option) any later version. dnl dnl GetData is distributed in the hope that it will be useful, but WITHOUT dnl ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public dnl License for more details. dnl dnl You should have received a copy of the GNU Lesser General Public License dnl along with GetData; if not, write to the Free Software Foundation, Inc., dnl 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl GD_C_CAST_COMPLEX dnl ------------------------------------------------------------- dnl Check wether the compiler requires explicit cast from real types to dnl _Complex AC_DEFUN([GD_C_CAST_COMPLEX], [AC_CACHE_CHECK([if implicit _Complex conversion works], [gd_cv_c_cast_complex], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( AC_INCLUDES_DEFAULT [[ #ifdef HAVE__COMPLEX_DOUBLE extern double creal(_Complex double z); #else not applicable #endif ]], [[ double a; int b; a = creal(b); ]])], [gd_cv_c_cast_complex=yes], [gd_cv_c_cast_complex=no])]) if test "x$gd_cv_c_cast_complex" = "xyes"; then AC_DEFINE([GD_COMPLEX_CONV_OK], [1], [Define to 1 if implicit conversion from real to _Complex works]) fi ]) dnl GD_LANG_COMPILER_INTEL dnl ------------------------------------------------------------- dnl Check whether the compiler for the current language is Intel. dnl dnl This is modelled after autoconf's _AC_LANG_COMPILER_GNU macro. AC_DEFUN([GD_LANG_COMPILER_INTEL], [AC_CACHE_CHECK([whether we are using the Intel _AC_LANG compiler], [gd_cv_[]_AC_LANG_ABBREV[]_compiler_intel], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef __INTEL_COMPILER choke me #endif ]])], [gd_compiler_intel=yes], [gd_compiler_intel=no]) gd_cv_[]_AC_LANG_ABBREV[]_compiler_intel=$gd_compiler_intel ])]) dnl GD_LANG_F77_COMPILER_INTEL dnl ------------------------------------------------------------- dnl Check whether the compiler for Fortran is Intel. AC_DEFUN([GD_LANG_F77_COMPILER_INTEL], [AC_CACHE_CHECK([whether we are using the Intel Fortran-77 compiler], [gd_cv_f77_compiler_intel], [if $F77 -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then gd_cv_f77_compiler_intel=yes else gd_cv_f77_compiler_intel=no fi ])]) dnl GD_LANG_FC_COMPILER_INTEL dnl ------------------------------------------------------------- dnl Check whether the compiler for free-form Fortran is Intel. AC_DEFUN([GD_LANG_FC_COMPILER_INTEL], [AC_CACHE_CHECK([whether we are using the Intel Fortran compiler], [gd_cv_fc_compiler_intel], [if $FC -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then gd_cv_fc_compiler_intel=yes else gd_cv_fc_compiler_intel=no fi ])]) dnl GD_PROG_CC_WEXTRA dnl ------------------------------------------------------------- dnl Check whether the C compiler accepts -Wextra AC_DEFUN([GD_PROG_CC_WEXTRA], [gd_saved_CFLAGS=$CFLAGS AC_CACHE_CHECK([whether $CC accepts -Wextra], gd_cv_prog_cc_wextra, [CFLAGS="-Wextra" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cc_wextra=yes], [gd_cv_prog_cc_wextra=no])]) CFLAGS=$gd_saved_CFLAGS if test "x$gd_cv_prog_cc_wextra" = "xyes"; then GD_CC_WEXTRA=-Wextra fi AC_SUBST([GD_CC_WEXTRA]) ]) dnl GD_PROG_CXX_WEXTRA dnl ------------------------------------------------------------- dnl Check whether the C++ compiler accepts -Wextra AC_DEFUN([GD_PROG_CXX_WEXTRA], [gd_saved_CXXFLAGS=$CXXFLAGS AC_CACHE_CHECK([whether $CXX accepts -Wextra], gd_cv_prog_cxx_wextra, [CXXFLAGS="-Wextra" AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cxx_wextra=yes], [gd_cv_prog_cxx_wextra=no]) AC_LANG_POP([C++])]) CXXFLAGS=$gd_saved_CXXFLAGS if test "x$gd_cv_prog_cxx_wextra" = "xyes"; then GD_CXX_WEXTRA=-Wextra fi AC_SUBST([GD_CXX_WEXTRA]) ]) dnl GD_PROG_F77_WEXTRA dnl ------------------------------------------------------------- dnl Check whether the Fotran-77 compiler accepts -Wextra AC_DEFUN([GD_PROG_F77_WEXTRA], [gd_saved_FFLAGS=$FFLAGS AC_CACHE_CHECK([whether $F77 accepts -Wextra], gd_cv_prog_f77_wextra, [FFLAGS="-Wextra" AC_LANG_PUSH([Fortran 77]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_wextra=yes], [gd_cv_prog_f77_wextra=no]) AC_LANG_POP([Fortran 77])]) FFLAGS=$gd_saved_FFLAGS if test "x$gd_cv_prog_f77_wextra" = "xyes"; then GD_F77_WEXTRA=-Wextra fi AC_SUBST([GD_F77_WEXTRA]) ]) dnl GD_PROG_FC_WEXTRA dnl ------------------------------------------------------------- dnl Check whether the free-form Fotran compiler accepts -Wextra AC_DEFUN([GD_PROG_FC_WEXTRA], [gd_saved_FCFLAGS=$FCFLAGS AC_CACHE_CHECK([whether $FC accepts -Wextra], gd_cv_prog_fc_wextra, [FCFLAGS="-Wextra" AC_LANG_PUSH([Fortran 77]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_fc_wextra=yes], [gd_cv_prog_fc_wextra=no]) AC_LANG_POP([Fortran 77])]) FCFLAGS=$gd_saved_FCFLAGS if test "x$gd_cv_prog_fc_wextra" = "xyes"; then GD_FC_WEXTRA=-Wextra fi AC_SUBST([GD_FC_WEXTRA]) ]) dnl GD_PROG_CC_WALL dnl ------------------------------------------------------------- dnl Check whether the C compiler accepts -Wall AC_DEFUN([GD_PROG_CC_WALL], [gd_saved_CFLAGS=$CFLAGS AC_CACHE_CHECK([whether $CC accepts -Wall], gd_cv_prog_cc_wall, [CFLAGS="-Wall" AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cc_wall=yes], [gd_cv_prog_cc_wall=no])]) CFLAGS=$gd_saved_CFLAGS if test "x$gd_cv_prog_cc_wall" = "xyes"; then GD_CC_WALL=-Wall fi AC_SUBST([GD_CC_WALL]) ]) dnl GD_PROG_CXX_WALL dnl ------------------------------------------------------------- dnl Check whether the C++ compiler accepts -Wall AC_DEFUN([GD_PROG_CXX_WALL], [gd_saved_CXXFLAGS=$CXXFLAGS AC_CACHE_CHECK([whether $CXX accepts -Wall], gd_cv_prog_cxx_wall, [CXXFLAGS="-Wall" AC_LANG_PUSH([C++]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_cxx_wall=yes], [gd_cv_prog_cxx_wall=no]) AC_LANG_POP([C++])]) CXXFLAGS=$gd_saved_CXXFLAGS if test "x$gd_cv_prog_cxx_wall" = "xyes"; then GD_CXX_WALL=-Wall fi AC_SUBST([GD_CXX_WALL]) ]) dnl GD_PROG_F77_WALL dnl ------------------------------------------------------------- dnl Check whether the Fotran-77 compiler accepts -Wall AC_DEFUN([GD_PROG_F77_WALL], [gd_saved_FFLAGS=$FFLAGS AC_CACHE_CHECK([whether $F77 accepts -Wall], gd_cv_prog_f77_wall, [FFLAGS="-Wall" AC_LANG_PUSH([Fortran 77]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_wall=yes], [gd_cv_prog_f77_wall=no]) AC_LANG_POP([Fortran 77])]) FFLAGS=$gd_saved_FFLAGS if test "x$gd_cv_prog_f77_wall" = "xyes"; then GD_F77_WALL=-Wall fi AC_SUBST([GD_F77_WALL]) ]) dnl GD_PROG_FC_WALL dnl ------------------------------------------------------------- dnl Check whether the free-form Fotran compiler accepts -Wall AC_DEFUN([GD_PROG_FC_WALL], [gd_saved_FCFLAGS=$FCFLAGS AC_CACHE_CHECK([whether $FC accepts -Wall], gd_cv_prog_fc_wall, [FCFLAGS="-Wall" AC_LANG_PUSH([Fortran 77]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_fc_wall=yes], [gd_cv_prog_fc_wall=no]) AC_LANG_POP([Fortran 77])]) FCFLAGS=$gd_saved_FCFLAGS if test "x$gd_cv_prog_fc_wall" = "xyes"; then GD_FC_WALL=-Wall fi AC_SUBST([GD_FC_WALL]) ]) dnl GD_C_RESTRICT_ARRAY dnl ----------------------------------------------------------- dnl Check whether " *restrict foo[]" is allowed. AC_DEFUN([GD_C_RESTRICT_ARRAY],[ dnl do nothing if restrict hasn't been found if ! test "x$ac_cv_c_restrict" = "xno"; then AC_CACHE_CHECK([whether restrict can be applied to pointer array arguments], [gd_cv_c_restrict_array],[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ int *foo (int *restrict bar@<:@3@:>@) { return bar@<:@2@:>@; } ], [])], [gd_cv_c_restrict_array="yes"],[gd_cv_c_restrict_array="no"]) ]) fi if test "x$gd_cv_c_restrict_array" = "xyes"; then AC_DEFINE([GD_RESTRICT_ARRAY_OK], [1], [Define to 1 if restrict can used on pointer arrays]) fi ]) libgetdata-0.9.0/COPYING.DOC0000640000175000017500000004766312614323564015463 0ustar alastairalastair GNU Free Documentation License Version 1.2, November 2002 Copyright (C) 2000,2001,2002 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. 0. PREAMBLE The purpose of this License is to make a manual, textbook, or other functional and useful document "free" in the sense of freedom: to assure everyone the effective freedom to copy and redistribute it, with or without modifying it, either commercially or noncommercially. Secondarily, this License preserves for the author and publisher a way to get credit for their work, while not being considered responsible for modifications made by others. This License is a kind of "copyleft", which means that derivative works of the document must themselves be free in the same sense. It complements the GNU General Public License, which is a copyleft license designed for free software. We have designed this License in order to use it for manuals for free software, because free software needs free documentation: a free program should come with manuals providing the same freedoms that the software does. But this License is not limited to software manuals; it can be used for any textual work, regardless of subject matter or whether it is published as a printed book. We recommend this License principally for works whose purpose is instruction or reference. 1. APPLICABILITY AND DEFINITIONS This License applies to any manual or other work, in any medium, that contains a notice placed by the copyright holder saying it can be distributed under the terms of this License. Such a notice grants a world-wide, royalty-free license, unlimited in duration, to use that work under the conditions stated herein. The "Document", below, refers to any such manual or work. Any member of the public is a licensee, and is addressed as "you". You accept the license if you copy, modify or distribute the work in a way requiring permission under copyright law. A "Modified Version" of the Document means any work containing the Document or a portion of it, either copied verbatim, or with modifications and/or translated into another language. A "Secondary Section" is a named appendix or a front-matter section of the Document that deals exclusively with the relationship of the publishers or authors of the Document to the Document's overall subject (or to related matters) and contains nothing that could fall directly within that overall subject. (Thus, if the Document is in part a textbook of mathematics, a Secondary Section may not explain any mathematics.) The relationship could be a matter of historical connection with the subject or with related matters, or of legal, commercial, philosophical, ethical or political position regarding them. The "Invariant Sections" are certain Secondary Sections whose titles are designated, as being those of Invariant Sections, in the notice that says that the Document is released under this License. If a section does not fit the above definition of Secondary then it is not allowed to be designated as Invariant. The Document may contain zero Invariant Sections. If the Document does not identify any Invariant Sections then there are none. The "Cover Texts" are certain short passages of text that are listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says that the Document is released under this License. A Front-Cover Text may be at most 5 words, and a Back-Cover Text may be at most 25 words. A "Transparent" copy of the Document means a machine-readable copy, represented in a format whose specification is available to the general public, that is suitable for revising the document straightforwardly with generic text editors or (for images composed of pixels) generic paint programs or (for drawings) some widely available drawing editor, and that is suitable for input to text formatters or for automatic translation to a variety of formats suitable for input to text formatters. A copy made in an otherwise Transparent file format whose markup, or absence of markup, has been arranged to thwart or discourage subsequent modification by readers is not Transparent. An image format is not Transparent if used for any substantial amount of text. A copy that is not "Transparent" is called "Opaque". Examples of suitable formats for Transparent copies include plain ASCII without markup, Texinfo input format, LaTeX input format, SGML or XML using a publicly available DTD, and standard-conforming simple HTML, PostScript or PDF designed for human modification. Examples of transparent image formats include PNG, XCF and JPG. Opaque formats include proprietary formats that can be read and edited only by proprietary word processors, SGML or XML for which the DTD and/or processing tools are not generally available, and the machine-generated HTML, PostScript or PDF produced by some word processors for output purposes only. The "Title Page" means, for a printed book, the title page itself, plus such following pages as are needed to hold, legibly, the material this License requires to appear in the title page. For works in formats which do not have any title page as such, "Title Page" means the text near the most prominent appearance of the work's title, preceding the beginning of the body of the text. A section "Entitled XYZ" means a named subunit of the Document whose title either is precisely XYZ or contains XYZ in parentheses following text that translates XYZ in another language. (Here XYZ stands for a specific section name mentioned below, such as "Acknowledgements", "Dedications", "Endorsements", or "History".) To "Preserve the Title" of such a section when you modify the Document means that it remains a section "Entitled XYZ" according to this definition. The Document may include Warranty Disclaimers next to the notice which states that this License applies to the Document. These Warranty Disclaimers are considered to be included by reference in this License, but only as regards disclaiming warranties: any other implication that these Warranty Disclaimers may have is void and has no effect on the meaning of this License. 2. VERBATIM COPYING You may copy and distribute the Document in any medium, either commercially or noncommercially, provided that this License, the copyright notices, and the license notice saying this License applies to the Document are reproduced in all copies, and that you add no other conditions whatsoever to those of this License. You may not use technical measures to obstruct or control the reading or further copying of the copies you make or distribute. However, you may accept compensation in exchange for copies. If you distribute a large enough number of copies you must also follow the conditions in section 3. You may also lend copies, under the same conditions stated above, and you may publicly display copies. 3. COPYING IN QUANTITY If you publish printed copies (or copies in media that commonly have printed covers) of the Document, numbering more than 100, and the Document's license notice requires Cover Texts, you must enclose the copies in covers that carry, clearly and legibly, all these Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on the back cover. Both covers must also clearly and legibly identify you as the publisher of these copies. The front cover must present the full title with all words of the title equally prominent and visible. You may add other material on the covers in addition. Copying with changes limited to the covers, as long as they preserve the title of the Document and satisfy these conditions, can be treated as verbatim copying in other respects. If the required texts for either cover are too voluminous to fit legibly, you should put the first ones listed (as many as fit reasonably) on the actual cover, and continue the rest onto adjacent pages. If you publish or distribute Opaque copies of the Document numbering more than 100, you must either include a machine-readable Transparent copy along with each Opaque copy, or state in or with each Opaque copy a computer-network location from which the general network-using public has access to download using public-standard network protocols a complete Transparent copy of the Document, free of added material. If you use the latter option, you must take reasonably prudent steps, when you begin distribution of Opaque copies in quantity, to ensure that this Transparent copy will remain thus accessible at the stated location until at least one year after the last time you distribute an Opaque copy (directly or through your agents or retailers) of that edition to the public. It is requested, but not required, that you contact the authors of the Document well before redistributing any large number of copies, to give them a chance to provide you with an updated version of the Document. 4. MODIFICATIONS You may copy and distribute a Modified Version of the Document under the conditions of sections 2 and 3 above, provided that you release the Modified Version under precisely this License, with the Modified Version filling the role of the Document, thus licensing distribution and modification of the Modified Version to whoever possesses a copy of it. In addition, you must do these things in the Modified Version: A. Use in the Title Page (and on the covers, if any) a title distinct from that of the Document, and from those of previous versions (which should, if there were any, be listed in the History section of the Document). You may use the same title as a previous version if the original publisher of that version gives permission. B. List on the Title Page, as authors, one or more persons or entities responsible for authorship of the modifications in the Modified Version, together with at least five of the principal authors of the Document (all of its principal authors, if it has fewer than five), unless they release you from this requirement. C. State on the Title page the name of the publisher of the Modified Version, as the publisher. D. Preserve all the copyright notices of the Document. E. Add an appropriate copyright notice for your modifications adjacent to the other copyright notices. F. Include, immediately after the copyright notices, a license notice giving the public permission to use the Modified Version under the terms of this License, in the form shown in the Addendum below. G. Preserve in that license notice the full lists of Invariant Sections and required Cover Texts given in the Document's license notice. H. Include an unaltered copy of this License. I. Preserve the section Entitled "History", Preserve its Title, and add to it an item stating at least the title, year, new authors, and publisher of the Modified Version as given on the Title Page. If there is no section Entitled "History" in the Document, create one stating the title, year, authors, and publisher of the Document as given on its Title Page, then add an item describing the Modified Version as stated in the previous sentence. J. Preserve the network location, if any, given in the Document for public access to a Transparent copy of the Document, and likewise the network locations given in the Document for previous versions it was based on. These may be placed in the "History" section. You may omit a network location for a work that was published at least four years before the Document itself, or if the original publisher of the version it refers to gives permission. K. For any section Entitled "Acknowledgements" or "Dedications", Preserve the Title of the section, and preserve in the section all the substance and tone of each of the contributor acknowledgements and/or dedications given therein. L. Preserve all the Invariant Sections of the Document, unaltered in their text and in their titles. Section numbers or the equivalent are not considered part of the section titles. M. Delete any section Entitled "Endorsements". Such a section may not be included in the Modified Version. N. Do not retitle any existing section to be Entitled "Endorsements" or to conflict in title with any Invariant Section. O. Preserve any Warranty Disclaimers. If the Modified Version includes new front-matter sections or appendices that qualify as Secondary Sections and contain no material copied from the Document, you may at your option designate some or all of these sections as invariant. To do this, add their titles to the list of Invariant Sections in the Modified Version's license notice. These titles must be distinct from any other section titles. You may add a section Entitled "Endorsements", provided it contains nothing but endorsements of your Modified Version by various parties--for example, statements of peer review or that the text has been approved by an organization as the authoritative definition of a standard. You may add a passage of up to five words as a Front-Cover Text, and a passage of up to 25 words as a Back-Cover Text, to the end of the list of Cover Texts in the Modified Version. Only one passage of Front-Cover Text and one of Back-Cover Text may be added by (or through arrangements made by) any one entity. If the Document already includes a cover text for the same cover, previously added by you or by arrangement made by the same entity you are acting on behalf of, you may not add another; but you may replace the old one, on explicit permission from the previous publisher that added the old one. The author(s) and publisher(s) of the Document do not by this License give permission to use their names for publicity for or to assert or imply endorsement of any Modified Version. 5. COMBINING DOCUMENTS You may combine the Document with other documents released under this License, under the terms defined in section 4 above for modified versions, provided that you include in the combination all of the Invariant Sections of all of the original documents, unmodified, and list them all as Invariant Sections of your combined work in its license notice, and that you preserve all their Warranty Disclaimers. The combined work need only contain one copy of this License, and multiple identical Invariant Sections may be replaced with a single copy. If there are multiple Invariant Sections with the same name but different contents, make the title of each such section unique by adding at the end of it, in parentheses, the name of the original author or publisher of that section if known, or else a unique number. Make the same adjustment to the section titles in the list of Invariant Sections in the license notice of the combined work. In the combination, you must combine any sections Entitled "History" in the various original documents, forming one section Entitled "History"; likewise combine any sections Entitled "Acknowledgements", and any sections Entitled "Dedications". You must delete all sections Entitled "Endorsements". 6. COLLECTIONS OF DOCUMENTS You may make a collection consisting of the Document and other documents released under this License, and replace the individual copies of this License in the various documents with a single copy that is included in the collection, provided that you follow the rules of this License for verbatim copying of each of the documents in all other respects. You may extract a single document from such a collection, and distribute it individually under this License, provided you insert a copy of this License into the extracted document, and follow this License in all other respects regarding verbatim copying of that document. 7. AGGREGATION WITH INDEPENDENT WORKS A compilation of the Document or its derivatives with other separate and independent documents or works, in or on a volume of a storage or distribution medium, is called an "aggregate" if the copyright resulting from the compilation is not used to limit the legal rights of the compilation's users beyond what the individual works permit. When the Document is included in an aggregate, this License does not apply to the other works in the aggregate which are not themselves derivative works of the Document. If the Cover Text requirement of section 3 is applicable to these copies of the Document, then if the Document is less than one half of the entire aggregate, the Document's Cover Texts may be placed on covers that bracket the Document within the aggregate, or the electronic equivalent of covers if the Document is in electronic form. Otherwise they must appear on printed covers that bracket the whole aggregate. 8. TRANSLATION Translation is considered a kind of modification, so you may distribute translations of the Document under the terms of section 4. Replacing Invariant Sections with translations requires special permission from their copyright holders, but you may include translations of some or all Invariant Sections in addition to the original versions of these Invariant Sections. You may include a translation of this License, and all the license notices in the Document, and any Warranty Disclaimers, provided that you also include the original English version of this License and the original versions of those notices and disclaimers. In case of a disagreement between the translation and the original version of this License or a notice or disclaimer, the original version will prevail. If a section in the Document is Entitled "Acknowledgements", "Dedications", or "History", the requirement (section 4) to Preserve its Title (section 1) will typically require changing the actual title. 9. TERMINATION You may not copy, modify, sublicense, or distribute the Document except as expressly provided for under this License. Any other attempt to copy, modify, sublicense or distribute the Document 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. 10. FUTURE REVISIONS OF THIS LICENSE The Free Software Foundation may publish new, revised versions of the GNU Free Documentation 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. See http://www.gnu.org/copyleft/. Each version of the License is given a distinguishing version number. If the Document specifies that a particular numbered version of this License "or any later version" applies to it, you have the option of following the terms and conditions either of that specified version or of any later version that has been published (not as a draft) by the Free Software Foundation. If the Document does not specify a version number of this License, you may choose any version ever published (not as a draft) by the Free Software Foundation. ADDENDUM: How to use this License for your documents To use this License in a document you have written, include a copy of the License in the document and put the following copyright and license notices just after the title page: Copyright (c) YEAR YOUR NAME. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License". If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, replace the "with...Texts." line with this: with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. If you have Invariant Sections without Cover Texts, or some other combination of the three, merge those two alternatives to suit the situation. If your document contains nontrivial examples of program code, we recommend releasing these examples in parallel under your choice of free software license, such as the GNU General Public License, to permit their use in free software. libgetdata-0.9.0/configure0000740000175000017500000437411512614323564015730 0ustar alastairalastair#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for GetData 0.9.0. # # 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. # # Parts of this program are copyright (C) 2008-2015 D. V. Wiebe. # # These parts may be redistributed and/or modified 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. # See the file COPYING for details. # ## -------------------- ## ## 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 and $0: getdata-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_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='GetData' PACKAGE_TARNAME='getdata' PACKAGE_VERSION='0.9.0' PACKAGE_STRING='GetData 0.9.0' PACKAGE_BUGREPORT='getdata-devel@lists.sourceforge.net' PACKAGE_URL='http://getdata.sourceforge.net/' ac_unique_file="src/getdata.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 GD_EXTERNAL_FALSE GD_EXTERNAL_TRUE USE_ZZSLIM_FALSE USE_ZZSLIM_TRUE HAVE_DIFF_FALSE HAVE_DIFF_TRUE TEST_PHP_FALSE TEST_PHP_TRUE TEST_MATLAB_FALSE TEST_MATLAB_TRUE TEST_PERL_FALSE TEST_PERL_TRUE TEST_IDL_FALSE TEST_IDL_TRUE TEST_PYTHON_FALSE TEST_PYTHON_TRUE USE_MODULES_FALSE USE_MODULES_TRUE MAKE_PHPBINDINGS_FALSE MAKE_PHPBINDINGS_TRUE MAKE_MATLABBINDINGS_FALSE MAKE_MATLABBINDINGS_TRUE MAKE_PERLBINDINGS_FALSE MAKE_PERLBINDINGS_TRUE MAKE_IDLBINDINGS_FALSE MAKE_IDLBINDINGS_TRUE MAKE_PYBINDINGS_FALSE MAKE_PYBINDINGS_TRUE MAKE_F95BINDINGS_FALSE MAKE_F95BINDINGS_TRUE MAKE_F77BINDINGS_FALSE MAKE_F77BINDINGS_TRUE MAKE_CXXBINDINGS_FALSE MAKE_CXXBINDINGS_TRUE INCLUDE_LEGACY_API_FALSE INCLUDE_LEGACY_API_TRUE INTEL_FC_COMPILER_FALSE INTEL_FC_COMPILER_TRUE INTEL_F77_COMPILER_FALSE INTEL_F77_COMPILER_TRUE HAVE_SED_FALSE HAVE_SED_TRUE GETDATA_DEBUG_FALSE GETDATA_DEBUG_TRUE absolute_docdir PRIVATE_LIBS USE_ZZIP_FALSE USE_ZZIP_TRUE path_unzip path_zip ZZIP_LIBS ZZIP_LDFLAGS ZZIP_CPPFLAGS USE_SLIM_FALSE USE_SLIM_TRUE path_unslim path_slimdata SLIM_LIBS SLIM_LDFLAGS SLIM_CPPFLAGS USE_LZMA_FALSE USE_LZMA_TRUE path_xz LZMA_LIBS LZMA_LDFLAGS LZMA_CPPFLAGS USE_GZIP_FALSE USE_GZIP_TRUE path_gunzip path_gzip GZIP_LIBS GZIP_LDFLAGS GZIP_CPPFLAGS USE_FLAC_FALSE USE_FLAC_TRUE path_flac FLAC_LIBS FLAC_LDFLAGS FLAC_CPPFLAGS USE_BZIP2_FALSE USE_BZIP2_TRUE path_bunzip2 path_bzip2 BZIP2_LIBS BZIP2_LDFLAGS BZIP2_CPPFLAGS pythondir PYTHON_PLATFORM PYTHON_VERSION PYTHON PHP_libs PHP_ldflags PHP_CPPFLAGS phpdir PHP PHP_CONFIG PERL_MAN3EXT perlmandir perldir PERL MATLAB_CPPFLAGS mexext matlabbasedir MATLAB MEX IDL_LIBS IDL_CFLAGS idldir IDL DEFINE_gd_uint64_t DEFINE_gd_int64_t DEFINE_gd_uint16_t DEFINE_gd_int16_t GD_FC_WEXTRA GD_FC_WALL FLIBS GD_F77_WEXTRA GD_F77_WALL GD_CXX_WEXTRA GD_CXX_WALL GD_CC_WEXTRA GD_CC_WALL LTDLINCL LIBLTDL LIBTOOL_DEPS CXXCPP LT_SYS_LIBRARY_PATH OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP NM ac_ct_DUMPBIN DUMPBIN LD FGREP LIBTOOL ac_ct_FC FCFLAGS FC ac_ct_F77 FFLAGS F77 am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCCAS_FALSE am__fastdepCCAS_TRUE CCASDEPMODE CCASFLAGS CCAS DEFINE_GD_NO_C99_API EGREP 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 DL_LIBRARY_PATH GD_DIRSEP GD_FDIRSEP DEFINE_GD_GETDATA_INT_VERSION DEFINE_GD_GETDATA_VERSION SEQ PRINTF JOT DIFF DATE SED GREP LN_S 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 moduledir GETDATA_DEBUG DEFINE_GD_LEGACY_API host_os host_vendor host_cpu host build_os build_vendor build_cpu build MATLABGETDATA_VERSION F95GETDATA_VERSION FGETDATA_VERSION GETDATAXX_VERSION GETDATA_IFACE_AGE GETDATA_IMPL_REVISION GETDATA_IFACE_VERSION BUILDCC GETDATA_VERSION_SUFFIX GETDATA_REVISION GETDATA_MINOR GETDATA_MAJOR 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_legacy_api enable_assert enable_debug enable_ansi_c enable_bindings enable_cplusplus enable_fortran enable_fortran95 enable_idl enable_matlab enable_perl enable_php enable_python enable_modules with_module_dir with_ltdl with_external_libraries enable_silent_rules enable_fast_unaligned enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_aix_soname with_gnu_ld with_sysroot enable_libtool_lock with_idl with_idl_dlm_dir with_matlab with_mex with_matlab_dir with_perl with_perl_dir with_php_config with_php_dir with_python with_python_module_dir with_libbz2 with_libFLAC with_libz with_liblzma with_libslim with_libzzip enable_zzslim ' ac_precious_vars='build_alias host_alias target_alias BUILDCC DATE DIFF JOT PRINTF SEQ CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CCAS CCASFLAGS CXX CXXFLAGS CCC F77 FFLAGS FC FCFLAGS LT_SYS_LIBRARY_PATH CXXCPP' # 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 GetData 0.9.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/getdata] --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 GetData 0.9.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] --enaable-legacy-api include the legacy API wrapper in the library --enable-assert enable assertions --enable-debug enable debugging messages --enable-ansi-c use ANSI C (C89) work-arounds for C99 code --disable-bindings don't build any bindings; just build the C library --disable-cplusplus don't build the C++ bindings (libgetdata++) --disable-fortran don't build the Fortran 77 bindings (libfgetdata) nor the Fortran 95 bindings (libf95getdata) --disable-fortran95 don't build the Fortran 95 bindings (libf95getdata) --disable-idl don't build the Interactive Data Language (IDL) bindings (IDL_GetData) --disable-matlab don't build the MATLAB bindings --disable-perl don't build the Perl bindings (GetData) --disable-php don't build the PHP bindings --disable-python don't build the Python bindings (pygetdata) --enable-modules build external encodings in dynamically loaded modules instead of directly into the core GetData library --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-fast-unaligned use fast loads and stores with non-aligned data. WARNING: Enabling this on a platform which does not support fast unaligned memory access may cause the library to silently corrupt data. [default: autodetect] --disable-fast-unaligned don't use fast loads and stores with non-aligned data, even if it looks like they should work. This is always safe, but can result in significant slow-down. [default: autodetect] --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --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-zzslim skip probing for zzslim required features and enable the zzslim encoding. Note: zzslim encoding support requires both slim and zzip encoding support. [default: autodetect] --disable-zzslim disable zzslim encodings support Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-module-dir=DIR if building modules, install them in DIR. This is ignored if --enable-modules isn't specified [default: LIBDIR/getdata] --with-ltdl=PREFIX if building modules, use the GNU ltdl library located in PREFIX [default: autodetect] --without-external-libraries disable all features relying on external libraries --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-aix-soname=aix|svr4|both shared library versioning (aka "SONAME") variant to provide on AIX, [default=aix]. --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-idl=PATH use the IDL interpreter located in PATH [default: autodetect] --with-idl-dlm-dir=PATH install the IDL bindings into PATH [default: autodetect] --with-matlab=PATH use the MATLAB interpreter located at PATH. [default: autodetect] --with-mex=PATH use the MATLAB MEX compiler located at PATH. [default: autodetect] --with-matlab-dir=PATH Install Matlab bindings in PATH/getdata. [default: LIBDIR/getdata/matlab] --with-perl=PATH use the Perl interpreter located in PATH. [default: autodetect] --with-perl-dir=PATH Install Perl bindings in PATH. If PATH is the special word `vendor', install Perl bindings into the default vendor-specific module directory (if present). If PATH is the special word `site', install Perl bindings into the default site-specific module directory. [default: site] --with-php-config=PATH use PATH as php-config. [default: autodetect] --with-php-dir=DIR install the GetData PHP extension into DIR [default: autodetect] --with-python=PATH use the Python interpreter located in PATH [default: autodetect] --with-python-module-dir=PATH install the Python bindings into PATH [default: autodetect] --with-libbz2=PREFIX use the libbz2 installed in PREFIX [default: autodetect] --without-libbz2 disable encodings supported by libbz2, even if the library is present --with-libFLAC=PREFIX use the libFLAC installed in PREFIX [default: autodetect] --without-libFLAC disable encodings supported by libFLAC, even if the library is present --with-libz=PREFIX use the libz installed in PREFIX [default: autodetect] --without-libz disable encodings supported by libz, even if the library is present --with-liblzma=PREFIX use the liblzma installed in PREFIX [default: autodetect] --without-liblzma disable encodings supported by liblzma, even if the library is present --with-libslim=PREFIX use the libslim installed in PREFIX [default: autodetect] --without-libslim disable encodings supported by libslim, even if the library is present --with-libzzip=PREFIX use the libzzip installed in PREFIX [default: autodetect] --without-libzzip disable encodings supported by libzzip, even if the library is present Some influential environment variables: BUILDCC C compiler command targetting the build system (only needed if cross-compiling) DATE a date program which supports '+%...' conversion specifiers DIFF a POSIX-compatible diff JOT a BSD-style jot; SysV-derived systems (like GNU/Linux) may find it easier to use SEQ (q.v.) PRINTF a POSIX-compatible printf SEQ a SysV-style seq; BSD-derived systems (like MacOS X) may find it easier to use JOT (q.v.) 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 CCAS assembler compiler command (defaults to CC) CCASFLAGS assembler compiler flags (defaults to CFLAGS) CXX C++ compiler command CXXFLAGS C++ compiler flags F77 Fortran 77 compiler command FFLAGS Fortran 77 compiler flags FC Fortran compiler command FCFLAGS Fortran compiler flags LT_SYS_LIBRARY_PATH User-defined run-time library search path. CXXCPP 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 . GetData 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 GetData configure 0.9.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. Parts of this program are copyright (C) 2008-2015 D. V. Wiebe. These parts may be redistributed and/or modified 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. See the file COPYING for details. _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_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 getdata-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_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_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_f77_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_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_f77_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_f77_try_compile # ac_fn_fc_try_compile LINENO # --------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_fc_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_fc_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_fc_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_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_f77_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_f77_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_f77_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_f77_try_link # ac_fn_fc_try_link LINENO # ------------------------ # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_fc_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_fc_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_fc_try_link # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_intX_t # 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done 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_find_uintX_t # 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 &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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 GetData $as_me 0.9.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 $as_echo "#define GETDATA_MAJOR 0" >>confdefs.h $as_echo "#define GETDATA_MINOR 9" >>confdefs.h $as_echo "#define GETDATA_REVISION 0" >>confdefs.h $as_echo "#define GETDATA_VERSION_SUFFIX \"\"" >>confdefs.h GETDATA_MAJOR=0 GETDATA_MINOR=9 GETDATA_REVISION=0 GETDATA_VERSION_SUFFIX= GETDATA_IFACE_VERSION=7 GETDATA_IMPL_REVISION=0 GETDATA_IFACE_AGE=0 GETDATAXX_VERSION=6:0:0 FGETDATA_VERSION=5:0:0 F95GETDATA_VERSION=6:0:0 MATLABGETDATA_VERSION=1:0:1 ac_config_headers="$ac_config_headers src/gd_config.h" BUINDINGS_BUILT= BINDINGS_LEFT= ENCODINGS_BUILT=" raw ascii sie" ENCODINGS_LEFT= PRIVATE_LIBS= echo "*** Checking GetData configuration" echo 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. # 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 # Check whether --enable-legacy-api was given. if test "${enable_legacy_api+set}" = set; then : enableval=$enable_legacy_api; case "${enableval}" in no) include_legacy_api="no" ;; *) include_legacy_api="yes" ;; esac else include_legacy_api="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the legacy API" >&5 $as_echo_n "checking whether to include the legacy API... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $include_legacy_api" >&5 $as_echo "$include_legacy_api" >&6; } if test "x$include_legacy_api" != "xno"; then DEFINE_GD_LEGACY_API="#define GD_LEGACY_API" else DEFINE_GD_LEGACY_API="/* #undef GD_LEGACY_API */" fi # Check whether --enable-assert was given. if test "${enable_assert+set}" = set; then : enableval=$enable_assert; case "${enableval}" in yes) enable_assert="yes" ;; *) enable_assert="no" ;; esac else enable_assert="no" fi # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then : enableval=$enable_debug; case "${enableval}" in yes) enable_debug="yes" ;; *) enable_debug="no" ;; esac else enable_debug="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable debugging messages" >&5 $as_echo_n "checking whether to enable debugging messages... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5 $as_echo "$enable_debug" >&6; } if test "x$enable_debug" = "xyes"; then $as_echo "#define GETDATA_DEBUG /**/" >>confdefs.h enable_assert="yes" GETDATA_DEBUG=1 else GETDATA_DEBUG=0 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5 $as_echo_n "checking whether to enable assertions... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5 $as_echo "$enable_assert" >&6; } if test "x$enable_assert" = "xno"; then $as_echo "#define NDEBUG 1" >>confdefs.h fi # Check whether --enable-ansi-c was given. if test "${enable_ansi_c+set}" = set; then : enableval=$enable_ansi_c; if test "x${enableval}" != "xno"; then disable_c99="yes"; else disable_c99="no"; fi else disable_c99="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build in ANSI C compliance mode" >&5 $as_echo_n "checking whether to build in ANSI C compliance mode... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $disable_c99" >&5 $as_echo "$disable_c99" >&6; } make_cxxbindings="yes" make_f77bindings="yes" make_pybindings="yes" make_idlbindings="yes" make_perlbindings="yes" make_matlabbindings="yes" make_phpbindings="yes" # Check whether --enable-bindings was given. if test "${enable_bindings+set}" = set; then : enableval=$enable_bindings; if test "x${enableval}" = "xno"; then make_cxxbindings="no" make_f77bindings="no" make_pybindings="no" make_idlbindings="no" make_perlbindings="no" make_matlabbindings="no" make_phpbindings="no" fi fi # Check whether --enable-cplusplus was given. if test "${enable_cplusplus+set}" = set; then : enableval=$enable_cplusplus; case "${enableval}" in no) make_cxxbindings="no" ;; *) make_cxxbindings="yes" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the C++ bindings" >&5 $as_echo_n "checking whether to include the C++ bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_cxxbindings" >&5 $as_echo "$make_cxxbindings" >&6; } # Check whether --enable-fortran was given. if test "${enable_fortran+set}" = set; then : enableval=$enable_fortran; case "${enableval}" in no) make_f77bindings="no" ;; *) make_f77bindings="yes" ;; esac fi # Check whether --enable-fortran95 was given. if test "${enable_fortran95+set}" = set; then : enableval=$enable_fortran95; case "${enableval}" in no) make_f95bindings="no" ;; *) make_f95bindings="yes" ;; esac else make_f95bindings="$make_f77bindings" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Fortran 95 bindings" >&5 $as_echo_n "checking whether to include the Fortran 95 bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_f95bindings" >&5 $as_echo "$make_f95bindings" >&6; } if test "x$make_f77bindings$make_f95bindings" = "xnoyes"; then make_f77bindings="yes (required by Fortran 95 bindings)" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Fortran 77 bindings" >&5 $as_echo_n "checking whether to include the Fortran 77 bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_f77bindings" >&5 $as_echo "$make_f77bindings" >&6; } # Check whether --enable-idl was given. if test "${enable_idl+set}" = set; then : enableval=$enable_idl; case "${enableval}" in no) make_idlbindings="no" ;; *) make_idlbindings="yes" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the IDL bindings" >&5 $as_echo_n "checking whether to include the IDL bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_idlbindings" >&5 $as_echo "$make_idlbindings" >&6; } # Check whether --enable-matlab was given. if test "${enable_matlab+set}" = set; then : enableval=$enable_matlab; case "${enableval}" in no) make_matlabbindings="no" ;; *) make_matlabbindings="yes" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the MATLAB bindings" >&5 $as_echo_n "checking whether to include the MATLAB bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_matlabbindings" >&5 $as_echo "$make_matlabbindings" >&6; } # Check whether --enable-perl was given. if test "${enable_perl+set}" = set; then : enableval=$enable_perl; case "${enableval}" in no) make_perlbindings="no" ;; *) make_perlbindings="yes" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Perl bindings" >&5 $as_echo_n "checking whether to include the Perl bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_perlbindings" >&5 $as_echo "$make_perlbindings" >&6; } # Check whether --enable-php was given. if test "${enable_php+set}" = set; then : enableval=$enable_php; case "${enableval}" in no) make_phpbindings="no" ;; *) make_phpbindings="yes" ;; esac fi # Check whether --enable-python was given. if test "${enable_python+set}" = set; then : enableval=$enable_python; case "${enableval}" in no) make_pybindings="no" ;; *) make_pybindings="yes" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the Python bindings" >&5 $as_echo_n "checking whether to include the Python bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_pybindings" >&5 $as_echo "$make_pybindings" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to include the PHP bindings" >&5 $as_echo_n "checking whether to include the PHP bindings... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $make_phpbindings" >&5 $as_echo "$make_phpbindings" >&6; } # Check whether --enable-modules was given. if test "${enable_modules+set}" = set; then : enableval=$enable_modules; case "${enableval}" in no) use_modules="no" ;; *) use_modules="yes" ;; esac else use_modules="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable getdata modules" >&5 $as_echo_n "checking whether to enable getdata modules... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_modules" >&5 $as_echo "$use_modules" >&6; } if test "x$use_modules" != "xno"; then $as_echo "#define USE_MODULES /**/" >>confdefs.h fi # Check whether --with-module-dir was given. if test "${with_module_dir+set}" = set; then : withval=$with_module_dir; case "${withval}" in no) moduledir="$libdir/getdata" ;; *) moduledir="${withval}" ;; esac else moduledir="$libdir/getdata" fi # Check whether --with-ltdl was given. if test "${with_ltdl+set}" = set; then : withval=$with_ltdl; case "${withval}" in no) ltdl_prefix= ;; *) ltdl_prefix="${withval}" ;; esac else ltdl_prefix= fi # Check whether --with-external-libraries was given. if test "${with_external_libraries+set}" = set; then : withval=$with_external_libraries; case "${withval}" in no) no_extern="yes";; *) no_extern="no";; esac else no_extern="no" fi echo echo "*** Initialising build system" echo am__api_version='1.14' # 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='getdata' VERSION='0.9.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}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $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 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 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 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 for ac_prog in date 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_DATE+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DATE"; then ac_cv_prog_DATE="$DATE" # 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_DATE="$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 DATE=$ac_cv_prog_DATE if test -n "$DATE"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DATE" >&5 $as_echo "$DATE" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DATE" && break done test -n "$DATE" || DATE="not found" for ac_prog in diff 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_DIFF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DIFF"; then ac_cv_prog_DIFF="$DIFF" # 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_DIFF="$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 DIFF=$ac_cv_prog_DIFF if test -n "$DIFF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5 $as_echo "$DIFF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DIFF" && break done for ac_prog in jot 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_JOT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$JOT"; then ac_cv_prog_JOT="$JOT" # 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_JOT="$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 JOT=$ac_cv_prog_JOT if test -n "$JOT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $JOT" >&5 $as_echo "$JOT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$JOT" && break done test -n "$JOT" || JOT="not found" for ac_prog in printf 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_PRINTF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PRINTF"; then ac_cv_prog_PRINTF="$PRINTF" # 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_PRINTF="$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 PRINTF=$ac_cv_prog_PRINTF if test -n "$PRINTF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PRINTF" >&5 $as_echo "$PRINTF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PRINTF" && break done test -n "$PRINTF" || PRINTF="not found" for ac_prog in seq 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_SEQ+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SEQ"; then ac_cv_prog_SEQ="$SEQ" # 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_SEQ="$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 SEQ=$ac_cv_prog_SEQ if test -n "$SEQ"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SEQ" >&5 $as_echo "$SEQ" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$SEQ" && break done test -n "$SEQ" || SEQ="not found" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we're running under Msys" >&5 $as_echo_n "checking whether we're running under Msys... " >&6; } if test "x`uname -o 2> /dev/null`" = "xMsys"; then this_is_msys=yes else this_is_msys=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $this_is_msys" >&5 $as_echo "$this_is_msys" >&6; } if test "$this_is_msys" = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the Win32 MSYS shell" >&5 $as_echo_n "checking for the Win32 MSYS shell... " >&6; } msys_root=`mount | ${GREP} 'on / ' | awk '{print $1}'` msys_shell1="$msys_root`echo $SHELL | ${SED} -e 's/\//\\\\/g'`.exe" msys_shell=`echo "$msys_shell1" | ${SED} -e 's/\\\\/\\\\\\\\/g'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $msys_shell1" >&5 $as_echo "$msys_shell1" >&6; } cat >>confdefs.h <<_ACEOF #define MSYS_SHELL "$msys_shell" _ACEOF fi DEFINE_GD_GETDATA_VERSION="#define GD_GETDATA_VERSION \"0.9.0\"" DEFINE_GD_GETDATA_INT_VERSION="#define GD_GETDATA_INT_VERSION `${PRINTF} %i%02i 9 0`" echo echo "*** Checking host environment" echo # Check whether --enable-fast-unaligned was given. if test "${enable_fast_unaligned+set}" = set; then : enableval=$enable_fast_unaligned; case "${enableval}" in yes) gd_unaligned_override="yes" ;; no) gd_unaligned_override="no" ;; *) gd_unaligned_override="check" ;; esac else gd_unaligned_override="check" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${host} supports fast unaligned memory access" >&5 $as_echo_n "checking whether ${host} supports fast unaligned memory access... " >&6; } if test "x$gd_unaligned_override" = "xyes"; then gd_unaligned_ok=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (forced)" >&5 $as_echo "yes (forced)" >&6; } elif test "x$gd_unaligned_override" = "xno"; then gd_unaligned_ok=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (forced)" >&5 $as_echo "no (forced)" >&6; } else case "${host}" in i?86-*-*|powerpc*-*-*|x86_64-*-*|armv6789*-*-*) gd_unaligned_ok=yes ;; *) gd_unaligned_ok=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_unaligned_ok" >&5 $as_echo "$gd_unaligned_ok" >&6; } fi if test "x$gd_unaligned_ok" = "xyes"; then $as_echo "#define UNALIGNED_ACCESS_OK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking the directory separator" >&5 $as_echo_n "checking the directory separator... " >&6; } case "${host}" in *-*-djgpp|*-*-mingw32) GD_FDIRSEP=\\; GD_DIRSEP=\\\\ ;; *) GD_FDIRSEP=/; GD_DIRSEP=/ ;; esac cat >>confdefs.h <<_ACEOF #define GD_DIRSEP '$GD_DIRSEP' _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GD_FDIRSEP" >&5 $as_echo "$GD_FDIRSEP" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra LDFLAGS needed on ${host}" >&5 $as_echo_n "checking for extra LDFLAGS needed on ${host}... " >&6; } case "${host}" in *-pc-mingw*) NO_UNDEFINED=" -no-undefined" NO_DLOPEN_TESTS=1 ;; *-*-cygwin*) NO_UNDEFINED=" -no-undefined -enable-auto-import" NO_DLOPEN_TESTS=1 ;; *) NO_DLOPEN_TESTS=0 ;; esac if test "x${NO_UNDEFINED}" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${NO_UNDEFINED}" >&5 $as_echo "${NO_UNDEFINED}" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the test suite can dynamically load objects" >&5 $as_echo_n "checking whether the test suite can dynamically load objects... " >&6; } if test "x${NO_DLOPEN_TESTS}" = "x1"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi case "${host}" in *-apple-darwin*) DL_LIBRARY_PATH="DYLD_LIBRARY_PATH" ;; *) DL_LIBRARY_PATH="LD_LIBRARY_PATH" ;; esac echo echo "*** Checking C compiler characteristics" echo 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 ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 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 egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" if test "x$ac_cv_header_minix_config_h" = xyes; then : MINIX=yes else MINIX= fi if test "$MINIX" = yes; then $as_echo "#define _POSIX_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h $as_echo "#define _MINIX 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 $as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } if ${ac_cv_safe_to_define___extensions__+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 $ac_includes_default int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_safe_to_define___extensions__=yes else ac_cv_safe_to_define___extensions__=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 $as_echo "$ac_cv_safe_to_define___extensions__" >&6; } test $ac_cv_safe_to_define___extensions__ = yes && $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h $as_echo "#define _ALL_SOURCE 1" >>confdefs.h $as_echo "#define _GNU_SOURCE 1" >>confdefs.h $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 if test "x$disable_c99" != "xyes"; then { $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 : fi if test "x$ac_cv_prog_cc_c99" = "xno"; then disable_c99="yes" fi fi if test "x$disable_c99" = "xyes"; then DEFINE_GD_NO_C99_API="#define GD_NO_C99_API" else DEFINE_GD_NO_C99_API="/* #undef GD_NO_C99_API */" fi { $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 # By default we simply use the C compiler to build assembly code. test "${CCAS+set}" = set || CCAS=$CC test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS depcc="$CCAS" 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_CCAS_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_CCAS_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 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_CCAS_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CCAS_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 $as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then am__fastdepCCAS_TRUE= am__fastdepCCAS_FALSE='#' else am__fastdepCCAS_TRUE='#' am__fastdepCCAS_FALSE= fi echo echo "*** Checking C++ compiler characteristics" echo 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 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 whether $CXX understands -c and -o together" >&5 $as_echo_n "checking whether $CXX understands -c and -o together... " >&6; } if ${ac_cv_prog_cxx_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 # We test twice because some compilers refuse to overwrite an existing # `.o' file with `-o', although they will create one. ac_try='$CXX $CXXFLAGS -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 ac_cv_prog_cxx_c_o=yes else ac_cv_prog_cxx_c_o=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_c_o" >&5 $as_echo "$ac_cv_prog_cxx_c_o" >&6; } if test $ac_cv_prog_cxx_c_o = no; then $as_echo "#define CXX_NO_MINUS_C_MINUS_O 1" >>confdefs.h 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 "x$make_f77bindings" != "xno"; then echo echo "*** Checking Fortran 77 compiler characteristics" echo 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 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor 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_F77+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_F77="$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 F77=$ac_cv_prog_F77 if test -n "$F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5 $as_echo "$F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$F77" && break done fi if test -z "$F77"; then ac_ct_F77=$F77 for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor 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_F77+:} false; then : $as_echo_n "(cached) " >&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_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_F77="$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_F77=$ac_cv_prog_ac_ct_F77 if test -n "$ac_ct_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5 $as_echo "$ac_ct_F77" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_F77" && break done if test "x$ac_ct_F77" = x; then F77="" 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 F77=$ac_ct_F77 fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; } if ${ac_cv_f77_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_f77_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_f77_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5 $as_echo "$ac_cv_f77_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FFLAGS=${FFLAGS+set} ac_save_FFLAGS=$FFLAGS FFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5 $as_echo_n "checking whether $F77 accepts -g... " >&6; } if ${ac_cv_prog_f77_g+:} false; then : $as_echo_n "(cached) " >&6 else FFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_g=yes else ac_cv_prog_f77_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5 $as_echo "$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 if test $ac_compiler_gnu = yes; then G77=yes else G77= 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=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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 understands -c and -o together" >&5 $as_echo_n "checking whether $F77 understands -c and -o together... " >&6; } if ${ac_cv_prog_f77_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # We test twice because some compilers refuse to overwrite an existing # `.o' file with `-o', although they will create one. ac_try='$F77 $FFLAGS -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 ac_cv_prog_f77_c_o=yes else ac_cv_prog_f77_c_o=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_c_o" >&5 $as_echo "$ac_cv_prog_f77_c_o" >&6; } if test $ac_cv_prog_f77_c_o = no; then $as_echo "#define F77_NO_MINUS_C_MINUS_O 1" >>confdefs.h 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 fi if test "x$make_f95bindings" != "xno"; then echo echo "*** Checking Fortran 90 compiler characteristics" echo ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test -n "$ac_tool_prefix"; then for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 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_FC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$FC"; then ac_cv_prog_FC="$FC" # 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_FC="$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 FC=$ac_cv_prog_FC if test -n "$FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5 $as_echo "$FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$FC" && break done fi if test -z "$FC"; then ac_ct_FC=$FC for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn nagfor xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 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_FC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_FC"; then ac_cv_prog_ac_ct_FC="$ac_ct_FC" # 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_FC="$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_FC=$ac_cv_prog_ac_ct_FC if test -n "$ac_ct_FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5 $as_echo "$ac_ct_FC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_FC" && break done if test "x$ac_ct_FC" = x; then FC="" 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 FC=$ac_ct_FC fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5 $as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; } if ${ac_cv_fc_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main #ifndef __GNUC__ choke me #endif end _ACEOF if ac_fn_fc_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_fc_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5 $as_echo "$ac_cv_fc_compiler_gnu" >&6; } ac_ext=$ac_save_ext ac_test_FCFLAGS=${FCFLAGS+set} ac_save_FCFLAGS=$FCFLAGS FCFLAGS= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5 $as_echo_n "checking whether $FC accepts -g... " >&6; } if ${ac_cv_prog_fc_g+:} false; then : $as_echo_n "(cached) " >&6 else FCFLAGS=-g cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_compile "$LINENO"; then : ac_cv_prog_fc_g=yes else ac_cv_prog_fc_g=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5 $as_echo "$ac_cv_prog_fc_g" >&6; } if test "$ac_test_FCFLAGS" = set; then FCFLAGS=$ac_save_FCFLAGS elif test $ac_cv_prog_fc_g = yes; then if test "x$ac_cv_fc_compiler_gnu" = xyes; then FCFLAGS="-g -O2" else FCFLAGS="-g" fi else if test "x$ac_cv_fc_compiler_gnu" = xyes; then FCFLAGS="-O2" else FCFLAGS= fi fi if test $ac_compiler_gnu = yes; then GFC=yes else GFC= 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=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC understands -c and -o together" >&5 $as_echo_n "checking whether $FC understands -c and -o together... " >&6; } if ${ac_cv_prog_fc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # We test twice because some compilers refuse to overwrite an existing # `.o' file with `-o', although they will create one. ac_try='$FC $FCFLAGS -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 ac_cv_prog_fc_c_o=yes else ac_cv_prog_fc_c_o=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_c_o" >&5 $as_echo "$ac_cv_prog_fc_c_o" >&6; } if test $ac_cv_prog_fc_c_o = no; then $as_echo "#define FC_NO_MINUS_C_MINUS_O 1" >>confdefs.h 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 # does $FC accept fortran code with .f90 extension? { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the Fortran 90 compiler works" >&5 $as_echo_n "checking whether the Fortran 90 compiler works... " >&6; } ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu ac_ext="f90" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_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; }; FC=; fi rm -f core 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 fi if test "x${cross_compiling}" != "xno"; then echo echo "*** Checking the build environment" echo if test -z "$BUILDCC"; then if test -n "$build_alias"; then for ac_prog in ${build_alias}-gcc ${build_alias}-cc ${build_alias}-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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_BUILDCC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$BUILDCC"; then ac_cv_prog_BUILDCC="$BUILDCC" # 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_BUILDCC="$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 BUILDCC=$ac_cv_prog_BUILDCC if test -n "$BUILDCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDCC" >&5 $as_echo "$BUILDCC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$BUILDCC" && break done fi fi if test -z "$BUILDCC"; then for ac_prog in gcc cc 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_BUILDCC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$BUILDCC"; then ac_cv_prog_BUILDCC="$BUILDCC" # 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_BUILDCC="$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 BUILDCC=$ac_cv_prog_BUILDCC if test -n "$BUILDCC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BUILDCC" >&5 $as_echo "$BUILDCC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$BUILDCC" && break done fi # bindings requiring interpreters aren't built when cross compiling make_idlbindings=no make_phpbindings=no make_pybindings=no make_perlbindings=no make_matlabbindings=no else if test -z "$BUILDCC"; then BUILDCC=$CC fi fi echo echo "*** Building libtool" echo 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.6' macro_revision='2.4.6' 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 no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) 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 no != "$lt_cv_path_NM"; 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 -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) 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; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # 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" && \ test undefined != "$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 17 != "$i" # 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"} 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 yes != "$GCC"; then reload_cmds=false fi ;; darwin*) if test yes = "$GCC"; 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 # that 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. if ( 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 ;; 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 | 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* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 ;; os2*) 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 one 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 0 -eq "$ac_status"; 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 0 -ne "$ac_status"; 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 no = "$lt_cv_ar_at_file"; 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 bitrig* | 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 ia64 = "$host_cpu"; 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 if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # 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"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$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"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/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, # D for any global variable and I for any imported 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};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,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 can'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* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$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 yes = "$pipe_works"; 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 yes = "$GCC"; 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; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 $as_echo_n "checking for a working dd... " >&6; } if ${ac_cv_path_lt_DD+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} if test -z "$lt_DD"; then ac_path_lt_DD_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 dd; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi $ac_path_lt_DD_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_lt_DD"; then : fi else ac_cv_path_lt_DD=$lt_DD fi rm -f conftest.i conftest2.i conftest.out fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 $as_echo "$ac_cv_path_lt_DD" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 $as_echo_n "checking how to truncate binary pipes... " >&6; } if ${lt_cv_truncate_bin+:} false; then : $as_echo_n "(cached) " >&6 else printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 $as_echo "$lt_cv_truncate_bin" >&6; } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test no = "$enable_libtool_lock" || 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 what ABI is being produced by ac_compile, and set mode # options accordingly. 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 what ABI is being produced by ac_compile, and set linker # options accordingly. 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 yes = "$lt_cv_prog_gnu_ld"; 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* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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 emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. 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*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; 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" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; 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 yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. 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 yes != "$lt_cv_path_mainfest_tool"; 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 0 = "$_lt_result"; 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 0 = "$_lt_result" && $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 yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; 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 no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; 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 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 # Set options enable_dlopen=yes 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; 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 # 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 shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 $as_echo_n "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. if test "${with_aix_soname+set}" = set; then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; *) as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5 ;; esac lt_cv_with_aix_soname=$with_aix_soname else if ${lt_cv_with_aix_soname+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 $as_echo "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File. # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag, # the AIX toolchain works better with OBJECT_MODE set (default 32). if test 64 = "${OBJECT_MODE-32}"; then shared_archive_member_spec=shr_64 else shared_archive_member_spec=shr fi fi ;; *) with_aix_soname=aix ;; esac # 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 set != "${COLLECT_NAMES+set}"; 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 func_cc_basename $compiler cc_basename=$func_cc_basename_result # 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 yes = "$GCC"; 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "$lt_cv_prog_compiler_rtti_exceptions"; 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 yes = "$GCC"; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi lt_prog_compiler_pic='-fPIC' ;; 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' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; esac ;; 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' case $host_os in os2*) lt_prog_compiler_static='$wl-static' ;; esac ;; 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 | 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' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' 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\ 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 that 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "$lt_cv_prog_compiler_pic_works"; 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 yes = "$lt_cv_prog_compiler_static_works"; 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 no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; 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 no = "$hard_links"; 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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) 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 yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 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 ia64 != "$host_cpu"; 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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" 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' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-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 yes = "$supports_anon_versioning"; 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 tcc*) export_dynamic_flag_spec='-rdynamic' ;; 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 yes = "$supports_anon_versioning"; 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 cannot *** 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 no = "$ld_shlibs"; 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 yes = "$GCC" && 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 ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct=no hardcode_direct_absolute=no ;; esac if test yes = "$GCC"; 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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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 set = "${lt_cv_aix_libpath+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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 set = "${lt_cv_aix_libpath+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 yes = "$with_gnu_ld"; 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 archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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 yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; 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 yes = "$GCC"; 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 "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; 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 no = "$with_gnu_ld"; 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 yes,no = "$GCC,$with_gnu_ld"; 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 yes = "$lt_cv_prog_compiler__b"; 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 no = "$with_gnu_ld"; 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 yes = "$GCC"; 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 yes = "$lt_cv_irix_exported_symbol"; 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 ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs=yes archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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* | bitrig*) 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__`"; 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 archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='$wl-rpath,$libdir' fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported shrext_cmds=.dll archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes=yes ;; osf3*) if test yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 yes = "$GCC"; 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 sequent = "$host_vendor"; 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 yes = "$GCC"; 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 CANNOT 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 yes = "$GCC"; 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 sni = "$host_vendor"; 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 no = "$ld_shlibs" && 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 yes,yes = "$GCC,$enable_shared"; 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 yes = "$GCC"; 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` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac 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" elif test -n "$lt_multi_os_dir"; then 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" && test no != "$hardcode_minus_L"; 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 relink = "$hardcode_action" || test yes = "$inherit_rpath"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi if test yes != "$enable_dlopen"; 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 ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) 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 no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && 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 yes = "$cross_compiling"; 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 -fvisibility=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 yes = "$lt_cv_dlopen_self"; 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 yes = "$cross_compiling"; 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 -fvisibility=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 what 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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || 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 if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); 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 yes != "$_lt_caught_CXX_error"; 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 func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test yes = "$GXX"; 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 no = "$withval" || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; 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 yes = "$with_gnu_ld"; 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 yes = "$with_gnu_ld"; 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 ia64 = "$host_cpu"; 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive 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 if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no ;; esac if test yes = "$GXX"; 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 yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' 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,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. no_undefined_flag_CXX='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. if test set = "${lt_cv_aix_libpath+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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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 set = "${lt_cv_aix_libpath+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 yes = "$with_gnu_ld"; 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 archive_expsym_cmds_CXX='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_CXX="$archive_expsym_cmds_CXX"'~$RM -r $output_objdir/$realname.d' 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,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_CXX='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 yes = "$lt_cv_ld_force_load"; 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*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; 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 yes != "$lt_cv_apple_cc_single_mod"; 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 ;; os2*) hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_minus_L_CXX=yes allow_undefined_flag_CXX=unsupported shrext_cmds=.dll archive_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_CXX='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_CXX='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_CXX=yes ;; 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 ;; 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 "x$output_objdir/$soname" = "x$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 yes = "$GXX"; 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 "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; 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 yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 yes = "$GXX"; then if test no = "$with_gnu_ld"; 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 | 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 yes = "$supports_anon_versioning"; 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 ;; openbsd* | bitrig*) 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__`"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 yes,no = "$GXX,$with_gnu_ld"; 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 $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 $wl-h $wl$soname -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 $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 $wl-h $wl$soname -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 CANNOT 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 no = "$ld_shlibs_CXX" && 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 x-L = "$p" || test x-R = "$p"; 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 no = "$pre_test_object_deps_done"; 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 no = "$pre_test_object_deps_done"; 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= ;; 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 yes = "$GXX"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi lt_prog_compiler_pic_CXX='-fPIC' ;; 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' case $host_os in os2*) lt_prog_compiler_static_CXX='$wl-static' ;; esac ;; 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 ia64 = "$host_cpu"; 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 ia64 != "$host_cpu"; 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 | 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 that 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" ## exclude from sc_useless_quotes_in_assignment # 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 yes = "$lt_cv_prog_compiler_pic_works_CXX"; 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 yes = "$lt_cv_prog_compiler_static_works_CXX"; 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 no = "$lt_cv_prog_compiler_c_o_CXX" && test no != "$need_locks"; 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 no = "$hard_links"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 no = "$ld_shlibs_CXX" && 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 yes,yes = "$GCC,$enable_shared"; 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_CXX='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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 yes = "$hardcode_automatic_CXX"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_CXX" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" && test no != "$hardcode_minus_L_CXX"; 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 relink = "$hardcode_action_CXX" || test yes = "$inherit_rpath_CXX"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; 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 yes != "$_lt_caught_CXX_error" 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=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 -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi 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_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_automatic_F77=no inherit_rpath_F77=no module_cmds_F77= module_expsym_cmds_F77= link_all_deplibs_F77=unknown old_archive_cmds_F77=$old_archive_cmds reload_flag_F77=$reload_flag reload_cmds_F77=$reload_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 # 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 yes != "$_lt_disable_F77"; 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. # 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 lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC compiler_F77=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result GCC=$G77 if test -n "$compiler"; then { $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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } GCC_F77=$G77 LD_F77=$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_prog_compiler_wl_F77= lt_prog_compiler_pic_F77= lt_prog_compiler_static_F77= if test yes = "$GCC"; 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 ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_F77='-Bstatic' fi lt_prog_compiler_pic_F77='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_F77='-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_F77='-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_F77='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_F77='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_F77= ;; 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_F77='-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_F77=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_F77='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_F77=-Kconform_pic fi ;; *) lt_prog_compiler_pic_F77='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl_F77='-Xlinker ' if test -n "$lt_prog_compiler_pic_F77"; then lt_prog_compiler_pic_F77="-Xcompiler $lt_prog_compiler_pic_F77" fi ;; 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 ia64 = "$host_cpu"; 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* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_F77='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_F77='-Wl,-Wl,,' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; esac ;; 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_F77='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_F77='$wl-static' ;; esac ;; 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' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='--shared' lt_prog_compiler_static_F77='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_F77='-Wl,-Wl,,' lt_prog_compiler_pic_F77='-PIC' lt_prog_compiler_static_F77='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-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_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' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-qpic' lt_prog_compiler_static_F77='-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_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' lt_prog_compiler_wl_F77='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fPIC' lt_prog_compiler_static_F77='-static' ;; *Portland\ Group*) lt_prog_compiler_wl_F77='-Wl,' lt_prog_compiler_pic_F77='-fpic' lt_prog_compiler_static_F77='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_F77='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_F77='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; rdos*) 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* | sunf77* | sunf90* | sunf95*) 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 case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_F77= ;; *) lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" ;; 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_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_F77=$lt_prog_compiler_pic_F77 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_F77" >&5 $as_echo "$lt_cv_prog_compiler_pic_F77" >&6; } lt_prog_compiler_pic_F77=$lt_cv_prog_compiler_pic_F77 # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_F77"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; } if ${lt_cv_prog_compiler_pic_works_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" ## exclude from sc_useless_quotes_in_assignment # 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_F77=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_F77"; 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 # # 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\" { $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_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_F77=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_F77=yes fi else lt_cv_prog_compiler_static_works_F77=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5 $as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_F77"; then : else lt_prog_compiler_static_F77= 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_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=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_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 .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&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_F77+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_F77=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_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 .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5 $as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_F77" && test no != "$need_locks"; 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 no = "$hard_links"; 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_F77= always_export_symbols_F77=no archive_cmds_F77= archive_expsym_cmds_F77= compiler_needs_object_F77=no enable_shared_with_static_runtimes_F77=no export_dynamic_flag_spec_F77= export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic_F77=no hardcode_direct_F77=no hardcode_direct_absolute_F77=no hardcode_libdir_flag_spec_F77= hardcode_libdir_separator_F77= hardcode_minus_L_F77=no hardcode_shlibpath_var_F77=unsupported inherit_rpath_F77=no link_all_deplibs_F77=unknown module_cmds_F77= module_expsym_cmds_F77= old_archive_from_new_cmds_F77= old_archive_from_expsyms_cmds_F77= thread_safe_flag_spec_F77= whole_archive_flag_spec_F77= # 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_|_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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs_F77=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 yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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 | $SED -e 's/(^)\+)\s\+//' 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 ia64 != "$host_cpu"; then ld_shlibs_F77=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_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) 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 ;; esac ;; 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* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_F77='-L$libdir' export_dynamic_flag_spec_F77='$wl--export-all-symbols' 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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_F77='[_]+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_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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_F77='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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 ;; haiku*) archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_F77=yes ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported shrext_cmds=.dll archive_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_F77=yes ;; interix[3-9]*) 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' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' 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; 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_F77='$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_F77= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-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_F77='$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_F77=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_F77='$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_F77=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; 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 '"$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 tcc*) export_dynamic_flag_spec_F77='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; 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~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$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_F77=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_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $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 cannot *** 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_F77='$wl-rpath $wl$libdir' 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 ;; 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 $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='$CC -shared $pic_flag $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 no = "$ld_shlibs_F77"; 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 yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_F77=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX 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") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_F77='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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_direct_absolute_F77=yes hardcode_libdir_separator_F77=':' link_all_deplibs_F77=yes file_list_spec_F77='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_F77=no hardcode_direct_absolute_F77=no ;; esac if test yes = "$GCC"; 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_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 yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_F77='$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_F77=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; 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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__F77+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__F77=`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__F77"; then lt_cv_aix_libpath__F77=`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__F77"; then lt_cv_aix_libpath__F77=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__F77 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 -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; 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. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__F77+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__F77=`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__F77"; then lt_cv_aix_libpath__F77=`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__F77"; then lt_cv_aix_libpath__F77=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__F77 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' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_F77='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_F77='$convenience' fi archive_cmds_need_lc_F77=yes archive_expsym_cmds_F77='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_F77="$archive_expsym_cmds_F77"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_F77='' ;; m68k) 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 ;; esac ;; bsdi[45]*) export_dynamic_flag_spec_F77=-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_F77=' ' allow_undefined_flag_F77=unsupported always_export_symbols_F77=yes file_list_spec_F77='@' # 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_F77='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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, F77)='true' enable_shared_with_static_runtimes_F77=yes exclude_expsyms_F77='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds_F77='$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_F77='chmod 644 $oldlib' postlink_cmds_F77='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_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 `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_F77='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes_F77=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_F77=no hardcode_direct_F77=no hardcode_automatic_F77=yes hardcode_shlibpath_var_F77=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_F77='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' compiler_needs_object_F77=yes else whole_archive_flag_spec_F77='' fi link_all_deplibs_F77=yes allow_undefined_flag_F77=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_F77="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_F77="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_F77=no 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 ;; # 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* | dragonfly*) archive_cmds_F77='$CC -shared $pic_flag -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 yes = "$GCC"; then archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$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 "x$output_objdir/$soname" = "x$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 yes,no = "$GCC,$with_gnu_ld"; then archive_cmds_F77='$CC -shared $pic_flag $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 no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir' hardcode_libdir_separator_F77=: hardcode_direct_F77=yes hardcode_direct_absolute_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 yes,no = "$GCC,$with_gnu_ld"; 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 $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_F77='$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_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 no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_F77='$wl+b $wl$libdir' hardcode_libdir_separator_F77=: case $host_cpu in hppa*64*|ia64*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no ;; *) hardcode_direct_F77=yes hardcode_direct_absolute_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 yes = "$GCC"; then archive_cmds_F77='$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 > conftest.$ac_ext <<_ACEOF subroutine foo end _ACEOF if ac_fn_f77_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 yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds_F77='$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_F77='$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_F77='$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_F77='no' hardcode_libdir_flag_spec_F77='$wl-rpath $wl$libdir' hardcode_libdir_separator_F77=: inherit_rpath_F77=yes link_all_deplibs_F77=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs_F77=yes archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; 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 ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_F77=yes hardcode_shlibpath_var_F77=no hardcode_direct_absolute_F77=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; 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 archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_F77='$wl-rpath,$libdir' fi else ld_shlibs_F77=no fi ;; os2*) hardcode_libdir_flag_spec_F77='-L$libdir' hardcode_minus_L_F77=yes allow_undefined_flag_F77=unsupported shrext_cmds=.dll archive_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_F77='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_F77='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_F77=yes ;; osf3*) if test yes = "$GCC"; 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" && func_echo_all "$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='$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_F77='no' 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 yes = "$GCC"; then allow_undefined_flag_F77=' $wl-expect_unresolved $wl\*' archive_cmds_F77='$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_F77='$wl-rpath $wl$libdir' else allow_undefined_flag_F77=' -expect_unresolved \*' archive_cmds_F77='$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_F77='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_F77='-rpath $libdir' fi archive_cmds_need_lc_F77='no' hardcode_libdir_separator_F77=: ;; solaris*) no_undefined_flag_F77=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds_F77='$CC -shared $pic_flag $wl-z ${wl}text $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 $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_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' ;; *) wlarc='$wl' archive_cmds_F77='$CC -G$allow_undefined_flag -h $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 -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac 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 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 yes = "$GCC"; then whole_archive_flag_spec_F77='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_F77=yes ;; sunos4*) if test sequent = "$host_vendor"; 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* | sco3.2v5.0.[024]*) 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 yes = "$GCC"; 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 CANNOT 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='$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 yes = "$GCC"; 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 ;; 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 if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec_F77='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5 $as_echo "$ld_shlibs_F77" >&6; } test no = "$ld_shlibs_F77" && can_build_shared=no with_gnu_ld_F77=$with_gnu_ld # # 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 yes,yes = "$GCC,$enable_shared"; 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. { $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_F77+:} 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_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\":${as_lineno-$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=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_F77=no else lt_cv_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* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_F77" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_F77" >&6; } archive_cmds_need_lc_F77=$lt_cv_archive_cmds_need_lc_F77 ;; 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_F77='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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_F77\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\"" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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_F77= if test -n "$hardcode_libdir_flag_spec_F77" || test -n "$runpath_var_F77" || test yes = "$hardcode_automatic_F77"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_F77" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" && test no != "$hardcode_minus_L_F77"; 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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5 $as_echo "$hardcode_action_F77" >&6; } if test relink = "$hardcode_action_F77" || test yes = "$inherit_rpath_F77"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" 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=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_fc_compiler_gnu if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi archive_cmds_need_lc_FC=no allow_undefined_flag_FC= always_export_symbols_FC=no archive_expsym_cmds_FC= export_dynamic_flag_spec_FC= hardcode_direct_FC=no hardcode_direct_absolute_FC=no hardcode_libdir_flag_spec_FC= hardcode_libdir_separator_FC= hardcode_minus_L_FC=no hardcode_automatic_FC=no inherit_rpath_FC=no module_cmds_FC= module_expsym_cmds_FC= link_all_deplibs_FC=unknown old_archive_cmds_FC=$old_archive_cmds reload_flag_FC=$reload_flag reload_cmds_FC=$reload_cmds no_undefined_flag_FC= whole_archive_flag_spec_FC= enable_shared_with_static_runtimes_FC=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o objext_FC=$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 yes != "$_lt_disable_FC"; 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. # 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 lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu compiler_FC=$CC func_cc_basename $compiler cc_basename=$func_cc_basename_result if test -n "$compiler"; then { $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 no = "$can_build_shared" && 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 yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac 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 yes = "$enable_shared" || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } GCC_FC=$ac_cv_fc_compiler_gnu LD_FC=$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_FC= postdep_objects_FC= predeps_FC= postdeps_FC= compiler_lib_search_path_FC= cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _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 x-L = "$p" || test x-R = "$p"; 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 no = "$pre_test_object_deps_done"; 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_FC"; then compiler_lib_search_path_FC=$prev$p else compiler_lib_search_path_FC="${compiler_lib_search_path_FC} $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_FC"; then postdeps_FC=$prev$p else postdeps_FC="${postdeps_FC} $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 no = "$pre_test_object_deps_done"; then if test -z "$predep_objects_FC"; then predep_objects_FC=$p else predep_objects_FC="$predep_objects_FC $p" fi else if test -z "$postdep_objects_FC"; then postdep_objects_FC=$p else postdep_objects_FC="$postdep_objects_FC $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling FC test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case " $postdeps_FC " in *" -lc "*) archive_cmds_need_lc_FC=no ;; esac compiler_lib_search_dirs_FC= if test -n "${compiler_lib_search_path_FC}"; then compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_FC= lt_prog_compiler_pic_FC= lt_prog_compiler_static_FC= if test yes = "$GCC"; then lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_static_FC='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_FC='-Bstatic' fi lt_prog_compiler_pic_FC='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_FC='-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_FC='-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_FC='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_FC='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_FC='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_FC= ;; 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_FC='-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_FC=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_FC='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_FC=-Kconform_pic fi ;; *) lt_prog_compiler_pic_FC='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl_FC='-Xlinker ' if test -n "$lt_prog_compiler_pic_FC"; then lt_prog_compiler_pic_FC="-Xcompiler $lt_prog_compiler_pic_FC" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl_FC='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_FC='-Bstatic' else lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_FC='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_FC='-Wl,-Wl,,' lt_prog_compiler_pic_FC='-PIC' lt_prog_compiler_static_FC='-Bstatic' ;; esac ;; 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_FC='-DDLL_EXPORT' case $host_os in os2*) lt_prog_compiler_static_FC='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl_FC='-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_FC='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static_FC='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl_FC='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static_FC='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-fPIC' lt_prog_compiler_static_FC='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='--shared' lt_prog_compiler_static_FC='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl_FC='-Wl,-Wl,,' lt_prog_compiler_pic_FC='-PIC' lt_prog_compiler_static_FC='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-fPIC' lt_prog_compiler_static_FC='-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_FC='-Wl,' lt_prog_compiler_pic_FC='-fpic' lt_prog_compiler_static_FC='-Bstatic' ;; ccc*) lt_prog_compiler_wl_FC='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static_FC='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-qpic' lt_prog_compiler_static_FC='-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_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' lt_prog_compiler_wl_FC='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' lt_prog_compiler_wl_FC='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' lt_prog_compiler_wl_FC='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-fPIC' lt_prog_compiler_static_FC='-static' ;; *Portland\ Group*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-fpic' lt_prog_compiler_static_FC='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_FC='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl_FC='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static_FC='-non_shared' ;; rdos*) lt_prog_compiler_static_FC='-non_shared' ;; solaris*) lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl_FC='-Qoption ld ';; *) lt_prog_compiler_wl_FC='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl_FC='-Qoption ld ' lt_prog_compiler_pic_FC='-PIC' lt_prog_compiler_static_FC='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_FC='-Kconform_pic' lt_prog_compiler_static_FC='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_pic_FC='-KPIC' lt_prog_compiler_static_FC='-Bstatic' ;; unicos*) lt_prog_compiler_wl_FC='-Wl,' lt_prog_compiler_can_build_shared_FC=no ;; uts4*) lt_prog_compiler_pic_FC='-pic' lt_prog_compiler_static_FC='-Bstatic' ;; *) lt_prog_compiler_can_build_shared_FC=no ;; esac fi case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_FC= ;; *) lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC" ;; 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_FC+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_FC=$lt_prog_compiler_pic_FC fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_FC" >&5 $as_echo "$lt_cv_prog_compiler_pic_FC" >&6; } lt_prog_compiler_pic_FC=$lt_cv_prog_compiler_pic_FC # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_FC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; } if ${lt_cv_prog_compiler_pic_works_FC+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_FC=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_FC" ## exclude from sc_useless_quotes_in_assignment # 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_FC=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works_FC"; then case $lt_prog_compiler_pic_FC in "" | " "*) ;; *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;; esac else lt_prog_compiler_pic_FC= lt_prog_compiler_can_build_shared_FC=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\" { $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_FC+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_FC=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_FC=yes fi else lt_cv_prog_compiler_static_works_FC=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5 $as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; } if test yes = "$lt_cv_prog_compiler_static_works_FC"; then : else lt_prog_compiler_static_FC= 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_FC+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_FC=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_FC=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_FC" >&5 $as_echo "$lt_cv_prog_compiler_c_o_FC" >&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_FC+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_FC=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_FC=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_FC" >&5 $as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; } hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o_FC" && test no != "$need_locks"; 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 no = "$hard_links"; 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_FC= always_export_symbols_FC=no archive_cmds_FC= archive_expsym_cmds_FC= compiler_needs_object_FC=no enable_shared_with_static_runtimes_FC=no export_dynamic_flag_spec_FC= export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic_FC=no hardcode_direct_FC=no hardcode_direct_absolute_FC=no hardcode_libdir_flag_spec_FC= hardcode_libdir_separator_FC= hardcode_minus_L_FC=no hardcode_shlibpath_var_FC=unsupported inherit_rpath_FC=no link_all_deplibs_FC=unknown module_cmds_FC= module_expsym_cmds_FC= old_archive_from_new_cmds_FC= old_archive_from_expsyms_cmds_FC= thread_safe_flag_spec_FC= whole_archive_flag_spec_FC= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms_FC= # 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_FC='_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 yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; esac ld_shlibs_FC=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 yes = "$with_gnu_ld"; 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 yes = "$lt_use_gnu_ld_interface"; 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_FC='$wl-rpath $wl$libdir' export_dynamic_flag_spec_FC='$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_FC=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else whole_archive_flag_spec_FC= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/(^)\+)\s\+//' 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 ia64 != "$host_cpu"; then ld_shlibs_FC=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_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_FC='' ;; m68k) archive_cmds_FC='$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_FC='-L$libdir' hardcode_minus_L_FC=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_FC=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else ld_shlibs_FC=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_FC='-L$libdir' export_dynamic_flag_spec_FC='$wl--export-all-symbols' allow_undefined_flag_FC=unsupported always_export_symbols_FC=no enable_shared_with_static_runtimes_FC=yes export_symbols_cmds_FC='$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_FC='[_]+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_FC='$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, use it as # is; otherwise, prepend EXPORTS... archive_expsym_cmds_FC='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; 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_FC=no fi ;; haiku*) archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' link_all_deplibs_FC=yes ;; os2*) hardcode_libdir_flag_spec_FC='-L$libdir' hardcode_minus_L_FC=yes allow_undefined_flag_FC=unsupported shrext_cmds=.dll archive_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_FC='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_FC=yes ;; interix[3-9]*) hardcode_direct_FC=no hardcode_shlibpath_var_FC=no hardcode_libdir_flag_spec_FC='$wl-rpath,$libdir' export_dynamic_flag_spec_FC='$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_FC='$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_FC='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 linux-dietlibc = "$host_os"; 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 no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec_FC='$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_FC='$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_FC= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-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_FC='$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_FC=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec_FC='$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_FC=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_FC='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 tcc*) export_dynamic_flag_spec_FC='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir' archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then archive_expsym_cmds_FC='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_FC=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_FC='$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_FC=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_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_FC=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs_FC=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** 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_FC='$wl-rpath $wl$libdir' archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_FC=no fi ;; esac ;; sunos4*) archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct_FC=yes hardcode_shlibpath_var_FC=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs_FC=no fi ;; esac if test no = "$ld_shlibs_FC"; then runpath_var= hardcode_libdir_flag_spec_FC= export_dynamic_flag_spec_FC= whole_archive_flag_spec_FC= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag_FC=unsupported always_export_symbols_FC=yes archive_expsym_cmds_FC='$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_FC=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct_FC=unsupported fi ;; aix[4-9]*) if test ia64 = "$host_cpu"; 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 GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_FC='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | 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 # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; 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_FC='' hardcode_direct_FC=yes hardcode_direct_absolute_FC=yes hardcode_libdir_separator_FC=':' link_all_deplibs_FC=yes file_list_spec_FC='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. hardcode_direct_FC=no hardcode_direct_absolute_FC=no ;; esac if test yes = "$GCC"; 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_FC=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_FC=yes hardcode_libdir_flag_spec_FC='-L$libdir' hardcode_libdir_separator_FC= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; 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 yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi export_dynamic_flag_spec_FC='$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_FC=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_FC='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__FC+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__FC=`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__FC"; then lt_cv_aix_libpath__FC=`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__FC"; then lt_cv_aix_libpath__FC=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__FC fi hardcode_libdir_flag_spec_FC='$wl-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then hardcode_libdir_flag_spec_FC='$wl-R $libdir:/usr/lib:/lib' allow_undefined_flag_FC="-z nodefs" archive_expsym_cmds_FC="\$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 set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__FC+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__FC=`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__FC"; then lt_cv_aix_libpath__FC=`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__FC"; then lt_cv_aix_libpath__FC=/usr/lib:/lib fi fi aix_libpath=$lt_cv_aix_libpath__FC fi hardcode_libdir_flag_spec_FC='$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_FC=' $wl-bernotok' allow_undefined_flag_FC=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_FC='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_FC='$convenience' fi archive_cmds_need_lc_FC=yes archive_expsym_cmds_FC='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi archive_expsym_cmds_FC="$archive_expsym_cmds_FC"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' archive_expsym_cmds_FC='' ;; m68k) archive_cmds_FC='$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_FC='-L$libdir' hardcode_minus_L_FC=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec_FC=-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_FC=' ' allow_undefined_flag_FC=unsupported always_export_symbols_FC=yes file_list_spec_FC='@' # 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_FC='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' archive_expsym_cmds_FC='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $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, FC)='true' enable_shared_with_static_runtimes_FC=yes exclude_expsyms_FC='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds_FC='$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_FC='chmod 644 $oldlib' postlink_cmds_FC='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_FC=' ' allow_undefined_flag_FC=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_FC='$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_FC='true' # FIXME: Should let the user specify the lib program. old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes_FC=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_FC=no hardcode_direct_FC=no hardcode_automatic_FC=yes hardcode_shlibpath_var_FC=unsupported if test yes = "$lt_cv_ld_force_load"; then whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' compiler_needs_object_FC=yes else whole_archive_flag_spec_FC='' fi link_all_deplibs_FC=yes allow_undefined_flag_FC=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" archive_expsym_cmds_FC="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_FC="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_FC=no fi ;; dgux*) archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_FC='-L$libdir' hardcode_shlibpath_var_FC=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_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec_FC='-R$libdir' hardcode_direct_FC=yes hardcode_shlibpath_var_FC=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_FC=yes hardcode_minus_L_FC=yes hardcode_shlibpath_var_FC=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_FC='-R$libdir' hardcode_direct_FC=yes hardcode_shlibpath_var_FC=no ;; hpux9*) if test yes = "$GCC"; then archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec_FC='$wl+b $wl$libdir' hardcode_libdir_separator_FC=: hardcode_direct_FC=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_FC=yes export_dynamic_flag_spec_FC='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then archive_cmds_FC='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_FC='$wl+b $wl$libdir' hardcode_libdir_separator_FC=: hardcode_direct_FC=yes hardcode_direct_absolute_FC=yes export_dynamic_flag_spec_FC='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_FC=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) archive_cmds_FC='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_FC='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_FC='$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_FC='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds_FC='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_FC='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test no = "$with_gnu_ld"; then hardcode_libdir_flag_spec_FC='$wl+b $wl$libdir' hardcode_libdir_separator_FC=: case $host_cpu in hppa*64*|ia64*) hardcode_direct_FC=no hardcode_shlibpath_var_FC=no ;; *) hardcode_direct_FC=yes hardcode_direct_absolute_FC=yes export_dynamic_flag_spec_FC='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L_FC=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then archive_cmds_FC='$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 > conftest.$ac_ext <<_ACEOF subroutine foo end _ACEOF if ac_fn_fc_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 yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds_FC='$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_FC='$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_FC='$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_FC='no' hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir' hardcode_libdir_separator_FC=: inherit_rpath_FC=yes link_all_deplibs_FC=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler ld_shlibs_FC=yes archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec_FC='-R$libdir' hardcode_direct_FC=yes hardcode_shlibpath_var_FC=no ;; newsos6) archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_FC=yes hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir' hardcode_libdir_separator_FC=: hardcode_shlibpath_var_FC=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then hardcode_direct_FC=yes hardcode_shlibpath_var_FC=no hardcode_direct_absolute_FC=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec_FC='$wl-rpath,$libdir' export_dynamic_flag_spec_FC='$wl-E' else archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec_FC='$wl-rpath,$libdir' fi else ld_shlibs_FC=no fi ;; os2*) hardcode_libdir_flag_spec_FC='-L$libdir' hardcode_minus_L_FC=yes allow_undefined_flag_FC=unsupported shrext_cmds=.dll archive_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' archive_expsym_cmds_FC='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' old_archive_From_new_cmds_FC='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' enable_shared_with_static_runtimes_FC=yes ;; osf3*) if test yes = "$GCC"; then allow_undefined_flag_FC=' $wl-expect_unresolved $wl\*' archive_cmds_FC='$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_FC=' -expect_unresolved \*' archive_cmds_FC='$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_FC='no' hardcode_libdir_flag_spec_FC='$wl-rpath $wl$libdir' hardcode_libdir_separator_FC=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then allow_undefined_flag_FC=' $wl-expect_unresolved $wl\*' archive_cmds_FC='$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_FC='$wl-rpath $wl$libdir' else allow_undefined_flag_FC=' -expect_unresolved \*' archive_cmds_FC='$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_FC='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_FC='-rpath $libdir' fi archive_cmds_need_lc_FC='no' hardcode_libdir_separator_FC=: ;; solaris*) no_undefined_flag_FC=' -z defs' if test yes = "$GCC"; then wlarc='$wl' archive_cmds_FC='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='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_FC='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds_FC='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_FC='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='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_FC='-R$libdir' hardcode_shlibpath_var_FC=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 yes = "$GCC"; then whole_archive_flag_spec_FC='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs_FC=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds_FC='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec_FC='-L$libdir' hardcode_direct_FC=yes hardcode_minus_L_FC=yes hardcode_shlibpath_var_FC=no ;; sysv4) case $host_vendor in sni) archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_FC=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds_FC='$CC -r -o $output$reload_objs' hardcode_direct_FC=no ;; motorola) archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var_FC=no ;; sysv4.3*) archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_FC=no export_dynamic_flag_spec_FC='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var_FC=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs_FC=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_FC='$wl-z,text' archive_cmds_need_lc_FC=no hardcode_shlibpath_var_FC=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds_FC='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_FC='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT 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_FC='$wl-z,text' allow_undefined_flag_FC='$wl-z,nodefs' archive_cmds_need_lc_FC=no hardcode_shlibpath_var_FC=no hardcode_libdir_flag_spec_FC='$wl-R,$libdir' hardcode_libdir_separator_FC=':' link_all_deplibs_FC=yes export_dynamic_flag_spec_FC='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then archive_cmds_FC='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds_FC='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_FC='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec_FC='-L$libdir' hardcode_shlibpath_var_FC=no ;; *) ld_shlibs_FC=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec_FC='$wl-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5 $as_echo "$ld_shlibs_FC" >&6; } test no = "$ld_shlibs_FC" && can_build_shared=no with_gnu_ld_FC=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_FC" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_FC=yes if test yes,yes = "$GCC,$enable_shared"; then case $archive_cmds_FC 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_FC+:} 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_FC pic_flag=$lt_prog_compiler_pic_FC compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_FC allow_undefined_flag_FC= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_FC 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_FC=no else lt_cv_archive_cmds_need_lc_FC=yes fi allow_undefined_flag_FC=$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_FC" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; } archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC ;; 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 ia64 = "$host_cpu"; 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 # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # 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' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a(lib.so.V)' # 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' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac 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%'\''`; $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$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' 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 ;; 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=no 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 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; 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 yes = "$lt_cv_prog_gnu_ld"; 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 ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # 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 dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. hardcode_libdir_flag_spec_FC='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | 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_FC\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\"" cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_fc_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 # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) 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* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi 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 shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec 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' ;; 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 yes = "$with_gnu_ld"; 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=sco 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 yes = "$with_gnu_ld"; 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 no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH { $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_FC= if test -n "$hardcode_libdir_flag_spec_FC" || test -n "$runpath_var_FC" || test yes = "$hardcode_automatic_FC"; then # We can hardcode non-existent directories. if test no != "$hardcode_direct_FC" && # 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 no != "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" && test no != "$hardcode_minus_L_FC"; then # Linking always hardcodes the temporary library directory. hardcode_action_FC=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_FC=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_FC=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5 $as_echo "$hardcode_action_FC" >&6; } if test relink = "$hardcode_action_FC" || test yes = "$inherit_rpath_FC"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: : ${CONFIG_LT=./config.lt} { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_LT" >&5 $as_echo "$as_me: creating $CONFIG_LT" >&6;} as_write_fail=0 cat >"$CONFIG_LT" <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>"$CONFIG_LT" <<\_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_LT" script. ## ## --------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x "$CONFIG_LT" cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 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="\ GetData config.lt 0.9.0 configured by $0, generated by GNU Autoconf 2.69. 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=: ;; -*) as_fn_error $? "unrecognized option: $1 Try '$0 --help' for more information." "$LINENO" 5 ;; *) as_fn_error $? "unrecognized argument: $1 Try '$0 --help' for more information." "$LINENO" 5 ;; esac shift done if $lt_cl_silent; then exec 6>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF # 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"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $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"`' 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"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $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_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $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"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $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"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $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"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $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"`' LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`' LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`' reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`' reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`' compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`' GCC_FC='`$ECHO "$GCC_FC" | $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_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $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"`' lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`' compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $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_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`' module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`' with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`' hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`' inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`' link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`' always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`' exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`' include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`' prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`' postlink_cmds_FC='`$ECHO "$postlink_cmds_FC" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`' file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`' hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`' predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`' postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`' predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`' postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $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 \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ 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_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ 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 \ LD_F77 \ LD_FC \ reload_flag_CXX \ reload_flag_F77 \ reload_flag_FC \ compiler_CXX \ compiler_F77 \ compiler_FC \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_no_builtin_flag_F77 \ lt_prog_compiler_no_builtin_flag_FC \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_pic_FC \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_wl_FC \ lt_prog_compiler_static_CXX \ lt_prog_compiler_static_F77 \ lt_prog_compiler_static_FC \ lt_cv_prog_compiler_c_o_CXX \ lt_cv_prog_compiler_c_o_F77 \ lt_cv_prog_compiler_c_o_FC \ export_dynamic_flag_spec_CXX \ export_dynamic_flag_spec_F77 \ export_dynamic_flag_spec_FC \ whole_archive_flag_spec_CXX \ whole_archive_flag_spec_F77 \ whole_archive_flag_spec_FC \ compiler_needs_object_CXX \ compiler_needs_object_F77 \ compiler_needs_object_FC \ with_gnu_ld_CXX \ with_gnu_ld_F77 \ with_gnu_ld_FC \ allow_undefined_flag_CXX \ allow_undefined_flag_F77 \ allow_undefined_flag_FC \ no_undefined_flag_CXX \ no_undefined_flag_F77 \ no_undefined_flag_FC \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_FC \ hardcode_libdir_separator_CXX \ hardcode_libdir_separator_F77 \ hardcode_libdir_separator_FC \ exclude_expsyms_CXX \ exclude_expsyms_F77 \ exclude_expsyms_FC \ include_expsyms_CXX \ include_expsyms_F77 \ include_expsyms_FC \ file_list_spec_CXX \ file_list_spec_F77 \ file_list_spec_FC \ compiler_lib_search_dirs_CXX \ compiler_lib_search_dirs_F77 \ compiler_lib_search_dirs_FC \ predep_objects_CXX \ predep_objects_F77 \ predep_objects_FC \ postdep_objects_CXX \ postdep_objects_F77 \ postdep_objects_FC \ predeps_CXX \ predeps_F77 \ predeps_FC \ postdeps_CXX \ postdeps_F77 \ postdeps_FC \ compiler_lib_search_path_CXX \ compiler_lib_search_path_F77 \ compiler_lib_search_path_FC; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ reload_cmds_F77 \ reload_cmds_FC \ old_archive_cmds_CXX \ old_archive_cmds_F77 \ old_archive_cmds_FC \ old_archive_from_new_cmds_CXX \ old_archive_from_new_cmds_F77 \ old_archive_from_new_cmds_FC \ old_archive_from_expsyms_cmds_CXX \ old_archive_from_expsyms_cmds_F77 \ old_archive_from_expsyms_cmds_FC \ archive_cmds_CXX \ archive_cmds_F77 \ archive_cmds_FC \ archive_expsym_cmds_CXX \ archive_expsym_cmds_F77 \ archive_expsym_cmds_FC \ module_cmds_CXX \ module_cmds_F77 \ module_cmds_FC \ module_expsym_cmds_CXX \ module_expsym_cmds_F77 \ module_expsym_cmds_FC \ export_symbols_cmds_CXX \ export_symbols_cmds_F77 \ export_symbols_cmds_FC \ prelink_cmds_CXX \ prelink_cmds_F77 \ prelink_cmds_FC \ postlink_cmds_CXX \ postlink_cmds_F77 \ postlink_cmds_FC; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that 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' RM='$RM' ofile='$ofile' _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ofile" >&5 $as_echo "$as_me: creating $ofile" >&6;} # See if we are running on zsh, and set the options that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX F77 FC ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### 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 # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # 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 # 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 # 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 # DLL creation program. DLLTOOL=$lt_DLLTOOL # 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 into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # 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 lister interface. nm_interface=$lt_lt_cv_nm_interface # 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 where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # 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 # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # 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 cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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) 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 cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: F77 # The linker used to build libraries. LD=$lt_LD_F77 # How to create reloadable object files. reload_flag=$lt_reload_flag_F77 reload_cmds=$lt_reload_cmds_F77 # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_F77 # A language specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU compiler? with_gcc=$GCC_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_F77 # 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 a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_F77 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # 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 # 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 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_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_F77 # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_F77 # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_F77 # Specify filename containing input files. file_list_spec=$lt_file_list_spec_F77 # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_F77 postdep_objects=$lt_postdep_objects_F77 predeps=$lt_predeps_F77 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 # ### END LIBTOOL TAG CONFIG: F77 _LT_EOF cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: FC # The linker used to build libraries. LD=$lt_LD_FC # How to create reloadable object files. reload_flag=$lt_reload_flag_FC reload_cmds=$lt_reload_cmds_FC # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_FC # A language specific compiler. CC=$lt_compiler_FC # Is the compiler the GNU compiler? with_gcc=$GCC_FC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_FC # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_FC # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_FC # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_FC # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_FC # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_FC archive_expsym_cmds=$lt_archive_expsym_cmds_FC # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_FC module_expsym_cmds=$lt_module_expsym_cmds_FC # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_FC # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_FC # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_FC # 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_FC # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_FC # 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_FC # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_FC # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_FC # 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_FC # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_FC # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_FC # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_FC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_FC # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_FC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_FC # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_FC # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_FC # Specify filename containing input files. file_list_spec=$lt_file_list_spec_FC # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_FC # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_FC postdep_objects=$lt_postdep_objects_FC predeps=$lt_predeps_FC postdeps=$lt_postdeps_FC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_FC # ### END LIBTOOL TAG CONFIG: FC _LT_EOF as_fn_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 yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec 5>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec 5>>config.log $lt_cl_success || as_fn_exit 1 if test "x${use_modules}" != "xno"; then echo echo "*** Configuring the dynamic loader" echo saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$ltdl_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$ltdl_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lt_dlinit in -lltdl" >&5 $as_echo_n "checking for lt_dlinit in -lltdl... " >&6; } if ${ac_cv_lib_ltdl_lt_dlinit+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lltdl $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 lt_dlinit (); int main () { return lt_dlinit (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ltdl_lt_dlinit=yes else ac_cv_lib_ltdl_lt_dlinit=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_ltdl_lt_dlinit" >&5 $as_echo "$ac_cv_lib_ltdl_lt_dlinit" >&6; } if test "x$ac_cv_lib_ltdl_lt_dlinit" = xyes; then : have_ltdl=yes else have_ltdl=no fi LDFLAGS=$saved_ldflags LIBS=$saved_libs if test "x$have_ltdl" == "xno"; then as_fn_error $? "libltdl is required to build modules. Please either specify the location of the libltdl library using --with-ldtl=PREFIX or else disable the building of modules by using --disable-modules." "$LINENO" 5 fi if test "x$ltdl_prefix" != "x"; then LIBLTDL="-L${ltdl_prefix}/lib -lltdl" LTDLINCL="-I${ltdl_prefix}/include" saved_cppflags=$CPPFLAGS CPPFLAGS="${CPPFLAGS} ${LTDLINCL}" for ac_header in ltdl.h do : ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" if test "x$ac_cv_header_ltdl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LTDL_H 1 _ACEOF fi done CPPFLAGS=$saved_cppflags else for ac_header in ltdl.h do : ac_fn_c_check_header_mongrel "$LINENO" "ltdl.h" "ac_cv_header_ltdl_h" "$ac_includes_default" if test "x$ac_cv_header_ltdl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LTDL_H 1 _ACEOF fi done LIBLTDL="-lltdl" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_mutex_lock" >&5 $as_echo_n "checking for library containing pthread_mutex_lock... " >&6; } if ${ac_cv_search_pthread_mutex_lock+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_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 pthread_mutex_lock (); int main () { return pthread_mutex_lock (); ; return 0; } _ACEOF for ac_lib in '' pthread; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_pthread_mutex_lock=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_pthread_mutex_lock+:} false; then : break fi done if ${ac_cv_search_pthread_mutex_lock+:} false; then : else ac_cv_search_pthread_mutex_lock=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pthread_mutex_lock" >&5 $as_echo "$ac_cv_search_pthread_mutex_lock" >&6; } ac_res=$ac_cv_search_pthread_mutex_lock if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" use_pthread=yes $as_echo "#define USE_PTHREAD /**/" >>confdefs.h else use_pthread=no fi for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF fi done fi if test "x$CXX" == "x"; then make_cxxbindings=no fi if test "x$F77" == "x"; then make_f77bindings=no make_f95bindings=no fi if test "x$FC" == "x"; then make_f95bindings=no fi echo echo "*** Checking additional compiler characteristics" echo { $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 for C/C++ restrict keyword" >&5 $as_echo_n "checking for C/C++ restrict keyword... " >&6; } if ${ac_cv_c_restrict+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_restrict=no # The order here caters to the fact that C++ does not require restrict. for ac_kw in __restrict __restrict__ _Restrict restrict; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ typedef int * int_ptr; int foo (int_ptr $ac_kw ip) { return ip[0]; } int main () { int s[1]; int * $ac_kw t = s; t[0] = 0; return foo(t) ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_restrict=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_restrict" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5 $as_echo "$ac_cv_c_restrict" >&6; } case $ac_cv_c_restrict in restrict) ;; no) $as_echo "#define restrict /**/" >>confdefs.h ;; *) cat >>confdefs.h <<_ACEOF #define restrict $ac_cv_c_restrict _ACEOF ;; esac if ! test "x$ac_cv_c_restrict" = "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether restrict can be applied to pointer array arguments" >&5 $as_echo_n "checking whether restrict can be applied to pointer array arguments... " >&6; } if ${gd_cv_c_restrict_array+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int *foo (int *restrict bar[3]) { return bar[2]; } int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_cv_c_restrict_array="yes" else gd_cv_c_restrict_array="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_c_restrict_array" >&5 $as_echo "$gd_cv_c_restrict_array" >&6; } fi if test "x$gd_cv_c_restrict_array" = "xyes"; then $as_echo "#define GD_RESTRICT_ARRAY_OK 1" >>confdefs.h fi gd_saved_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wall" >&5 $as_echo_n "checking whether $CC accepts -Wall... " >&6; } if ${gd_cv_prog_cc_wall+:} false; then : $as_echo_n "(cached) " >&6 else CFLAGS="-Wall" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_cv_prog_cc_wall=yes else gd_cv_prog_cc_wall=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cc_wall" >&5 $as_echo "$gd_cv_prog_cc_wall" >&6; } CFLAGS=$gd_saved_CFLAGS if test "x$gd_cv_prog_cc_wall" = "xyes"; then GD_CC_WALL=-Wall fi gd_saved_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -Wextra" >&5 $as_echo_n "checking whether $CC accepts -Wextra... " >&6; } if ${gd_cv_prog_cc_wextra+:} false; then : $as_echo_n "(cached) " >&6 else CFLAGS="-Wextra" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_cv_prog_cc_wextra=yes else gd_cv_prog_cc_wextra=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cc_wextra" >&5 $as_echo "$gd_cv_prog_cc_wextra" >&6; } CFLAGS=$gd_saved_CFLAGS if test "x$gd_cv_prog_cc_wextra" = "xyes"; then GD_CC_WEXTRA=-Wextra fi if test "x$make_cxxbindings" != "xno"; then gd_saved_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wall" >&5 $as_echo_n "checking whether $CXX accepts -Wall... " >&6; } if ${gd_cv_prog_cxx_wall+:} false; then : $as_echo_n "(cached) " >&6 else CXXFLAGS="-Wall" 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : gd_cv_prog_cxx_wall=yes else gd_cv_prog_cxx_wall=no fi rm -f core 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cxx_wall" >&5 $as_echo "$gd_cv_prog_cxx_wall" >&6; } CXXFLAGS=$gd_saved_CXXFLAGS if test "x$gd_cv_prog_cxx_wall" = "xyes"; then GD_CXX_WALL=-Wall fi gd_saved_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -Wextra" >&5 $as_echo_n "checking whether $CXX accepts -Wextra... " >&6; } if ${gd_cv_prog_cxx_wextra+:} false; then : $as_echo_n "(cached) " >&6 else CXXFLAGS="-Wextra" 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 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : gd_cv_prog_cxx_wextra=yes else gd_cv_prog_cxx_wextra=no fi rm -f core 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_cxx_wextra" >&5 $as_echo "$gd_cv_prog_cxx_wextra" >&6; } CXXFLAGS=$gd_saved_CXXFLAGS if test "x$gd_cv_prog_cxx_wextra" = "xyes"; then GD_CXX_WEXTRA=-Wextra fi fi if test "x$make_f77bindings" != "xno"; then gd_saved_FFLAGS=$FFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -Wall" >&5 $as_echo_n "checking whether $F77 accepts -Wall... " >&6; } if ${gd_cv_prog_f77_wall+:} false; then : $as_echo_n "(cached) " >&6 else FFLAGS="-Wall" 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 cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : gd_cv_prog_f77_wall=yes else gd_cv_prog_f77_wall=no fi rm -f core 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_f77_wall" >&5 $as_echo "$gd_cv_prog_f77_wall" >&6; } FFLAGS=$gd_saved_FFLAGS if test "x$gd_cv_prog_f77_wall" = "xyes"; then GD_F77_WALL=-Wall fi gd_saved_FFLAGS=$FFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -Wextra" >&5 $as_echo_n "checking whether $F77 accepts -Wextra... " >&6; } if ${gd_cv_prog_f77_wextra+:} false; then : $as_echo_n "(cached) " >&6 else FFLAGS="-Wextra" 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 cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : gd_cv_prog_f77_wextra=yes else gd_cv_prog_f77_wextra=no fi rm -f core 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_f77_wextra" >&5 $as_echo "$gd_cv_prog_f77_wextra" >&6; } FFLAGS=$gd_saved_FFLAGS if test "x$gd_cv_prog_f77_wextra" = "xyes"; then GD_F77_WEXTRA=-Wextra fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Intel Fortran-77 compiler" >&5 $as_echo_n "checking whether we are using the Intel Fortran-77 compiler... " >&6; } if ${gd_cv_f77_compiler_intel+:} false; then : $as_echo_n "(cached) " >&6 else if $F77 -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then gd_cv_f77_compiler_intel=yes else gd_cv_f77_compiler_intel=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_f77_compiler_intel" >&5 $as_echo "$gd_cv_f77_compiler_intel" >&6; } fi if test "x$make_f77bindings" != "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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get verbose linking output from $F77" >&5 $as_echo_n "checking how to get verbose linking output from $F77... " >&6; } if ${ac_cv_prog_f77_v+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : ac_cv_prog_f77_v= # Try some options frequently used verbose output for ac_verb in -v -verbose --verbose -V -\#\#\#; do cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_verb" eval "set x $ac_link" shift $as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` $as_echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac # look for -l* and *.a constructs in the output for ac_arg in $ac_f77_v_output; do case $ac_arg in [\\/]*.a | ?:[\\/]*.a | -[lLRu]*) ac_cv_prog_f77_v=$ac_verb break 2 ;; esac done done if test -z "$ac_cv_prog_f77_v"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine how to obtain linking information from $F77" >&5 $as_echo "$as_me: WARNING: cannot determine how to obtain linking information from $F77" >&2;} fi else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compilation failed" >&5 $as_echo "$as_me: WARNING: compilation failed" >&2;} fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_v" >&5 $as_echo "$ac_cv_prog_f77_v" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 libraries of $F77" >&5 $as_echo_n "checking for Fortran 77 libraries of $F77... " >&6; } if ${ac_cv_f77_libs+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$FLIBS" != "x"; then ac_cv_f77_libs="$FLIBS" # Let the user override the test. else cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF # Compile and link our simple test program by passing a flag (argument # 1 to this macro) to the Fortran compiler in order to get # "verbose" output that we can then parse for the Fortran linker # flags. ac_save_FFLAGS=$FFLAGS FFLAGS="$FFLAGS $ac_cv_prog_f77_v" eval "set x $ac_link" shift $as_echo "$as_me:${as_lineno-$LINENO}: $*" >&5 # gfortran 4.3 outputs lines setting COLLECT_GCC_OPTIONS, COMPILER_PATH, # LIBRARY_PATH; skip all such settings. ac_f77_v_output=`eval $ac_link 5>&1 2>&1 | sed '/^Driving:/d; /^Configured with:/d; '"/^[_$as_cr_Letters][_$as_cr_alnum]*=/d"` $as_echo "$ac_f77_v_output" >&5 FFLAGS=$ac_save_FFLAGS rm -rf conftest* # On HP/UX there is a line like: "LPATH is: /foo:/bar:/baz" where # /foo, /bar, and /baz are search directories for the Fortran linker. # Here, we change these into -L/foo -L/bar -L/baz (and put it first): ac_f77_v_output="`echo $ac_f77_v_output | grep 'LPATH is:' | sed 's|.*LPATH is\(: *[^ ]*\).*|\1|;s|: */| -L/|g'` $ac_f77_v_output" # FIXME: we keep getting bitten by quoted arguments; a more general fix # that detects unbalanced quotes in FLIBS should be implemented # and (ugh) tested at some point. case $ac_f77_v_output in # With xlf replace commas with spaces, # and remove "-link" and closing parenthesis. *xlfentry*) ac_f77_v_output=`echo $ac_f77_v_output | sed ' s/,/ /g s/ -link / /g s/) *$// ' ` ;; # With Intel ifc, ignore the quoted -mGLOB_options_string stuff (quoted # $LIBS confuse us, and the libraries appear later in the output anyway). *mGLOB_options_string*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"-mGLOB[^"]*"/ /g'` ;; # Portland Group compiler has singly- or doubly-quoted -cmdline argument # Singly-quoted arguments were reported for versions 5.2-4 and 6.0-4. # Doubly-quoted arguments were reported for "PGF90/x86 Linux/x86 5.0-2". *-cmdline\ * | *-ignore\ * | *-def\ *) ac_f77_v_output=`echo $ac_f77_v_output | sed "\ s/-cmdline *'[^']*'/ /g; s/-cmdline *\"[^\"]*\"/ /g s/-ignore *'[^']*'/ /g; s/-ignore *\"[^\"]*\"/ /g s/-def *'[^']*'/ /g; s/-def *\"[^\"]*\"/ /g"` ;; # If we are using fort77 (the f2c wrapper) then filter output and delete quotes. *fort77*f2c*gcc*) ac_f77_v_output=`echo "$ac_f77_v_output" | sed -n ' /:[ ]\+Running[ ]\{1,\}"gcc"/{ /"-c"/d /[.]c"*/d s/^.*"gcc"/"gcc"/ s/"//gp }'` ;; # If we are using Cray Fortran then delete quotes. *cft90*) ac_f77_v_output=`echo $ac_f77_v_output | sed 's/"//g'` ;; esac ac_cv_f77_libs= # Save positional arguments (if any) ac_save_positional="$@" set X $ac_f77_v_output while test $# != 1; do shift ac_arg=$1 case $ac_arg in [\\/]*.a | ?:[\\/]*.a) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -bI:*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_arg; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi fi ;; # Ignore these flags. -lang* | -lcrt*.o | -lc | -lgcc* | -lSystem | -libmil | -little \ |-LANG:=* | -LIST:* | -LNO:* | -link) ;; -lkernel32) case $host_os in *cygwin*) ;; *) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; esac ;; -[LRuYz]) # These flags, when seen by themselves, take an argument. # We remove the space between option and argument and re-iterate # unless we find an empty arg or a new option (starting with -) case $2 in "" | -*);; *) ac_arg="$ac_arg$2" shift; shift set X $ac_arg "$@" ;; esac ;; -YP,*) for ac_j in `$as_echo "$ac_arg" | sed -e 's/-YP,/-L/;s/:/ -L/g'`; do ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_j" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_arg="$ac_arg $ac_j" ac_cv_f77_libs="$ac_cv_f77_libs $ac_j" fi done ;; -[lLR]*) ac_exists=false for ac_i in $ac_cv_f77_libs; do if test x"$ac_arg" = x"$ac_i"; then ac_exists=true break fi done if test x"$ac_exists" = xtrue; then : else ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" fi ;; -zallextract*| -zdefaultextract) ac_cv_f77_libs="$ac_cv_f77_libs $ac_arg" ;; # Ignore everything else. esac done # restore positional arguments set X $ac_save_positional; shift # We only consider "LD_RUN_PATH" on Solaris systems. If this is seen, # then we insist that the "run path" must be an absolute path (i.e. it # must begin with a "/"). case `(uname -sr) 2>/dev/null` in "SunOS 5"*) ac_ld_run_path=`$as_echo "$ac_f77_v_output" | sed -n 's,^.*LD_RUN_PATH *= *\(/[^ ]*\).*$,-R\1,p'` test "x$ac_ld_run_path" != x && if test "$ac_compiler_gnu" = yes; then for ac_link_opt in $ac_ld_run_path; do ac_cv_f77_libs="$ac_cv_f77_libs -Xlinker $ac_link_opt" done else ac_cv_f77_libs="$ac_cv_f77_libs $ac_ld_run_path" fi ;; esac fi # test "x$[]_AC_LANG_PREFIX[]LIBS" = "x" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_libs" >&5 $as_echo "$ac_cv_f77_libs" >&6; } FLIBS="$ac_cv_f77_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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dummy main to link with Fortran 77 libraries" >&5 $as_echo_n "checking for dummy main to link with Fortran 77 libraries... " >&6; } if ${ac_cv_f77_dummy_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_f77_dm_save_LIBS=$LIBS LIBS="$LIBS $FLIBS" ac_fortran_dm_var=F77_DUMMY_MAIN 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 # First, try linking without a dummy main: cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_fortran_dummy_main=none else ac_cv_fortran_dummy_main=unknown fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test $ac_cv_fortran_dummy_main = unknown; then for ac_func in MAIN__ MAIN_ __main MAIN _MAIN __MAIN main_ main__ _main; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define $ac_fortran_dm_var $ac_func #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_fortran_dummy_main=$ac_func; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done 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 ac_cv_f77_dummy_main=$ac_cv_fortran_dummy_main rm -rf conftest* LIBS=$ac_f77_dm_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_dummy_main" >&5 $as_echo "$ac_cv_f77_dummy_main" >&6; } F77_DUMMY_MAIN=$ac_cv_f77_dummy_main if test "$F77_DUMMY_MAIN" != unknown; then : if test $F77_DUMMY_MAIN != none; then cat >>confdefs.h <<_ACEOF #define F77_DUMMY_MAIN $F77_DUMMY_MAIN _ACEOF if test "x$ac_cv_fc_dummy_main" = "x$ac_cv_f77_dummy_main"; then $as_echo "#define FC_DUMMY_MAIN_EQ_F77 1" >>confdefs.h fi fi 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 $? "linking to Fortran libraries from C fails 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 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 name-mangling scheme" >&5 $as_echo_n "checking for Fortran 77 name-mangling scheme... " >&6; } if ${ac_cv_f77_mangling+:} false; then : $as_echo_n "(cached) " >&6 else cat > conftest.$ac_ext <<_ACEOF subroutine foobar() return end subroutine foo_bar() return end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : mv conftest.$ac_objext cfortran_test.$ac_objext ac_save_LIBS=$LIBS LIBS="cfortran_test.$ac_objext $LIBS $FLIBS" 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_success=no for ac_foobar in foobar FOOBAR; do for ac_underscore in "" "_"; do ac_func="$ac_foobar$ac_underscore" 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 $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_success=yes; break 2 fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done done 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 "$ac_success" = "yes"; then case $ac_foobar in foobar) ac_case=lower ac_foo_bar=foo_bar ;; FOOBAR) ac_case=upper ac_foo_bar=FOO_BAR ;; 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 ac_success_extra=no for ac_extra in "" "_"; do ac_func="$ac_foo_bar$ac_underscore$ac_extra" 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 $ac_func (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return $ac_func (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_success_extra=yes; break fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done 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 "$ac_success_extra" = "yes"; then ac_cv_f77_mangling="$ac_case case" if test -z "$ac_underscore"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, underscore" fi if test -z "$ac_extra"; then ac_cv_f77_mangling="$ac_cv_f77_mangling, no extra underscore" else ac_cv_f77_mangling="$ac_cv_f77_mangling, extra underscore" fi else ac_cv_f77_mangling="unknown" fi else ac_cv_f77_mangling="unknown" fi LIBS=$ac_save_LIBS rm -rf conftest* rm -f cfortran_test* 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 compile a simple Fortran program See \`config.log' for more details" "$LINENO" 5; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_mangling" >&5 $as_echo "$ac_cv_f77_mangling" >&6; } 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=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 case $ac_cv_f77_mangling in "lower case, no underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name" >>confdefs.h ;; "lower case, no underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) name" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name ## _" >>confdefs.h ;; "lower case, underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) name ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) name ## __" >>confdefs.h ;; "upper case, no underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME" >>confdefs.h ;; "upper case, no underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, no extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME ## _" >>confdefs.h ;; "upper case, underscore, extra underscore") $as_echo "#define F77_FUNC(name,NAME) NAME ## _" >>confdefs.h $as_echo "#define F77_FUNC_(name,NAME) NAME ## __" >>confdefs.h ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unknown Fortran name-mangling scheme" >&5 $as_echo "$as_me: WARNING: unknown Fortran name-mangling scheme" >&2;} ;; 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 "x$ac_cv_f77_mangling" == "xunknown"; then make_f77bindings=no make_f95bindings=no fi fi if test "x$make_f95bindings" != "xno"; then gd_saved_FCFLAGS=$FCFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -Wall" >&5 $as_echo_n "checking whether $FC accepts -Wall... " >&6; } if ${gd_cv_prog_fc_wall+:} false; then : $as_echo_n "(cached) " >&6 else FCFLAGS="-Wall" 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 cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : gd_cv_prog_fc_wall=yes else gd_cv_prog_fc_wall=no fi rm -f core 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_fc_wall" >&5 $as_echo "$gd_cv_prog_fc_wall" >&6; } FCFLAGS=$gd_saved_FCFLAGS if test "x$gd_cv_prog_fc_wall" = "xyes"; then GD_FC_WALL=-Wall fi gd_saved_FCFLAGS=$FCFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -Wextra" >&5 $as_echo_n "checking whether $FC accepts -Wextra... " >&6; } if ${gd_cv_prog_fc_wextra+:} false; then : $as_echo_n "(cached) " >&6 else FCFLAGS="-Wextra" 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 cat > conftest.$ac_ext <<_ACEOF program main end _ACEOF if ac_fn_f77_try_compile "$LINENO"; then : gd_cv_prog_fc_wextra=yes else gd_cv_prog_fc_wextra=no fi rm -f core 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_prog_fc_wextra" >&5 $as_echo "$gd_cv_prog_fc_wextra" >&6; } FCFLAGS=$gd_saved_FCFLAGS if test "x$gd_cv_prog_fc_wextra" = "xyes"; then GD_FC_WEXTRA=-Wextra fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the Intel Fortran compiler" >&5 $as_echo_n "checking whether we are using the Intel Fortran compiler... " >&6; } if ${gd_cv_fc_compiler_intel+:} false; then : $as_echo_n "(cached) " >&6 else if $FC -help 2>/dev/null | grep -q 'Intel.R. Fortran Compiler'; then gd_cv_fc_compiler_intel=yes else gd_cv_fc_compiler_intel=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_fc_compiler_intel" >&5 $as_echo "$gd_cv_fc_compiler_intel" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we're linking against the Microsoft C Run-Time" >&5 $as_echo_n "checking if we're linking against the Microsoft C Run-Time... " >&6; } #' cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __MSVCRT__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_msvcrt=yes else gd_msvcrt=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_msvcrt" >&5 $as_echo "$gd_msvcrt" >&6; } if test "$gd_msvcrt" = "yes"; then $as_echo "#define __MSVCRT_VERSION__ 0x601" >>confdefs.h fi echo echo "*** Looking for additional libraries" echo { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ceil" >&5 $as_echo_n "checking for library containing ceil... " >&6; } if ${ac_cv_search_ceil+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_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 ceil (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return ceil (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_ceil=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_ceil+:} false; then : break fi done if ${ac_cv_search_ceil+:} false; then : else ac_cv_search_ceil=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ceil" >&5 $as_echo "$ac_cv_search_ceil" >&6; } ac_res=$ac_cv_search_ceil if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi echo echo "*** Looking for additional header files" echo for ac_header in asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \ float.h inttypes.h io.h libgen.h libkern/OSByteOrder.h \ math.h stddef.h stdint.h sys/endian.h sys/file.h sys/param.h \ sys/resource.h sys/stat.h sys/time.h sys/types.h sys/wait.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 if test "x$disable_c99" = "xno"; then for ac_header in complex.h do : ac_fn_c_check_header_mongrel "$LINENO" "complex.h" "ac_cv_header_complex_h" "$ac_includes_default" if test "x$ac_cv_header_complex_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_COMPLEX_H 1 _ACEOF fi done fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 $as_echo_n "checking for $ac_hdr that defines DIR... " >&6; } if eval \${$as_ac_Header+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$as_ac_Header=yes" else eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$as_ac_Header { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_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 opendir (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' dir; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opendir" >&5 $as_echo_n "checking for library containing opendir... " >&6; } if ${ac_cv_search_opendir+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_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 opendir (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return opendir (); ; return 0; } _ACEOF for ac_lib in '' x; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_opendir=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_opendir+:} false; then : break fi done if ${ac_cv_search_opendir+:} false; then : else ac_cv_search_opendir=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 $as_echo "$ac_cv_search_opendir" >&6; } ac_res=$ac_cv_search_opendir if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi fi echo echo "*** Checking data types" echo { $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. */ #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking floating point endianness" >&5 $as_echo_n "checking floating point endianness... " >&6; } if ${gd_cv_c_floatordering+:} false; then : $as_echo_n "(cached) " >&6 else gd_cv_c_floatordering=unknown # check for arm middle endianness cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if ! (defined __arm__ && ! (defined __VFP_FP__ || defined __MAVERICK___)) not arm middle endian #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_cv_c_floatordering=arm else # not middle-endian arm, check for __FLOAT_WORD_ORDER cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifndef __FLOAT_WORD_ORDER no __FLOAT_WORD_ORDER defined #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : # __FLOAT_WORD_ORDER is defined; is it BIG_ENDIAN? cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #if __FLOAT_WORD_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_cv_c_floatordering="big" else gd_cv_c_floatordering="little" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # no __FLOAT_WORD_ORDER defined; so we just assume it's the same as the # integer ordering cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef WORDS_BIGENDIAN not big endian #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_cv_c_floatordering="big" else gd_cv_c_floatordering="little" 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_cv_c_floatordering" >&5 $as_echo "$gd_cv_c_floatordering" >&6; } if test $gd_cv_c_floatordering = "arm"; then $as_echo "#define ARM_ENDIAN_DOUBLES 1" >>confdefs.h elif test $gd_cv_c_floatordering = "big"; then $as_echo "#define FLOATS_BIGENDIAN 1" >>confdefs.h fi ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" case $ac_cv_c_int8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int8_t $ac_cv_c_int8_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" case $ac_cv_c_int64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi 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 ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" case $ac_cv_c_uint64_t in #( no|yes) ;; #( *) $as_echo "#define _UINT64_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint64_t $ac_cv_c_uint64_t _ACEOF ;; esac if test "x$disable_c99" = "xno"; then ac_fn_c_check_type "$LINENO" "_Complex float" "ac_cv_type__Complex_float" "$ac_includes_default" if test "x$ac_cv_type__Complex_float" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__COMPLEX_FLOAT 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "_Complex double" "ac_cv_type__Complex_double" "$ac_includes_default" if test "x$ac_cv_type__Complex_double" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__COMPLEX_DOUBLE 1 _ACEOF fi fi ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "$ac_includes_default" if test "x$ac_cv_type_struct_stat64" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT64 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "struct _stat64" "ac_cv_type_struct__stat64" "$ac_includes_default" if test "x$ac_cv_type_struct__stat64" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT__STAT64 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "struct __stat64" "ac_cv_type_struct___stat64" "$ac_includes_default" if test "x$ac_cv_type_struct___stat64" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT___STAT64 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "off64_t" "ac_cv_type_off64_t" "$ac_includes_default" if test "x$ac_cv_type_off64_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_OFF64_T 1 _ACEOF fi # 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 off_t" >&5 $as_echo_n "checking size of off_t... " >&6; } if ${ac_cv_sizeof_off_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default"; then : else if test "$ac_cv_type_off_t" = 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 (off_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 $as_echo "$ac_cv_sizeof_off_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_OFF_T $ac_cv_sizeof_off_t _ACEOF # 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 size_t" >&5 $as_echo_n "checking size of size_t... " >&6; } if ${ac_cv_sizeof_size_t+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (size_t))" "ac_cv_sizeof_size_t" "$ac_includes_default"; then : else if test "$ac_cv_type_size_t" = 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 (size_t) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_size_t=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_size_t" >&5 $as_echo "$ac_cv_sizeof_size_t" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SIZE_T $ac_cv_sizeof_size_t _ACEOF # 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 short int" >&5 $as_echo_n "checking size of short int... " >&6; } if ${ac_cv_sizeof_short_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int" "$ac_includes_default"; then : else if test "$ac_cv_type_short_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 (short int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short_int" >&5 $as_echo "$ac_cv_sizeof_short_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT_INT $ac_cv_sizeof_short_int _ACEOF # 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 int" >&5 $as_echo_n "checking size of int... " >&6; } if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : else if test "$ac_cv_type_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 (int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 $as_echo "$ac_cv_sizeof_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF # 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 long int" >&5 $as_echo_n "checking size of long int... " >&6; } if ${ac_cv_sizeof_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_long_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 (long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_int" >&5 $as_echo "$ac_cv_sizeof_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_INT $ac_cv_sizeof_long_int _ACEOF # 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 long long int" >&5 $as_echo_n "checking size of long long int... " >&6; } if ${ac_cv_sizeof_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_long_long_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 (long long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long_int" >&5 $as_echo "$ac_cv_sizeof_long_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG_LONG_INT $ac_cv_sizeof_long_long_int _ACEOF # 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 int" >&5 $as_echo_n "checking size of unsigned short int... " >&6; } if ${ac_cv_sizeof_unsigned_short_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned short int))" "ac_cv_sizeof_unsigned_short_int" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_short_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 short int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_short_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_short_int" >&5 $as_echo "$ac_cv_sizeof_unsigned_short_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_SHORT_INT $ac_cv_sizeof_unsigned_short_int _ACEOF # 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 # 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 int" >&5 $as_echo_n "checking size of unsigned long int... " >&6; } if ${ac_cv_sizeof_unsigned_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long int))" "ac_cv_sizeof_unsigned_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_long_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 long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_int" >&5 $as_echo "$ac_cv_sizeof_unsigned_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_INT $ac_cv_sizeof_unsigned_long_int _ACEOF # 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 int" >&5 $as_echo_n "checking size of unsigned long long int... " >&6; } if ${ac_cv_sizeof_unsigned_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (unsigned long long int))" "ac_cv_sizeof_unsigned_long_long_int" "$ac_includes_default"; then : else if test "$ac_cv_type_unsigned_long_long_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 long long int) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_unsigned_long_long_int=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_unsigned_long_long_int" >&5 $as_echo "$ac_cv_sizeof_unsigned_long_long_int" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_UNSIGNED_LONG_LONG_INT $ac_cv_sizeof_unsigned_long_long_int _ACEOF # 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 void *" >&5 $as_echo_n "checking size of void *... " >&6; } if ${ac_cv_sizeof_void_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void *))" "ac_cv_sizeof_void_p" "$ac_includes_default"; then : else if test "$ac_cv_type_void_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 (void *) See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_void_p=0 fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_void_p" >&5 $as_echo "$ac_cv_sizeof_void_p" >&6; } cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF if test $ac_cv_sizeof_int -eq 2; then gd_int16_t="int" elif test $ac_cv_sizeof_short_int -eq 2; then gd_int16_t="short int" elif test $ac_cv_sizeof_long_int -eq 2; then gd_int16_t="long int" elif test $ac_cv_sizeof_long_long_int -eq 2; then gd_int16_t="long long int" fi if test $ac_cv_sizeof_unsigned_int -eq 2; then gd_uint16_t="unsigned int" elif test $ac_cv_sizeof_unsigned_short_int -eq 2; then gd_uint16_t="unsigned short int" elif test $ac_cv_sizeof_unsigned_long_int -eq 2; then gd_uint16_t="unsigned long int" elif test $ac_cv_sizeof_unsigned_long_long_int -eq 2; then gd_uint16_t="unsigned long long int" fi if test $ac_cv_sizeof_int -eq 8; then gd_int64_t="int" elif test $ac_cv_sizeof_short_int -eq 8; then gd_int64_t="short int" elif test $ac_cv_sizeof_long_int -eq 8; then gd_int64_t="long int" elif test $ac_cv_sizeof_long_long_int -eq 8; then gd_int64_t="long long int" fi if test $ac_cv_sizeof_unsigned_int -eq 8; then gd_uint64_t="unsigned int" elif test $ac_cv_sizeof_unsigned_short_int -eq 8; then gd_uint64_t="unsigned short int" elif test $ac_cv_sizeof_unsigned_long_int -eq 8; then gd_uint64_t="unsigned long int" elif test $ac_cv_sizeof_unsigned_long_long_int -eq 8; then gd_uint64_t="unsigned long long int" fi if test "x$gd_cv_type_off64_t" = "xyes"; then $as_echo "#define HAVE_OFF64_T 1" >>confdefs.h fi DEFINE_gd_int16_t="# define gd_int16_t $gd_int16_t"; DEFINE_gd_uint16_t="# define gd_uint16_t $gd_uint16_t"; DEFINE_gd_int64_t="# define gd_int64_t $gd_int64_t"; DEFINE_gd_uint64_t="# define gd_uint64_t $gd_uint64_t"; echo echo "*** Looking for additional library functions" echo for ac_func in basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \ _finite fpathconf fseeko fseeko64 _fstat fstat64 _fstat64 \ fstatat fstatat64 fsync ftello ftello64 ftruncate ftruncate64 \ getcwd _getcwd getdelim gmtime_r isnan _isnan lseek64 \ _lseeki64 lstat lstat64 _mkdir mkfifo nan _open openat \ pathconf _read readdir_r readlink renameat _rmdir setrlimit \ snprintf _snprintf stat64 _stat64 _strtoi64 strtoll strtoq \ _strtoui64 strtoull strtouq symlink _unlink unlinkat _write 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 if test "x$disable_c99" = "xno"; then for ac_func in cabs do : ac_fn_c_check_func "$LINENO" "cabs" "ac_cv_func_cabs" if test "x$ac_cv_func_cabs" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CABS 1 _ACEOF fi done fi ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" if test "x$ac_cv_have_decl_strerror_r" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_STRERROR_R $ac_have_decl _ACEOF for ac_func in strerror_r do : ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r" if test "x$ac_cv_func_strerror_r" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR_R 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5 $as_echo_n "checking whether strerror_r returns char *... " >&6; } if ${ac_cv_func_strerror_r_char_p+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_func_strerror_r_char_p=no if test $ac_cv_have_decl_strerror_r = yes; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); char *p = strerror_r (0, buf, sizeof buf); return !p || x; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_strerror_r_char_p=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else # strerror_r is not declared. Choose between # systems that have relatively inaccessible declarations for the # function. BeOS and DEC UNIX 4.0 fall in this category, but the # former has a strerror_r that returns char*, while the latter # has a strerror_r that returns `int'. # This test should segfault on the DEC system. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default extern char *strerror_r (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { char buf[100]; char x = *strerror_r (0, buf, sizeof buf); return ! isalpha (x); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strerror_r_char_p=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_func_strerror_r_char_p" >&5 $as_echo "$ac_cv_func_strerror_r_char_p" >&6; } if test $ac_cv_func_strerror_r_char_p = yes; then $as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork 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 if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mkdir accepts two arguments" >&5 $as_echo_n "checking whether mkdir accepts two arguments... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_SYS_STAT_H #include #endif #if HAVE_SYS_TYPES_H #include #endif #if HAVE_IO_H #include #endif #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { #ifdef HAVE__MKDIR _mkdir("x", 00777); #else mkdir("x", 00777); #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : gd_2arg_mkdir=yes else gd_2arg_mkdir=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gd_2arg_mkdir" >&5 $as_echo "$gd_2arg_mkdir" >&6; } if test $gd_2arg_mkdir = "no"; then $as_echo "#define MKDIR_NO_MODE 1" >>confdefs.h fi ac_fn_c_check_decl "$LINENO" "isfinite" "ac_cv_have_decl_isfinite" " #ifdef HAVE_MATH_H #include #endif " if test "x$ac_cv_have_decl_isfinite" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_ISFINITE $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "_strtoi64" "ac_cv_have_decl__strtoi64" " #ifdef STDC_HEADERS #include #endif " if test "x$ac_cv_have_decl__strtoi64" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__STRTOI64 $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "_strtoui64" "ac_cv_have_decl__strtoui64" " #ifdef STDC_HEADERS #include #endif " if test "x$ac_cv_have_decl__strtoui64" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL__STRTOUI64 $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "bswap16" "ac_cv_have_decl_bswap16" " #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_LIBKERN_OSBYTEORDER_H #include #endif " if test "x$ac_cv_have_decl_bswap16" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_BSWAP16 $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "bswap_16" "ac_cv_have_decl_bswap_16" " #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_LIBKERN_OSBYTEORDER_H #include #endif " if test "x$ac_cv_have_decl_bswap_16" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_BSWAP_16 $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "OSSwapInt16" "ac_cv_have_decl_OSSwapInt16" " #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_LIBKERN_OSBYTEORDER_H #include #endif " if test "x$ac_cv_have_decl_OSSwapInt16" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_OSSWAPINT16 $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "get_unaligned" "ac_cv_have_decl_get_unaligned" " #ifdef HAVE_ASM_UNALIGNED_H #include #endif " if test "x$ac_cv_have_decl_get_unaligned" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_GET_UNALIGNED $ac_have_decl _ACEOF ac_fn_c_check_decl "$LINENO" "put_unaligned" "ac_cv_have_decl_put_unaligned" " #ifdef HAVE_ASM_UNALIGNED_H #include #endif " if test "x$ac_cv_have_decl_put_unaligned" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_PUT_UNALIGNED $ac_have_decl _ACEOF if test "x$make_idlbindings" = "xyes"; then echo echo "*** Configuring interactive data language (IDL) bindings" echo { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C99 is supported" >&5 $as_echo_n "checking whether C99 is supported... " >&6; } if test "x$disable_c99" = "xno"; 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; } make_idlbindings=no fi fi if test "x$make_idlbindings" = "xyes"; then idl_min_version=5.5 # Check whether --with-idl was given. if test "${with_idl+set}" = set; then : withval=$with_idl; case "${withval}" in no) have_idl="no" ;; yes) user_idl= ; have_idl= ;; *) user_idl="${withval}"; have_idl= ;; esac else user_idl=; have_idl= fi # Check whether --with-idl-dlm-dir was given. if test "${with_idl_dlm_dir+set}" = set; then : withval=$with_idl_dlm_dir; case "${withval}" in no) local_idl_dlm_path= ;; *) local_idl_dlm_path="${withval}" esac else local_idl_dlm_path= fi if test "x${have_idl}" != "xno"; then if test "x$user_idl" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $user_idl is an IDL interpreter version >= $idl_min_version" >&5 $as_echo_n "checking whether $user_idl is an IDL interpreter version >= $idl_min_version... " >&6; } idl_version_ok="no" idl_header=`( echo | $user_idl 2>&1 )` #'' IDL_VERSION="unknown" if echo $idl_header | grep -q "IDL Version"; then IDL_VERSION=`echo $idl_header | grep Version | sed -e 's/IDL Version \([^ ]*\).*/\1/'` #' # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$IDL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "$idl_min_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` if test "$ax_compare_version" = "true" ; then idl_version_ok="yes" fi fi if test "x$idl_version_ok" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } IDL=$user_idl true else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } IDL="not found" true fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an IDL interpreter version >= $idl_min_version" >&5 $as_echo_n "checking for an IDL interpreter version >= $idl_min_version... " >&6; } IDL="not found" for prog in idl idl7 idl6 idl5; do as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$prog$exec_ext"; then idl_version_ok="no" idl_header=`( echo | "$as_dir/$prog$exec_ext" 2>&1 )` #'' IDL_VERSION="unknown" if echo $idl_header | grep -q "IDL Version"; then IDL_VERSION=`echo $idl_header | grep Version | sed -e 's/IDL Version \([^ ]*\).*/\1/'` #' # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$IDL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "$idl_min_version" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` if test "$ax_compare_version" = "true" ; then idl_version_ok="yes" fi fi if test "x$idl_version_ok" = "xyes"; then IDL="$as_dir/$prog$exec_ext"; break 3 true else true fi fi done done IFS=$as_save_IFS done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL" >&5 $as_echo "$IDL" >&6; } fi if test "x$IDL" = "xnot found"; then have_idl="no" IDL= fi fi if test "x${have_idl}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking $IDL version" >&5 $as_echo_n "checking $IDL version... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL_VERSION" >&5 $as_echo "$IDL_VERSION" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $IDL DLM directory" >&5 $as_echo_n "checking for $IDL DLM directory... " >&6; } if test "x${local_idl_dlm_path}" = "x"; then idldir=`(echo 'print,"@@@"+!DLM_PATH' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@\([^:]*\)/\1/'` else idldir="$local_idl_dlm_path" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $idldir" >&5 $as_echo "$idldir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking IDL compiler flags" >&5 $as_echo_n "checking IDL compiler flags... " >&6; } IDL_CFLAGS=`(echo 'print,"@@@"+!MAKE_DLL.CC' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@.*%X \(.*\) %C.*/\1/' | sed -e 's/\(.* \)-c\(.*\)/\1\2/' | sed -e 's/"//g'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL_CFLAGS" >&5 $as_echo "$IDL_CFLAGS" >&6; } IDL_LIBS=`(echo 'print,"@@@"+!MAKE_DLL.LD' | $IDL 2>&1) | $GREP '@@@' | sed -e 's/@@@[^ ]* \(.*\?\) -o.*/\1/' | sed -e 's/-m \?\w*//g'` { $as_echo "$as_me:${as_lineno-$LINENO}: checking IDL linker flags" >&5 $as_echo_n "checking IDL linker flags... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IDL_LIBS" >&5 $as_echo "$IDL_LIBS" >&6; } saved_CPPFLAGS=${CPPFLAGS} CPPFLAGS="${CPPFLAGS} ${IDL_CFLAGS}" for ac_header in idl_export.h do : ac_fn_c_check_header_mongrel "$LINENO" "idl_export.h" "ac_cv_header_idl_export_h" "$ac_includes_default" if test "x$ac_cv_header_idl_export_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_IDL_EXPORT_H 1 _ACEOF else have_idl="no" fi done CPPFLAGS=${saved_CPPFLAGS} fi if test "x$have_idl" = "xno"; then make_idlbindings="no" fi fi if test "x$make_matlabbindings" = "xyes"; then echo echo "*** Configuring MATLAB bindings" echo # Check whether --with-matlab was given. if test "${with_matlab+set}" = set; then : withval=$with_matlab; case "${withval}" in no) have_matlab="no" ;; yes) user_matlab= ; have_matlab= ;; *) user_matlab="${withval}"; have_matlab= ;; esac else user_matlab=; have_matlab= fi if test "x${have_matlab}" != "xno"; then # Check whether --with-mex was given. if test "${with_mex+set}" = set; then : withval=$with_mex; case "${withval}" in no) have_matlab="no" ;; yes) user_mex= ;; *) user_mex="${withval}";; esac else user_mex= fi MEX="not found" if test "x$user_mex" != "x"; then MEX=$user_mex else # Extract the first word of "mex", so it can be a program name with args. set dummy mex; 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_path_MEX+:} false; then : $as_echo_n "(cached) " >&6 else case $MEX in [\\/]* | ?:[\\/]*) ac_cv_path_MEX="$MEX" # Let the user override the test with a path. ;; *) 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_path_MEX="$as_dir/$ac_word$ac_exec_ext" $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_path_MEX" && ac_cv_path_MEX="not found" ;; esac fi MEX=$ac_cv_path_MEX if test -n "$MEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MEX" >&5 $as_echo "$MEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$MEX" != "xnot found"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MEX is a MATLAB mex compiler" >&5 $as_echo_n "checking if $MEX is a MATLAB mex compiler... " >&6; } mex_out=`$MEX 2>&1` mex_status=$? if test $mex_status -eq 1; then if ! echo $mex_out | grep -q 'consult the MATLAB External Interfaces Guide'; then MEX="not found"; fi fi if test "x$MEX" = "xnot found"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi fi if test "x$MEX" = "xnot found"; then have_matlab="no" MEX= fi fi if test "x${have_matlab}" != "xno"; then if test "x$user_matlab" != "x"; then MATLAB=$user_matlab; else # Extract the first word of "matlab", so it can be a program name with args. set dummy matlab; 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_path_MATLAB+:} false; then : $as_echo_n "(cached) " >&6 else case $MATLAB in [\\/]* | ?:[\\/]*) ac_cv_path_MATLAB="$MATLAB" # Let the user override the test with a path. ;; *) 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_path_MATLAB="$as_dir/$ac_word$ac_exec_ext" $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_path_MATLAB" && ac_cv_path_MATLAB="not found" ;; esac fi MATLAB=$ac_cv_path_MATLAB if test -n "$MATLAB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB" >&5 $as_echo "$MATLAB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test "x$MATLAB" != "xnot found"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking $MATLAB version" >&5 $as_echo_n "checking $MATLAB version... " >&6; } matlab_int=$MATLAB MATLAB_VERSION=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', version); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print $2 }'` if test "x$MATLAB_VERSION" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } MATLAB="not found" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB_VERSION" >&5 $as_echo "$MATLAB_VERSION" >&6; } fi fi if test "x$MATLAB" = "xnot found"; then have_matlab=no MATLAB= fi fi if test "x${have_matlab}" != "xno"; then default_matlabbasedir=$libdir/getdata/matlab # Check whether --with-matlab-dir was given. if test "${with_matlab_dir+set}" = set; then : withval=$with_matlab_dir; case "${withval}" in no) matlabbasedir=$default_matlabbasedir ;; *) matlabbasedir="${withval}" ;; esac else matlabbasedir=$default_matlabbasedir fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking matlab install directory" >&5 $as_echo_n "checking matlab install directory... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $matlabbasedir" >&5 $as_echo "$matlabbasedir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking MEX extension" >&5 $as_echo_n "checking MEX extension... " >&6; } matlab_int=$MATLAB mexext=`$matlab_int -nodisplay -nosplash -nojvm -nodesktop -r "fprintf(2, '@@@%s@@@\n', mexext); quit" 2>&1 >/dev/null | ${AWK} 'BEGIN { FS="@@@" } /^@@@/ { print $2 }'` { $as_echo "$as_me:${as_lineno-$LINENO}: result: .$mexext" >&5 $as_echo ".$mexext" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking MatLab CPPFLAGS" >&5 $as_echo_n "checking MatLab CPPFLAGS... " >&6; } matlab_prefix=`$MEX -v 2>/dev/null | ${AWK} '/MATLAB *=/ { print $4 }'` MATLAB_CPPFLAGS="-I${matlab_prefix}/extern/include" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MATLAB_CPPFLAGS" >&5 $as_echo "$MATLAB_CPPFLAGS" >&6; } fi if test "x$have_matlab" = "xno"; then make_matlabbindings=no fi fi if test "x$make_perlbindings" = "xyes"; then echo echo "*** Configuring Perl bindings" echo first_perl=5.8.0 perl_prog_list="perl perl5 \ perl5.14 perl5.12 perl5.10 perl5.8 \ perl5.14.0 \ perl5.12.3 perl5.12.2 perl5.12.1 perl5.12.0 \ perl5.10.1 perl5.10.0 \ perl5.8.9 perl5.8.8 perl5.8.7 perl5.8.6 perl5.8.5 perl5.8.4 perl5.8.3 \ perl5.8.2 perl5.8.1 perl5.8.0" # Check whether --with-perl was given. if test "${with_perl+set}" = set; then : withval=$with_perl; case "${withval}" in no) have_perl="no" ;; yes) user_perl= ; have_perl= ;; *) user_perl="${withval}"; have_perl= ;; esac else user_perl=; have_perl= fi if test "x${have_perl}" != "xno"; then if test "x$user_perl" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $user_perl version >= $first_perl" >&5 $as_echo_n "checking whether $user_perl version >= $first_perl... " >&6; } perl_version_ok="no" perl_int=$user_perl # 3=$user_perl PERL_VERSION=`$perl_int -V::version: | sed -e "s/'//g" | sed -e "s/ \t*$//"` # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$PERL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "$first_perl" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` if test "$ax_compare_version" = "true" ; then perl_version_ok="yes" fi if test "x$perl_version_ok" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PERL=$user_perl true else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PERL="not found" true fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl interpreter version >= $first_perl" >&5 $as_echo_n "checking for Perl interpreter version >= $first_perl... " >&6; } PERL="not found" for perl in $perl_prog_list; do as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$perl$exec_ext"; then perl_version_ok="no" perl_int="$as_dir/$perl$exec_ext" # 3="$as_dir/$perl$exec_ext" PERL_VERSION=`$perl_int -V::version: | sed -e "s/'//g" | sed -e "s/ \t*$//"` # Used to indicate true or false condition ax_compare_version=false # Convert the two version strings to be compared into a format that # allows a simple string comparison. The end result is that a version # string of the form 1.12.5-r617 will be converted to the form # 0001001200050617. In other words, each number is zero padded to four # digits, and non digits are removed. ax_compare_version_A=`echo "$PERL_VERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version_B=`echo "$first_perl" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ -e 's/[^0-9]//g'` ax_compare_version=`echo "x$ax_compare_version_A x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` if test "$ax_compare_version" = "true" ; then perl_version_ok="yes" fi if test "x$perl_version_ok" = "xyes"; then PERL="$as_dir/$perl$exec_ext"; break 3 true else true fi fi done done IFS=$as_save_IFS done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 $as_echo "$PERL" >&6; } fi if test "x$PERL" = "xnot found"; then have_perl="no" PERL= fi fi if test "x${have_perl}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking $PERL version" >&5 $as_echo_n "checking $PERL version... " >&6; } perl_int=$PERL # 3= PERL_VERSION=`$perl_int -V::version: | sed -e "s/'//g" | sed -e "s/ \t*$//"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL_VERSION" >&5 $as_echo "$PERL_VERSION" >&6; } fi # Check whether --with-perl-dir was given. if test "${with_perl_dir+set}" = set; then : withval=$with_perl_dir; case "${withval}" in vendor|site) perl_inst_type="${withval}" ;; no) perl_inst_type="site" ;; *) perl_inst_type="local"; local_perl_path="${withval}" ;; esac else perl_inst_type="site" fi if test "x${have_perl}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Math::Complex" >&5 $as_echo_n "checking for Math::Complex... " >&6; } if $PERL -MMath::Complex -e 'exit' > /dev/null 2>&1; then HAVE_Math__Complex=yes else HAVE_Math__Complex=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAVE_Math__Complex}" >&5 $as_echo "${HAVE_Math__Complex}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Module::Build" >&5 $as_echo_n "checking for Module::Build... " >&6; } if $PERL -MModule::Build -e 'exit' > /dev/null 2>&1; then HAVE_Module__Build=yes else HAVE_Module__Build=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAVE_Module__Build}" >&5 $as_echo "${HAVE_Module__Build}" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Test::Harness" >&5 $as_echo_n "checking for Test::Harness... " >&6; } if $PERL -MTest::Harness -e 'exit' > /dev/null 2>&1; then HAVE_Test__Harness=yes else HAVE_Test__Harness=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${HAVE_Test__Harness}" >&5 $as_echo "${HAVE_Test__Harness}" >&6; } fi if test "$HAVE_Math__Complex$HAVE_Module__Build" != "yesyes"; then have_perl=no fi if test "x${have_perl}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking Perl module directory" >&5 $as_echo_n "checking Perl module directory... " >&6; } if test $perl_inst_type = "vendor"; then perl_int=$PERL # 3= perldir=`$perl_int -V::vendorarchexp: | sed -e "s/'//g" | sed -e "s/ \t*$//"` perl_int=$PERL # 3= perlmandir=`$perl_int -V::vendorman3direxp: | sed -e "s/'//g" | sed -e "s/ \t*$//"` if test perldir = "UNKNOWN"; then perl_inst_type = "site"; fi fi if test $perl_inst_type = "site"; then perl_int=$PERL # 3= perldir=`$perl_int -V::sitearchexp: | sed -e "s/'//g" | sed -e "s/ \t*$//"` perl_int=$PERL # 3= perlmandir=`$perl_int -V::siteman3direxp: | sed -e "s/'//g" | sed -e "s/ \t*$//"` elif test $perl_inst_type != "vendor"; then perldir="${local_perl_path}" perlmandir="${man3dir}" fi if test $perlmandir = "UNKNOWN"; then perlmandir="${mandir}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perldir" >&5 $as_echo "$perldir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Perl man directory" >&5 $as_echo_n "checking Perl man directory... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $perlmandir" >&5 $as_echo "$perlmandir" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the section 3 manual page extension" >&5 $as_echo_n "checking for the section 3 manual page extension... " >&6; } PERL_MAN3EXT=`$PERL -MModule::Build -e 'print "\n>>GD ", Module::Build->new(module_name=>"conftest",dist_version=>0)->config('man3ext'), " GD<<";' | $AWK '/>>GD .* GD<&5 $as_echo ".$PERL_MAN3EXT" >&6; } fi if test "x$have_perl" = "xno"; then make_perlbindings=no fi fi if test "x$make_phpbindings" = "xyes"; then echo echo "*** Configuring PHP bindings" echo { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C99 is supported" >&5 $as_echo_n "checking whether C99 is supported... " >&6; } if test "x$disable_c99" = "xno"; 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; } make_phpbindings=no fi fi if test "x$make_phpbindings" = "xyes"; then have_php="yes" # Check whether --with-php-config was given. if test "${with_php_config+set}" = set; then : withval=$with_php_config; case "${withval}" in no) have_php="no" ;; yes) user_php_config= ;; *) user_php_config="${withval}" ;; esac else user_php_config= fi if test "x${have_php}" != "xno"; then for ac_prog in $user_php_config php5-config php-config 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_path_PHP_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PHP_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PHP_CONFIG="$PHP_CONFIG" # Let the user override the test with a path. ;; *) 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_path_PHP_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PHP_CONFIG=$ac_cv_path_PHP_CONFIG if test -n "$PHP_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CONFIG" >&5 $as_echo "$PHP_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PHP_CONFIG" && break done test -n "$PHP_CONFIG" || PHP_CONFIG="not found" if test "x$PHP_CONFIG" = "xnot found"; then have_php="no" PHP_CONFIG= fi fi # Check whether --with-php-dir was given. if test "${with_php_dir+set}" = set; then : withval=$with_php_dir; if test "x${withval}" = "xno"; then phpdir=UNKNOWN; else phpdir=${withval}; fi else phpdir=UNKNOWN fi if test "x${have_php}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP interpreter path" >&5 $as_echo_n "checking PHP interpreter path... " >&6; } PHP=`${PHP_CONFIG} --php-binary` if test "x${PHP}" = "x"; then PHP="UNKNOWN"; have_php="no"; elif test "x${PHP}" = "xNONE"; then have_php="no"; fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP" >&5 $as_echo "$PHP" >&6; } fi if test "x${have_php}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking the PHP extension directory" >&5 $as_echo_n "checking the PHP extension directory... " >&6; } if test "x${phpdir}" = "xUNKNOWN"; then phpdir=`${PHP_CONFIG} --extension-dir` if test "x${phpdir}" = "x"; then phpdir="UNKNOWN"; have_php="no"; elif test "x${phpdir}" = "xNONE"; then have_php="no"; fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $phpdir" >&5 $as_echo "$phpdir" >&6; } if test "x${phpdir}" = "xUNKNOWN"; then have_php=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP CPPFLAGS" >&5 $as_echo_n "checking PHP CPPFLAGS... " >&6; } PHP_CPPFLAGS=`${PHP_CONFIG} --includes` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_CPPFLAGS" >&5 $as_echo "$PHP_CPPFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP LDFLAGS" >&5 $as_echo_n "checking PHP LDFLAGS... " >&6; } PHP_LDFLAGS=`${PHP_CONFIG} --ldflags` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_LDFLAGS" >&5 $as_echo "$PHP_LDFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking PHP LIBS" >&5 $as_echo_n "checking PHP LIBS... " >&6; } PHP_LIBS=`${PHP_CONFIG} --libs` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PHP_LIBS" >&5 $as_echo "$PHP_LIBS" >&6; } fi if test "x$have_php" = "xno"; then make_phpbindings=no fi fi if test "x$make_pybindings" = "xyes"; then echo echo "*** Configuring python bindings" echo last_python=2.7 first_python=2.3 if test "x$SEQ" == "xnot found"; then if test "x$JOT" == "xnot found"; then python_prog_list="python python2" else python_prog_list="python python2 `$JOT -w 'python%.1f' - $last_python $first_python -0.1`" #' fi else python_prog_list="python python2 `$SEQ -f 'python%.1f' $last_python -0.1 $first_python`" #' fi # Check whether --with-python was given. if test "${with_python+set}" = set; then : withval=$with_python; case "${withval}" in no) have_python="no" ;; yes) user_python= ; have_python= ;; *) user_python="${withval}"; have_python= ;; esac else user_python=; have_python= fi # Check whether --with-python-module-dir was given. if test "${with_python_module_dir+set}" = set; then : withval=$with_python_module_dir; case "${withval}" in no) local_python_modpath= ;; *) local_python_modpath="${withval}" esac else local_python_modpath= fi if test "x${have_python}" != "xno"; then if test "x$user_python" != "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $user_python version >= $first_python" >&5 $as_echo_n "checking whether $user_python version >= $first_python... " >&6; } prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$first_python'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $user_python -c "$prog"" >&5 ($user_python -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } PYTHON=$user_python else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PYTHON="not found" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python interpreter version >= $first_python" >&5 $as_echo_n "checking for Python interpreter version >= $first_python... " >&6; } PYTHON="not found" for py in $python_prog_list; do as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$py$exec_ext"; then prog="import sys # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. # map returns an iterator in Python 3.0 and a list in 2.x minver = list(map(int, '$first_python'.split('.'))) + [0, 0, 0] minverhex = 0 # xrange is not present in Python 3.0 and range returns an iterator for i in list(range(0, 4)): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: "$as_dir/$py$exec_ext" -c "$prog"" >&5 ("$as_dir/$py$exec_ext" -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then : PYTHON="$as_dir/$py$exec_ext"; break 3 fi fi done done IFS=$as_save_IFS done { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } fi if test "x$PYTHON" = "xnot found"; then have_python="no" PYTHON= fi fi if test "x${have_python}" != "xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking $PYTHON version" >&5 $as_echo_n "checking $PYTHON version... " >&6; } PYTHON_VERSION=`$PYTHON -c "import sys; print sys.version[:3]"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_VERSION" >&5 $as_echo "$PYTHON_VERSION" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python includes" >&5 $as_echo_n "checking Python includes... " >&6; } if test -x $PYTHON-config; then PYTHON_CPPFLAGS=`$PYTHON-config --includes 2>/dev/null` else python_prefix=`$PYTHON -c "import sys; print sys.prefix"` python_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"` PYTHON_CPPFLAGS="-I${python_prefix}/include/python${PYTHON_VERSION} -I${python_exec_prefix}/include/python${PYTHON_VERSION}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5 $as_echo "$PYTHON_CPPFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python platform name" >&5 $as_echo_n "checking Python platform name... " >&6; } PYTHON_PLATFORM=`$PYTHON -c "from distutils import util; print util.get_platform()"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_PLATFORM" >&5 $as_echo "$PYTHON_PLATFORM" >&6; } pyexec_prefix=$exec_prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$prefix test "x$pyexec_prefix" = xNONE && pyexec_prefix=$ac_default_prefix { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python extension module directory" >&5 $as_echo_n "checking Python extension module directory... " >&6; } if test "x${local_python_modpath}" = "x"; then pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='${pyexec_prefix}')" 2>/dev/null || echo "${pyexec_prefix}/lib/python${PYTHON_VERSION}/site-packages"` else pythondir=$local_python_modpath fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythondir" >&5 $as_echo "$pythondir" >&6; } fi have_numpy="no (required for python bindings)" if test "x$have_python" = "xno"; then make_pybindings="no" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NumPy" >&5 $as_echo_n "checking for NumPy... " >&6; } cat > conftest.py << EOF import sys try: import numpy except ImportError: sys.exit(1) EOF if $PYTHON conftest.py > /dev/null 2>&1; then have_numpy="yes" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_numpy" >&5 $as_echo "$have_numpy" >&6; } fi if test "x$have_numpy" = "xyes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking NumPy includes" >&5 $as_echo_n "checking NumPy includes... " >&6; } NUMPY_CPPFLAGS=-I`$PYTHON -c "import numpy; print numpy.get_include()"` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NUMPY_CPPFLAGS" >&5 $as_echo "$NUMPY_CPPFLAGS" >&6; } saved_cppflags=$CPPFLAGS CPPFLAGS="${CPPFLAGS} ${PYTHON_CPPFLAGS} ${NUMPY_CPPFLAGS}" for ac_header in numpy/arrayobject.h do : ac_fn_c_check_header_compile "$LINENO" "numpy/arrayobject.h" "ac_cv_header_numpy_arrayobject_h" " #include " if test "x$ac_cv_header_numpy_arrayobject_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NUMPY_ARRAYOBJECT_H 1 _ACEOF else have_numpy="no" fi done CPPFLAGS=$saved_cppflags else make_pybindings=no fi fi have_this_header= have_this_lib= # Check whether --with-libbz2 was given. if test "${with_libbz2+set}" = set; then : withval=$with_libbz2; case "${withval}" in no) use_bzip2="no" ;; yes) use_bzip2="yes"; bzip2_prefix= ;; *) use_bzip2="yes"; bzip2_prefix="${withval}" ;; esac else use_bzip2="yes"; bzip2_prefix=; fi echo echo "*** Configuring bzip2 support" echo if test "x$no_extern" = "xyes"; then use_bzip2="no"; fi if test "x$use_bzip2" = "xyes"; then saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$bzip2_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$bzip2_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzReadOpen in -lbz2" >&5 $as_echo_n "checking for BZ2_bzReadOpen in -lbz2... " >&6; } if ${ac_cv_lib_bz2_BZ2_bzReadOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbz2 $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 BZ2_bzReadOpen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return BZ2_bzReadOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_bz2_BZ2_bzReadOpen=yes else ac_cv_lib_bz2_BZ2_bzReadOpen=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_bz2_BZ2_bzReadOpen" >&5 $as_echo "$ac_cv_lib_bz2_BZ2_bzReadOpen" >&6; } if test "x$ac_cv_lib_bz2_BZ2_bzReadOpen" = xyes; then : have_this_lib=yes LIBS="$LIBS -lbz2" $as_echo "#define HAVE_LIBBZ2 1" >>confdefs.h fi LDFLAGS=$saved_ldflags LIBS=$saved_libs saved_cppflags=$CPPFLAGS if test "x$bzip2_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$bzip2_prefix/include" fi for ac_header in bzlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "bzlib.h" "ac_cv_header_bzlib_h" "$ac_includes_default" if test "x$ac_cv_header_bzlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_BZLIB_H 1 _ACEOF have_this_header=yes fi done CPPFLAGS=$saved_cppflags fi BZIP2_CPPFLAGS= BZIP2_LDFLAGS= BZIP2_LIBS= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$bzip2_prefix" = "x"; then BZIP2_LIBS="-lbz2" BZIP2_SEARCHPATH="$PATH" else BZIP2_CPPFLAGS="-I$bzip2_prefix/include" BZIP2_LDFLAGS="-L$bzip2_prefix/lib" BZIP2_LIBS="-lbz2" BZIP2_SEARCHPATH="$bzip2_prefix/bin:$PATH" fi $as_echo "#define USE_BZIP2 /**/" >>confdefs.h else use_bzip2="no"; BZIP2_SEARCHPATH="$PATH" fi for ac_prog in bzip2 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_path_path_bzip2+:} false; then : $as_echo_n "(cached) " >&6 else case $path_bzip2 in [\\/]* | ?:[\\/]*) ac_cv_path_path_bzip2="$path_bzip2" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $BZIP2_SEARCHPATH 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_path_path_bzip2="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_bzip2=$ac_cv_path_path_bzip2 if test -n "$path_bzip2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_bzip2" >&5 $as_echo "$path_bzip2" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_bzip2" && break done test -n "$path_bzip2" || path_bzip2="not found" if test "x$path_bzip2" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define BZIP2 "$path_bzip2" _ACEOF fi for ac_prog in bunzip2 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_path_path_bunzip2+:} false; then : $as_echo_n "(cached) " >&6 else case $path_bunzip2 in [\\/]* | ?:[\\/]*) ac_cv_path_path_bunzip2="$path_bunzip2" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $BZIP2_SEARCHPATH 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_path_path_bunzip2="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_bunzip2=$ac_cv_path_path_bunzip2 if test -n "$path_bunzip2"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_bunzip2" >&5 $as_echo "$path_bunzip2" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_bunzip2" && break done test -n "$path_bunzip2" || path_bunzip2="not found" if test "x$path_bunzip2" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define BUNZIP2 "$path_bunzip2" _ACEOF fi if test "x$use_bzip2" = "xyes"; then USE_BZIP2_TRUE= USE_BZIP2_FALSE='#' else USE_BZIP2_TRUE='#' USE_BZIP2_FALSE= fi if test "x$path_bzip2" != "xnot found" -a \ "x$path_bunzip2" != "xnot found"; then $as_echo "#define TEST_BZIP2 /**/" >>confdefs.h fi if test "x$use_bzip2" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} bzip2"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} bzip2"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="$BZIP2_LDFLAGS $BZIP2_LIBS" else PRIVATE_LIBS="$BZIP2_LDFLAGS $PRIVATE_LIBS $BZIP2_LIBS" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} bzip2"; fi have_this_header= have_this_lib= # Check whether --with-libFLAC was given. if test "${with_libFLAC+set}" = set; then : withval=$with_libFLAC; case "${withval}" in no) use_flac="no" ;; yes) use_flac="yes"; flac_prefix= ;; *) use_flac="yes"; flac_prefix="${withval}" ;; esac else use_flac="yes"; flac_prefix=; fi echo echo "*** Configuring flac support" echo if test "x$no_extern" = "xyes"; then use_flac="no"; fi if test "x$use_flac" = "xyes"; then saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$flac_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$flac_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLAC__stream_decoder_init_FILE in -lFLAC" >&5 $as_echo_n "checking for FLAC__stream_decoder_init_FILE in -lFLAC... " >&6; } if ${ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lFLAC $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 FLAC__stream_decoder_init_FILE (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return FLAC__stream_decoder_init_FILE (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE=yes else ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE=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_FLAC_FLAC__stream_decoder_init_FILE" >&5 $as_echo "$ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE" >&6; } if test "x$ac_cv_lib_FLAC_FLAC__stream_decoder_init_FILE" = xyes; then : have_this_lib=yes LIBS="$LIBS -lFLAC" $as_echo "#define HAVE_LIBFLAC 1" >>confdefs.h fi LDFLAGS=$saved_ldflags LIBS=$saved_libs saved_cppflags=$CPPFLAGS if test "x$flac_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$flac_prefix/include" fi for ac_header in FLAC/all.h do : ac_fn_c_check_header_mongrel "$LINENO" "FLAC/all.h" "ac_cv_header_FLAC_all_h" "$ac_includes_default" if test "x$ac_cv_header_FLAC_all_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLAC_ALL_H 1 _ACEOF have_this_header=yes fi done CPPFLAGS=$saved_cppflags fi FLAC_CPPFLAGS= FLAC_LDFLAGS= FLAC_LIBS= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$flac_prefix" = "x"; then FLAC_LIBS="-lFLAC" FLAC_SEARCHPATH="$PATH" else FLAC_CPPFLAGS="-I$flac_prefix/include" FLAC_LDFLAGS="-L$flac_prefix/lib" FLAC_LIBS="-lFLAC" FLAC_SEARCHPATH="$flac_prefix/bin:$PATH" fi $as_echo "#define USE_FLAC /**/" >>confdefs.h else use_flac="no"; FLAC_SEARCHPATH="$PATH" fi for ac_prog in flac 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_path_path_flac+:} false; then : $as_echo_n "(cached) " >&6 else case $path_flac in [\\/]* | ?:[\\/]*) ac_cv_path_path_flac="$path_flac" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $FLAC_SEARCHPATH 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_path_path_flac="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_flac=$ac_cv_path_path_flac if test -n "$path_flac"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_flac" >&5 $as_echo "$path_flac" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_flac" && break done test -n "$path_flac" || path_flac="not found" if test "x$path_flac" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define FLAC "$path_flac" _ACEOF fi if test "x$use_flac" = "xyes"; then USE_FLAC_TRUE= USE_FLAC_FALSE='#' else USE_FLAC_TRUE='#' USE_FLAC_FALSE= fi if test "x$path_flac" != "xnot found" -a \ "x$path_bunzip2" != "xnot found"; then $as_echo "#define TEST_FLAC /**/" >>confdefs.h fi if test "x$use_flac" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} flac"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} flac"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="$FLAC_LDFLAGS $FLAC_LIBS" else PRIVATE_LIBS="$FLAC_LDFLAGS $PRIVATE_LIBS $FLAC_LIBS" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} flac"; fi have_this_header= have_this_lib= # Check whether --with-libz was given. if test "${with_libz+set}" = set; then : withval=$with_libz; case "${withval}" in no) use_gzip="no" ;; yes) use_gzip="yes"; gzip_prefix= ;; *) use_gzip="yes"; gzip_prefix="${withval}" ;; esac else use_gzip="yes"; gzip_prefix=; fi echo echo "*** Configuring gzip support" echo if test "x$no_extern" = "xyes"; then use_gzip="no"; fi if test "x$use_gzip" = "xyes"; then saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$gzip_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$gzip_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gzopen in -lz" >&5 $as_echo_n "checking for gzopen in -lz... " >&6; } if ${ac_cv_lib_z_gzopen+:} 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 gzopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return gzopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_gzopen=yes else ac_cv_lib_z_gzopen=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_gzopen" >&5 $as_echo "$ac_cv_lib_z_gzopen" >&6; } if test "x$ac_cv_lib_z_gzopen" = xyes; then : have_this_lib=yes LIBS="$LIBS -lz" $as_echo "#define HAVE_LIBZ 1" >>confdefs.h fi for ac_func in gzseek64 gztell64 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 LDFLAGS=$saved_ldflags LIBS=$saved_libs saved_cppflags=$CPPFLAGS if test "x$gzip_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$gzip_prefix/include" fi for ac_header in zlib.h do : 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 : cat >>confdefs.h <<_ACEOF #define HAVE_ZLIB_H 1 _ACEOF have_this_header=yes fi done CPPFLAGS=$saved_cppflags fi GZIP_CPPFLAGS= GZIP_LDFLAGS= GZIP_LIBS= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$gzip_prefix" = "x"; then GZIP_LIBS="-lz" GZIP_SEARCHPATH="$PATH" else GZIP_CPPFLAGS="-I$gzip_prefix/include" GZIP_LDFLAGS="-L$gzip_prefix/lib" GZIP_LIBS="-lz" GZIP_SEARCHPATH="$gzip_prefix/bin:$PATH" fi $as_echo "#define USE_GZIP /**/" >>confdefs.h else use_gzip="no"; GZIP_SEARCHPATH="$PATH" fi for ac_prog in gzip 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_path_path_gzip+:} false; then : $as_echo_n "(cached) " >&6 else case $path_gzip in [\\/]* | ?:[\\/]*) ac_cv_path_path_gzip="$path_gzip" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $GZIP_SEARCHPATH 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_path_path_gzip="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_gzip=$ac_cv_path_path_gzip if test -n "$path_gzip"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_gzip" >&5 $as_echo "$path_gzip" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_gzip" && break done test -n "$path_gzip" || path_gzip="not found" if test "x$path_gzip" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define GZIP "$path_gzip" _ACEOF fi for ac_prog in gunzip 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_path_path_gunzip+:} false; then : $as_echo_n "(cached) " >&6 else case $path_gunzip in [\\/]* | ?:[\\/]*) ac_cv_path_path_gunzip="$path_gunzip" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $GZIP_SEARCHPATH 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_path_path_gunzip="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_gunzip=$ac_cv_path_path_gunzip if test -n "$path_gunzip"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_gunzip" >&5 $as_echo "$path_gunzip" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_gunzip" && break done test -n "$path_gunzip" || path_gunzip="not found" if test "x$path_gunzip" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define GUNZIP "$path_gunzip" _ACEOF fi if test "x$use_gzip" = "xyes"; then USE_GZIP_TRUE= USE_GZIP_FALSE='#' else USE_GZIP_TRUE='#' USE_GZIP_FALSE= fi if test "x$path_gzip" != "xnot found" -a \ "x$path_gunzip" != "xnot found"; then $as_echo "#define TEST_GZIP /**/" >>confdefs.h fi if test "x$use_gzip" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} gzip"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} gzip"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="$GZIP_LDFLAGS $GZIP_LIBS" else PRIVATE_LIBS="$GZIP_LDFLAGS $PRIVATE_LIBS $GZIP_LIBS" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} gzip"; fi have_this_header= have_this_lib= # Check whether --with-liblzma was given. if test "${with_liblzma+set}" = set; then : withval=$with_liblzma; case "${withval}" in no) use_lzma="no" ;; yes) use_lzma="yes"; lzma_prefix= ;; *) use_lzma="yes"; lzma_prefix="${withval}" ;; esac else use_lzma="yes"; lzma_prefix=; fi echo echo "*** Configuring lzma support" echo if test "x$no_extern" = "xyes"; then use_lzma="no"; fi if test "x$use_lzma" = "xyes"; then saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$lzma_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$lzma_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzma_auto_decoder in -llzma" >&5 $as_echo_n "checking for lzma_auto_decoder in -llzma... " >&6; } if ${ac_cv_lib_lzma_lzma_auto_decoder+:} 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_auto_decoder (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return lzma_auto_decoder (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lzma_lzma_auto_decoder=yes else ac_cv_lib_lzma_lzma_auto_decoder=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_auto_decoder" >&5 $as_echo "$ac_cv_lib_lzma_lzma_auto_decoder" >&6; } if test "x$ac_cv_lib_lzma_lzma_auto_decoder" = xyes; then : have_this_lib=yes LIBS="$LIBS -llzma" $as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h fi LDFLAGS=$saved_ldflags LIBS=$saved_libs saved_cppflags=$CPPFLAGS if test "x$lzma_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$lzma_prefix/include" fi for ac_header in lzma.h do : 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 : cat >>confdefs.h <<_ACEOF #define HAVE_LZMA_H 1 _ACEOF have_this_header=yes fi done CPPFLAGS=$saved_cppflags fi LZMA_CPPFLAGS= LZMA_LDFLAGS= LZMA_LIBS= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$lzma_prefix" = "x"; then LZMA_LIBS="-llzma" LZMA_SEARCHPATH="$PATH" else LZMA_CPPFLAGS="-I$lzma_prefix/include" LZMA_LDFLAGS="-L$lzma_prefix/lib" LZMA_LIBS="-llzma" LZMA_SEARCHPATH="$lzma_prefix/bin:$PATH" fi $as_echo "#define USE_LZMA /**/" >>confdefs.h else use_lzma="no"; LZMA_SEARCHPATH="$PATH" fi for ac_prog in xz 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_path_path_xz+:} false; then : $as_echo_n "(cached) " >&6 else case $path_xz in [\\/]* | ?:[\\/]*) ac_cv_path_path_xz="$path_xz" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $LZMA_SEARCHPATH 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_path_path_xz="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_xz=$ac_cv_path_path_xz if test -n "$path_xz"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_xz" >&5 $as_echo "$path_xz" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_xz" && break done test -n "$path_xz" || path_xz="not found" if test "x$path_xz" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define XZ "$path_xz" _ACEOF fi if test "x$use_lzma" = "xyes"; then USE_LZMA_TRUE= USE_LZMA_FALSE='#' else USE_LZMA_TRUE='#' USE_LZMA_FALSE= fi if test "x$path_xz" != "xnot found" -a \ "x$path_gunzip" != "xnot found"; then $as_echo "#define TEST_LZMA /**/" >>confdefs.h fi if test "x$use_lzma" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} lzma"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} lzma"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="$LZMA_LDFLAGS $LZMA_LIBS" else PRIVATE_LIBS="$LZMA_LDFLAGS $PRIVATE_LIBS $LZMA_LIBS" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} lzma"; fi have_this_header= have_this_lib= # Check whether --with-libslim was given. if test "${with_libslim+set}" = set; then : withval=$with_libslim; case "${withval}" in no) use_slim="no" ;; yes) use_slim="yes"; slim_prefix= ;; *) use_slim="yes"; slim_prefix="${withval}" ;; esac else use_slim="yes"; slim_prefix=; fi echo echo "*** Configuring slim support" echo if test "x$no_extern" = "xyes"; then use_slim="no"; fi if test "x$use_slim" = "xyes"; then saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$slim_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$slim_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for slimopen in -lslim" >&5 $as_echo_n "checking for slimopen in -lslim... " >&6; } if ${ac_cv_lib_slim_slimopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lslim $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 slimopen (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return slimopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_slim_slimopen=yes else ac_cv_lib_slim_slimopen=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_slim_slimopen" >&5 $as_echo "$ac_cv_lib_slim_slimopen" >&6; } if test "x$ac_cv_lib_slim_slimopen" = xyes; then : have_this_lib=yes LIBS="$LIBS -lslim" $as_echo "#define HAVE_LIBSLIM 1" >>confdefs.h fi for ac_func in slimdopen slimdrawsize 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 LDFLAGS=$saved_ldflags LIBS=$saved_libs saved_cppflags=$CPPFLAGS if test "x$slim_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$slim_prefix/include" fi for ac_header in slimlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "slimlib.h" "ac_cv_header_slimlib_h" "$ac_includes_default" if test "x$ac_cv_header_slimlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SLIMLIB_H 1 _ACEOF have_this_header=yes fi done CPPFLAGS=$saved_cppflags fi SLIM_CPPFLAGS= SLIM_LDFLAGS= SLIM_LIBS= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$slim_prefix" = "x"; then SLIM_LIBS="-lslim" SLIM_SEARCHPATH="$PATH" else SLIM_CPPFLAGS="-I$slim_prefix/include" SLIM_LDFLAGS="-L$slim_prefix/lib" SLIM_LIBS="-lslim" SLIM_SEARCHPATH="$slim_prefix/bin:$PATH" fi $as_echo "#define USE_SLIM /**/" >>confdefs.h else use_slim="no"; SLIM_SEARCHPATH="$PATH" fi for ac_prog in slimdata slim 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_path_path_slimdata+:} false; then : $as_echo_n "(cached) " >&6 else case $path_slimdata in [\\/]* | ?:[\\/]*) ac_cv_path_path_slimdata="$path_slimdata" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $SLIM_SEARCHPATH 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_path_path_slimdata="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_slimdata=$ac_cv_path_path_slimdata if test -n "$path_slimdata"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_slimdata" >&5 $as_echo "$path_slimdata" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_slimdata" && break done test -n "$path_slimdata" || path_slimdata="not found" if test "x$path_slimdata" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define SLIMDATA "$path_slimdata" _ACEOF fi for ac_prog in unslim 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_path_path_unslim+:} false; then : $as_echo_n "(cached) " >&6 else case $path_unslim in [\\/]* | ?:[\\/]*) ac_cv_path_path_unslim="$path_unslim" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $SLIM_SEARCHPATH 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_path_path_unslim="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_unslim=$ac_cv_path_path_unslim if test -n "$path_unslim"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_unslim" >&5 $as_echo "$path_unslim" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_unslim" && break done test -n "$path_unslim" || path_unslim="not found" if test "x$path_unslim" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define UNSLIM "$path_unslim" _ACEOF fi if test "x$use_slim" = "xyes"; then USE_SLIM_TRUE= USE_SLIM_FALSE='#' else USE_SLIM_TRUE='#' USE_SLIM_FALSE= fi if test "x$path_slimdata" != "xnot found" -a \ "x$path_unslim" != "xnot found"; then $as_echo "#define TEST_SLIM /**/" >>confdefs.h fi if test "x$use_slim" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} slim"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} slim"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="$SLIM_LDFLAGS $SLIM_LIBS" else PRIVATE_LIBS="$SLIM_LDFLAGS $PRIVATE_LIBS $SLIM_LIBS" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} slim"; fi have_this_header= have_this_lib= # Check whether --with-libzzip was given. if test "${with_libzzip+set}" = set; then : withval=$with_libzzip; case "${withval}" in no) use_zzip="no" ;; yes) use_zzip="yes"; zzip_prefix= ;; *) use_zzip="yes"; zzip_prefix="${withval}" ;; esac else use_zzip="yes"; zzip_prefix=; fi echo echo "*** Configuring zzip support" echo if test "x$no_extern" = "xyes"; then use_zzip="no"; fi if test "x$use_zzip" = "xyes"; then saved_ldflags=$LDFLAGS saved_libs=$LIBS if test "x$zzip_prefix" != "x"; then LDFLAGS="$LDFLAGS -L$zzip_prefix/lib" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzip_open in -lzzip" >&5 $as_echo_n "checking for zzip_open in -lzzip... " >&6; } if ${ac_cv_lib_zzip_zzip_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lzzip $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 zzip_open (); #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { return zzip_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_zzip_zzip_open=yes else ac_cv_lib_zzip_zzip_open=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_zzip_zzip_open" >&5 $as_echo "$ac_cv_lib_zzip_zzip_open" >&6; } if test "x$ac_cv_lib_zzip_zzip_open" = xyes; then : have_this_lib=yes LIBS="$LIBS -lzzip" $as_echo "#define HAVE_LIBZZIP 1" >>confdefs.h fi LDFLAGS=$saved_ldflags LIBS=$saved_libs saved_cppflags=$CPPFLAGS if test "x$zzip_prefix" != "x"; then CPPFLAGS="$CPPFLAGS -I$zzip_prefix/include" fi for ac_header in zzip/lib.h do : ac_fn_c_check_header_mongrel "$LINENO" "zzip/lib.h" "ac_cv_header_zzip_lib_h" "$ac_includes_default" if test "x$ac_cv_header_zzip_lib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_ZZIP_LIB_H 1 _ACEOF have_this_header=yes fi done CPPFLAGS=$saved_cppflags fi ZZIP_CPPFLAGS= ZZIP_LDFLAGS= ZZIP_LIBS= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then if test "x$zzip_prefix" = "x"; then ZZIP_LIBS="-lzzip" ZZIP_SEARCHPATH="$PATH" else ZZIP_CPPFLAGS="-I$zzip_prefix/include" ZZIP_LDFLAGS="-L$zzip_prefix/lib" ZZIP_LIBS="-lzzip" ZZIP_SEARCHPATH="$zzip_prefix/bin:$PATH" fi $as_echo "#define USE_ZZIP /**/" >>confdefs.h else use_zzip="no"; ZZIP_SEARCHPATH="$PATH" fi for ac_prog in zip 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_path_path_zip+:} false; then : $as_echo_n "(cached) " >&6 else case $path_zip in [\\/]* | ?:[\\/]*) ac_cv_path_path_zip="$path_zip" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ZZIP_SEARCHPATH 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_path_path_zip="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_zip=$ac_cv_path_path_zip if test -n "$path_zip"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_zip" >&5 $as_echo "$path_zip" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_zip" && break done test -n "$path_zip" || path_zip="not found" if test "x$path_zip" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define ZIP "$path_zip" _ACEOF fi for ac_prog in unzip 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_path_path_unzip+:} false; then : $as_echo_n "(cached) " >&6 else case $path_unzip in [\\/]* | ?:[\\/]*) ac_cv_path_path_unzip="$path_unzip" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $ZZIP_SEARCHPATH 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_path_path_unzip="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi path_unzip=$ac_cv_path_path_unzip if test -n "$path_unzip"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $path_unzip" >&5 $as_echo "$path_unzip" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$path_unzip" && break done test -n "$path_unzip" || path_unzip="not found" if test "x$path_unzip" != "xnot found"; then cat >>confdefs.h <<_ACEOF #define UNZIP "$path_unzip" _ACEOF fi if test "x$use_zzip" = "xyes"; then USE_ZZIP_TRUE= USE_ZZIP_FALSE='#' else USE_ZZIP_TRUE='#' USE_ZZIP_FALSE= fi if test "x$path_zip" != "xnot found" -a \ "x$path_unzip" != "xnot found"; then $as_echo "#define TEST_ZZIP /**/" >>confdefs.h fi if test "x$use_zzip" != "xno"; then if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} zzip"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} zzip"; if test -z "$PRIVATE_LIBS"; then PRIVATE_LIBS="$ZZIP_LDFLAGS $ZZIP_LIBS" else PRIVATE_LIBS="$ZZIP_LDFLAGS $PRIVATE_LIBS $ZZIP_LIBS" fi fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} zzip"; fi # Check whether --enable-zzslim was given. if test "${enable_zzslim+set}" = set; then : enableval=$enable_zzslim; case "${enableval}" in no) zzslim_override="no" ;; *) zzslim_override="yes" ;; esac else zzslim_override="auto" fi echo echo "*** Configuring zzslim support " echo if test $zzslim_override = "no"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzslim support" >&5 $as_echo_n "checking for zzslim support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (forced)" >&5 $as_echo "no (forced)" >&6; } use_zzslim=no else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for slim support" >&5 $as_echo_n "checking for slim support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_slim" >&5 $as_echo "$use_slim" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzip support" >&5 $as_echo_n "checking for zzip support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_zzip" >&5 $as_echo "$use_zzip" >&6; } if test "$use_slim$use_zzip" == "yesyes"; then if test $zzslim_override = "yes"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzslim support" >&5 $as_echo_n "checking for zzslim support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes (forced)" >&5 $as_echo "yes (forced)" >&6; } use_zzslim=yes elif test "x$CXX" = "x"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zzslim support" >&5 $as_echo_n "checking for zzslim support... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: no (no C++ compiler available for configure test)" >&5 $as_echo "no (no C++ compiler available for configure test)" >&6; } use_zzslim=no else { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lslim contains zzip capability" >&5 $as_echo_n "checking whether -lslim contains zzip capability... " >&6; } 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 saved_ldflags=$LDFLAGS saved_libs=$LIBS LDFLAGS="$SLIM_LDFLAGS $LDFLAGS" LIBS="$SLIM_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ struct zzip_file; typedef struct zzip_file ZZIP_FILE; class ibitstream { public: ibitstream(ZZIP_FILE *file, int buffersize); }; #ifdef F77_DUMMY_MAIN # ifdef __cplusplus extern "C" # endif int F77_DUMMY_MAIN() { return 1; } #endif int main () { ZZIP_FILE *file; ibitstream foo(file, 0); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : slim_zzip="yes" else slim_zzip="no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $slim_zzip" >&5 $as_echo "$slim_zzip" >&6; } LDFLAGS=$saved_ldflags LIBS=$saved_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 use_zzslim=$slim_zzip fi else use_zzslim="no" fi fi if test "x$use_zzslim" != "xno"; then $as_echo "#define USE_ZZSLIM /**/" >>confdefs.h if test "x$use_modules" != "xno"; then ENCODINGS_MODS="${ENCODINGS_MODS} zzslim"; else ENCODINGS_BUILT="${ENCODINGS_BUILT} zzslim"; fi else ENCODINGS_LEFT="${ENCODINGS_LEFT} zzslim"; fi if test ! -z "${LIBS}"; then PRIVATE_LIBS="${LIBS} ${PRIVATE_LIBS}" fi cat < conftest.sh prefix=$prefix test "x$prefix" = xNONE && prefix=$ac_default_prefix test "x$exec_prefix" = xNONE && exec_prefix=\$prefix exec_prefix=$exec_prefix datarootdir=$datarootdir PACKAGE_TARNAME=$PACKAGE_TARNAME echo $docdir EOF absolute_docdir=`$SHELL conftest.sh` echo echo "*** Writing configure output" echo ac_config_files="$ac_config_files Makefile" ac_config_files="$ac_config_files bindings/Makefile" ac_config_files="$ac_config_files bindings/cxx/Makefile" ac_config_files="$ac_config_files bindings/cxx/test/Makefile" ac_config_files="$ac_config_files bindings/f77/Makefile" ac_config_files="$ac_config_files bindings/f77/test/Makefile" ac_config_files="$ac_config_files bindings/f77/test/test_getdata.f" ac_config_files="$ac_config_files bindings/idl/Makefile" ac_config_files="$ac_config_files bindings/idl/makedlm.sh" ac_config_files="$ac_config_files bindings/idl/test/Makefile" ac_config_files="$ac_config_files bindings/matlab/Makefile" ac_config_files="$ac_config_files bindings/matlab/make_contents.sh" ac_config_files="$ac_config_files bindings/matlab/test/Makefile" ac_config_files="$ac_config_files bindings/perl/Makefile" ac_config_files="$ac_config_files bindings/perl/Build.PL" ac_config_files="$ac_config_files bindings/php/Makefile" ac_config_files="$ac_config_files bindings/php/test/Makefile" ac_config_files="$ac_config_files bindings/python/Makefile" ac_config_files="$ac_config_files bindings/python/setup.py" ac_config_files="$ac_config_files bindings/python/test/Makefile" ac_config_files="$ac_config_files doc/Makefile" ac_config_files="$ac_config_files man/Makefile" ac_config_files="$ac_config_files man/gd_alter_encoding.3" ac_config_files="$ac_config_files man/gd_alter_endianness.3" ac_config_files="$ac_config_files man/gd_alter_frameoffset.3" ac_config_files="$ac_config_files src/Makefile" ac_config_files="$ac_config_files src/getdata.h.in2:src/getdata.h.in" ac_config_headers="$ac_config_headers src/getdata.h:src/getdata.h.in2" ac_config_files="$ac_config_files src/getdata.pc" ac_config_files="$ac_config_files test/Makefile" ac_config_files="$ac_config_files util/Makefile" if test "x$enable_debug" == "xyes"; then GETDATA_DEBUG_TRUE= GETDATA_DEBUG_FALSE='#' else GETDATA_DEBUG_TRUE='#' GETDATA_DEBUG_FALSE= fi if test "x${SED}" != 'x' ; then HAVE_SED_TRUE= HAVE_SED_FALSE='#' else HAVE_SED_TRUE='#' HAVE_SED_FALSE= fi if test "x$gd_cv_f77_compiler_intel" == "xyes"; then INTEL_F77_COMPILER_TRUE= INTEL_F77_COMPILER_FALSE='#' else INTEL_F77_COMPILER_TRUE='#' INTEL_F77_COMPILER_FALSE= fi if test "x$gd_cv_fc_compiler_intel" == "xyes"; then INTEL_FC_COMPILER_TRUE= INTEL_FC_COMPILER_FALSE='#' else INTEL_FC_COMPILER_TRUE='#' INTEL_FC_COMPILER_FALSE= fi if test "x$include_legacy_api" != "xno"; then INCLUDE_LEGACY_API_TRUE= INCLUDE_LEGACY_API_FALSE='#' else INCLUDE_LEGACY_API_TRUE='#' INCLUDE_LEGACY_API_FALSE= fi if test "x$make_cxxbindings" = "xyes"; then MAKE_CXXBINDINGS_TRUE= MAKE_CXXBINDINGS_FALSE='#' else MAKE_CXXBINDINGS_TRUE='#' MAKE_CXXBINDINGS_FALSE= fi if test "x$make_f77bindings" != "xno"; then MAKE_F77BINDINGS_TRUE= MAKE_F77BINDINGS_FALSE='#' else MAKE_F77BINDINGS_TRUE='#' MAKE_F77BINDINGS_FALSE= fi if test "x$make_f95bindings" = "xyes"; then MAKE_F95BINDINGS_TRUE= MAKE_F95BINDINGS_FALSE='#' else MAKE_F95BINDINGS_TRUE='#' MAKE_F95BINDINGS_FALSE= fi if test "x$make_pybindings" = "xyes"; then MAKE_PYBINDINGS_TRUE= MAKE_PYBINDINGS_FALSE='#' else MAKE_PYBINDINGS_TRUE='#' MAKE_PYBINDINGS_FALSE= fi if test "x$make_idlbindings" = "xyes"; then MAKE_IDLBINDINGS_TRUE= MAKE_IDLBINDINGS_FALSE='#' else MAKE_IDLBINDINGS_TRUE='#' MAKE_IDLBINDINGS_FALSE= fi if test "x$make_perlbindings" = "xyes"; then MAKE_PERLBINDINGS_TRUE= MAKE_PERLBINDINGS_FALSE='#' else MAKE_PERLBINDINGS_TRUE='#' MAKE_PERLBINDINGS_FALSE= fi if test "x$make_matlabbindings" = "xyes"; then MAKE_MATLABBINDINGS_TRUE= MAKE_MATLABBINDINGS_FALSE='#' else MAKE_MATLABBINDINGS_TRUE='#' MAKE_MATLABBINDINGS_FALSE= fi if test "x$make_phpbindings" = "xyes"; then MAKE_PHPBINDINGS_TRUE= MAKE_PHPBINDINGS_FALSE='#' else MAKE_PHPBINDINGS_TRUE='#' MAKE_PHPBINDINGS_FALSE= fi if test "x$use_modules" != "xno"; then USE_MODULES_TRUE= USE_MODULES_FALSE='#' else USE_MODULES_TRUE='#' USE_MODULES_FALSE= fi if test "x$NO_DLOPEN_TESTS" = "x0"; then TEST_PYTHON_TRUE= TEST_PYTHON_FALSE='#' else TEST_PYTHON_TRUE='#' TEST_PYTHON_FALSE= fi if test "x$NO_DLOPEN_TESTS" = "x0"; then TEST_IDL_TRUE= TEST_IDL_FALSE='#' else TEST_IDL_TRUE='#' TEST_IDL_FALSE= fi if test "x$HAVE_Test__Harness" = "xyes"; then TEST_PERL_TRUE= TEST_PERL_FALSE='#' else TEST_PERL_TRUE='#' TEST_PERL_FALSE= fi if test "x$NO_DLOPEN_TESTS" = "x0"; then TEST_MATLAB_TRUE= TEST_MATLAB_FALSE='#' else TEST_MATLAB_TRUE='#' TEST_MATLAB_FALSE= fi if test "x$NO_DLOPEN_TESTS" = "x0"; then TEST_PHP_TRUE= TEST_PHP_FALSE='#' else TEST_PHP_TRUE='#' TEST_PHP_FALSE= fi if test "x$DIFF" != "x"; then HAVE_DIFF_TRUE= HAVE_DIFF_FALSE='#' else HAVE_DIFF_TRUE='#' HAVE_DIFF_FALSE= fi if test "x$use_zzslim" = "xyes"; then USE_ZZSLIM_TRUE= USE_ZZSLIM_FALSE='#' else USE_ZZSLIM_TRUE='#' USE_ZZSLIM_FALSE= fi if false; then GD_EXTERNAL_TRUE= GD_EXTERNAL_FALSE='#' else GD_EXTERNAL_TRUE='#' GD_EXTERNAL_FALSE= fi LDFLAGS="${LDFLAGS}${NO_UNDEFINED}" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi 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 "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCCAS\" 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 "${USE_BZIP2_TRUE}" && test -z "${USE_BZIP2_FALSE}"; then as_fn_error $? "conditional \"USE_BZIP2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_FLAC_TRUE}" && test -z "${USE_FLAC_FALSE}"; then as_fn_error $? "conditional \"USE_FLAC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GZIP_TRUE}" && test -z "${USE_GZIP_FALSE}"; then as_fn_error $? "conditional \"USE_GZIP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_LZMA_TRUE}" && test -z "${USE_LZMA_FALSE}"; then as_fn_error $? "conditional \"USE_LZMA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_SLIM_TRUE}" && test -z "${USE_SLIM_FALSE}"; then as_fn_error $? "conditional \"USE_SLIM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_ZZIP_TRUE}" && test -z "${USE_ZZIP_FALSE}"; then as_fn_error $? "conditional \"USE_ZZIP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GETDATA_DEBUG_TRUE}" && test -z "${GETDATA_DEBUG_FALSE}"; then as_fn_error $? "conditional \"GETDATA_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SED_TRUE}" && test -z "${HAVE_SED_FALSE}"; then as_fn_error $? "conditional \"HAVE_SED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INTEL_F77_COMPILER_TRUE}" && test -z "${INTEL_F77_COMPILER_FALSE}"; then as_fn_error $? "conditional \"INTEL_F77_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INTEL_FC_COMPILER_TRUE}" && test -z "${INTEL_FC_COMPILER_FALSE}"; then as_fn_error $? "conditional \"INTEL_FC_COMPILER\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${INCLUDE_LEGACY_API_TRUE}" && test -z "${INCLUDE_LEGACY_API_FALSE}"; then as_fn_error $? "conditional \"INCLUDE_LEGACY_API\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_CXXBINDINGS_TRUE}" && test -z "${MAKE_CXXBINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_CXXBINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_F77BINDINGS_TRUE}" && test -z "${MAKE_F77BINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_F77BINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_F95BINDINGS_TRUE}" && test -z "${MAKE_F95BINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_F95BINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_PYBINDINGS_TRUE}" && test -z "${MAKE_PYBINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_PYBINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_IDLBINDINGS_TRUE}" && test -z "${MAKE_IDLBINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_IDLBINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_PERLBINDINGS_TRUE}" && test -z "${MAKE_PERLBINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_PERLBINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_MATLABBINDINGS_TRUE}" && test -z "${MAKE_MATLABBINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_MATLABBINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAKE_PHPBINDINGS_TRUE}" && test -z "${MAKE_PHPBINDINGS_FALSE}"; then as_fn_error $? "conditional \"MAKE_PHPBINDINGS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_MODULES_TRUE}" && test -z "${USE_MODULES_FALSE}"; then as_fn_error $? "conditional \"USE_MODULES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TEST_PYTHON_TRUE}" && test -z "${TEST_PYTHON_FALSE}"; then as_fn_error $? "conditional \"TEST_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TEST_IDL_TRUE}" && test -z "${TEST_IDL_FALSE}"; then as_fn_error $? "conditional \"TEST_IDL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TEST_PERL_TRUE}" && test -z "${TEST_PERL_FALSE}"; then as_fn_error $? "conditional \"TEST_PERL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TEST_MATLAB_TRUE}" && test -z "${TEST_MATLAB_FALSE}"; then as_fn_error $? "conditional \"TEST_MATLAB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${TEST_PHP_TRUE}" && test -z "${TEST_PHP_FALSE}"; then as_fn_error $? "conditional \"TEST_PHP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DIFF_TRUE}" && test -z "${HAVE_DIFF_FALSE}"; then as_fn_error $? "conditional \"HAVE_DIFF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_ZZSLIM_TRUE}" && test -z "${USE_ZZSLIM_FALSE}"; then as_fn_error $? "conditional \"USE_ZZSLIM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${GD_EXTERNAL_TRUE}" && test -z "${GD_EXTERNAL_FALSE}"; then as_fn_error $? "conditional \"GD_EXTERNAL\" 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 GetData $as_me 0.9.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 . GetData 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="\\ GetData config.status 0.9.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' 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"`' shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $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"`' 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"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $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_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $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"`' lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $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"`' lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $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"`' configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`' configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $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"`' LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`' LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`' reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`' reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`' compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`' GCC_FC='`$ECHO "$GCC_FC" | $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_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $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"`' lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`' compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $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_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`' module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`' with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`' no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`' hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`' inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`' link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`' always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`' exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`' include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`' prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`' postlink_cmds_FC='`$ECHO "$postlink_cmds_FC" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`' file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`' hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`' predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`' postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`' predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`' postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $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 \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ 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_import \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ lt_cv_nm_interface \ nm_file_list_spec \ lt_cv_truncate_bin \ 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 \ LD_F77 \ LD_FC \ reload_flag_CXX \ reload_flag_F77 \ reload_flag_FC \ compiler_CXX \ compiler_F77 \ compiler_FC \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_no_builtin_flag_F77 \ lt_prog_compiler_no_builtin_flag_FC \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_pic_F77 \ lt_prog_compiler_pic_FC \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_wl_F77 \ lt_prog_compiler_wl_FC \ lt_prog_compiler_static_CXX \ lt_prog_compiler_static_F77 \ lt_prog_compiler_static_FC \ lt_cv_prog_compiler_c_o_CXX \ lt_cv_prog_compiler_c_o_F77 \ lt_cv_prog_compiler_c_o_FC \ export_dynamic_flag_spec_CXX \ export_dynamic_flag_spec_F77 \ export_dynamic_flag_spec_FC \ whole_archive_flag_spec_CXX \ whole_archive_flag_spec_F77 \ whole_archive_flag_spec_FC \ compiler_needs_object_CXX \ compiler_needs_object_F77 \ compiler_needs_object_FC \ with_gnu_ld_CXX \ with_gnu_ld_F77 \ with_gnu_ld_FC \ allow_undefined_flag_CXX \ allow_undefined_flag_F77 \ allow_undefined_flag_FC \ no_undefined_flag_CXX \ no_undefined_flag_F77 \ no_undefined_flag_FC \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_F77 \ hardcode_libdir_flag_spec_FC \ hardcode_libdir_separator_CXX \ hardcode_libdir_separator_F77 \ hardcode_libdir_separator_FC \ exclude_expsyms_CXX \ exclude_expsyms_F77 \ exclude_expsyms_FC \ include_expsyms_CXX \ include_expsyms_F77 \ include_expsyms_FC \ file_list_spec_CXX \ file_list_spec_F77 \ file_list_spec_FC \ compiler_lib_search_dirs_CXX \ compiler_lib_search_dirs_F77 \ compiler_lib_search_dirs_FC \ predep_objects_CXX \ predep_objects_F77 \ predep_objects_FC \ postdep_objects_CXX \ postdep_objects_F77 \ postdep_objects_FC \ predeps_CXX \ predeps_F77 \ predeps_FC \ postdeps_CXX \ postdeps_F77 \ postdeps_FC \ compiler_lib_search_path_CXX \ compiler_lib_search_path_F77 \ compiler_lib_search_path_FC; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) 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 \ configure_time_dlsearch_path \ configure_time_lt_sys_library_path \ reload_cmds_CXX \ reload_cmds_F77 \ reload_cmds_FC \ old_archive_cmds_CXX \ old_archive_cmds_F77 \ old_archive_cmds_FC \ old_archive_from_new_cmds_CXX \ old_archive_from_new_cmds_F77 \ old_archive_from_new_cmds_FC \ old_archive_from_expsyms_cmds_CXX \ old_archive_from_expsyms_cmds_F77 \ old_archive_from_expsyms_cmds_FC \ archive_cmds_CXX \ archive_cmds_F77 \ archive_cmds_FC \ archive_expsym_cmds_CXX \ archive_expsym_cmds_F77 \ archive_expsym_cmds_FC \ module_cmds_CXX \ module_cmds_F77 \ module_cmds_FC \ module_expsym_cmds_CXX \ module_expsym_cmds_F77 \ module_expsym_cmds_FC \ export_symbols_cmds_CXX \ export_symbols_cmds_F77 \ export_symbols_cmds_FC \ prelink_cmds_CXX \ prelink_cmds_F77 \ prelink_cmds_FC \ postlink_cmds_CXX \ postlink_cmds_F77 \ postlink_cmds_FC; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' # See if we are running on zsh, and set the options that 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' RM='$RM' ofile='$ofile' ac_aux_dir='$ac_aux_dir' _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 "src/gd_config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/gd_config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "bindings/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/Makefile" ;; "bindings/cxx/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/cxx/Makefile" ;; "bindings/cxx/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/cxx/test/Makefile" ;; "bindings/f77/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/f77/Makefile" ;; "bindings/f77/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/f77/test/Makefile" ;; "bindings/f77/test/test_getdata.f") CONFIG_FILES="$CONFIG_FILES bindings/f77/test/test_getdata.f" ;; "bindings/idl/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/idl/Makefile" ;; "bindings/idl/makedlm.sh") CONFIG_FILES="$CONFIG_FILES bindings/idl/makedlm.sh" ;; "bindings/idl/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/idl/test/Makefile" ;; "bindings/matlab/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/matlab/Makefile" ;; "bindings/matlab/make_contents.sh") CONFIG_FILES="$CONFIG_FILES bindings/matlab/make_contents.sh" ;; "bindings/matlab/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/matlab/test/Makefile" ;; "bindings/perl/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/perl/Makefile" ;; "bindings/perl/Build.PL") CONFIG_FILES="$CONFIG_FILES bindings/perl/Build.PL" ;; "bindings/php/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/php/Makefile" ;; "bindings/php/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/php/test/Makefile" ;; "bindings/python/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/Makefile" ;; "bindings/python/setup.py") CONFIG_FILES="$CONFIG_FILES bindings/python/setup.py" ;; "bindings/python/test/Makefile") CONFIG_FILES="$CONFIG_FILES bindings/python/test/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "man/gd_alter_encoding.3") CONFIG_FILES="$CONFIG_FILES man/gd_alter_encoding.3" ;; "man/gd_alter_endianness.3") CONFIG_FILES="$CONFIG_FILES man/gd_alter_endianness.3" ;; "man/gd_alter_frameoffset.3") CONFIG_FILES="$CONFIG_FILES man/gd_alter_frameoffset.3" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/getdata.h.in2") CONFIG_FILES="$CONFIG_FILES src/getdata.h.in2:src/getdata.h.in" ;; "src/getdata.h") CONFIG_HEADERS="$CONFIG_HEADERS src/getdata.h:src/getdata.h.in2" ;; "src/getdata.pc") CONFIG_FILES="$CONFIG_FILES src/getdata.pc" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "util/Makefile") CONFIG_FILES="$CONFIG_FILES util/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 that 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 # Generated automatically by $as_me ($PACKAGE) $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. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 # Copyright (C) 2014 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 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 this program. If not, see . # The names of the tagged configurations supported by this script. available_tags='CXX F77 FC ' # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### 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 # Shared archive member basename,for filename based shared library versioning on AIX. shared_archive_member_spec=$shared_archive_member_spec # 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 # 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 # 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 # DLL creation program. DLLTOOL=$lt_DLLTOOL # 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 into a list of symbols to manually relocate. global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import # 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 lister interface. nm_interface=$lt_lt_cv_nm_interface # 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 where our libraries should be installed. lt_sysroot=$lt_sysroot # Command to truncate a binary pipe. lt_truncate_bin=$lt_lt_cv_truncate_bin # 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 # Detected run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path # Explicit LT_SYS_LIBRARY_PATH set during ./configure time. configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path # 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 cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE # func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x$2 in x) ;; *:) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\" ;; x:*) eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\" ;; *::*) eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\" ;; *) eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\" ;; esac } # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in $*""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } # ### END FUNCTIONS SHARED WITH CONFIGURE _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 set != "${COLLECT_NAMES+set}"; 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) 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 cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: F77 # The linker used to build libraries. LD=$lt_LD_F77 # How to create reloadable object files. reload_flag=$lt_reload_flag_F77 reload_cmds=$lt_reload_cmds_F77 # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_F77 # A language specific compiler. CC=$lt_compiler_F77 # Is the compiler the GNU compiler? with_gcc=$GCC_F77 # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_F77 # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_F77 # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_F77 # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 # 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 # 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 # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_F77 # 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 a shared archive. archive_cmds=$lt_archive_cmds_F77 archive_expsym_cmds=$lt_archive_expsym_cmds_F77 # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_F77 module_expsym_cmds=$lt_module_expsym_cmds_F77 # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_F77 # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_F77 # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_F77 # 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 # 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 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_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 # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_F77 # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_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 # 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 # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_F77 # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_F77 # Specify filename containing input files. file_list_spec=$lt_file_list_spec_F77 # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_F77 # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_F77 postdep_objects=$lt_postdep_objects_F77 predeps=$lt_predeps_F77 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 # ### END LIBTOOL TAG CONFIG: F77 _LT_EOF cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: FC # The linker used to build libraries. LD=$lt_LD_FC # How to create reloadable object files. reload_flag=$lt_reload_flag_FC reload_cmds=$lt_reload_cmds_FC # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_FC # A language specific compiler. CC=$lt_compiler_FC # Is the compiler the GNU compiler? with_gcc=$GCC_FC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_FC # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_FC # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_FC # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_FC # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_FC # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_FC archive_expsym_cmds=$lt_archive_expsym_cmds_FC # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_FC module_expsym_cmds=$lt_module_expsym_cmds_FC # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_FC # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_FC # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_FC # 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_FC # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC # Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_FC # 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_FC # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_FC # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_FC # 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_FC # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_FC # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_FC # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_FC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_FC # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_FC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_FC # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_FC # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_FC # Specify filename containing input files. file_list_spec=$lt_file_list_spec_FC # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_FC # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_FC postdep_objects=$lt_postdep_objects_FC predeps=$lt_predeps_FC postdeps=$lt_postdeps_FC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_FC # ### END LIBTOOL TAG CONFIG: FC _LT_EOF ;; "src/getdata.h":H) chmod a-w src/getdata.h ;; 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 if test "x$make_cxxbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} C++" else BINDINGS_LEFT="${BINDINGS_LEFT} C++" fi if test "x$make_f77bindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-77" else BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-77" fi if test "x$make_f95bindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Fortran-95" else BINDINGS_LEFT="${BINDINGS_LEFT} Fortran-95" fi if test "x$make_idlbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} IDL" else BINDINGS_LEFT="${BINDINGS_LEFT} IDL" fi if test "x$make_matlabbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} MATLAB" else BINDINGS_LEFT="${BINDINGS_LEFT} MATLAB" fi if test "x$make_phpbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} PHP" else BINDINGS_LEFT="${BINDINGS_LEFT} PHP" fi if test "x$make_perlbindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Perl" else BINDINGS_LEFT="${BINDINGS_LEFT} Perl" fi if test "x$make_pybindings" != "xno"; then BINDINGS_BUILT="${BINDINGS_BUILT} Python" else BINDINGS_LEFT="${BINDINGS_LEFT} Python" fi if test "x$BINDINGS_BUILT" = "x"; then BINDINGS_BUILT=" none" fi if test "x$BINDINGS_LEFT" = "x"; then BINDINGS_LEFT=" none" fi if test "x$ENCODINGS_MODS" = "x"; then ENCODINGS_MODS=" none" fi if test "x$ENCODINGS_LEFT" = "x"; then ENCODINGS_LEFT=" none" fi if test "x$enable_debug$enable_assert" = "xnoyes"; then enable_debug="assert only" fi echo echo "Configuration summary: " echo " Build platform: ${build}" if test "x${cross_compiling}" != "xno"; then echo " Cross compiling for: ${host}" fi echo " ANSI C compatibility mode: ${disable_c99}" echo " Legacy API: ${include_legacy_api}" echo " Verbose debugging: ${enable_debug}" echo " Fast unaligned memory access: ${gd_unaligned_ok}" echo " Use modules: ${use_modules}" if test "x${use_modules}" != "xno"; then echo " Thread-safe dynamic loading: ${use_pthread}" fi echo echo " Supported internal encodings: ${ENCODINGS_BUILT}" if test "x${use_modules}" != "xno"; then echo " Supported external encodings: ${ENCODINGS_MODS}" fi echo " Unsupported encodings: ${ENCODINGS_LEFT}" echo echo " Bindings built: ${BINDINGS_BUILT}" echo " Bindings not built: ${BINDINGS_LEFT}" echo libgetdata-0.9.0/doc/0000740000175000017500000000000012614323564014547 5ustar alastairalastairlibgetdata-0.9.0/doc/README.perl0000640000175000017500000000105412614323564016372 0ustar alastairalastairPERL BINDINGS FOR GETDATA ========================= The Perl bindings consist of a perl module, `GetData.pm'. They should work with Perl 5.6 or newer. Complex data are represented within the module as Math::Complex objects. The GetData Perl bindings are documented in POD markup within GetData.pm. After installation, this documentation should be available in section 3 of the UNIX manual: $ man 3 GetData Before installation, the manual can be read using a command along the lines of $ pod2man bindings/perl/GetData.pm.in | nroff -mandoc | less libgetdata-0.9.0/doc/Makefile.in0000640000175000017500000004455512614323564016633 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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.in $(srcdir)/Makefile.am \ $(am__dist_doc_DATA_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.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__dist_doc_DATA_DIST = README.cxx README.f77 README.f95 README.idl \ README.matlab README.perl README.python \ unclean_database_recovery.txt 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) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008, 2009, 2012, 2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign @MAKE_CXXBINDINGS_TRUE@READMECXX = README.cxx @MAKE_F77BINDINGS_TRUE@READMEF77 = README.f77 @MAKE_F95BINDINGS_TRUE@READMEF95 = README.f95 @MAKE_IDLBINDINGS_TRUE@READMEIDL = README.idl @MAKE_MATLABBINDINGS_TRUE@READMEMATLAB = README.matlab @MAKE_PERLBINDINGS_TRUE@READMEPERL = README.perl @MAKE_PYBINDINGS_TRUE@READMEPYTHON = README.python dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \ ${READMEMATLAB} ${READMEPERL} ${READMEPYTHON} \ unclean_database_recovery.txt all: all-am .SUFFIXES: $(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 doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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: $(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): 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: 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 clean-local 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 \ clean-local cscopelist-am ctags-am 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 tags-am uninstall \ uninstall-am uninstall-dist_docDATA clean-local: rm -rf *~ # 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: libgetdata-0.9.0/doc/README.idl0000640000175000017500000012764312614323564016215 0ustar alastairalastairIDL BINDINGS FOR GETDATA ======================== The IDL bindings for GetData provide bindings to the GetData library for the Interactive Data Language developed by Research Systems, Incorporated. They provide a dynamically loaded module (DLM) `idl_getdata.so', described by `idl_getdata.dlm', written in C, which will be installed in IDL's DLM search path. The bindings should work with any version of IDL from version 5.5 onwards, but are not compatible with earlier versions. Using DLMs ---------- If the DLM is installed in the correct place and found by the interpreter, no work should be needed to have the GetData functions available in the interpreter. To check if the GetData bindings have been found, execute: IDL> HELP, /DLM If the GetData IDL bindings have been found, you should see among the output something similar to: *** GETDATA - IDL GetData bindings (not loaded) Version: 0.8.0, Build Date: Thu Apr 12 00:00:00 UTC 2012, Source: The GetData Project Path: /usr/local/rsi/idl/bin/bin.linux.x86/idl_getdata.so The DLM will be automatically loaded by the interpreter the first time a IDL GetData function or procedure is referenced. If no GETDATA entry is present, in the list returned by the above command, check that these bindings have been installed in the correct place. The current DLM search path can be printed with: IDL> PRINT, !DLM_PATH If you find that the install process has installed idl_getdata.so in the wrong place you can either: * change the installed location by passing --with-idl-dlm-dir=PATH to GetData's ./configure script, and rebuild GetData, or * change IDL's DLM search path by setting or modifying the environmental variable IDL_DLM_PATH before starting the IDL interpreter. See Appendix D of the IDL Reference Guide for further details. This situation should be unlikely, since the DLM install directory is determined by ./configure by running the IDL interpreter to read the value of !DLM_PATH explicitly. NB: Third-party DLMs, such as these bindings, cannot be used in timed demo mode. To use the IDL GetData bindings, a fully licensed version of IDL is required. An unlicensed version of IDL will never find these bindings. IDL GetData Preliminaries ------------------------- Because the GetData library relies on a large number of symbolic constants, a convenience function, GETDATA_CONSTANTS() is provided. This function will create a structure of constants, with member names identical to the GetData C API's symbolic constants, but without the initial GD_ (eg. E_OK, INT8, &c.). This is a structure of type `GD_CONSTANTS', which is defined in the bindings. The typical use of this function is to define a new system variable, called `!GD' which can then be used to reference these constants, when necessary. This can be done using the following command: IDL> DEFSYSV, "!GD", GETDATA_CONSTANTS() although this isn't strictly necessary, since constants could be fetched from GETDATA_CONSTANTS() as necessary, if desired. Nevertheless, for simplicity, the remainder of this documentation refers to the system variable !GD as defined above, whenever it needs to refer to a GetData constant. Instead of using a DIRFILE pointer, an integer dirfile unit number is used to refer to an open dirfile object. Space is available in the DLM for only 1023 dirfile units. If an application attempts to open more than 1023 dirfiles simultaneously, the DLM will emit an error message and immediately return to the interpreter. Passing an invalid dirfile unit number to a procedure which requires one as input (other than GD_CLOSE and GD_DISCARD, which will simply ignore it) will result in the call failing with error code !GD.E_BAD_DIRFILE. IDL supports all GetData data types with the exception of INT8. Attempting to return data as INT8 will result in an error. Except for the functions GETDATA_CONSTANTS, GD_ERROR, GD_ERROR_COUNT, GD_ERROR_STRING, and GD_INVALID_DIRFILE, all IDL GetData functions and procedures may take two optional keyword parameters which deal with error reporting: ERROR: a variable into which the dirfile error number resulting from this call will be stored. It will be the !GD.E_* error code corresponding to the C API error code. On success this will be !GD.E_OK (= 0). If this parameter is not specified, the dirfile error can still be retrieved by calling GD_ERROR() after this call. ESTRING: a variable in which the string representation of the error resulting from this call will be stored. If this parameter is not specified, the the dirfile error string can still be retrieved by calling GD_ERROR_STRING() after the call. For brevity, these keyword parameters are omitted from the subroutine prototypes given below. The GD_ENTRY Structure ---------------------- The GD_ENTRY structure is used in place of the C API's gd_entry_t data type. It is essentially equivalent and is defined as: ** Structure GD_ENTRY, 30 tags, length=568, data length=546: FIELD STRING FIELD_TYPE INT FLAGS UINT FRAGMENT INT IN_FIELDS STRING Array[3] A DOUBLE Array[6] CA DCOMPLEX Array[6] ARRAY_LEN INT B DOUBLE Array[3] CB DCOMPLEX Array[3] BITNUM INT COUNT_VAL INT DATA_TYPE INT DIVIDEND DOUBLE CDIVIDEND DCOMPLEX M DOUBLE Array[3] CM DCOMPLEX Array[3] N_FIELDS INT NUMBITS INT PERIOD INT POLY_ORD INT SCALAR STRING Array[6] SCALAR_IND INT Array[6] SHIFT LONG SPF UINT TABLE STRING UTHRESHOLD ULONG ITHRESHOLD LONG RTHRESHOLD DOUBLE WINDOP INT The DATA_TYPE member is used for both RAW and CONST fields. (The gd_entry_t object has a 'const_type' member for the CONST fields instead.) For details on how to use this structure, see the gd_entry(3) manual page. IDL GetData Subroutines ----------------------- The following subroutines are available in the IDL GetData bindings. In general, they are named equivalently to their counterparts in the C API, and differences in behaviour from the C API functionality is noted below. Keyword parameters are always optional, unless noted below. FUNCTION GETDATA_CONSTANTS() This function takes no inputs or keyword parameters, and returns a GD_CONSTANTS structure defining various useful GetData library constants. The use of this function is discussed further above. PROCEDURE GD_ADD, dirfile_unit, entry, PARENT=parent This procedure adds the field entry given by 'entry' to the dirfile. The 'entry' input should be a GD_ENTRY structure. If the keyword parameter PARENT is given, the field will be added as a metafield under the given parent field, otherwise the field will be added to the fragment index indicated in the 'entry' structure. See gd_add(3) and gd_madd(3). PROCEDURE GD_ADD_ALIAS, dirfile_unit, field_code, target, FRAGMENT=fragment, PARENT=parent This procedure adds an alias called 'field_code' pointing to 'target' to the fragment indicated by 'fragment'. See gd_add_alias(3). PROCEDURE GD_ADD_BIT, dirfile_unit, field_name, in_field, BITNUM=bitnum, FRAGMENT=fragment, NUMBITS=numbits, PARENT=parent This procedure adds a BIT field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field'. If not given, bitnum defaults to zero and numbits to one. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_bit(3) and gd_madd_bit(3). PROCEDURE GD_ADD_CARRAY, dirfile_unit, field_name, FRAGMENT=fragment, LENGTH=length, PARENT=parent, TYPE=type, VALUE=value This procedure adds a CARRAY field with the name 'field_name' to the dirfile. The storage type of the field is given by the TYPE keyword, which defaults to !GD.FLOAT64. If given, the initial value of the field is given by the VALUE keyword, in this case LENGTH is ignored, if also given. if VALUE is not given, LENGTH must be specified, and the field will be initialised to all zeros. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_carray(3) and gd_madd_carray(3). PROCEDURE GD_ADD_CONST, dirfile_unit, field_name, FRAGMENT=fragment, PARENT=parent, TYPE=type, VALUE=value This procedure adds a CONST field with the name 'field_name' to the dirfile. The storage type of the field is given by the TYPE keyword, which defaults to !GD.FLOAT64. The initial value of the field is given by the VALUE keyword, which defaults to zero. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_const(3) and gd_madd_const(3). PROCEDURE GD_ADD_DIVIDE, dirfile_unit, field_name, in_field1, in_field2, FRAGMENT=fragment, PARENT=parent This procedure adds a DIVIDE field with the name 'field_name' to the dirfile. The input vector fields are given by 'in_field1' and 'in_field2'. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_divide(3) and gd_madd_divide(3). PROCEDURE GD_ADD_LINCOM, dirfile_unit, field_name, in_field1, m1, b1, [in_field2, m2, b2, [in_field3, m3, b3,]] FRAGMENT=fragment, PARENT=parent This procedure adds a LINCOM field with the name 'field_name' to the dirfile. The number of fields in the LINCOM is determined by the number of inputs passed to the function. The scale factors and offset terms may be real or complex valued. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_lincom(3), gd_add_clincom(3), gd_madd_lincom(3), and gd_madd_clincom(3). PROCEDURE GD_ADD_LINTERP, dirfile_unit, field_name, in_field, table, FRAGMENT=fragment, PARENT=parent This procedure adds a LINTERP field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field', and pathname of the look up table is 'table'. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_linterp(3) and gd_madd_linterp(3). PROCEDURE GD_ADD_MPLEX, dirfile_unit, field_name, in_field, count_field, value, FRAGMENT=fragment, MAX=max, PARENT=parent This procedure adds a MPLEX field with the name 'field_name' to the dirfile. The input vector is 'in_field', the multiplex index vector is 'count_field', the value of the multiplex index is 'value' and the maximum value is 'max', if specified. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_mplex(3) and gd_madd_mplex(3). PROCEDURE GD_ADD_MULTIPLY, dirfile_unit, field_name, in_field1, in_field2, FRAGMENT=fragment, PARENT=parent This procedure adds a MULTIPLY field with the name 'field_name' to the dirfile. The input vector fields are given by 'in_field1' and 'in_field2'. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_multiply(3) and gd_madd_multiply(3). PROCEDURE GD_ADD_PHASE, dirfile_unit, field_name, in_field, shift, FRAGMENT=fragment, PARENT=parent This procedure adds a PHASE field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field' and the shift by 'shift'. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_phase(3) and gd_madd_phase(3). PROCEDURE GD_ADD_POLYNOM, dirfile_unit, field_name, in_field, a0, [a1, [a2, [a3, [a4, [a5,]]]]] FRAGMENT=fragment, PARENT=parent This procedure adds a POLYNOM field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field' and the shift by the remaining inputs. The order of the polynomial will be automatically determined by the number of co-efficients given. If only a0 is given, it should be an array containing the co-efficients, otherwise each a should be one co-efficient. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_polynom(3) and gd_madd_polynom(3). PROCEDURE GD_ADD_RAW, dirfile_unit, field_name data_type, FRAGMENT=fragment, SPF=spf This procedure adds a RAW field with the name 'field_name' to the dirfile. The data type specified by 'data_type' should be one of the data type constants: !GD.UINT8, !GD.INT8, &c. The number of samples per frame of the raw data is given by the SPF keyword, which defaults to one, if not given. The field will be added to the fragment indexed by FRAGMENT, if given, or else to the primary format file. See gd_add_raw(3). PROCEDURE GD_ADD_RECIP, dirfile_unit, field_name, in_field, DIVIDEND=dividend, FRAGMENT=fragment, PARENT=parent This procedure adds a RECIP field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field'. If not given, dividend defaults to one. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_recip(3), gd_add_crecip(3), gd_madd_recip(3), gd_madd_crecip(3). PROCEDURE GD_ADD_SBIT, dirfile_unit, field_name, in_field, BITNUM=bitnum, FRAGMENT=fragment, NUMBITS=numbits, PARENT=parent This procedure adds a SBIT field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field'. If not given, bitnum defaults to zero and numbits to one. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_sbit(3) and gd_madd_sbit(3). PROCEDURE GD_ADD_SPEC, dirfile_unit, line, FRAGMENT=fragment, PARENT=parent This procedure adds a field described by the field specification line 'line' to the dirfile. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_spec(3) and gd_madd_spec(3). PROCEDURE GD_ADD_STRING, dirfile_unit, field_name, FRAGMENT=fragment, PARENT=parent, VALUE=value This procedure adds a STRING field with the name 'field_name' to the dirfile. The initial value of the field is given by the VALUE keyword, which defaults to the empty string. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_string(3) and gd_madd_string(3). PROCEDURE GD_ADD_WINDOW, dirfile_unit, field_name, in_field, check_field, threshold, /CLR, /EQ, /GE, /GT, /LE, /LT, /NE, /SET, FRAGMENT=fragment, PARENT=parent This procedure adds a WINDOW field with the name 'field_name' to the dirfile. The input vector field is given by 'in_field' and the check field is given by 'check_field. The window operation is specified by one of the optional parameters, CLR, EQ, GE, &c. If PARENT is given, this field is added as a metafield under the given parent field. Otherwise, the field is added to the fragment indexed by FRAGMENT, or the primary format file if FRAGMENT is not given either. See gd_add_window(3), and gd_madd_window(3). FUNCTION GD_ALIASES(dirfile_unit, field_code) This function returns a list of aliases of 'field_code' (including field_code) itself. See gd_aliases(3). FUNCTION GD_ALIAS_TARGET(dirfile_unit, field_code) This procedure returns the target pointed to by the alias 'field_code'. See gd_alias_target(3). PROCEDURE GD_ALTER_AFFIXES(dirfile_unit, FRAGMENT=fragment, PREFIX=prefix, SUFFIX=suffix) This procedure modifies the prefix and/or suffix of the fragment index specified by FRAGMENT. Zero is assumed if FRAGMENT is not specified. See gd_alter_affixes(3). PROCEDURE GD_ALTER_BIT, dirfile_unit, field_code, BITNUM=bitnum, IN_FIELD=in_field, NUMBITS=numbits This procedure modifies the metadata of the BIT field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_bit(3). PROCEDURE GD_ALTER_CARRAY, dirfile_unit, field_code, TYPE=type, LENGTH=length This procedure modifies the metadata of the field specified by 'field_code', updating the storage data type and array length if specified as keyword parameters. If given, TYPE should be one of the data type constants: !GD.UINT8, !GD.INT8, &c. See gd_alter_carray(3). PROCEDURE GD_ALTER_CONST, dirfile_unit, field_code, TYPE=type This procedure modifies the metadata of the field specified by 'field_code', updating the storage data type if specified as a keyword parameter. If given, TYPE should be one of the data type constants: !GD.UINT8, !GD.INT8, &c. See gd_alter_const(3). PROCEDURE GD_ALTER_DIVIDE, dirfile_unit, field_code, IN_FIELD1=in_field1, IN_FIELD2=in_field2 This procedure modifies the metadata of the DIVIDE field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_divide(3). PROCEDURE GD_ALTER_ENCODING, dirfile_unit, encoding, FRAGMENT=fragment, /RECODE This procedure modifies the encoding of part or all of the dirfile. The new encoding is given be 'encoding' and should either be a string indicating the encoding type: 'BZIP2', 'GZIP', 'LZMA', 'SLIM', 'TEXT', 'NONE', or else a numeric encoding type: !GD.BZIP2_ENCODED, &c. If FRAGMENT is given, only the fragment with that index is modified, otherwise all fragments are modified. If RECODE is specified, the data files on disk will be updated for the new encoding. See gd_alter_encoding(3). PROCEDURE GD_ALTER_ENDIANNESS, dirfile_unit, /ARM_ENDIAN, /BIG_ENDIAN, FRAGMENT=fragment, /LITTLE_ENDIAN, /NOT_ARM_ENDIAN, /RECODE This procedure modifies the byte sex of part or all of the dirfile. The new byte sex is the bitwise or of the two endianness KEYWORD flags, if given, as described in the gd_alter_endianness manual page. If FRAGMENT is given, only the fragment with that index is modified, otherwise all fragments are modified. If RECODE is specified, the data files on disk will be updated for the new byte sex. See gd_alter_endianness(3). PROCEDURE GD_ALTER_ENTRY, dirfile_unit, field_code, entry, /RECODE This procedure modifies the field specified by 'field_code' to conform to the field metadata given in the GD_ENTRY structure 'entry'. If RECODE is specified, and the field is a RAW or LINTERP entry, the data on disk will be updated to reflect changes to the field metadata. See gd_alter_entry(3). PROCEDURE GD_ALTER_FRAMEOFFSET, dirfile_unit, frameoffset, FRAGMENT=fragment, /RECODE This procedure modifies the frame offset of part or all of the dirfile. The new frame offset is given by 'frameoffset'. If FRAGMENT is given, only the fragment with that index is modified, otherwise all fragments are modified. If RECODE is specified, the data files on disk will be updated for the new frame offset. See gd_alter_frameoffset(3). PROCEDURE GD_ALTER_LINCOM, dirfile_unit, field_code, B=b, IN_FIELDS=in_fields, M=m, N_FIELDS=n_fields This procedure modifies the metadata of the LINCOM field specified by 'field_code', updating only those field parameters specified as keyword parameters. If specified, B, IN_FIELDS, M must be arrays of length n_fields (which may be simultaneously updated). The numeric parameters may be either real or complex valued. If N_FIELDS specifies more fields than the field currently has, but B, IN_FIELDS, or M are not specified, the new values will contain uninitialised data. See gd_alter_lincom(3) and gd_alter_clincom(3). PROCEDURE GD_ALTER_LINTERP, dirfile_unit, field_code, IN_FIELD=in_field, /RENAME_TABLE, TABLE=table This procedure modifies the metadata of the LINTERP field specified by 'field_code', updating only those field parameters specified as keyword parameters. If both TABLE and RENAME_TABLE are specified, the name of the file containing the look up table will be renamed to reflect changes to the field metadata. See gd_alter_linterp(3). PROCEDURE GD_ALTER_MPLEX, dirfile_unit, field_code, COUNT_FIELD=count_field, PERIOD=period, COUNT_VAL=count_val, IN_FIELD=in_field This procedure modifies the metadata of the MPLEX field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_mplex(3). PROCEDURE GD_ALTER_MULTIPLY, dirfile_unit, field_code, IN_FIELD1=in_field1, IN_FIELD2=in_field2 This procedure modifies the metadata of the MULTIPLY field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_multiply(3). PROCEDURE GD_ALTER_PHASE, dirfile_unit, field_code, IN_FIELD=in_field, SHIFT=shift This procedure modifies the metadata of the PHASE field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_phase(3). PROCEDURE GD_ALTER_POLYNOM, dirfile_unit, field_code, A=a, IN_FIELD=in_field, POLY_ORD=poly_ord This procedure modifies the metadata of the POLYNOM field specified by 'field_code', updating only those field parameters specified as keyword parameters. If specified, A must be an array of length poly_ord + 1 (which may be simultaneously updated). This array may be either real or complex valued. If POLY_ORD specifies a higher order than the field currently has, but A is not specified, the new co-efficients will contain uninitialised data. This procedure may also be called GD_ALTER_CPOLYNOM without change in functionality. See gd_alter_polynom(3) and gd_alter_cpolynom(3). PROCEDURE GD_ALTER_RAW, dirfile_unit, field_code, /RECODE, SPF=spf, TYPE=type This procedure modifies the metadata of the RAW field specified by 'field_code', updating only those field parameters specified as keyword parameters. If given, TYPE should be one of the data type constants: !GD.UINT8, !GD.INT8, &c. If RECODE is specified, the file on disk backing this RAW file will be update to reflect changes in the field metadata. See gd_alter_raw(3). PROCEDURE GD_ALTER_RECIP, dirfile_unit, field_code, DIVIDEND=dividend, IN_FIELD=in_field This procedure modifies the metadata of the RECIP field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_recip(3) and gd_alter_crecip(3). PROCEDURE GD_ALTER_SBIT, dirfile_unit, field_code, BITNUM=bitnum, IN_FIELD=in_field, NUMBITS=numbits This procedure modifies the metadata of the SBIT field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_sbit(3). PROCEDURE GD_ALTER_SPEC, dirfile_unit, line, PARENT=parent, /RECODE This procedure modifies the metadata of the field specified by the field specification line 'line' to conform to the specification. If /RECODE is given, data on disk is update, if applicable, to correspond with changes made to the field metadata. If PARENT is given, the field is assumed to be a metafield under the given parent. See gd_alter_spec(3) and gd_malter_spec(3). PROCEDURE GD_ALTER_WINDOW, dirfile_unit, field_code, CHECK_FIELD=check_field, /CLR, /EQ, /GE, /GT, IN_FIELD=in_field, /LE, /LT, /NE, /SET, THRESHOLD=threshold This procedure modifies the metadata of the WINDOW field specified by 'field_code', updating only those field parameters specified as keyword parameters. See gd_alter_window(3). FUNCTION GD_BOF(dirfile_unit, field_code) This function returns the sample number of the position of the beginning-of-field marker for the specified field. See gd_bof(3). FUNCTION GD_CARRAY_LEN(dirfileunit, field_code) This function returns the length of the specified field. See gd_carray_len(3). PROCEDURE GD_CLOSE, dirfile_unit, /DISCARD This procedure closes the specified dirfile. If DISCARD is not given, pending metadata changes are first flushed to disk. In all cases, pending data writes are flushed to disk before close. See gd_close(3) and gd_discard(3). FUNCTION GD_CONSTANTS(dirfile_unit, PARENT=parent, TYPE=type) This function returns the value of all CONST fields in the dirfile, converting them to the return type specified by TYPE, which should be one of the data type constants: !GD.UINT8, !GD.UINT16, &c. If TYPE is not specified, the values are returned as double precision data, even if they are stored as complex values. If PARENT is given, the value of CONST metafields defined for the given parent field will be returned, otherwise all non-meta CONST fields will be returned. See gd_constants(3) and gd_mconstants(3). PROCEDURE GD_DELETE, dirfile_unit, field_code, /DEL_DATA, /DEREF, /FORCE, /META This procedure delete the field or alias specified by 'field_code' from the database. The meanings of the keyword flags are discussed in the gd_delete(3) manual page (q.v.). FUNCTION GD_DESYNC(dirfile_unit, /PATHCHECK, /REOPEN) This function returns non-zero if the loaded dirfile has become desynchronised from the metadata on disk (due to a third party modifying the dirfile on disk). If /PATHCHECK is specified, the metadata on disk will be probed via the full canonicalised pathnames to the fragment files, otherwise the dirfile's cached directory descriptors will be used. If /REOPEN is given, the dirfile will be rescanned and updated if a change is discovered. See gd_desync(3). FUNCTION GD_DIRFILENAME(dirfile_unit) This function returns the name of the dirfile specified by 'dirfile_unit'. See dirfilename(3). FUNCTION GD_DIRFILE_STANDARDS(dirfile_unit, [version,] /LATEST, /EARLIEST) This function returns the current Standards Version of the loaded dirfile, optionally setting it first. If more than one of version, LATEST or EARLIEST are provided, results are undefined. See gd_dirfile_standards(3). FUNCTION GD_ENCODING(dirfile_unit, FRAGMENT=fragment) This function returns the encoding scheme of the fragment indexed by FRAGMENT, or of the primary format file, if FRAGMENT is omitted. The return value will be one of the !GD.*_ENCODED constants. See gd_encoding(3). FUNCTION GD_ENCODING_SUPPORT(encoding) This function returns !GD.RDWR, !GD.RONLY, or -1 depending on the runtime support for the specified encoding. See gd_encoding_support(3). FUNCTION GD_ENDIANNESS(dirfile_unit, FRAGMENT=fragment) This function returns the byte sex of the fragment indexed by FRAGMENT, or of the primary format file, if FRAGMENT is omitted. The return value will be one of !GD.BIG_ENDIAN or !GD.LITTLE_ENDIAN bitwise or'd with one of !GD.ARM_ENDIAN or !GD.NOT_ARM_ENDIAN. See gd_endianness(3). FUNCTION GD_ENTRY(dirfile_unit, field_code) This function returns a GD_ENTRY structure containing the field metadata for the field specified by 'field_code'. See gd_entry(3). FUNCTION GD_ENTRY_LIST(dirfile_unit, /ALIASES, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS, TYPE=type, /VECTORS) This function returns a list of entry names defined by the dirfile. If PARENT is given, a list of metafields for the given parent will be returned otherwise top-level fields are considered. If TYPE is given, which should be one of the !GD.*_ENTRY constants, only fields of the given type will be returned. If /ALIASES, /SCALARS or /VECTORS is specified, the TYPE parameter is ignored if it is also given. The list returned includes aliases, unless /NOALIAS is specified, but not hidden fields, unless /HIDDEN is specified. See gd_entry_list(3). FUNCTION GD_ENTRY_TYPE(dirfile_unit, field_code) This function returns the field type of the field specified by 'field_code'. The returned value will be one of the !GD.*_ENTRY constants. See gd_entry_type(3). FUNCTION GD_EOF(dirfile_unit, field_code) This function returns the sample number of the position of the end-of-field marker for the specified field. See gd_eof(3). FUNCTION GD_ERROR(dirfile_unit) This function returns the error status of the last call to the GetData library on the specified dirfile. The return value will be one of the !GD.E_* codes. This function does not take the normal ERROR and ESTRING keyword parameters. See gd_error(3). FUNCTION GD_ERROR_COUNT(dirfile_unit) This function returns the number of errors encountered by the GetData library on the specified dirfile since this function was last called (or since the dirfile was opened, if this is the first call to this function). See gd_error_count(3). FUNCTION GD_ERROR_STRING(dirfile_unit) This function returns a human readable string describing the error status of the last call to the GetData library on the specified dirfile. This function does not take the normal ERROR and ESTRING keyword parameters. See gd_error_string(3). FUNCTION GD_FIELD_LIST(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS, TYPE=type, /VECTORS) An alias for GD_ENTRY_LIST (q.v.) kept for backwards compatibility. FUNCTION GD_FLAGS(dirfile_unit, PRETTY_PRINT=pretty_print, VERBOSE=verbose) This function modifies the operational flags of the dirfile. If a keyword parameter is zero, the corresponding flag will be cleared; if a keyword parameter is one, the corresponding flag will be set; otherwise, the flag is unchanged. The function returns the value of the flags register after modification. See gd_flags(3). PROCEDURE GD_FLUSH, dirfile_unit, FIELD_CODE=field_code, /NOCLOSE, /NOSYNC This procedure flushes pending data writes to disk. If FIELD_CODE is given, only writes for the given field are flushed to disk. Otherwise, all fields and metadata changes are flushed to disk. In normal operation, first the raw data is flushed (synced) and then the raw data files are closed. Specifying /NOSYNC will skip the flushing; specifying /NOCLOSE will skip the closing. Specifying both will result in an error (since the function is left with nothing to do.) See gd_flush(3), gd_sync(3) and gd_raw_close(3). FUNCTION GD_FRAGMENT_AFFIXES(dirfile_unit, FRAGMENT=fragment) This function returns a two element array of the field code prefix and suffix of the fragment specified by FRAGMENT. Zero is assumed if FRAGMENT is not specified. See gd_fragment_affixes(3). FUNCTION GD_FRAGMENT_INDEX(dirfile_unit, field_code) This function returns the index of the format file fragment which defines the field specified by 'field_code'. See gd_fragment_index(3). FUNCTION GD_FRAGMENTNAME(dirfile_unit, fragment_index) This function returns the pathname of the format file fragment indexed by 'fragment_index'. See gd_fragmentname(3). FUNCTION GD_FRAMENUM(dirfile_unit, field_code, value, FIELD_START=field_start, FIELD_END=field_end) This function performs a reverse look up on the field specified by 'field_code'. It returns the fractional frame number where the field has the value given by 'value'. The search is performed between the frame limits FRAME_START and FRAME_END. If FRAME_START is omitted, the beginning of the frame is used; if FRAME_END is omitted, the end of frame is used. See gd_framenum(3) and gd_framenum_subset(3). FUNCTION GD_FRAMEOFFSET(dirfile_unit, FRAGMENT=fragment_index) This function returns the frame offset of the fragment indexed by FRAGMENT, or of the primary format file, if FRAGMENT is omitted. See gd_frameoffset(3). FUNCTION GD_GETDATA(dirfile_unit, field_code, FIRST_FRAME=first_frame, FIRST_SAMPLE=first_sample, NUM_FRAMES=num_frames, NUM_SAMPLES=num_samples, TYPE=type) This function retrieves data from the field specified by 'field_code'. It returns a list of data, of the type given by TYPE, which should be one of the data type constants: !GD.UINT8, !GD.UINT16, &c. If TYPE is omitted, this function returns double precision data, even if originally complex valued. The first sample read is given by FIRST_FRAME and/or FIRST_SAMPLE. If neither of these are given, reading occurs at the current position. The number of samples requested is given by NUM_FRAMES and/or NUM_SAMPLES. Fewer samples than requested may be returned, without causing an error, if the end of the field is encountered. See getdata(3). FUNCTION GD_GET_CARRAY(dirfile_unit, field_code, TYPE=type) This function returns the value of a CONST field, converting it to the return type specified by TYPE, which should be one of the data type constants: !GD.UINT8, !GD.UINT16, &c. If TYPE is not specified, the value is returned as a double precision number, even if complex valued. See gd_get_constant(3). FUNCTION GD_GET_CONSTANT(dirfile_unit, field_code, LENGTH=length, START=start, TYPE=type) This function returns all or part of a CARRAY field, converting the data to the return type specified by TYPE, which should be one of the data type constants: !GD.UINT8, !GD.UINT16, &c. If TYPE is not specified, !GD.FLOAT64 is assumed. The first element returned is given by the START keyword, which defaults to zero. If LENGTH is not specified, all elements from START to the end of the field are returned, otherwise. See gd_get_carray_slice(3). FUNCTION GD_GET_STRING(dirfile_unit, field_code) This function returns the value of a STRING field specified by 'field_code'. See gd_get_string(3). FUNCTION GD_HIDDEN(dirfile_unit, field_code) This function returns one if the field or alias specified by 'field_code' is hidden, or zero if it is not. On error it returns -1. See gd_hidden(3). PROCEDURE GD_HIDE, dirfile_unit, field_code This procedure hides the field or alias specified by 'field_code'. See gd_hide(3). PROCEDURE GD_INCLUDE, dirfile_unit, fragment_name, /ARM_ENDIAN, /BIG_ENDIAN, /CREAT, ENCODING=encoding, /EXCL, /FORCE_ENCODING, /FORCE_ENDIANNESS, FRAGMENT=fragment, INDEX=index, /IGNORE_DUPS, /IGNORE_REFS, /LITTLE_ENDIAN, /NOT_ARM_ENDIAN, /PEDANTIC, /PERMISSIVE, PREFIX=prefix, SUFFIX=suffix, /TRUNC This procedure adds the format file fragment specified by 'fragment_name' to the format file indexed by FRAGMENT, or else the primary format file, if FRAGMENT is not given. If specified, the fragment index of the newly added fragment is returned in INDEX. If specified, ENCODING should either be a string indicating the encoding type: 'BZIP2', 'GZIP', 'LZMA', 'SLIM', 'TEXT', 'NONE', or else a numeric encoding type: !GD.BZIP2_ENCODED, &c. The meaning of the remaining keyword flags is discussed in the gd_include manual page. See gd_include(3) and gd_include_affix(3). FUNCTION GD_INVALID_DIRFILE() This functions returns a dirfile unit number corresponding to a newly created invalid dirfile. See gd_invalid_dirfile(3). PROCEDURE GD_METAFLUSH, dirfile_unit This procedure flushes pending metadata changes to the dirfile to disk. See gd_metaflush(3). PROCEDURE GD_MOVE, dirfile_unit, field_code, new_fragment, /DANGLE, /FORCE, /MOVE_DATA, /UPDATEDB This procedure moves the field or alias specified by 'field_code' to the format file fragment indexed by 'new_fragment'. See gd_move(3) for the meaning of the flags. PROCEDURE GD_MPLEX_LOOKBACK dirfile_unit, [lookback,] /ALL This procedure sets the MPLEX lookback length to the value given, if supplied, or to the maximum value, if /ALL is given, or else to the default value if neither is provided. See gd_mplex_lookback(3). FUNCTION GD_NALIASES(dirfile_unit, field_code) This function returns the number of aliases of 'field_code' (including field_code itself). See gd_naliases(3). FUNCTION GD_NATIVE_TYPE(dirfile_unit, field_code) This function returns the native data type of the field given by 'field_code'. The return value will be one of the data type constants: !GD.UINT8, !GD.INT8, &c. See gd_native_type(3). FUNCTION GD_NENTRIES(dirfile_unit, /ALIAS, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS, TYPE=type, /VECTORS) This function returns the number of entries in the dirfile satisfying the given criteria. If PARENT is given, the number of metafields for the given parent will be returned otherwise top-level fields are considered. If TYPE is given, which should be one of the !GD.*_ENTRY constants, only fields of the given type will be counted. If /ALIASES, /SCALARS or /VECTORS is specified, the TYPE parameter is ignored if it is also given. The number returned includes aliases, unless /NOALIAS is specified, but not hidden fields, unless /HIDDEN is specified. See gd_nentries(3). FUNCTION GD_NFIELDS(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS, TYPE=type, /VECTORS) An alias for GD_NENTRIES (q.v.) kept for backwards compatibility. FUNCTION GD_NFRAGMENTS(dirfile_unit) This function returns the number of format file fragments in the dirfile. See gd_nfragments(3). FUNCTION GD_NFRAMES(dirfile_unit) This function returns the number of frames in the dirfile. See gd_nframes(3). FUNCTION GD_NVECTORS(dirfile_unit, PARENT=parent) This function returns the number of vector type fields defined by the dirfile. If PARENT is given, the number vector type metafields for the given parent will be returned. Otherwise, the total number of vector fields in the database will be returned. See gd_nvectors(3) and gd_nmvectors(3). FUNCTION GD_OPEN(dirfilename, /ARM_ENDIAN, /BIG_ENDIAN, /CREAT, ENCODING=encoding, /EXCL, /FORCE_ENCODING, /FORCE_ENDIANNESS, /IGNORE_DUPS, /IGNORE_REFS, /LITTLE_ENDIAN, /NOT_ARM_ENDIAN, /PEDANTIC, /PERMISSIVE, /PRETTY_PRINT, /RDWR, /TRUNC, /TRUNCSUB, /VERBOSE) This function opens the dirfile specified by 'dirfilename', returning the dirfile unit number which can be subsequently used to refer to it. If specified, ENCODING should either be a string indicating the encoding type: 'BZIP2', 'GZIP', 'LZMA', 'SIE', 'SLIM', 'TEXT', 'ZZIP', 'ZZSLIM', 'NONE', or else a numeric encoding type: !GD.BZIP2_ENCODED, &c. The meaning of the other keyword flags is explained in the gd_open(3) manual page. A parser callback function cannot be used by the IDL GetData bindings. See gd_open(3). FUNCTION GD_PARENT_FRAGMENT(dirfile_unit, fragment_index) This function returns the index of the format file fragment which includes the fragment indexed by 'fragment_index'. See gd_parent_fragment(3). PROCEDURE GD_PROTECT, dirfile_unit, protection, FRAGMENT=fragment This function changes the (advisory) protection level of the fragment indexed by FRAGMENT to 'protection', which should be one of the !GD.PROTECT_* values. If FRAGMENT is not given, the protection level of all fragments is changed. See gd_protect(3). FUNCTION GD_PROTECTION(dirfile_unit, FRAGMENT=fragment) This function returns the (advisory) protection level for the format file fragment indexed by FRAGMENT, or for the primary format file, if FRAGMENT is omitted. The returned value will be one of the !GD.PROTECT_* constants. See gd_protection(3). PROCEDURE GD_PUTDATA, dirfile_unit, field_code, data, FIRST_FRAME=first_frame, FIRST_SAMPLE=first_sample This procedure writes data in the numerical vector 'data' to the field specified by 'field_code'. The keywords FIRST_FRAME and/or FIRST_SAMPLE indicate the first sample written. If neither of these are specified, the data is written at the current position. See putdata(3). PROCEDURE GD_PUT_CARRAY, dirfile_unit, field_code, value, START=start This procedure stores the data in 'value' to the CARRAY field specified by 'field_code'. START indicates the first element of the field which is written. Zero is assumed for START if not given. See gd_put_carray_slice(3). PROCEDURE GD_PUT_CONSTANT, dirfile_unit, field_code, value This procedure stores the number 'value' in the CONST field specified by 'field_code'. See gd_put_constant(3). PROCEDURE GD_PUT_STRING, dirfile_unit, field_code, value This procedure stores the string 'value' in the STRING field specified by 'field_code'. See gd_put_string(3). FUNCTION GD_RAW_FILENAME(dirfile_unit, field_code) This function returns the pathname of the data file backing the RAW field specified by 'field_code'. See gd_raw_filename(3). FUNCTION GD_REFERENCE(dirfile_unit, [new_reference]) This function returns the name of the RAW field used as the reference field for the dirfile, after optionally changing it to new_reference. If the dirfile contains no reference field, the empty string is returned. See gd_reference(3). PROCEDURE GD_RENAME, dirfile_unit, field_code, new_name, /DANGLE, /FORCE, /MOVE_DATA, /UPDATEDB This function renames the field specified by 'field_code' to 'new_name'. See gd_rename(3) for the meaning of the flags. FUNCTION GD_SEEK(dirfile_unit, field_code, FRAME_NUM=frame_num, SAMPLE_NUM=sample_num, WHENCE=whence, /WRITE) This function sets the current I/O position of the field specified by 'field_code' to the position given by FRAME_NUM and SAMPLE_NUM (which both default to zero). WHENCE should be one of the !GD.SEEK_* symbols. If the next operation on the field is a write (via GD_PUTDATA), the /WRITE flag should also be specified. See gd_seek(3). FUNCTION GD_SPF(dirfile_unit, field_code) This function returns the number of samples per frame of the field specified by 'field_code'. See gd_spf(3). FUNCTION GD_STRINGS(dirfile_unit, PARENT=parent, TYPE=type) This function returns the value of all STRING fields in the dirfile. If PARENT is given, the value of STRING metafields defined for the given parent field will be returned, otherwise all non-meta STRING fields will be returned. See gd_strings(3) and gd_mstrings(3). FUNCTION GD_STRTOK(dirfile_unit, STRING=string) If STRING is given, this function returns the first token of the string. Otherwise, it returns the next token of a string provided to a previous call. See gd_strtok(3). FUNCTION GD_TELL(dirfile_unit, field_code) This function returns the current I/O position of the specified field. See gd_tell(3). PROCEDURE GD_UNHIDE, dirfile_unit, field_code This procedure unhides the field or alias specified by 'field_code'. See gd_unhide(3). PROCEDURE GD_UNINCLUDE, dirfile_unit, fragment_index, /DELETE This function removes the format file fragment indexed by 'fragment_index'. If DELETE is specified, the fragment is also deleted from disk. See gd_uninclude(3). FUNCTION GD_VALIDATE(dirfile_unit, field_code) This function checks whether 'field_code' is valid for reading and writing. If it is this function returns zero. Otherwise it returns non-zero. See gd_validate(3). PROCEDURE GD_VERBOSE_PREFIX, dirfile_unit, PREFIX=prefix) This procedure sets the dirfile verbose prefix to PREFIX, if given, or else removes it. See gd_verbose_prefix(3). FUNCTION GD_VECTOR_LIST(dirfile_unit, PARENT=parent) This function returns a list of vector type fields defined by the dirfile. If PARENT is given, a list of vector metafields for the given parent will be returned. Otherwise all non-meta vector fields will be returned. See gd_vector_list(3) and gd_mvector_list(3). libgetdata-0.9.0/doc/README.f770000640000175000017500000030321212614323564016034 0ustar alastairalastairFORTRAN 77 BINDINGS FOR GETDATA =============================== This README describes the Fortran 77 bindings for the GetData library. These bindings consist of a Fortran compatibility library, 'libfgetdata' (written in C) and a Fortran 77 source file, 'getdata.f' which defines useful Fortran parameters and declares the external subroutines. These bindings are designed to comply to the Fortran 77 standards. As a result, identifiers are limited to six characters. The compatibility library will take care of converting Fortran CHARACTER stings to C strings. However, as a result, when strings are passed to the compatibility library as arguments, the length of the string must also be passed. Because Fortran 77 handles neither pointers nor abstract data types, DIRFILE pointers are not used to refer to dirfile instances. Instead, an integer dirfile unit number is used. Space is available in the compatibility library for only 1023 dirfile units. If an application attempts to open more than 1023 dirfiles simultaneously, the compatibility library will emit an error message on standard error and return an invalid dirfile unit number. Passing an invalid dirfile unit number to a subroutines which requires one as input (other than GDCLOS, which will simply ignore it) will result in the call failing with error code GD_EBD (= GD_E_BAD_DIRFILE, see below). Including getdata.f (which will be installed in the same directory as getdata.h) will define several convenient parameters including the DIRFILE flags, the data type specifiers, and error codes. See below for a complete list. If your Fortran 77 compiler supports the MIL STD 1753 (DoD Extension) INCLUDE statement (which any remotely modern compiler should), you can include this file in your Fortran program to define these constants. All integer type parameters passed to the compatibility library are of type INTEGER (i.e. the native size of the platform). As a result, largefile support are not be available in the Fortran 77 bindings. All character string arguments require also an integer indicating the size of the character buffer. In cases where the bindings return a string value, the value will not be returned if the string length supplied is too short. In these cases, the character string will be left untouched, but the integer indicating the string length will be updated to indicate the required string length. The exception to this is GDESTR, which simply truncates the string it outputs, as the C API does. Available Subroutines ===================== * GDENCS(support, encoding) Output: INTEGER support Input: INTEGER encoding This wraps gd_encoding_support(3). When passed one of the GDE_xx encoding parameters, this subroutine will return GD_RW if the library can read from and write to that encoding, GD_RO if it can only read from the encoding, or -1 if neither reading or writing is supported. Subroutines interacting with the database ----------------------------------------- * GDOPEN(dirfile_unit, dirfilename, dirfilename_len, flags) Output: INTEGER dirfile_unit Input: INTEGER dirfilename_len, flags CHARACTER* dirfilename This wraps gd_open(3), with the same input arguments (dirfilename_len should contain the string length of dirfilename). It returns the dirfile unit number in dirfile_unit. The flags should be a bitwise "or"d list of flag parameters (see below). If no more dirfile unit numbers are available, it returns -1, otherwise, this behaves analogously to gd_open() itself: it returns a valid dirfile unit even in case of error. * GDCOPN(dirfile_unit, dirfilename, dirfilename_len, flags, sehandler) Output: INTEGER dirfile_unit Input: INTEGER dirfilename_len, flags CHARACTER* dirfilename EXTERNAL sehandler This wraps gd_cbopen(3), and behaves identically to GDOPEN, except for requiring the name of the callback subroutine as sehandler. The callback subroutine should accept the following arguments: SUBROUTINE CALBCK(act, dirfile_unit, suberror, line) INTEGER act, dirfile_unit, suberror CHARACTER*(GD_MLL) line where GD_MLL is a integer parameter, defined in getdata.f, equal to the value of the C macro GD_MAX_LINE_LENGTH. The callback subroutine may modify line, and should set act to one of the syntax handler action parameters (see below). If the callback subroutine fails to set act, the default action (GDSX_A = GD_SYNTAX_ABORT) will be assumed. The possible values of suberror are also listed below. If GDCOPN is passed zero as sehandler, no callback is set. The callback subroutine is wrapped by the Fortran 77 library to properly interface with GetData. Other than GDCOPN, the only other subroutines which potentially could cause the callback subroutine to be called are GDINCL and GDINCA. Use GDCLBK to change the callback function before calling GDINCL or GDINCA, if required. * GDCLBK(dirfile_unit, callback) Input: INTEGER dirfile_unit EXTERNAL callback This wraps gd_parser_callback(3), setting the registered parser callback to the subroutine given. The signature of this subroutine is given above under GDCOPN. Unlike the C interface, this function cannot be used to remove a registered callback; use GDNOCB for that. * GDNOCB(dirfile_unit) Input: INTEGER dirfile_unit This calls gd_parser_callback(3) to deregister a previous parser callback associated with the specified dirfile. If it had none, this procedure does nothing. * GDINVD(dirfile_unit) Output: INTEGER dirfile_unit This wraps gd_invalid_dirfile(3), and returns the unit number of a newly-created, invalid dirfile. If no dirfile unit numbers were available, it returns -1. * GDCLOS(dirfile_unit) Input: INTEGER dirfile_unit This wraps gd_close(3). The argument is the dirfile unit to close. In addition to closing the dirfile itself, this will also disassociate the supplied dirfile unit number, which may be subsequently returned by a subsequent call to GDOPEN. * GDDSCD(dirfile_unit) Input: INTEGER dirfile_unit This wraps gd_discard(3), but otherwise behaves identically to GDCLOS. * GDFLSH(dirfile_unit, field_code, field_code_len) Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This wraps gd_flush(3). If field_code_len is zero, the entire dirfile will be flushed, and field_code will be ignored. Otherwise the field named by field_code will be flushed. * GDSYNC(dirfile_unit, field_code, field_code_len) Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This wraps gd_sync(3). If field_code_len is zero, the entire dirfile will be synced, and field_code will be ignored. Otherwise the field named by field_code will be synced. * GDRCLO(dirfile_unit, field_code, field_code_len) Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This wraps gd_raw_close(3). If field_code_len is zero, the entire dirfile will be closed, and field_code will be ignored. Otherwise the field named by field_code will be closed. * GDMFLS(dirfile_unit) Input: INTEGER dirfile_unit This subroutine wraps gd_metaflush(3), and will cause metadata changes to be written to disk. * GDDSYN(desync, dirfile_unit, flags) Output: INTEGER desync Input: INTEGER dirfile_unit, flags This wraps gd_desync(3), and sets desync to a non-zero value if the loaded dirfile has become desynchronised from the metadata on disk and will, optionally, reload the dirfile. * GDFLAG(flags, dirfile_unit, set, reset) Output: INTEGER flags Input: INTEGER dirfile_unit, set, reset This wraps gd_flags(3). The value of the flags after modification are returned in flags. * GDTOKE(token, token_len, dirfile_unit, string, string_len) Output: CHARACTER* token Input/Output: INTEGER token_len Input: INTEGER dirfile_unit, string_len CHARACTER* string This wraps gd_strtok(3). If string_len <= 0, the next token of the previously supplied string is returned in token (ie. NULL is passed to gd_strtok(3)), otherwise, the first token from string is returned, and the string is cached by GetData. If the output token is longer than the supplied token_len, the actual length of the token is returned in token_len and token is unmodified. * GDVBPX(dirfile_unit, prefix, prefix_len Input: INTEGER dirfile_unit, prefix_len CHARACTER* prefix This wraps gd_verbose_prefix(3). To remove a prefix, set prefix_len to zero, in which case prefix itself is ignored. Subroutines interacting with data --------------------------------- * GDGETD(n_read, dirfile_unit, field_code, field_code_len, first_frame, first_sample, num_frames, num_samples, return_type, data_out) Output: INTEGER n_read data_out(n) Input: INTEGER dirfile_unit, field_code_len, first_frame, first_sample INTEGER num_frames, num_samples, return_type CHARACTER* field_code This wraps getdata(3), with the same input arguments (field_code_len should contain the string length of the field_code). The number of samples actually read is returned in n_read. The return_type parameter should be one of the parameters defined in getdata.f (see below). data_out must be of sufficient length and of appropriate data type width for the data returned. * GDGTCA(dirfile_unit, field_code, field_code_len, return_type, data_out) Output: data_out(array_len) Input: INTEGER dirfile_unit, field_code_len, return_type CHARACTER* field_code This wraps gd_get_carray(3), with the same input arguments (field_code_len should contain the string length of the field_code). The return_type parameter should be one of the parameters defined in getdata.f. data_out must be of appropriate data type width and length for the data returned. * GDGCAS(dirfile_unit, field_code, field_code_len, start, n, return_type, data_out) Output: data_out(array_len) Input: INTEGER dirfile_unit, field_code_len, return_type, start, n CHARACTER* field_code This wraps gd_get_carray_slice(3), with the same input arguments (field_code_len should contain the string length of the field_code). The return_type parameter should be one of the parameters defined in getdata.f. data_out must be of appropriate data type width and length for the data returned. * GDGTCO(dirfile_unit, field_code, field_code_len, return_type, data_out) Output: data_out Input: INTEGER dirfile_unit, field_code_len, return_type CHARACTER* field_code This wraps gd_get_constant(3), with the same input arguments (field_code_len should contain the string length of the field_code). The return_type parameter should be one of the parameters defined in getdata.f. data_out must be of appropriate data type width for the data returned. * GDGTST(size, dirfile_unit, field_code, field_code_len, len, data_out) Output: INTEGER size CHARACTER* data_out Input: INTEGER dirfile_unit, field_code_len, len CHARACTER* field_code This wraps gd_get_string(3), with the same input arguments (field_code_len should contain the string length of the field_code). The number of characters actually read is returned in size. At most len characters will be returned. * GDPUTD(n_wrote, dirfile_unit, field_code, field_code_len, first_frame, first_sample, num_frames, num_samples, data_type, data_in) Output: INTEGER n_wrote Input: INTEGER dirfile_unit, field_code_len, first_frame, first_sample INTEGER num_frames, num_samples, data_type CHARACTER* field_code data_out(n) This wraps gd_putdata(3), with the same input arguments (field_code_len should contain the string length of the field_code). The number of samples actually written is returned in n_wrote. The data_type parameter should be one of the parameters defined in getdata.f. data_in must be of sufficient length and of appropriate data type width for the data input. * GDPTCA(dirfile_unit, field_code, field_code_len, data_type, data_in) Input: INTEGER dirfile_unit, field_code_len, data_type CHARACTER* field_code data_in(array_len) This wraps gd_put_carray(3), with the same input arguments (field_code_len should contain the string length of the field_code). The data_type parameter should be one of the parameters defined in getdata.f. * GDPCAS(dirfile_unit, field_code, field_code_len, start, n, data_type, data_in) Input: INTEGER dirfile_unit, field_code_len, data_type CHARACTER* field_code data_in(n) This wraps gd_put_carray_slice(3), with the same input arguments (field_code_len should contain the string length of the field_code). The data_type parameter should be one of the parameters defined in getdata.f. * GDPTCO(dirfile_unit, field_code, field_code_len, data_type, data_in) Input: INTEGER dirfile_unit, field_code_len, data_type CHARACTER* field_code data_in This wraps gd_put_constant(3), with the same input arguments (field_code_len should contain the string length of the field_code). The data_type parameter should be one of the parameters defined in getdata.f. * GDPTST(size, dirfile_unit, field_code, field_code_len, len, data_out) Output: INTEGER size Input: INTEGER dirfile_unit, field_code_len, len CHARACTER* field_code CHARACTER* data_in This wraps gd_put_string(3), with the same input arguments (field_code_len should contain the string length of the field_code, and len should contain the string length of data_in). The number of characters actually written is returned in size. * GDVLDT(invalid, dirfile_unit, field_code, field_code_len) Output: INTEGER invalid Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_validate(3), and returns non-zero if there is a problem with the specified field. * GDFNUM(framenum, dirfile_unit, field_code, field_code_len, value) Output: REAL*8 invalid Input: INTEGER dirfile_unit, field_code_len REAL*8 value CHARACTER* field_code This subroutine wraps gd_framenum(3), and performs a reverse look-up on a field. * GDFNSS(framenum, dirfile_unit, field_code, field_code_len, value, field_start, field_end) Output: REAL*8 invalid Input: INTEGER dirfile_unit, field_code_len, field_start, field_end REAL*8 value CHARACTER* field_code This subroutine wraps gd_framenum_subset(3), and performs a reverse look-up on a field. * GDSEEK(pos, dirfile_unit, field_code, field_code_len, frame_num, sample_num, flags) Output: INTEGER pos Input: INTEGER dirfile_unit, field_code_len, frame_num, sample_num, flags CHARACTER* field_code This subroutine wraps gd_seek(3), and repositions the field pointer of the specified field. It returns the new value of the field pointer. The 'flags' argument should be one of GDSK_S, GDSK_C, or GDSK_E, optionally bitwise or'd with GDSK_E. * GDTELL(pos, dirfile_unit, field_code) Output: INTEGER pos Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_tell(3), and returns the current value of the field pointer for the specified field. * GDMXLB(dirfile_unit, lookback) Input: INTEGER dirfile_unit, lookback This wraps gd_mplex_lookback(3). Subroutines interacting with global metadata -------------------------------------------- * GDNENT(nentries dirfile_unit, parent, parent_len, type, flags) Output: INTEGER nentries Input: INTEGER dirfile_unit, parent_len, type, flags CHARACTER* parent This wraps gd_nentries(3). It returns the number of entries in the dirfile satisfying the supplied criteria. If parent_len is zero, parent itself is ignored, and top-level entries are considered. Otherwise, meta-entries under parent are considered. * GDNFLD(nfields, dirfile_unit) * GDNFDT(nfields, dirfile_unit, type) * GDNVEC(nvectors, dirfile_unit) * GDNMFD(nfields, dirfile, parent, parent_l) * GDNMFT(nfields, dirfile, parent, parent_l, type) * GDNMVE(nvectors, dirfile, parent, parent_l) These procedures wrap, respectively, gd_nfields(3), gd_nfields_by_type(3), gd_nvectors(3), gd_nmfields(3), gd_nmfields_by_type(3), and gd_nmvectors(3), and are all special cases of GDNENT. * GDNALS(nfields, dirfile_unit, field_code, field_code_len) Output: INTEGER nframes Input: INTEGER dirfile_unit CHARACTER* field_code This wraps gd_naliases(3). It returns the number of aliases of field_code (including field_code itself). * GDENTX(entry_max, dirfile_unit, parent, parent_len, type, flags) Output: INTEGER entry_max Input: INTEGER dirfile_unit, parent_len, type, flags CHARACTER* parent This subroutine, which has no direct analogue in the C API, returns the length of the longest entry name defined in the dirfile. It returns the length (in characters) of the longest entry name in the dirfile in entry_max which satisfies the given criteria. If parent_len is zero, parent itself is ignored, and top-level entries are considered. Otherwise, meta-entries under parent are considered. * GDFDNX(field_max, dirfile_unit) * GDMFNX(field_max, dirfile_unit, parent, parent_len) These subroutines are special cases of GDENTX, with type and flags both equal to zero, and, in the case of GDFDNX, parent_len also zero. * GDENTN(name, name_len, dirfile_unit, parent, parent_len, type, flags, entry_num) Output: CHARACTER* name Input/Output: INTEGER name_len Input: INTEGER dirfile_unit, parent_len, type, flags, entry_num CHARACTER* parent This subroutine is the replacement for gd_entry_list(3). It returns in name a Fortran 77 string containing the entry name of the entry indexed by entry_num (which is should be a number between 1 and the output of GDNENT). If the name of the field is longer than name_len, it will return the actual length of the field in name_len and not modify the name argument. If entry_num is out of range, name_len will be set to zero, and name will not be modified. * GDFLDN(name, name_len, dirfile_unit, field_num) * GDFDNT(name, name_len, dirfile_unit, type, field_num) * GDVECN(name, name_len, dirfile_unit, field_num) * GDMFDN(name, name_len, dirfile_unit, parent, parent_len, field_num) * GDMFDT(name, name_len, dirfile_unit, parent, parent_len, type, field_num) * GDMVEN(name, name_len, dirfile_unit, parent, parent_len, field_num) These subroutines are replacements for, respectively, gd_field_list(3), gd_field_list_by_type(3), gd_vector_list(3), gd_mfield_list(3), gd_mfield_list_by_type(3), and gd_mvector_list(3), and are all special cases of GDENTN. * GDALSS(name, name_len, dirfile_unit, field_code, field_code_len, field_num) Output: CHARACTER* name Input/Output: INTEGER name_len Input: INTEGER dirfile_unit, field_num, field_code_len CHARACTER* field_code This subroutine is the replacement for gd_aliases(3) and behaves in the same manner as GDFLDN. * GDSTRX(string_max, dirfile_unit) Output: INTEGER string_max Input: INTEGER dirfile_unit This subroutine, which has no direct analogue in the C API, returns the length of the longest STRING field defined in the dirfile. It takes the dirfile unit number as input and returns the length (in characters) of the longest STRING in the dirfile in string_max. * GDMSTX(string_max, dirfile_unit, parent, parent_len) Output: INTEGER string_max Input: INTEGER dirfile_unit, parent_len CHARACTER* parent This subroutine, which has no direct analogue in the C API, returns the length of the longest STRING defined in the dirfile for META fields of the supplied parent field. It returns the length (in characters) of the longest STRING META field for the supplied parent in string_max. * GDCONS(value, dirfile_unit, return_type, field_num) Output: CHARACTER* name value Input: INTEGER dirfile_unit, field_num This subroutine is the replacement for gd_constants(3) and behaves in the same manner as GDFLDN. * GDMCOS(value, dirfile_unit, parent, parent_len, return_type, field_num) Output: CHARACTER* name value Input: INTEGER dirfile_unit, field_num, parent_len CHARACTER* parent This subroutine is the replacement for gd_mconstants(3) and behaves in the same manner as GDFLDN. * GDSTRS(value, value_len, dirfile_unit, field_num) Output: CHARACTER* value Input/Output: INTEGER value_len Input: INTEGER dirfile_unit, field_num This subroutine is the replacement for gd_strings(3) and behaves in the same manner as GDSTRS. * GDMSTS(value, value_len, dirfile_unit, parent, parent_len, field_num) Output: CHARACTER* value Input/Output: INTEGER value_len Input: INTEGER dirfile_unit, field_num, parent_len CHARACTER* parent This subroutine is the replacement for gd_mstrings(3) and behaves in the same manner as GDFLDN. * GDNFRM(nframes, dirfile_unit) Output: INTEGER nframes Input: INTEGER dirfile_unit This wraps gd_nframes(3). It takes the dirfile unit number as input and returns the number of frames in the dirfile in nframes. * GDALSX(alias_max, dirfile_unit, field_code, field_code_len) Output: INTEGER alias_max Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine, which has no direct analogue in the C API, returns the length of the longest alias defined in the dirfile for field_code. * GDECNT(error_count, dirfile_unit) Output: INTEGER error_count Input: INTEGER dirfile_unit This subroutine wraps gd_error_count(3). It takes the dirfile unit number as input and returns the number of errors encountered by GetData since the last call to this subroutine (or since the dirfile was first opened) in error_count. * GDEROR(error, dirfile_unit) Output: INTEGER error Input: INTEGER dirfile_unit This subroutine wraps gd_error(3). It takes the dirfile unit number as input and returns the error value arising from the last library call in error. The value of error will equal one of the error codes defined in getdata.f. * GDESTR(dirfile_unit, buffer, buffer_len) Output: CHARACTER* buffer Input: INTEGER dirfile_unit, buffer_len This subroutine takes a dirfile unit as input and will write the error string returned by gd_error_string(3) in buffer, which is of length buffer_len. * GDNFRG(nformats, dirfile_unit) Output: INTEGER nformats Input: INTEGER dirfile_unit This subroutine returns the number of format file fragments in the specified dirfile. * GDNAME(name, name_len, dirfile_unit) Output: CHARACTER* name Input/Output: INTEGER name_len Input: INTEGER dirfile_unit This wraps gd_dirfilename(3). The name of the dirfile will be returned in name. If the name of the dirfile is longer than name_len, it will return the actual length of the name in name_len and not modify the name argument. * GDREFE(name, name_len, dirfile_unit, field_code, field_code_len) Output: CHARACTER* name Input/Output: INTEGER name_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This wraps gd_reference(3). The reference field will be set to field_code, unless field_code_len is zero, in which case the reference field will not be changed, and field_code will be ignored. The name of the reference field will be returned in name. If the name of the reference field is longer than name_len it will return the actual length of the field in name_len and not modify the name argument. * GDSTDV(version, dirfile_unit) Input/Output: INTEGER version Input: INTEGER dirfile_unit This wraps gd_dirfile_standards(3). It attempts to set the current Standards Version of the loaded dirfile to the value specified by version (which may equal the parameter GDSV_C indicating no change). It then returns the current Version in version, or -1 on error. Subroutines interacting with fragment metadata ---------------------------------------------- * GDFRGN(filename, filename_len, dirfile_unit, ind) Output: CHARACTER* infield Input/Output: INTEGER infield_len Input: INTEGER ind This subroutine returns the name of the format file fragment indexed by ind. If the name of the file is longer than filename_len, it will return the actual length of the filename in filename_len and not modify the filename argument. * GDINCL(dirfile_unit, file, file_len, fragment_index, flags) Input: INTEGER dirfile_unit, field_code_len, fragment_index, flags CHARACTER* file This subroutine wraps gd_include(3), and allows the inclusion of another format file fragment into the current dirfile. This may call the registered callback subroutine, if any. See the caveat in the description of GDCOPN above. * GDINCA(dirfile_unit, file, file_len, fragment_index, prefix, prefix_len, suffix, suffix_len, flags) Input: INTEGER dirfile_unit, field_code_len, fragment_index, prefix_len, INTEGER suffix_len, flags CHARACTER* file CHARACTER* prefix CHARACTER* suffix This subroutine wraps gd_include_affix(3), and allows the inclusion of another format file fragment into the current dirfile with the specified field code prefix and suffix. This may call the registered callback subroutine, if any. See the caveat in the description of GDCOPN above. * GDUINC(dirfile_unit, fragment, del) Input: INTEGER dirfile_unit, fragment, del This subroutine wraps gd_uninclude(3). It removes the specified fragment from the dirfile. If del is non-zero, the fragment file will be deleted. * GDGENC(encoding, dirfile_unit, fragment_index) Output: INTEGER encoding Input: INTEGER dirfile_unit, fragment_index This subroutine wraps gd_encoding(3). It returns the current encoding scheme of the specified fragment, which will be one of the symbols listed below. * GDAENC(dirfile_unit, encoding, fragment, recode) Input: INTEGER dirfile_unit, encoding, fragment, recode This subroutine wraps gd_alter_encoding(3). It sets the encoding scheme of the specified fragment to the value of the encoding parameter, which should be one of the encoding flags listed below. If recode is non-zero, binary files associated with this fragment will be modified to compensate for the change. * GDGEND(endianness, dirfile_unit, fragment_index) Output: INTEGER endianness Input: INTEGER dirfile_unit, fragment_index This subroutine wraps gd_endianness(3). It returns the current byte sex of the specified fragment, which will be one of the symbols listed below. * GDAEND(dirfile_unit, endianness, fragment, recode) Input: INTEGER dirfile_unit, endianness, fragment, recode This subroutine wraps gd_alter_endianness(3). It sets the byte sex of the specified fragment to the value of the endianness parameter, which should be zero or a combination of GD_BE and GD_LE as described on the gd_alter_endianness manual page. If recode is non-zero, binary files associated with this fragment will be modified to compensate for the change. * GDGFOF(frame_offset, dirfile_unit, fragment_index) Output: INTEGER frame_offset Input: INTEGER dirfile_unit, fragment_index This subroutine wraps gd_frameoffset(3). It returns the current frame offset of the specified fragment. * GDAFOF(dirfile_unit, frame_offset, fragment, recode) Input: INTEGER dirfile_unit, frame_offset, fragment, recode This subroutine wraps gd_alter_frameoffset(3). It sets the frame offset of the specified fragment to the value of the frame_offset parameter. If recode is non-zero, binary files associated with this fragment will be modified to compensate for the change. * GDGPRT(protection_level, dirfile_unit, fragment_index) Output: INTEGER protection_level Input: INTEGER dirfile_unit, fragment_index This subroutine wraps gd_protection(3). It returns the current protection level of the specified fragment, which will be one of the symbols listed below. * GDAPRT(dirfile_unit, protection_level, fragment) Input: INTEGER dirfile_unit, protection_level, fragment This subroutine wraps gd_protect(3). It sets the protection level of the specified fragment to the value of the protection_level parameter, which should one of the protection level listed below. * GDPFRG(parent, dirfile_unit, fragment) Output: INTEGER parent Input: INTEGER dirfile_unit, fragment This subroutine wraps gd_parent_fragment(3). It returns the parent fragment of the specified fragment, or -1 on error. * GDFRAF(prefix, prefix_len, suffix, suffix_len, dirfile_unit, fragment_index) Output: CHARACTER* prefix CHARACTER* suffix Input/Output: INTEGER prefix_len, suffix_len Input: INTEGER dirfile_unit, fragment_index This subroutine wraps gd_fragment_affixes(3), returning the field code prefix and suffix for the specified fragment. On error, it sets prefix_len to zero. In this case the value of the other output parameters in unspecified. * GDAAFX(dirfile_unit, fragment, prefix, prefix_len, suffix, suffix_len Input: INTEGER dirfile_unit, fragment CHARACTER* prefix CHARACTER* suffix This subroutine wraps gd_alter_affix(3). It sets the field code prefix and suffix of the specified fragment to the value of the prefix and suffix parameters. Subroutines interacting with field metadata ------------------------------------------- * GDGERW(spf, data_type, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER spf, data_type, fragment_index Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a RAW field. It returns the samples-per-frame, native data type, and the format file index in spf and data_type. The data_type will be one of the data type parameters listed below. If field_code is not found, or the field specified is not of RAW type, spf will be set to zero. In this case the value of the other output parameters is unspecified. * GDGECL(nfields, infield1, infield1_len, m1, b1, infield2, infield2_len, m2, b2, infield3, infield3_len, m3, b3, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER nfields, fragment_index CHARACTER* infield1 CHARACTER* infield2 CHARACTER* infield3 COMPLEX*16 m1, b1, m2, b2, m3, b3 Input/Output: INTEGER infield1_len, infield2_len, infield3_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a LINCOM field. Although three sets of arguments are required, only nfields of them will be updated. If field_code is not found, or the field specified is not of LINCOM type, nfields will be set to zero. In this case the value of the remaining data is unspecified. * GDGELC(nfields, infield1, infield1_len, m1, b1, infield2, infield2_len, m2, b2, infield3, infield3_len, m3, b3, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER nfields, fragment_index CHARACTER* infield1 CHARACTER* infield2 CHARACTER* infield3 REAL*8 m1, b1, m2, b2, m3, b3 Input/Output: INTEGER infield1_len, infield2_len, infield3_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This is equivalent to GDGELC above, but returns only the real part of the scale factors and offset terms. * GDGELT(infield, infield_len, table, table_len, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield CHARACTER* table INTEGER fragment_index Input/Output: INTEGER infield_len, table_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a LINTERP field. If field_code is not found, or the field specified is not of LINTERP type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGEBT(infield, infield_len, bitnum, numbits, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield INTEGER bitnum, numbits, fragment_index Input/Output: INTEGER infield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a BIT field. If field_code is not found, or the field specified is not of BIT type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGESB(infield, infield_len, bitnum, numbits, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield INTEGER bitnum, numbits, fragment_index Input/Output: INTEGER infield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a SBIT field. If field_code is not found, or the field specified is not of SBIT type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGECR(infield, infield_len, dividend, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield COMPLEX*16 dividend INTEGER fragment_index Input/Output: INTEGER infield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a RECIP field. If field_code is not found, or the field specified is not of RECIP type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGERC(infield, infield_len, dividend, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield REAL*8 dividend INTEGER fragment_index Input/Output: INTEGER infield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a RECIP field. If field_code is not found, or the field specified is not of RECIP type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGEDV(infield1, infield1_len, infield2, infield2_len, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield1 CHARACTER* infield2 INTEGER fragment_index Input/Output: INTEGER infield1_len, infield2_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a DIVIDE field. If field_code is not found, or the field specified is not of DIVIDE type, infield1_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGEMT(infield1, infield1_len, infield2, infield2_len, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield1 CHARACTER* infield2 INTEGER fragment_index Input/Output: INTEGER infield1_len, infield2_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a MULTIPLY field. If field_code is not found, or the field specified is not of MULTIPLY type, infield1_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGEPH(infield, infield_len, shift, fragment_index, dirfile_unit, field_code, field_code_len) Output: CHARACTER* infield INTEGER shift, fragment_index Input/Output: INTEGER infield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a PHASE field. If field_code is not found, or the field specified is not of PHASE type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGEPN(poly_ord, infield, infield_len, a0, a1, a2, a3, a4, a5, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER poly_ord, fragment_index CHARACTER* infield REAL*8 a0, a1, a2, a3, a4, a5 Input/Output: INTEGER infield1_len, infield2_len, infield3_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This is equivalent to GDGECP above, but returns only the real part of the coefficients. * GDGECP(poly_ord, infield, infield_len, a0, a1, a2, a3, a4, a5, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER poly_ord, fragment_index CHARACTER* infield COMPLEX*16 a0, a1, a2, a3, a4, a5 Input/Output: INTEGER infield1_len, infield2_len, infield3_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a POLYNOM field. Although six coefficients must be provided, only poly_ord + 1 of them will be updated. If field_code is not found, or the field specified is not of POLYNOM type, nfields will be set to zero. In this case the value of the remaining data is unspecified. * GDGEWD(infield, infield_len, checkfield, checkfield_len, windop, ithreshold, rthreshold, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER windop, ithreshold, fragment_index CHARACTER* infield CHARACTER* checkfield Input/Output: INTEGER infield_len, checkfield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a WINDOW field. Only one of ithreshold and rthreshold is ever updated. If the returned windop is one of GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, ithreshold will be updated, otherwise, rthreshold will be updated. If field_code is not found, or the field specified is not of POLYNOM type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGEMX(infield, infield_len, countfield, countfield_len, countval, period, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER countval, period, fragment_index CHARACTER* infield CHARACTER* countfield Input/Output: INTEGER infield_len, countfield_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a MPLEX field. If field_code is not found, or the field specified is not of MPLEX type, infield_len will be set to zero. In this case the value of the remaining data is unspecified. * GDGECA(const_type, array_len, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER const_type, array_len, fragment_index Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a CARRAY field. If field_code is not found, or the field specified is not of CARRAY type, const_type will be set to zero. In this case the value of the remaining data is unspecified. * GDGECO(const_type, fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER const_type, fragment_index Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns metadata describing a CONST field. If field_code is not found, or the field specified is not of CONST type, const_type will be set to zero. In this case the value of the remaining data is unspecified. * GDARLN(array_len, dirfile_unit, field_code, field_code_len) Output: INTEGER array_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This wraps gd_array_len(3). The field_code_len parameter should contain the string length of field_code. The length of the field will be returned in array_len. * GDGSPF(spf, dirfile_unit, field_code, field_code_len) Output: INTEGER spf Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This wraps gd_spf(3). The field_code_len parameter should contain the string length of field_code. The number of samples per frame in field_code will be returned in spf. * GDENTY(entry_type, dirfile_unit, field_code, field_code_len) Output: INTEGER type Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_entry_type(3), and returns the field type of the specified field_code in entry_type. The entry_type will be one of the entry type parameters listed below. * GDFRGI(fragment_index, dirfile_unit, field_code, field_code_len) Output: INTEGER fragment_index Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_fragment_index(3), and returns the format file fragment index for the supplied field. If the field does not exist, or an error occurred, -1 is returned. * GDATRG(targ, targ_len, dirfile_unit, field_code, field_code_len) Output: CHARACTER* targ Input/Output: INTEGER targ_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_alias_target(3), and returns the target of the alias specified by format_file. * GDHIDN(result, dirfile_unit, field_code, field_code_len) Output: INTEGER result Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_hidden(3). It sets result to one if the specified field is hidden, or zero if it is not. On error, it sets result to -1. * GDHIDE(dirfile_unit, field_code, field_code_len) Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_hide(3). It hides the specified field. * GDUHID(dirfile_unit, field_code, field_code_len) Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_unhide(3). It unhides the specified field. * GDGBOF(bof, dirfile_unit, field_code, field_code_len) Output: INTEGER bof Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_bof(3), and returns the location of the beginning- of-field marker for the specified field. * GDGEOF(eof, dirfile, field_code, field_code_len) Output: INTEGER eof Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_eof(3), and returns the location of the end-of-field marker for the specified field. * GDLSRW(dirfile_unit, field_code, field_code_len, data_type, spf, spf_scalar, spf_scalar_len, spf_scalar_index, recode) Input: INTEGER dirfile_unit, field_code_len, data_type, spf, spf_scalar_len INTEGER spf_scalar_index, recode CHARACTER* field_code CHARACTER* spf_scalar This subroutine modifies the RAW field specified according to the supplied parameters. Passing -1 as one of the spf_scalar_len will delete an existing scalar field code, if one is present. Passing 0 for this parameter indicates no change to the corresponding parameter field code. If recode is non-zero, the binary file associated with this field will be modified to account for the changes. * GDALRW(dirfile_unit, field_code, field_code_len, data_type, spf, recode) Input: INTEGER dirfile_unit, field_code_len, data_type, spf, recode CHARACTER* field_code This subroutine wraps gd_alter_raw(3), and modifies the specified field metadata. If recode is non-zero, the binary file associated with this field will be modified to account for the changes. * GDLSCL(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar, b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar, m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index, in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3, b3_scalar, b3_scalar_len, b3_scalar_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len INTEGER b3_scalar_index COMPLEX*16 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 CHARACTER* in_field3 This subroutine modifies the LINCOM field specified according to the supplied parameters. Passing -1 as one of the .._scalar_len parameters will delete an existing scalar field code, if one is present. Passing 0 for these parameters indicates no change to the corresponding parameter field code. * GDALCL(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3, in_field3_len, m3, b3) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len INTEGER in_field3_len COMPLEX*16 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 CHARACTER* in_field3 This subroutine wraps gd_alter_lincom(3), and modifies the specified field metadata. * GDLSLC(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar, b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar, m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index, in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3, b3_scalar, b3_scalar_len, b3_scalar_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len INTEGER b3_scalar_index REAL*8 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 CHARACTER* in_field3 This is equivalent to GDLSCL above, but takes purely real parameters. * GDALLC(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3, in_field3_len, m3, b3) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len INTEGER in_field3_len REAL*8 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 CHARACTER* in_field3 This is equivalent to GDALCL above, but takes purely real parameters. * GDALLT(dirfile_unit, field_code, field_code_len, in_field, in_field_len, table, table_len, move) Input: INTEGER dirfile_unit, field_code_len, in_field_len, table_len, move CHARACTER* field_code CHARACTER* in_field CHARACTER* table This subroutine wraps gd_alter_linterp(3), and modifies the specified field metadata. If move is non-zero, the look-up table will be moved to the path specified by table. * GDLSBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, bitnum INTEGER bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar_len INTEGER numbits_scalar_index CHARACTER* field_code CHARACTER* in_field CHARACTER* bitnum_scalar_len CHARACTER* numbits_scalar_len This subroutine modifies the BIT field specified according to the supplied parameters. Passing -1 as bitnum_scalar_len or numbits_scalar_len will delete an existing scalar field code, if one is present. Passing 0 for these parameters indicates no change to the corresponding parameter field code. * GDALBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, numbits) Input: INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits CHARACTER* field_code CHARACTER* in_field This subroutine wraps gd_alter_bit(3), and modifies the specified field metadata. * GDALDV(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, in_field2, in_field2_len) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 This subroutine wraps gd_alter_divide(3), and modifies the specified field metadata. * GDALMT(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, in_field2, in_field2_len) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 This subroutine wraps gd_alter_multiply(3), and modifies the specified field metadata. * GDLSPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, shift, shift_scalar, shift_scalar_len, shift_scalar_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, shift, fragment_index CHARACTER* field_code CHARACTER* in_field This subroutine modifies the PHASE field specified according to the supplied parameters. Passing -1 as shift_scalar_len will delete an existing scalar field code, if one is present. Passing 0 for this parameter indicates no change to the corresponding parameter field code. * GDALPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, shift) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, shift, fragment_index CHARACTER* field_code CHARACTER* in_field This subroutine wraps gd_alter_phase(3), and modifies the specified field metadata. * GDLSCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar, a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index, a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len, a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field_len, a0_scalar_len INTEGER a0_scalar_index, a1_scalar_len, a1_scalar_index, a2_scalar_len INTEGER a2_scalar_index, a3_scalar_len, a3_scalar_index, a4_scalar_len INTEGER a4_scalar_index, a5_scalar_len, a5_scalar_index COMPLEX*16 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* a0_scalar CHARACTER* a1_scalar CHARACTER* a2_scalar CHARACTER* a3_scalar CHARACTER* a4_scalar CHARACTER* a5_scalar This subroutine modifies the POLYNOM field specified according to the supplied parameters. Passing -1 as one of the .._scalar_len parameters will delete an existing scalar field code, if one is present. Passing 0 for these parameters indicates no change to the corresponding parameter field code. * GDALCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a1, a2, a3, a4, a5) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field_len COMPLEX*16 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* in_field This subroutine wraps gd_alter_polynom(3), and modifies the specified field metadata. * GDLSPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar, a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index, a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len, a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field_len, a0_scalar_len INTEGER a0_scalar_index, a1_scalar_len, a1_scalar_index, a2_scalar_len INTEGER a2_scalar_index, a3_scalar_len, a3_scalar_index, a4_scalar_len INTEGER a4_scalar_index, a5_scalar_len, a5_scalar_index REAL*8 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* a0_scalar CHARACTER* a1_scalar CHARACTER* a2_scalar CHARACTER* a3_scalar CHARACTER* a4_scalar CHARACTER* a5_scalar This is equivalent to GDLSCP, but with purely real parameters. * GDALPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a1, a2, a3, a4, a5) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field_len REAL*8 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* in_field This subroutine is equivalent to GDALCP above, but takes purely real parameters. * GDLSSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, bitnum INTEGER bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar_len INTEGER numbits_scalar_index CHARACTER* field_code CHARACTER* in_field CHARACTER* bitnum_scalar_len CHARACTER* numbits_scalar_len This subroutine modifies the SBIT field specified according to the supplied parameters. Passing -1 as bitnum_scalar_len or numbits_scalar_len will delete an existing scalar field code, if one is present. Passing 0 for these parameters indicates no change to the corresponding parameter field code. * GDALSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, numbits) Input: INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits CHARACTER* field_code CHARACTER* in_field This subroutine wraps gd_alter_sbit(3), and modifies the specified field metadata. * GDLSCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len, dividend, dividend_scalar, dividend_scalar_len, dividend_scalar_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, dividend_scalar_len, INTEGER dividend_scalar_index CHARACTER* field_code CHARACTER* in_field CHARACTER* dividend_scalar COMPLEX*16 dividend This subroutine modifies the RECIP field specified according to the supplied parameters. Passing -1 as dividend_scalar_len parameters will delete an existing scalar field code, if one is present. Passing 0 for this parameter indicates no change to the corresponding parameter field code. * GDALCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len, dividend) Input: INTEGER dirfile_unit, field_code_len, in_field_len CHARACTER* field_code CHARACTER* in_field COMPLEX*16 dividend This subroutine wraps gd_alter_crecip(3), and modifies the specified field metadata. * GDLSRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len, dividend, dividend_scalar, dividend_scalar_len, dividend_scalar_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, dividend_scalar_len, INTEGER dividend_scalar_index CHARACTER* field_code CHARACTER* in_field CHARACTER* dividend_scalar REAL*16 dividend This is equivalent to GDLSCR, but with purely real parameters. * GDALRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len, dividend) Input: INTEGER dirfile_unit, field_code_len, in_field_len CHARACTER* field_code CHARACTER* in_field REAL*8 dividend This subroutine wraps gd_alter_recip(3), and modifies the specified field metadata. * GDLSWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len, check_field, check_field_len, windop, threshold, threshold_scalar, threshold_scalar_len, threshold_scalar_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len, windop INTEGER threshold_scalar_len, threshold_scalar_index CHARACTER* field_code CHARACTER* in_field CHARACTER* check_field CHARACTER* threshold_scalar INTEGER threshold or REAL*8 threshold This subroutine modifies the WINDOW field specified according to the supplied parameters. Passing -1 as threshold_scalar_len will delete an existing scalar field code, if one is present. Passing 0 for this parameter indicates no change to the corresponding parameter field code. If windop is one of GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, threshold should be of type integer, otherwise it should be double precision. * GDALWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len, check_field, check_field_len, windop, threshold) Input: INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len, windop CHARACTER* field_code CHARACTER* in_field CHARACTER* check_field INTEGER threshold or REAL*8 threshold This subroutine wraps gd_alter_windop(3), and modifies the specified field metadata. If windop is one of GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, threshold should be of type integer, otherwise it should be double precision. * GDLSMX(dirfile_unit, field_code, field_code_len, infield, infield_len, countfield, countfield_len, countval, countval_scalar, countval_scalar_len, countval_scalar_index, period, period_scalar_len, period_scalar_index) Input: INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval INTEGER countval_scalar_len, countval_scalar_index, period, INTEGER period_scalar_len, period_scalar_index CHARACTER* field_code CHARACTER* infield CHARACTER* countfield This subroutine modifies the MPLEX field specified according to the supplied parameters. Passing -1 as one of the .._scalar_len parameters will delete an existing scalar field code, if one is present. Passing 0 for these parameters indicates no change to the corresponding parameter field code. * GDALMX(dirfile_unit, field_code, field_code_len, infield, infield_len, countfield, countfield_len, countval, period) Input: INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval INTEGER period CHARACTER* field_code CHARACTER* infield CHARACTER* countfield This subroutine wraps gd_alter_mplex(3), and modifies the specified field metadata. * GDALCA(dirfile_unit, field_code, field_code_len, const_type, array_len) Input: INTEGER dirfile_unit, field_code_len, const_type, array_len CHARACTER* field_code This subroutine wraps gd_alter_carray(3), and modifies the specified field metadata. * GDALCO(dirfile_unit, field_code, field_code_len, const_type) Input: INTEGER dirfile_unit, field_code_len, const_type CHARACTER* field_code This subroutine wraps gd_alter_const(3), and modifies the specified field metadata. * GDALSP(dirfile_unit, spec, spec_len, move) Input: INTEGER dirfile_unit, move, spec_len CHARACTER* spec This subroutine wraps gd_alter_spec(3), and modifies the specified field metadata. If move is non-zero, and the field is a RAW field, the binary file will be modified. If move is non-zero, and the field is a LINTERP, the look-up table will be moved. Otherwise, move is ignored. * GDMLSP(dirfile_unit, spec, spec_len, parent, parent_len, move) Input: INTEGER dirfile_unit, spec_len, parent_len, move CHARACTER* spec CHARACTER* parent This subroutine wraps gd_malter_spec(3), and behaves similarly to GDALSP, but also requires the name of the metafield's parent. The spec should contain only the name of the metafield, and not the metafield's full field code. * GDRWFN(name, name_len, dirfile_unit, field_code, field_code_len) Output: CHARACTER* name Input/Output: INTEGER name_len Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_raw_filename(3). It returns in name the name of the binary file associated with the raw field indicated by field_code. On error, it sets name_len to zero. * GDMOVE(dirfile_unit, field_code, field_code_len, new_fragment, flags) Input: INTEGER dirfile_unit, field_code_len, new_fragment, flags CHARACTER* field_code This subroutine wraps gd_move(3), and moves the specified field or alias to indicated fragment. The flags parameter should be zero or more of the GDR_xx parameters, bitwise or'd together. * GDRENM(dirfile_unit, field_code, field_code_len, new_name, new_name_len, flags) Input: INTEGER dirfile_unit, field_code_len, new_name_len, flags CHARACTER* field_code CHARACTER* new_name This subroutine wraps gd_rename(3), and changes the name of a field. The flags parameter should be zero or more of the GDR_xx parameters, bitwise or'd together. * GDNTYP(ntype, dirfile_unit, field_code, field_code_len) Output: INTEGER ntype Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine wraps gd_native_type(3), and returns the native type of the specified field. The return value will be one of the data type symbols listed below. * GDENFL(flags, dirfile_unit, field_code, field_code_len) Output: INTEGER flags Input: INTEGER dirfile_unit, field_code_len CHARACTER* field_code This subroutine returns the flags member of the specified field. * GDGSCA(scalar, scalar_len, scalar_index, dirfile_unit, field_code, field_code_len, index) Output: CHARACTER* scalar INTEGER scalar_index Input/Output: INTEGER scalar_len Input: INTEGER dirfile_unit, field_code_len, index CHARACTER* field_code This subroutine returns the element indexed by index of the scalar array of the gd_entry_t object associated with the specified field code. If index is too large for the specified field, behaviour is undefined. The array is indexed starting from one. * GDGACA(dirfile_unit, field_code, field_code_len, index, scalar, scalar_len, scalar_index, recode) Input: INTEGER dirfile_unit, field_code_len, scalar_len, index, recode INTEGER scalar_index CHARACTER* field_code CHARACTER* scalar This subroutine modifies the element indexed by index of the scalar array member of the gd_entry_t object associated with the specified field code. If index is too large for the specified field, nothing happens. The array is indexed starting from one. If scalar indicates a CONST field, scalar_index is ignored. Subroutines which add or delete fields and aliases -------------------------------------------------- * GDDELE(dirfile_unit, field_code, field_code_len, flags) Input: INTEGER dirfile_unit, field_code_len, flags CHARACTER* field_code This subroutine wraps gd_delete(3). It deletes the indicated field or alias. The flags parameter should be either zero, or one or more of the delete flags listed below bitwise or'd together. * GDADAL(dirfile_unit, field_code, field_code_len, targ, targ_len, fragment_index) Input: INTEGER dirfile_unit, field_code_len, targ_len, fragment_index CHARACTER* field_code CHARACTER* targ This subroutine wraps gd_add_alias(3). It adds an alias named field_code pointing to targ in the fragment indexed by fragment_index. * GDASRW(dirfile_unit, field_code, field_code_len, data_type, spf, spf_scalar, spf_scalar_len, spf_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, data_type, spf, spf_scalar_len INTEGER spf_scalar_index, fragment_index CHARACTER* field_code CHARACTER* spf_scalar This subroutine adds a RAW field with the supplied parameters to the specified fragment of the dirfile. If spf_scalar_len is zero, spf_scalar and spf_scalar_index are ignored, and the literal value spf is used for the parameter. If spf_scalar_len is non-zero, the literal spf is ignored and the field code specified by spf_scalar and spf_scalar_index is used for the parameter. * GDADRW(dirfile_unit, field_code, field_code_len, data_type, spf, fragment_index) Input: INTEGER dirfile_unit, field_code_len, data_type, spf, fragment_index CHARACTER* field_code This is equivalent to GDASRW with spf_scalar_len set to zero (i.e. with a literal parameter only). * GDASCL(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar, b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar, m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index, in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3, b3_scalar, b3_scalar_len, b3_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len INGEGER b3_scalar_index, fragment_index COMPLEX*16 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* m1_scalar CHARACTER* b1_scalar CHARACTER* in_field2 CHARACTER* m2_scalar CHARACTER* b2_scalar CHARACTER* in_field3 CHARACTER* m3_scalar CHARACTER* b3_scalar This subroutine adds a LINCOM field with the supplied parameters to the specified format file fragment of the dirfile. All three sets of input parameters are required to be passed to the call, but only the first nfields sets will be examined. If a .._scalar_len parameter is zero, the corresponding .._scalar and .._scalar_index parameters are ignored, and the literal parameter (m1, b1, &c.) is used for that parameter. If the .._scalar_len parameter is non-zero, the literal parameter is ignored, and the scalar is set to the field code specified by the corresponding .._scalar and .._scalar_index parameters. * GDADCL(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3, in_field3_len, m3, b3, fragment_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len INTEGER in_field3_len, fragment_index COMPLEX*16 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 CHARACTER* in_field3 This is equivalent to GDASCL with all the .._scalar_len parameters set to zero. (i.e. using literal scalars only.) * GDASLC(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, m1_scalar, m1_scalar_len, m1_scalar_index, b1, b1_scalar, b1_scalar_len, b1_scalar_index, in_field2, in_field2_len, m2, m2_scalar, m2_scalar_len, m2_scalar_index, b2, b2_scalar, b2_scalar_len, b2_scalar_index, in_field3, in_field3_len, m3, m3_scalar, m3_scalar_len, m3_scalar_index, b3, b3_scalar, b3_scalar_len, b3_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, m1_scalar_len INTEGER m1_scalar_index, b1_scalar_len, b1_scalar_index, in_field2_len INTEGER m2_scalar_len, m2_scalar_index, b2_scalar_len, b2_scalar_index INTEGER in_field3_len, m3_scalar_len, m3_scalar_index, b3_scalar_len INGEGER b3_scalar_index, fragment_index REAL*8 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* m1_scalar CHARACTER* b1_scalar CHARACTER* in_field2 CHARACTER* m2_scalar CHARACTER* b2_scalar CHARACTER* in_field3 CHARACTER* m3_scalar CHARACTER* b3_scalar This is equivalent to GDASCL above, but takes purely real parameters. * GDADLC(dirfile_unit, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3, in_field3_len, m3, b3, fragment_index) Input: INTEGER dirfile_unit, field_code_len, nfields, in_field1_len, in_field2_len INTEGER in_field3_len, fragment_index REAL*8 m1, b1, m2, b2, m3, b3 CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 CHARACTER* in_field3 This is equivalent to GDADCL above, but takes purely real parameters. * GDADLT(dirfile_unit, field_code, field_code_len, in_field, in_field_len, table, table_len, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, table_len INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field CHARACTER* table This subroutine adds a LINTERP field with the supplied parameters to the specified format file fragment of the dirfile. * GDASBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, fragment_index INTEGER bitnum, bitnum_scalar_len, bitnum_scalar_index INTEGER numbits, numbits_scalar_len, numbits_scalar_index CHARACTER* field_code CHARACTER* bitnum_scalar CHARACTER* numbits_scalar CHARACTER* in_field This subroutine adds a BIT field with the supplied parameters to the specified format file fragment of the dirfile. If bitnum_scalar_len is zero, the bitnum_scalar and bitnum_scalar_index values are ignored and the literal value of bitnum is used. If bitnum_scalar_len is non-zero, the value of bitnum is ignored and bitnum_scalar and bitnum_scalar_index is used to form a scalar field code for bitnum. Similarly with numbits. See also GDADBT. * GDADBT(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, numbits, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field This function is equivalent to calling GDASBT (above) with bitnum_scalar_len and numbits_scalar_len set to zero (i.e. with literal parameters only). * GDASSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, bitnum_scalar, bitnum_scalar_len, bitnum_scalar_index, numbits, numbits_scalar, numbits_scalar_len, numbits_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, fragment_index INTEGER bitnum, bitnum_scalar_len, bitnum_scalar_index INTEGER numbits, numbits_scalar_len, numbits_scalar_index CHARACTER* field_code CHARACTER* bitnum_scalar CHARACTER* numbits_scalar CHARACTER* in_field This subroutine adds a SBIT field with the supplied parameters to the specified format file fragment of the dirfile. If bitnum_scalar_len is zero, the bitnum_scalar and bitnum_scalar_index values are ignored and the literal value of bitnum is used. If bitnum_scalar_len is non-zero, the value of bitnum is ignored and bitnum_scalar and bitnum_scalar_index is used to form a scalar field code for bitnum. Similarly with numbits. See also GDADBT. * GDADSB(dirfile_unit, field_code, field_code_len, in_field, in_field_len, bitnum, numbits, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, bitnum, numbits INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field This function is equivalent to calling GDASSB (above) with bitnum_scalar_len and numbits_scalar_len set to zero (i.e. with literal parameters only). * GDASCR(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, divident, divident_scalar, divident_scalar_len, divident_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len INTEGER dividend_scalar_len, dividend_scalar_index, fragment_index COMPLEX*16 dividend CHARACTER* field_code CHARACTER* in_field CHARACTER* dividend_scalar. This subroutine adds a PHASE field with the supplied parameters to the specified fragment of the dirfile. If dividend_scalar_len is zero, dividend_scalar and dividend_scalar_index are ignored, and the literal value dividend is used for the parameter. If dividend_scalar_len is non-zero, the literal dividend is ignored and the field code specified by dividend_scalar and dividend_scalar_index is used for the parameter. * GDADCR(dirfile_unit, field_code, field_code_len, in_field, in_field_len, dividend, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field COMPLEX*16 dividend This is equivalent to GDASCR with dividend_scalar_len set to zero (i.e. with a literal parameter only). * GDASRC(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, divident, divident_scalar, divident_scalar_len, divident_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len INTEGER dividend_scalar_len, dividend_scalar_index, fragment_index REAL*8 dividend CHARACTER* field_code CHARACTER* in_field CHARACTER* dividend_scalar. This is equivalent to GDASCR, but with a purely real dividend. * GDADRC(dirfile_unit, field_code, field_code_len, in_field, in_field_len, dividend, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field REAL*8 dividend This is equivalent to GDASRC with dividend_scalar_len set to zero (i.e. with a literal parameter only). * GDADMT(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, in_field2, in_field2_len, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 This subroutine adds a MULTIPLY field with the supplied parameters to the specified format file fragment of the dirfile. * GDADDV(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, in_field2, in_field2_len, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, in_field2_len INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field1 CHARACTER* in_field2 This subroutine adds a DIVIDE field with the supplied parameters to the specified format file fragment of the dirfile. * GDASCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar, a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index, a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len, a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len INTEGER a0_scalar_len, a0_scalar_index, a1_scalar_len, a1_scalar_index INTEGER a2_scalar_len, a2_scalar_index, a3_scalar_len, a3_scalar_index INTEGER a4_scalar_len, a4_scalar_index, a5_scalar_len, a5_scalar_index INTEGER fragment_index COMPLEX*16 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* a0_scalar_len CHARACTER* a1_scalar_len CHARACTER* a2_scalar_len CHARACTER* a3_scalar_len CHARACTER* a4_scalar_len CHARACTER* a5_scalar_len CHARACTER* in_field This subroutine adds a POLYNOM field with the supplied parameters to the specified format file fragment of the dirfile. All six coefficients are required to be passed to the call, but only the first poly_ord + 1 will be examined. If a .._scalar_len parameter is zero, the corresponding .._scalar and .._scalar_index parameters are ignored, and the literal parameter (a0, a1, &c.) is used for that parameter. If the .._scalar_len parameter is non-zero, the literal parameter is ignored, and the scalar is set to the field code specified by the corresponding .._scalar and .._scalar_index parameters. * GDADCP(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a1, a2, a3, a4, a5, fragment_index) Input: INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len INTEGER fragment_index COMPLEX*16 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* in_field This is equivalent to GDASCP with all the .._scalar_len parameters set to zero. (i.e. using literal scalars only.) * GDASPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a0_scalar, a0_scalar_len, a0_scalar_index, a1, a1_scalar, a1_scalar_len, a1_scalar_index, a2, a2_scalar, a2_scalar_len, a2_scalar_index, a3, a3_scalar, a3_scalar_len, a3_scalar_index, a4, a4_scalar, a4_scalar_len, a4_scalar_index, a5, a5_scalar, a5_scalar_len, a5_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len INTEGER a0_scalar_len, a0_scalar_index, a1_scalar_len, a1_scalar_index INTEGER a2_scalar_len, a2_scalar_index, a3_scalar_len, a3_scalar_index INTEGER a4_scalar_len, a4_scalar_index, a5_scalar_len, a5_scalar_index INTEGER fragment_index REAL*8 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* a0_scalar_len CHARACTER* a1_scalar_len CHARACTER* a2_scalar_len CHARACTER* a3_scalar_len CHARACTER* a4_scalar_len CHARACTER* a5_scalar_len CHARACTER* in_field This subroutine is equivalent GDASCP, but takes purely real parameters. * GDADPN(dirfile_unit, field_code, field_code_len, poly_ord, in_field, in_field_len, a0, a1, a2, a3, a4, a5, fragment_index) Input: INTEGER dirfile_unit, field_code_len, poly_ord, in_field_len INTEGER fragment_index REAL*8 a0, a1, a2, a3, a4, a5 CHARACTER* field_code CHARACTER* in_field This subroutine is equivalent GDADCP, but takes purely real parameters. * GDASPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, shift, shift_scalar, shift_scalar_len, shift_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, shift INTEGER shift_scalar_len, shift_scalar_index, fragment_index CHARACTER* field_code CHARACTER* in_field CHARACTER* shift_scalar. This subroutine adds a PHASE field with the supplied parameters to the specified fragment of the dirfile. If shift_scalar_len is zero, shift_scalar and shift_scalar_index are ignored, and the literal value shift is used for the parameter. If shift_scalar_len is non-zero, the literal shift is ignored and the field code specified by shift_scalar and shift_scalar_index is used for the parameter. * GDADPH(dirfile_unit, field_code, field_code_len, in_field1, in_field1_len, shift, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field1_len, shift, fragment_index CHARACTER* field_code CHARACTER* in_field This is equivalent to GDASPH above with shift_scalar_len set to zer (i.e. with a literal parameter only). * GDASWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len, check_field, check_field_len, windop, threshold, threshold_scalar, threshold_scalar_len, threshold_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len INTEGER threshold_scalar_len, threshold_scalar_index, windop CHARACTER* field_code CHARACTER* in_field CHARACTER* check_field INTEGER threshold or REAL*8 threshold This subroutine adds a WINDOW field with the supplied parameters to the specified fragment of the dirfile. If threshold_scalar_len is zero, threshold_scalar and threshold_scalar_index are ignored, and the literal value threshold is used for the parameter. In this case, if windop is one of GDW_EQ, GDW_NE, GDW_ST, or GDW_CL, threshold should be an integer; otherwise, threshold should be a real. If threshold_scalar_len is non-zero, the literal threshold is ignored and the field code specified by threshold_scalar and threshold_scalar_index is used for the parameter. * GDADWD(dirfile_unit, field_code, field_code_len, in_field, in_field_len, check_field, check_field_len, windop, threshold, fragment_index) Input: INTEGER dirfile_unit, field_code_len, in_field_len, check_field_len, windop INTEGER fragment_index CHARACTER* field_code CHARACTER* in_field CHARACTER* check_field INTEGER threshold or REAL*8 threshold This is equivalent to GDASWD with threshold_scalar_len set to zero (i.e. with a literal parameter only). * GDASMX(dirfile_unit, field_code, field_code_len, infield, infield_len, countfield, countfield_len, countval, countval_scalar, countval_scalar_len, countval_scalar_index, period, period_scalar, period_scalar_len, period_scalar_index, fragment_index) Input: INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval INTEGER countval_scalar_len, countval_scalar_index, period INTEGER period_scalar_len, period_scalar_index, fragment_index CHARACTER* field_code CHARACTER* infield CHARACTER* countfield CHARACTER* countval_scalar CHARACTER* period_scalar This subroutine adds a MPLEX field with the supplied parameters to the specified fragment of the dirfile. If countval_scalar_len is zero, countval_scalar and countval_scalar_index are ignored and the literal value countval is used for the parameter. If countval_scalar_len is non-zero, the literal countval is ignored, and the field code specified by countval_scalar and countval_scalar_index are used for the parameter. Similarly with period. * GDADMX(dirfile_unit, field_code, field_code_len, infield, infield_len, countfield, countfield_len, countval, period, fragment_index) Input: INTEGER dirfile_unit, field_code_len, infield_len, countfile_len, countval INTEGER period, fragment_index CHARACTER* field_code CHARACTER* infield CHARACTER* countfield This subroutine is equivalent to GDASMX above with countval_scalar_len and period_scalar_len set to zero (i.e. with literal parameters only). * GDADCA(dirfile_unit, field_code, field_code_len, const_type, array_len, data_type, data, fragment_index) Input: INTEGER dirfile_unit, field_code_len, const_type, data_type, fragment_index INTEGER array_len CHARACTER* field_code data(array_len) This subroutine adds a CARRAY field with the supplied parameters to the specified format file fragment of the dirfile. const_type is the data type of the field when stored in the dirfile. data_type is the data type of the supplied data. These need not be the same. * GDADCO(dirfile_unit, field_code, field_code_len, const_type, data_type, value, fragment_index) Input: INTEGER dirfile_unit, field_code_len, const_type, data_type, fragment_index CHARACTER* field_code value This subroutine adds a CONST field with the supplied parameters to the specified format file fragment of the dirfile. const_type is the data type of the field when stored in the dirfile. data_type is the data type of the supplied value. These need not be the same. * GDADST(dirfile_unit, field_code, field_code_len, value, value_len, fragment_index) Input: INTEGER dirfile_unit, field_code_len, value_len, fragment_index CHARACTER* field_code CHARACTER* value This subroutine adds a STRING field with the supplied parameters to the specified format file fragment of the dirfile * GDADSP(dirfile_unit, spec, spec_len, fragment_index) Input: INTEGER dirfile_unit, fragment_index, spec_len CHARACTER* spec This subroutine wraps gd_add_spec(3), and allows adding a field to a dirfile given a field specification line. * GDMDSP(dirfile_unit, spec, spec_len, parent, parent_len) Input: INTEGER dirfile_unit, spec_len, parent_len CHARACTER* spec CHARACTER* parent This subroutine wraps gd_madd_spec(3), and allows adding a metafield to a dirfile given a field specification line. * GDMDAL(dirfile_unit, parent, parent_len, field_code, field_code_len, targ, targ_len) * GDMDBT(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field, in_field_len, bitnum, numbits) * GDMDCL(dirfile_unit, parent, parent_len, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3, in_field3_len, m3, b3) * GDFACO(dirfile_unit, parent, parent_len, field_code, field_code_len, const_type, data_type, value) * GDMDCP(dirfile_unit, parent, parent_len, field_code, field_code_len, poly_ord, int_field, in_field_len, a0, a1, a2, a3, a4, a5) * GDMDCR(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field, in_field_len, dividend) * GDMDDV(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field1, in_field1_len, in_field2, in_field2_len) * GDMDLC(dirfile_unit, parent, parent_len, field_code, field_code_len, nfields, in_field1, in_field1_len, m1, b1, in_field2, in_field2_len, m2, b2, in_field3, in_field3_len, m3, b3) * GDMDLT(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field, in_field_len, table, table_len) * GDMDMT(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field1, in_field1_len, in_field2, in_field2_len) * GDMDPH(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field, in_field_len, shift) * GDMDPN(dirfile_unit, parent, parent_len, field_code, field_code_len, poly_ord, int_field, in_field_len, a0, a1, a2, a3, a4, a5) * GDMDRC(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field, in_field_len, dividend) * GDMDSB(dirfile_unit, parent, parent_len, field_code, field_code_len, in_field, in_field_len, bitnum, numbits) * GDMDWD(dirfile_unit, parent, field_code, field_code_len, in_field, in_field_len, check_field, check_field_len, windop, threshold) * GDMDMX(dirfile_unit, parent, field_code, field_code_len, in_field, in_field_len, count_field, count_field_len, count_val, period) * GDMDCA(dirfile_unit, parent, parent_len, field_code, field_code_len, const_type, array_len, data_type, data) * GDMDCO(dirfile_unit, parent, parent_len, field_code, field_code_len, const_type, data_type, value) * GDMDST(dirfile_unit, parent, parent_len, field_code, field_code_len, value, value_len) These functions are the corresponding META field functions for the GDADxx functions above. They add META fields to the parent field indicated. Defined Parameters ================== The following parameters, listed here with their C library analogues, are defined in getdata.f which may be included in any Fortran program using the Fortran 77 bindings. Error codes (returned by GDEROR): F77 symbol C symbol Notes ---------- ------------------- --------------------------------------- GD_EOK GD_E_OK This is guaranteed to be equal to zero. GD_EAC GD_E_ACCMODE GD_EAL GD_E_ALLOC GD_EAR GD_E_ARGUMENT GD_EBC GD_E_BAD_CODE GD_EBD GD_E_BAD_DIRFILE GD_EBE GD_E_BAD_ENTRY GD_EBF GD_E_BAD_FIELD_TYPE GD_EBI GD_E_BAD_INDEX GD_EBO GD_E_BOUNDS GD_EBP GD_E_BAD_PROTECTION Deprecated; kept as an alias for GD_EAR. GD_EBR GD_E_BAD_REFERENCE GD_EBS GD_E_BAD_SCALAR GD_EBT GD_E_BAD_TYPE GD_ECB GD_E_CALLBACK GD_ECR GD_E_CREAT GD_EDL GD_E_DELETE GD_EDM GD_E_DIMENSION GD_EDO GD_E_DOMAIN GD_EDU GD_E_DUPLICATE GD_EEN GD_E_BAD_ENDIANNESS Deprecated; kept as an alias for GD_EAR. GD_EEX GD_E_EXISTS GD_EFL GD_E_FLUSH GD_EFO GD_E_FORMAT GD_EIE GD_E_INTERNAL_ERROR GD_EOF GD_E_OPEN_FRAGMENT GD_EOI GD_E_OPEN_INCLUDE Deprecated; kept as an alias for GD_EOF. GD_EOL GD_E_OPEN_LINFILE GD_EOP GD_E_OPEN GD_EPT GD_E_PROTECTED GD_ERA GD_E_RANGE GD_ERL GD_E_RECURSE_LEVEL GD_ERP GD_E_BAD_REPR GD_ERW GD_E_RAW_IO GD_ETL GD_E_LINE_TOO_LONG GD_ETR GD_E_TRUNC GD_EUE GD_E_UNKNOWN_ENCODING GD_EVR GD_E_BAD_VERSION Deprecated; kept as an alias for GD_EAR. GD_UCL GD_E_UNCLEAN_DB GD_UNS GD_E_UNSUPPORTED Dirfile flags (required by GDOPEN, GDCOPN, GDINCL, GDINCA, and GDFLAG): F77 symbol C symbol Notes ---------- ----------------- -------------------------------------- GD_RO GD_RDONLY The flags argument passed to GDOPEN GD_RW GD_RDWR must contain at least GD_RO or GD_RW GD_AE GD_ARM_ENDIAN GD_BE GD_BIG_ENDIAN GD_CR GD_CREAT GD_EX GD_EXCL GD_FC GD_FORCE_ENCODING GD_FE GD_FORCE_ENDIAN GD_ID GD_IGNORE_DUPS GD_IR GD_IGNORE_REFS GD_LE GD_LITTLE_ENDIAN GD_NA GD_NOT_ARM_ENDIAN GD_PE GD_PEDANTIC GD_PM GD_PERMISSIVE GD_PP GD_PRETTY_PRINT GD_TR GD_TRUNC GD_TS GD_TRUNCSUB GD_VB GD_VERBOSE Encoding types: F77 symbol C symbol Notes ---------- ----------------- -------------------------------------- GDE_AU GD_AUTO_ENCODED GDE_BZ GD_BZIP2_ENCODED GDE_GZ GD_GZIP_ENCODED GDE_LZ GD_LZMA_ENCODED GDE_SL GD_SLIM_ENCODED GDE_SI GD_SIE_ENCODED GDE_TX GD_TEXT_ENCODED GDE_UN GD_UNENCODED GDE_ZS GD_ZZSLIM_ENCODED GDE_ZZ GD_ZZIP_ENCODED Entry types (required by GDFLDT): F77 symbol C symbol Notes ---------- ----------------- -------------------------------------- GD_NOE GD_NO_ENTRY Indicating an invalid field type GD_RWE GD_RAW_ENTRY GD_LCE GD_LINCOM_ENTRY GD_LTE GD_LINTERP_ENTRY GD_BTE GD_BIT_ENTRY GD_MTE GD_MULTIPLY_ENTRY GD_PHE GD_PHASE_ENTRY GD_IXE GD_INDEX_ENTRY GD_PNE GD_POLYNOM_ENTRY GD_SBE GD_SBIT_ENTRY GD_DVE GD_DIVIDE_ENTRY GD_RCE GD_RECIP_ENTRY GD_WDE GD_WINDOW_ENTRY GD_MXE GD_MPLEX_ENTRY GD_COE GD_CONST_ENTRY GD_CAE GD_CARRAY_ENTRY GD_STE GD_STRING_ENTRY Data types. Note, Fortran does not support unsigned data types, but GDGERW may still return an unsigned type, so all types are defined here. The unsigned data type specifiers will be accepted by the other subroutines, but the data returned may not be properly interpretable by Fortran 77. F77 symbol C symbol Notes ---------- ----------------- -------------------------------------- GD_NUL GD_NULL Not suitable to be passed to GDPUTD GD_U8 GD_UINT8 GD_I8 GD_INT8 GD_U16 GD_UINT16 GD_I16 GD_INT16 GD_U32 GD_UINT32 GD_I32 GD_INT32 GD_U64 GD_UINT64 GD_I64 GD_INT64 GD_F32 GD_FLOAT32 GD_F64 GD_FLOAT64 GD_C64 GD_COMPLEX64 GDC128 GD_COMPLEX128 Delete flags (required by GDDELE): F77 symbol C symbol ---------- ----------------- GDD_MT GD_DEL_META GDD_DT GD_DEL_DATA GDD_DR GD_DEL_DEREF GDD_FO GD_DEL_FORCE Rename flags (requred by GDRENM): F77 symbol C symbol ---------- ----------------- GDR_DT GD_REN_DATA GDR_UP GD_REN_UPDB Protection levels (returned by GDGPRT and required by GDAPRT): F77 symbol C symbol Notes ---------- ----------------- -------------------------------------- GDPR_N GD_PROTECT_NONE GDPR_F GD_PROTECT_FORMAT GDPR_D GD_PROTECT_DATA GDPR_A GD_PROTECT_ALL This is the bitwise or of GDPR_D and GDPR_A Syntax error handler actions (returned by the registered callback function, see GDCOPN) F77 symbol C symbol ---------- ------------------- GDSX_A GD_PROTECT_ABORT GDSX_S GD_PROTECT_RESCAN GDSX_I GD_PROTECT_IGNORE GDSX_C GD_PROTECT_CONTINUE Syntax suberrors (provided to the registered callback function, see GDCOPN): F77 symbol C symbol ---------- --------------------- GDF_AL GD_E_FORMAT_ALIAS GDF_BN GD_E_FORMAT_BITNUM GDF_CH GD_E_FORMAT_CHARACTER GDF_DU GD_E_FORMAT_DUPLICATE GDF_EN GD_E_FORMAT_ENDIAN GDF_LI GD_E_FORMAT_BAD_LINE GDF_LO GD_E_FORMAT_LOCATION GDF_LT GD_E_FORMAT_LITERAL GDF_MM GD_E_FORMAT_META_META GDF_MR GD_E_FORMAT_METARAW GDF_MV GD_E_FORMAT_MPLEXVAL GDF_NA GD_E_FORMAT_BAD_NAME GDF_NB GD_E_FORMAT_NUMBITS GDF_NF GD_E_FORMAT_N_FIELDS GDF_NT GD_E_FORMAT_N_TOK GDF_PA GD_E_FORMAT_NO_PARENT GDF_PR GD_E_FORMAT_PROTECT GDF_RN GD_E_FORMAT_RES_NAME GDF_SF GD_E_FORMAT_BAD_SPF GDF_SZ GD_E_FORMAT_BITSIZE GDF_TY GD_E_FORMAT_BAD_TYPE GDF_UM GD_E_FORMAT_UNTERM GDF_WO GD_E_FORMAT_WINDOP Special version symbols: F77 symbol C symbol ---------- --------------------- GDSV_C GD_VERSION_CURRENT GDSV_L GD_VERSION_LATEST GDSV_E GD_VERSION_EARLIEST Seek flags: F77 symbol C symbol ---------- --------------------- GDSK_C GD_SEEK_CUR GDSK_E GD_SEEK_END GDSK_P GD_SEEK_PAD GDSK_S GD_SEEK_SET WINDOW entry operations: F77 symbol C symbol ---------- --------------------- GDW_CL GD_WINDOP_CLR GDW_EQ GD_WINDOP_EQ GDW_GE GD_WINDOP_GE GDW_GT GD_WINDOP_GT GDW_LE GD_WINDOP_LE GDW_LT GD_WINDOP_LT GDW_NE GD_WINDOP_NE GDW_ST GD_WINDOP_SET GDW_UN GD_WINDOP_UNK Desync flags: F77 symbol C symbol ---------- --------------------- GDDS_P GD_DESYNC_PATHCHECK GDDS_O GD_DESYNC_REOPEN MPLEX lookback parameters: F77 symbol C symbol ---------- --------------------- GDLB_A GD_LOOKBACK_ALL GDLB_D GD_DEFAULT_LOOKBACK Miscellaneous parameters: F77 symbol C symbol ---------- ------------------------- GD_ALL GD_ALL_FRAGMENTS GD_DSV GD_DIRFILE_STANDARDS_VERSION GD_HER GD_HERE GD_MLL GD_MAX_LINE_LENGTH libgetdata-0.9.0/doc/README.matlab0000640000175000017500000000136412614323564016674 0ustar alastairalastairMATLAB BINDINGS FOR GETDATA =========================== The MATLAB bindings consist of a compatibility library, libgetdata-matlab, a collection of MEX functions, and a few pure MATLAB functions implementing the bindings. The compatibility library is installed in ${libdir}. By default, the MATLAB files are installed in ${libdir}/getdata/matlab/getdata, although this path can be changed with the --with-matlab-dir option to ./configure. To use the bindings, the installation directory must be added to the MATLAB path. Full documentation of the bindings are provided from within the MATLAB help system. After installing the bindings, running >> help getdata will provide an overview of the bindings and provide a list of the functions availabe. libgetdata-0.9.0/doc/README.f950000640000175000017500000011270312614323564016037 0ustar alastairalastairFORTRAN 95 BINDINGS FOR GETDATA =============================== This README describes the Fortran 95 bindings for the GetData library. These bindings consist of a Fortran 95 compatibility library `libf95getdata' (written in Fortran 95) and a Fortran 95 module file `getdata.mod' which defines the interface. The Fortran 95 bindings require the Fortran 77 compatibility library `libfgetdata' for operation. For programs which can use Fortran 95 modules, these bindings should be preferred over the Fortran 77 bindings, since these bindings provide type safety and more legible symbols. As in the Fortran 77 bindings, dirfiles are referred to by "dirfile unit" numbers, which are internally converted to the C API DIRFILE pointers. Space is available in the compatibility library for only 1023 dirfile units. If an application attempts to open more than 1023 dirfiles simultaneously, the compatibility library will emit an error message on standard error and return and invalid dirfile unit number. Passing an invalid dirfile unit number to a procedure which requires one as input (other than fgd_close, which will simply ignore it) will result in the call failing with error code GD_E_BAD_DIRFILE. The "getdata" module, which these bindings define, is described in `getdata.mod', which will be installed in the same directory as getdata.h. The getdata module defines the same error codes (GD_E_OK, GD_E_OPEN, &c.), the same open flags (GD_RDONLY, GD_CREAT, &c.) and the same data type specifiers (GD_INT8, GD_FLOAT32, &c.), and other symbolic parameters as the C API. Available Procedures ==================== Notably, unlike the Fortran 77 bindings, the Fortran 95 bindings do not require passing character string lengths along with the string itself to procedures. The downside to this convenience is that strings with trailing whitespace cannot be used. Procedures which are essentially equivalent to their C API counterparts, with the exception of including an initial `f' in their names, and using dirfile unit numbers in place of C's DIRFILE pointers are: * integer function fgd_open(dirfilename, flags) character (len=*), intent(in) :: dirfilename integer, intent(in) :: flags * integer function fgd_cbopen (dirfilename, flags, sehandler) character (len=*), intent (in) :: dirfilename integer, intent (in) :: flags interface subroutine sehandler(act, dirfile_unit, suberror, line) integer, intent (out) :: act integer, intent (in) :: dirfile_unit, suberror character (len=GD_MAX_LINE_LENGTH), intent (inout) :: line end subroutine end interface * subroutine fgd_close (dirfile_unit) integer, intent(in) :: dirfile * subroutine fgd_desync (dirfile_unit, flags) integer :: fgd_desync integer, intent(in) :: dirfile, flags * subroutine fgd_discard (dirfile_unit) integer, intent(in) :: dirfile * subroutine fgd_verbose_prefix(dirfile, prefix) integer, intent(in) :: dirfile character (len=*), intent(in) :: prefix * subroutine fgd_mplex_lookback(dirfile, lookback) integer, intent(in) :: dirfile, lookback * subroutine fgd_flush (dirfile_unit, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_sync (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_raw_close (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code (For fgd_flush, fgd_sync and fgd_raw_close, if field_code is the empty string, the operation will be performed on the entire dirfile.) * subroutine fgd_metaflush (dirfile_unit) integer, intent(in) :: dirfile * character (len=GD_MAX_LINE_LENGTH) function fgd_fragmentname(dirfile_unit, ind) integer, intent(in) :: dirfile_unit, ind * function fgd_nentries (dirfile, parent, entype, flags) integer :: fgd_nentries integer, intent(in) :: dirfile, entype, flags character (len=*), intent(in) :: parent integer :: parent_l * integer function fgd_nfields (dirfile_unit) integer, intent(in) :: dirfile_unit * integer function fgd_nfields_by_type (dirfile_unit, type) integer, intent(in) :: dirfile_unit, type * integer function fgd_nvectors (dirfile_unit) integer, intent(in) :: dirfile_unit * integer function fgd_nmetafields (dirfile_unit, parent) integer, intent(in) :: dirfile_unit character, intent(in) :: parent * integer function fgd_nmetafields_by_type (dirfile_unit, parent, type) integer, intent(in) :: dirfile_unit, type character, intent(in) :: parent * integer function fgd_nmetavectors (dirfile_unit, parent) integer, intent(in) :: dirfile_unit character, intent(in) :: parent * integer function fgd_nformats (dirfile_unit) integer, intent(in) :: dirfile_unit * integer function fgd_nframes (dirfile_unit) integer, intent(in) :: dirfile_unit * integer function fgd_spf (dirfile_unit, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_error (dirfile_unit) integer, intent(in) :: dirfile_unit * integer function fgd_error_count (dirfile_unit) integer, intent(in) :: dirfile_unit * integer function fgd_error_string (dirfile, buffer, len) integer, intent(in) :: dirfile, len character (len=), intent(out) :: buffer * integer function fgd_get_string (dirfile, field_code, length, data_out) integer, intent(in) :: dirfile, length character (len=*), intent(in) :: field_code character (len=*), intent(out) :: data_out * integer function fgd_put_string (dirfile, field_code, data_in) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code, data_in * subroutine fgd_add_spec (dirfile, spec, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: spec * subroutine fgd_madd_spec (dirfile, spec, parent) integer, intent(in) :: dirfile character (len=*), intent(in) :: parent, spec * subroutine fgd_include (dirfile, inc_file, flags) integer, intent(in) :: dirfile, fragment_index, flags character (len=*), intent(in) :: inc_file * subroutine fgd_include_affix (dirfile, fragmentname, fragment_index, prefix, suffix, flags) integer, intent(in) :: dirfile, fragment_index, flags character (len=*), intent(in) :: fragmentname, prefix, suffix * integer function fgd_array_len (dirfile_unit, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_add_alias (dirfile, field_code, targ, fragment_index) integer, intent(in) :: dirfile, fragment_index character(len=*), intent(in) :: field_code, targ * subroutine fgd_add_bit (dirfile, field_name, in_field, bitnum, numbits, fragment_index) integer, intent(in) :: dirfile, bitnum, numbits, fragment_index character (len=*), intent(in) :: field_name, in_field * subroutine fgd_add_clincom (dirfile, field_name, n_fields, in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3, fragment_index) integer, intent(in) :: dirfile, n_fields, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double complex, intent(in) :: m1, b1, m2, b2, m3, b3 * subroutine fgd_add_carray (dirfile, field_name, const_type, array_len, fragment_index) integer, intent(in) :: dirfile, const_type, array_len, fragment_index character (len=*), intent(in) :: field_name (Unlike the C counterpart, this version cannot be used to simultaneously set the value of the field. Use one of the fgd_put_carray procedures after creating the field). * subroutine fgd_add_const (dirfile, field_name, const_type, fragment_index) integer, intent(in) :: dirfile, const_type, fragment_index character (len=*), intent(in) :: field_name (Unlike the C counterpart, this version cannot be used to simultaneously set the value of the constant. Use one of the fgd_put_constant procedures after creating the field). * subroutine fgd_add_cpolynom (dirfile, field_name, poly_ord, in_field, a0, a1, a2, a3, a4, a5, fragment_index) integer, intent(in) :: dirfile, poly_ord, fragment_index character (len=*), intent(in) :: field_name, in_field double complex, intent(in) :: a0, a1, a2, a3, a4, a5 * subroutine fgd_add_crecip (dirfile, field_name, in_field, cdividend, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field double complex, intent(in) :: cdividend * subroutine fgd_add_divide (dirfile, field_name, in_field1, in_field2, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2 * subroutine fgd_add_lincom (dirfile, field_name, n_fields, in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3, fragment_index) integer, intent(in) :: dirfile, n_fields, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double precision, intent(in) :: m1, b1, m2, b2, m3, b3 * subroutine fgd_add_linterp (dirfile, field_name, in_field, table, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field, table * subroutine fgd_add_mplex (dirfile, field_code, in_field, count_field, count_val, period, fragment_index) character(len=*), intent(in) :: field_code, in_field, count_field integer, intent(in) :: dirfile, count_val, period, fragment_index * subroutine fgd_add_multiply (dirfile, field_name, in_field1, in_field2, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field1, in_field2 * subroutine fgd_add_phase (dirfile, field_name, in_field, phase, fragment_index) integer, intent(in) :: dirfile, phase, fragment_index character (len=*), intent(in) :: field_name, in_field * subroutine fgd_add_polynom (dirfile, field_name, poly_ord, in_field, a0, a1, a2, a3, a4, a5, fragment_index) integer, intent(in) :: dirfile, poly_ord, fragment_index character (len=*), intent(in) :: field_name, in_field double precision, intent(in) :: a0, a1, a2, a3, a4, a5 * subroutine fgd_add_raw (dirfile, field_code, data_type, spf, fragment_index) integer, intent(in) :: dirfile, data_type, spf, fragment_index character (len=*), intent(in) :: field_code * subroutine fgd_add_recip (dirfile, field_name, in_field, dividend, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_name, in_field double precision, intent(in) :: dividend * subroutine fgd_add_sbit (dirfile, field_name, in_field, bitnum, numbits, fragment_index) integer, intent(in) :: dirfile, bitnum, numbits, fragment_index character (len=*), intent(in) :: field_name, in_field * subroutine fgd_add_string (dirfile, field_code, fragment_index) integer, intent(in) :: dirfile, fragment_index character (len=*), intent(in) :: field_code (Unlike the C counterpart, this version cannot be used to simultaneously set the value of the string. Use the gd_put_string procedures after creating the field). * subroutine fgd_add_window_i (dirfile, field_code, in_field, check_field, windop, threshold, fragment_index) character(len=*), intent(in) :: field_code, in_field, check_field integer, intent(in) :: dirfile, windop, threshold, fragment_index * subroutine fgd_add_window_r (dirfile, field_code, in_field, check_field, & windop, threshold, fragment_index) character(len=*), intent(in) :: field_code, in_field, check_field integer, intent(in) :: dirfile, windop, fragment_index double precision, intent(in) :: threshold * subroutine fgd_madd_alias (dirfile, parent, field_code, targ) integer, intent(in) :: dirfile character(len=*), intent(in) :: parent, field_code, targ * subroutine fgd_madd_bit (dirfile, parent, field_name, in_field, bitnum, numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field, parent * subroutine fgd_madd_clincom (dirfile, parent, field_name, n_fields, in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 character (len=*), intent(in) :: parent double complex, intent(in) :: m1, b1, m2, b2, m3, b3 * subroutine fgd_madd_carray (dirfile, parent, field_name, const_type, array_len) integer, intent(in) :: dirfile, const_type, array_len character (len=*), intent(in) :: field_name, parent (Unlike the C counterpart, this version cannot be used to simultaneously set the value of the field. Use one of the fgd_put_carray procedures after creating the field). * subroutine fgd_madd_const (dirfile, parent, field_name, const_type) integer, intent(in) :: dirfile, const_type character (len=*), intent(in) :: field_name, parent (Unlike the C counterpart, this version cannot be used to simultaneously set the value of the constant. Use one of the gd_put_constant procedures after creating the field). * subroutine fgd_madd_cpolynom (dirfile, parent, field_name, poly_ord, in_field, a0, a1, a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field, parent double precision, intent(in) :: a0, a1, a2, a3, a4, a5 * subroutine fgd_madd_crecip (dirfile, parent, field_name, in_field, cdividend) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field, parent double complex, intent(in) :: cdividend * subroutine fgd_madd_divide (dirfile, parent, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2, parent * subroutine fgd_madd_lincom (dirfile, parent, field_name, n_fields, in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 character (len=*), intent(in) :: parent double precision, intent(in) :: m1, b1, m2, b2, m3, b3 * subroutine fgd_madd_divide (dirfile, parent, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2, parent * subroutine fgd_madd_linterp (dirfile, parent, field_name, in_field, table) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field, table, parent * subroutine fgd_madd_mplex (dirfile, parent, field_code, in_field, count_field, count_val, period) character(len=*), intent(in) :: parent, field_code, in_field, count_field integer, intent(in) :: dirfile, count_val, period * subroutine fgd_madd_phase (dirfile, parent, field_name, in_field, phase) integer, intent(in) :: dirfile, phase character (len=*), intent(in) :: field_name, in_field, parent * subroutine fgd_madd_polynom (dirfile, parent, field_name, poly_ord, in_field, a0, a1, a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field, parent double precision, intent(in) :: a0, a1, a2, a3, a4, a5 * subroutine fgd_madd_recip (dirfile, parent, field_name, in_field, dividend) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field, parent double precision, intent(in) :: dividend * subroutine fgd_madd_sbit (dirfile, parent, field_name, in_field, bitnum, numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field, parent * subroutine fgd_madd_string (dirfile, parent, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code, parent (Unlike the C counterpart, this version cannot be used to simultaneously set the value of the string. Use the gd_put_string procedures after creating the field). * subroutine fgd_madd_window_i (dirfile, parent, field_code, in_field, check_field, windop, threshold) character(len=*), intent(in) :: parent, field_code, in_field, check_field integer, intent(in) :: dirfile, windop, threshold * subroutine fgd_madd_window_r (dirfile, parent, field_code, in_field, check_field, windop, threshold) character(len=*), intent(in) :: parent, field_code, in_field, check_field integer, intent(in) :: dirfile, windop double precision, intent(in) :: threshold * character (len=GD_FIELD_LEN) function fgd_reference (dirfile) integer, intent(in) :: dirfile * character (len=GD_FIELD_LEN) function fgd_reference (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_parser_callback (dirfile, sehandler) integer, intent(in) :: dirfile interface subroutine sehandler(act, dirfile_unit, suberror, line) integer, intent (out) :: act integer, intent (in) :: dirfile_unit, suberror character (len=GD_MAX_LINE_LENGTH), intent (inout) :: line end subroutine end interface * integer function fgd_encoding (dirfile, fragment) integer, intent(in) :: dirfile, fragment * subroutine fgd_alter_encoding (dirfile, encoding, fragment, recode) integer, intent(in) :: dirfile, encoding, fragment, recode * integer function fgd_endianness (dirfile, fragment) integer, intent(in) :: dirfile, fragment * subroutine fgd_alter_endianness (dirfile, endianness, fragment, recode) integer, intent(in) :: dirfile, endianness, fragment, recode * integer function fgd_frameoffset (dirfile, fragment) integer, intent(in) :: dirfile, fragment * subroutine fgd_alter_frameoffset (dirfile, frameoffset, fragment, recode) integer, intent(in) :: dirfile, frameoffset, fragment, recode * integer function fgd_protection (dirfile, fragment) integer, intent(in) :: dirfile, fragment * subroutine fgd_alter_protection (dirfile, protection_level, fragment) integer, intent(in) :: dirfile, protection_level, fragment * subroutine fgd_fragment_affixes (prefix, suffix, dirfile, fragment_index) character(len=*), intent(out) :: prefix, suffix integer, intent(in) :: dirfile, fragment_index * subroutine fgd_alter_affixes (dirfile, fragment_index, prefix, suffix) integer, intent(in) :: dirfile, fragment_index character(len=*), intent(in) :: prefix, suffix * integer function fgd_native_type (dirfile, field_code) integer integer(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_parent_fragment (dirfile, fragment) integer, intent(in) :: dirfile, fragment * subroutine fgd_uninclude (dirfile, fragment, del) integer, intent(in) :: dirfile, fragment, del * character (len=GD_MAX_LINE_LENGTH) function fgd_raw_filename (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_move (dirfile, field_code, new_fragment, flags) integer, intent(in) :: dirfile, new_fragment, flags character (len=*), intent(in) :: field_code * subroutine fgd_alter_bit (dirfile, field_name, in_field, bitnum, numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field * subroutine fgd_alter_clincom (dirfile, field_name, n_fields, in_field1, cm1, cb1, in_field2, cm2, cb2, in_field3, cm3, cb3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double complex, intent(in) :: cm1, cb1, cm2, cb2, cm3, cb3 * subroutine fgd_alter_carray (dirfile, field_name, const_type, array_len) integer, intent(in) :: dirfile, const_type, array_len character (len=*), intent(in) :: field_name * subroutine fgd_alter_const (dirfile, field_name, const_type) integer, intent(in) :: dirfile, const_type character (len=*), intent(in) :: field_name * subroutine fgd_alter_cpolynom (dirfile, field_name, poly_ord, in_field, ca0, ca1, ca2, ca3, ca4, ca5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double complex, intent(in) :: ca0, ca1, ca2, ca3, ca4, ca5 * subroutine fgd_alter_crecip (dirfile, field_name, in_field, dividend) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field double complex, intent(in) :: cdividend * subroutine fgd_alter_divide (dirfile, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2 * subroutine fgd_alter_lincom (dirfile, field_name, n_fields, in_field1, m1, b1, in_field2, m2, b2, in_field3, m3, b3) integer, intent(in) :: dirfile, n_fields character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double precision, intent(in) :: m1, b1, m2, b2, m3, b3 * subroutine fgd_alter_linterp (dirfile, field_name, in_field, table, move) integer, intent(in) :: dirfile, move character (len=*), intent(in) :: field_name, in_field, table * subroutine fgd_alter_mplex (dirfile, field_name, in_field, count_field, count_val, period) integer, intent(in) :: dirfile, count_val, period character (len=*), intent(in) :: field_name, in_field, count_field * subroutine fgd_alter_multiply (dirfile, field_name, in_field1, in_field2) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field1, in_field2 * subroutine fgd_alter_phase (dirfile, field_name, in_field, phase) integer, intent(in) :: dirfile, phase character (len=*), intent(in) :: field_name, in_field * subroutine fgd_alter_polynom (dirfile, field_name, poly_ord, in_field, a0, a1, a2, a3, a4, a5) integer, intent(in) :: dirfile, poly_ord character (len=*), intent(in) :: field_name, in_field1, in_field2, in_field3 double precision, intent(in) :: a0, a1, a2, a3, a4, a5 * subroutine fgd_alter_raw (dirfile, field_code, data_type, spf, move) integer, intent(in) :: dirfile, data_type, spf, move character (len=*), intent(in) :: field_code * subroutine fgd_alter_recip (dirfile, field_name, in_field, dividend) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_name, in_field double precision, intent(in) :: dividend * subroutine fgd_alter_sbit (dirfile, field_name, in_field, bitnum, numbits) integer, intent(in) :: dirfile, bitnum, numbits character (len=*), intent(in) :: field_name, in_field * subroutine fgd_alter_window_i (dirfile, field_name, in_field, check_field, windop, threshold) integer, intent(in) :: dirfile, windop, threshold character (len=*), intent(in) :: field_name, in_field, check_field * subroutine fgd_alter_window_r (dirfile, field_name, in_field, check_field, windop, threshold) integer, intent(in) :: dirfile, windop character (len=*), intent(in) :: field_name, in_field, check_field double precision, intent(in) :: threshold * subroutine fgd_alter_spec (dirfile, spec, recode) integer, intent(in) :: dirfile, recode character (len=*), intent(in) :: spec * subroutine fgd_malter_spec (dirfile, spec, parent, recode) integer, intent(in) :: dirfile, recode character (len=*), intent(in) :: parent, spec * subroutine fgd_rename (dirfile, field_code, new_name, flags) integer, intent(in) :: dirfile, flags character (len=*), intent(in) :: field_code, new_name * subroutine fgd_delete (dirfile, field_code, flags) integer, intent(in) :: dirfile, flags character (len=*), intent(in) :: field_code * integer function fgd_entry_type (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_fragment_index (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_validate (dirfile, field_code) integer integer(in) :: dirfile character (len=*), intent(in) :: field_code * double precision function fgd_framenum (dirfile, field_code, value) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code double precision, intent(in) :: value * double precision function fgd_framenum_subset (dirfile, field_code, value, frame_start, frame_end) integer, intent(in) :: dirfile, frame_start, frame_end character (len=*), intent(in) :: field_code double precision, intent(in) :: value * subroutine fgd_dirfilename (dirfilename, dirfilename_l, dirfile, fragment_index) character (len=*), intent(out) :: dirfilename integer, intent(in) :: dirfile, fragment_index integer, intent(inout) :: dirfilename_l * integer function fgd_bof (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_eof (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_dirfile_standards (dirfile, version) integer, intent(in) :: dirfile, version * integer function fgd_invalid_dirfile () * integer function fgd_seek (dirfile, field_code, frame_num, sample_num, flags) integer, intent(in) :: dirfile, frame_num, sample_num, flags character (len=*), intent(in): field_code * subroutine fgd_strtok (token, token_len, dirfile, string) character (len=*), intent(out) :: token integer, intent(inout) :: token_len integer, intent(in) :: dirfile character (len=*), intent(in) :: string (If passed the empty string, the next token of the previous string is returned.) * integer function fgd_tell (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in): field_code * character (len=GD_MAX_LINE_LENGTH) function fgd_alias_target (dirfile, field_code) integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code * integer function fgd_naliases (dirfile, field_code) integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code * integer function fgd_hidden (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_hide (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * subroutine fgd_unhide (dirfile, field_code) integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code * integer function fgd_encoding_support (encoding) integer, intent(in) :: encoding In order to respect type safety, the gd_getdata and gd_putdata analogues encode the data type of their array in their function name, rather than as a parameter. Otherwise, they behave the same as their C counterparts. * integer function fgd_getdata_n (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples) integer, intent(in) :: dirfile_unit integer, intent(in) :: first_frame, first_sample, num_frames, num_samples character (len=*), intent(in) :: field_code This calls getdata(3) with return_type = GD_NULL (i.e. return no data). As a result, no data_out parameter is required. * integer function fgd_getdata_i1 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_i2 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_i4 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_i8 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_r4 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_r8 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_c8 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_getdata_c16 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) integer, intent(in) :: dirfile_unit integer, intent(in) :: first_frame, first_sample, num_frames, num_samples character (len=*), intent(in) :: field_code , dimension(:), intent(out) :: data_out These call getdata(3) with return_type = GD_INT8, GD_INT16, GD_INT32, GD_INT64, GD_FLOAT32, GD_FLOAT64, GD_COMPLEX64, and GD_COMPLEX128 respectively. Here is an integer or real type of the appropriate width. Analogously, for putdata: * integer function fgd_putdata_i1 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_in) * integer function fgd_putdata_i2 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_in) * integer function fgd_putdata_i4 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_in) * integer function fgd_putdata_i8 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_in) * integer function fgd_putdata_r4 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_in) * integer function fgd_putdata_r8 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_in) * integer function fgd_putdata_c8 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) * integer function fgd_putdata_c16 (dirfile_unit, field_code, first_frame, first_sample, num_frames, num_samples, data_out) integer, intent(in) :: dirfile_unit integer, intent(in) :: first_frame, first_sample, num_frames, num_samples character (len=*), intent(in) :: field_code , dimension(:), intent(in) :: data_in No corresponding fgd_putdata_n function exists, since GD_NULL is not an acceptable input data_type for gd_putdata(3). Analogously for gd_constants, gd_get_carray_slice, gd_get_constant, gd_mconstants, gd_put_carray_slice, and gd_put_constant, for which only the _i1 versions are shown here: * subroutine fgd_constants_i1(values, dirfile) integer(1), dimension(:), intent(out) :: values * subroutine fgd_get_carray_i1 (dirfile, field_code, data_out, start, array_len) integer, intent(in) :: dirfile_unit, start, array_len character (len=*), intent(in) :: field_code integer(1), intent(out) :: data_out * subroutine fgd_get_constant_i1 (dirfile, field_code, data_out) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: field_code integer(1), intent(out) :: data_out * subroutine fgd_mconstants_i1(values, dirfile, parent) integer(1), dimension(:), intent(out) :: values character (len=*), intent(in) :: parent * subroutine fgd_put_carray_i1 (dirfile, field_code, data_in, start, array_len) integer, intent(in) :: dirfile_unit, start, array_len character (len=*), intent(in) :: field_code integer(1), intent(in) :: data_in * subroutine fgd_put_constant_i1 (dirfile, field_code, data_in) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: field_code integer(1), intent(in) :: data_in For the carray functions, if len is zero, gd_get_carray(3) or gd_put_carray(3) will be called to read or write the whole array. Otherwise these subroutines will call gd_get_carray_slice(3) or gd_put_carray_slice(3). Other procedures in the Fortran 95 bindings are: function fgd_entry_name_max (dirfile, parent, entype, flags) integer :: fgd_entry_name_max integer, intent(in) :: dirfile, entype, flags character (len=*), intent(in) :: parent integer :: parent_l This function returns the length of the longest entry name defined in the dirfile satisfying the given criteria. The parameters are the same as they are for fgd_nentries. * integer fgd_field_name_max (dirfile_unit) integer, intent(in) :: dirfile_unit This function returns the length of the longest field name defined in the dirfile. * integer fgd_mfield_name_max (dirfile_unit, parent) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: parent This function returns the length of the longest field name defined in the dirfile for META fields of the supplied parent field. * integer fgd_string_value_max (dirfile_unit) integer, intent(in) :: dirfile_unit This function returns the length of the longest STRING field (excluding /META fields) in the database. * integer fgd_mstring_value_max (dirfile_unit, parent) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: parent This function returns the length of the longest STRING metafield for the given parent field. * integer fgd_alias_max (dirfile, field_code) integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code This function returns the length of the longest alias for the given field_code. * subroutine fgd_entry_list (entry_list, dirfile, parent, entype, flags, entry_len) character(len=*), dimension(:), intent(out) :: entry_list integer, intent(in) :: dirfile, entype, flags integer, intent(inout) :: entry_len character (len=*), intent(in) :: parent integer :: max_len, nentries, i, parent_l This subroutine behaves analogously to gd_entry_list(3), except that it requires an additional argument, entry_len, which is the longest entry name which will fit in the supplied entry_list array. If the longest entry name in the dirfile is longer than entry_len, entry_len will be set to this value (which is equivalent to the return value of fgd_entry_name_max) and entry_list will remain untouched. Analogously: * subroutine fgd_field_list (field_list, dirfile, field_len) character (len=) dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile_unit integer, intent(inout) :: field_len * subroutine fgd_field_list_by_type (field_list, dirfile, entype, field_len) character (len=) dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile_unit, entype integer, intent(inout) :: field_len * subroutine fgd_vector_list (field_list, dirfile, field_len) character (len=) dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile_unit integer, intent(inout) :: field_len * subroutine fgd_strings (strings, dirfile, string_len) character (len=) dimension(:), intent(out) :: string_list integer, intent(in) :: dirfile_unit integer, intent(inout) :: string_len * subroutine fgd_aliases (aliases, dirfile, field_code, alias_len) character(len= dimension(:), intent(out) :: aliases integer, intent(in) :: dirfile character(len=*), intent(in) :: field_code integer, intent(inout) :: alias_len Also analogously, except that field_len will be equivalent to the return value of fgd_mfield_name_max or fgd_string_value_max, if too small: * subroutine fgd_mfield_list (field_list, dirfile, parent, field_len) character (len=) dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile_unit integer, intent(inout) :: field_len character (len=*), intent(in) :: parent * subroutine fgd_mfield_list_by_type (field_list, dirfile, entype, parent, field_len) character (len=) dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile_unit, entype integer, intent(inout) :: field_len character (len=*), intent(in) :: parent * subroutine fgd_mvector_list (field_list, dirfile, parent, field_len) character (len=) dimension(:), intent(out) :: field_list integer, intent(in) :: dirfile_unit integer, intent(inout) :: field_len character (len=*), intent(in) :: parent * subroutine fgd_mstrings (string_list, dirfile, parent, string_len) character (len=) dimension(:), intent(out) :: string_list integer, intent(in) :: dirfile_unit integer, intent(inout) :: string_len character (len=*), intent(in) :: parent * integer function fgd_entry (dirfile_unit, field_code, ent) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: field_code type(gd_entry), intent(out) :: ent This fills ent with the metadata for field_code obtained by calling gd_entry(3). It returns the field type, or GD_NO_ENTRY if an error occurred in the gd_entry() call. The gd_entry type is defined in the getdata module to be: type gd_entry integer :: field_type, n_fields, spf, data_type, bitnum, numbits, shift integer :: fragment_index, flags, poly_ord, array_len, windop integer :: ithreshold, count_val, period character (len=GD_FIELD_LEN), dimension(3) :: field character (len=GD_FIELD_LEN), dimension(6) :: scalar integer, dimension(6) :: scalar_ind double precision, dimension(3) :: m, b double precision, dimension(6) :: a double precision :: dividend, rthreshold double complex, dimension(3) :: cm, cb double complex, dimension(6) :: ca double complex :: cdividend end type where GD_FIELD_LEN is a constant parameter equal to 4096. Character strings are all stored in field(:) according to the following table: TYPES FIELD(1) FIELD(2) FIELD(3) ------------------ ---------- ---------- ---------- RAW -- -- -- LINCOM infield[0] infield[1] infield[2] LINTERP infield[0] table -- BIT / SBIT / PHASE / RECIP / infield[0] -- -- POLYNOM MULTIPLY / DIVIDE / infield[0] infield[1] -- WINDOW Furthermore, data_type does double duty as the data_type parameter for RAW fields, and the const_type parameter for CONST and CARRAY fields. For WINDOW fields, only one of ithreshold and rthreshold will be set, according to the windop parameter. * subroutine fgd_add (dirfile_unit, field_code, ent) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: field_code type(gd_entry), intent(in) :: ent This subroutine adds the field indicated by field_code and described by ent into specified dirfile. Analogously, for adding meta fields: * subroutine fgd_madd (dirfile_unit, parent, field_code, ent) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: parent, field_code type(gd_entry), intent(in) :: ent * subroutine fgd_alter_entry (dirfile, field_code, ent, recode) integer, intent(in) :: dirfile, recode character (len=*), intent(in) :: field_code type(gd_entry), intent(in) :: ent This subroutine alters the field or metafield specified. libgetdata-0.9.0/doc/README.cxx0000640000175000017500000007622512614323564016246 0ustar alastairalastairC++ BINDINGS FOR GETDATA ======================== This README describes the C++ bindings for the GetData library. These bindings consist of a several C++ classes in the `GetData' namespace, plus a few associated named constants. Header files defining these data types are installed into the ${includedir}/getdata directory. The classes defined in the GetData namespace are: Dirfile, Entry, Fragment, plus an additional Entry subclass for each field type (i.e. RawEntry, LincomEntry, &c.) CONSTANTS ========= Because the C++ headers include the C API header getdata.h, all named constants defined in the C API may also be used in the C++ API without change in meaning. In addition to the classes documented below, the C++ bindings define the following enumerated constants. These are re-encapsulations of various C API named constants permitting better type safety in C++. In all cases, the corresponding C API constant can be used in place of the C++ named constant, with an appropriate type-cast (so that, e.g., (GetData::DataType)GD_NULL can be used in place of GetData::Null). The GetData data types (defined in getdata/entry.h): enum DataType { Null = GD_NULL, Unknown = GD_UNKNOWN, UInt8 = GD_UINT8, Int8 = GD_INT8, UInt16 = GD_UINT16, Int16 = GD_INT16, UInt32 = GD_UINT32, Int32 = GD_INT32, UInt64 = GD_UINT64, Int64 = GD_INT64, Float32 = GD_FLOAT32, Float64 = GD_FLOAT64, Complex64 = GD_COMPLEX64, Complex128 = GD_COMPLEX128 }; The GetData entry types (defined in getdata/entry.h): enum EntryType { NoEntryType = GD_NO_ENTRY, RawEntryType = GD_RAW_ENTRY, LincomEntryType = GD_LINCOM_ENTRY, LinterpEntryType = GD_LINTERP_ENTRY, BitEntryType = GD_BIT_ENTRY, MultiplyEntryType = GD_MULTIPLY_ENTRY, PhaseEntryType = GD_PHASE_ENTRY, SBitEntryType = GD_SBIT_ENTRY, PolynomEntryType = GD_POLYNOM_ENTRY, ConstEntryType = GD_CONST_ENTRY, CarrayEntryType = GD_CARRAY_ENTRY, StringEntryType = GD_STRING_ENTRY, IndexEntryType = GD_INDEX_ENTRY, DivideEntryType = GD_DIVIDE_ENTRY, RecipEntryType = GD_RECIP_ENTRY, WindowEntryType = GD_WINDOW_ENTRY, MPlexEntryType = GD_MPLEX_ENTRY }; The GetData window operations (defined in getdata/entry.h): enum WindOpType { WindOpEq = GD_WINDOP_EQ, WindOpNe = GD_WINDOP_NE, WindOpGe = GD_WINDOP_GE, WindOpGt = GD_WINDOP_GT, WindOpLe = GD_WINDOP_LE, WindOpLt = GD_WINDOP_LT, WindOpSet = GD_WINDOP_SET, WindOpClr = GD_WINDOP_CLR }; The GetData encoding schemes (defined in getdata/fragment.h): enum EncodingScheme { AutoEncoding = GD_AUTO_ENCODED, Bzip2Encoding = GD_BZIP2_ENCODED, FlacEncoding = GD_FLAC_ENCODED, GzipEncoding = GD_GZIP_ENCODED, RawEncoding = GD_UNENCODED, SieEncoding = GD_SIE_ENCODED, SlimEncoding = GD_SLIM_ENCODED, TextEncoding = GD_TEXT_ENCODED, ZzipEncoding = GD_ZZIP_ENCODED, ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED }; NON-MEMBER FUNCTIONS ==================== The following non-member functions in the GetData namespace are defined in getdata/dirfile.h: * GetData::EncodingSupport(GetData::EncodingScheme encoding) This function returns GD_RDWR if the library supports both reading from and writing to the specified encoding, GD_RDONLY, if the library can only read from the encoding, or -1 if the library supports neither reading nor writing for the specified encoding. See gd_encoding_support(3). DIRFILE CLASS ============= Defined in getdata/dirfile.h, the Getdata::Dirfile class encapsulates the DIRFILE object, providing a thin wrapper to the C API. The following methods are available: * Dirfile::Dirfile() The empty constructor creates an invalid dirfile. Attempting to call any member function will result in a GD_E_BAD_DIRFILE error. * Dirfile::Dirfile(const char *dirfilename, unsigned int flags = GD_RDONLY, gd_parser_callback_t sehandler = NULL, void *extra = NULL) This constructor takes the name of the dirfile, the dirfile flags, and optional pointers to a syntax error callback handler, and a caller pointer passed to that callback. The constructor will call gd_cbopen(3) on the provided path name. If flags is omitted, the default GD_RDWR will be used. * Dirfile::Dirfile(DIRFILE *dirfile) This constructor creates a Dirfile object from the supplied C API's DIRFILE object. This may be used especially in the supplied parser callback, sehandler, to instantiate a Dirfile object from the supplied DIRFILE pointer. * ~Dirfile::Dirfile() If not done explicitly (see below), the destructor will take care of calling gd_close(3). * int Dirfile::Close() * int Dirfile::Discard() These call gd_close(3) and gd_discard(3) respectively. If they return successfully (return value zero), the Dirfile should immediately be destroyed, by calling its destructor. Calling any member function after these functions return successfully will result in a GD_E_BAD_DIRFILE error. * int Dirfile::Error() The Error method calls gd_error(3) to return the error status of the last GetData library call on this Dirfile object. * int Dirfile::ErrorCount() The ErrorCount method calls gd_error_count(3) to return the number of errors encountered by the GetData library on this Dirfile object since this method was last called (or, the first time, since the object was created). * const char *Dirfile::ErrorString() * const char *Dirfile::ErrorString(size_t len) The ErrorString method will return a buffer containing a description of the last GetData library error as obtained from gd_error_string(3). This buffer is local to the object, and subsequent calls to ErrorString() will overwrite the buffer. The len parameter, if specified, is ignored. * off_t BoF(const char *field_code) This method will call gd_bof(3) and return the location of the beginning-of-field marker of the specified field. * GetData::Entry *Dirfile::Entry(const char *field_code) This method will return a pointer to a newly allocated object of the appropriate Entry Child class, cast as a plain GetData::Entry, created after calling gd_entry(3) with the supplied field_code. See below for a description of the Entry classes. * off_t EoF(const char *field_code) This method will call gd_eof(3) and return the location of the end-of-field marker of the specified field. * GetData::Fragment *Dirfile::Fragment(int index) This method will return a pointer to a newly allocated GetData::Fragment object corresponding to the fragment with the specified index. * int Dirfile::FragmentIndex(const char *field_code) This method will call gd_fragment_index(3) and return the index number of the fragment defining the specified field. * double Dirfile::FrameNum(const char *field_code, double value, off_t frame_start = 0, off_t frame_end = 0) This method will call gd_framenum_subset(3) to perform a reverse look-up on the specified field. If frame_start or frame_end are omitted, the start or end of the field will be used as the limit. * const char *Dirfile::Name() This method returns the name of the dirfile, that is the value of the dirfilename parameter passed to the constructor. * GetData::RawEntry *Dirfile::Reference(const char *field_code = NULL) This method will call gd_reference(3) to set and/or retrieve the reference field. It returns a RawEntry object describing the reference field. * const char *Dirfile::ReferenceFilename() This method is equivalent to calling Dirfile::Reference()->FileName() to return the binary file pathname associated with the dirfile reference field, except that it properly check that Dirfile::Reference() hasn't returned NULL, and it does not create a RawEntry object. * void Dirfile::SetCallback(gd_parser_callback_t sehandler, void *extra = NULL) This method will call gd_parser_callback(3) to change or remove the parser callback function. * int Dirfile::Standards(int version = GD_VERSION_CURRENT) This method will call gd_dirfile_standards(3) to set or report the current Standards Version of the loaded dirfile. * int Dirfile::UnInclude(int fragment_index, int del = 0) This method will call gd_uninclude(3) to remove the indicated fragment from the dirfile. Because gd_uninclude may re-arrange the order of fragments in the dirfile, the caller should destroy any GetData::Fragment objects it has retained. * int Dirfile::Add(const Entry &entry) * int Dirfile::AddAlias(const char* field_code, const char* target, int fragment_index = 0) * int Dirfile::AddSpec(const char *spec, int fragment_index = 0) * const char** Dirfile::Aliases(const char* field_code) * const char* Dirfile::AliasTarget(const char* field_code) * int Dirfile::AlterSpec(const char *line, int recode = 0) * const size_t Dirfile::ArrayLen(const char *field_code) * const gd_carray_t *Dirfile::Carrays(GetData::DataType type = Float64) * const void *Dirfile::Constants(GetData::DataType type = Float64) * int Dirfile::Delete(const char *field_code, unsigned flags = 0) * const char **Dirfile::EntryList(const char *parent = NULL, int type = 0, unsigned int flags = 0) * const char **Dirfile::FieldList() * const char **Dirfile::FieldListByType(GetData::EntryType type) * unsigned long Dirfile::Flags(unsigned long set = 0, unsigned long reset = 0) * int Dirfile::Flush(const char *field_code = NULL) * const char *Dirfile::FormatFilename(int index) * int Dirfile::GetCarray(const char *field_code, GetData::DataType type, void *data_out, unsigned int start = 0, size_t len = 0) * int Dirfile::GetConstant(const char *field_code, GetData::DataType type, void *data_out) * size_t Dirfile::GetData(const char *field_code, off_t first_frame, off_t first_sample, size_t num_frames, size_t num_samples, GetData::DataType type, void *data_out) * size_t Dirfile::GetString(const char *field_code, size_t len, char *data_out) * int Dirfile::Hidden(const char* field_code) * int Dirfile::Hide(const char* field_code) * int Dirfile::Include(const char *file, int fragment_index, unsigned int flags) * int Dirfile::IncludeAffix(const char *file, int fragment_index = 0, const char* prefix = NULL, const char* suffix = NULL, unsigned long flags = 0) * int Dirfile::MAdd(const Entry &entry, const char *parent) * int Dirfile::MAddAlias(const char* parent, const char* name, const char* target) * int Dirfile::MAddSpec(const char *spec, const char *parent) * int Dirfile::MAlterSpec(const char *line, const char *parent) * const gd_carray_t *Dirfile::MCarrays(GetData::DataType type = Float64) * const void *Dirfile::MConstants(const char *parent, GetData::DataType type) * int Dirfile::MetaFlush() * const char **Dirfile::MFieldList(const char *parent) * const char **Dirfile::MFieldListByType(const char *parent, GetData::EntryType type) * void MplexLookback(int lookback) * const char **Dirfile::MStrings(const char *parent) * const char **Dirfile::MVectorList(const char *parent) * int Dirfile::NAliases(const char* field_code) * DataType Dirfile::NativeType(const char *field_code) * unsigned int Dirfile::NEntries(const char *parent = NULL, int type = 0, unsigned int flags = 0) * unsigned int Dirfile::NFields() * unsigned int Dirfile::NFieldsByType(GetData::EntryType type) * off_t Dirfile::NFrames() * int Dirfile::NFormats() * unsigned int Dirfile::NMFields(const char *parent) * unsigned int Dirfile::NMFieldsByType(const char *parent, GetData::EntryType type) * unsigned int Dirfile::NMVectors(const char *parent) * int Dirfile::NVectors() * int Dirfile::PutCarray(const char *field_code, GetData::DataType type, const void *data_in, unsigned int start = 0, size_t len = 0) * int Dirfile::PutConstant(const char *field_code, GetData::DataType type, const void *data_in) * size_t Dirfile::PutData(const char *field_code, off_t first_frame, off_t first_sample, size_t num_frames, size_t num_samples, GetData::DataType type, const void *data_in) * size_t Dirfile::PutString(const char *field_code, const char *data_in) * int RawClose(const char *field_code = NULL) * unsigned int Dirfile::SamplesPerFrame(const char *field_code) * off_t Dirfile::Seek(const char *field_code, off_t frame_num, off_t sample_num, int whence) * const char **Dirfile::Strings() * char *StrTok(const char *string = NULL) * int Dirfile::Sync(const char* field_code = NULL) * off_t Dirfile::Tell(const char *field_code) * int Dirfile::UnHide(const char* field_code) * int Dirfile::Validate(const char *field_code) * const char **Dirfile::VectorList() * int VerbosePrefix(const char *prefix = NULL) These methods call the corresponding function from the C API on the C DIRFILE object associated with the C++ object. For allowed values for arguments of type GetData::DataType or GetData::EntryType, see the CONSTANTS section above. Note that the arguments to AddSpec are opposite to that of the corresponding function add_spec(3) in the C API. FRAGMENT CLASS ============== Define in getdata/fragment.h, the GetData::Fragment class provides information about an individual fragment in a dirfile. This class has no public constructor, but may be created by calling Dirfile::Fragment. Note: The Fragment class caches the format file index for the associated fragment. As a result, if Dirfile::UnInclude is called, these indices will be incorrect, and all pre-existing Fragment objects should be destroyed. * GetData::EncodingScheme Fragment::Encoding() * unsigned long Fragment::Endianness() * off_t Fragment::FrameOffset() * const char *Fragment::Name() * int Fragment::Parent() * int Fragment::Protection() * int Fragment::Index() These methods return the specified information on the associated fragment. For allowed values for arguments of type EncodingScheme, see the CONSTANTS section above. * int SetEncoding(EncodingScheme encoding, int recode = 0) * int SetEndianness(unsigned long byte_sex, int recode = 0) * int SetFrameOffset(off_t offset, int recode = 0) * int SetPrefix(const char *prefix) * int SetProtection(int protection_level) * int SetSuffix(const char *suffix) These methods set the specified information on the associated fragment by calling gd_alter_encoding(3), gd_alter_endianness(3), gd_alter_frameoffset(3), gd_protect(3), or gd_alter_affixes(3) as appropriate. ENTRY CLASS =========== Defined in getdata/entry.h, the GetData::Entry class encapsulates the gd_entry_t object. An entry object may be "associated" with a dirfile. An entry object returned by Dirfile::Entry will be associated with that dirfile. Entry objects created by using one of the constructors will not be associated. Changing the value of one of the data members of an associated entry object will result in a call to the C API to update the corresponding entry in the dirfile. Changing the value of one of the data members of an unassociated entry has no such side effect. The following methods are available: * Entry::Entry() This will create an empty gd_entry_t object. * int Entry::Associated() Returns non-zero if this entry object is associated with a dirfile. * void Entry::Dissociate() Dissociates this entry object. If the object is already dissociated, this function does nothing. * EntryType Entry::Type() This will return the field type of the Entry's field. This will be one of the Entry types listed above in the CONSTANTS section. * int Entry::SetFragmentIndex(int fragment_index) * int Entry::Move(int new_fragment, unsigned flags = 0) These will update the fragment index of the entry. If the entry is associated, these will call gd_move(3) to move the field to a different fragment. These two functions are equivalent, except Entry::Move allows specifying flags for the move. Entry::SetFragmentIndex always calls gd_move with flags = 0. * const char *Entry::Name() This method returns the name of the field. * int Entry::SetName(const char *new_name) * int Entry::Rename(const char *new_name, unsigned flags = 0) These will change the name of the field of this entry. If the entry object is associated, these will also call calling gd_rename(3). These two functions are equivalent, except Entry::Rename allows specifying the flags explicitly. Entry::SetName always calls gd_rename with flags = 0. * unsigned int Entry::Flags() * virtual int Entry::ComplexScalars() * virtual int Entry::FragmentIndex() * virtual int Entry::PolyOrd() * virtual unsigned int Entry::SamplesPerFrame() * virtual DataType Entry::RawType() * virtual int Entry::NFields() * virtual int Entry::FirstBit() * virtual int Entry::NumBits() * virtual int Entry::Shift() * virtual DataType Entry::ConstType() * virtual size_t Entry::ArrayLen() * virtual const char *Entry::Table() * virtual WindOpType Entry::WindOp() * virtual gd_triplet_t Entry::Threshold() * virtual int Entry::CountVal() * virtual int Entry::Period() These methods will return the corresponding member of the gd_entry_t object. Only methods reasonable to be queried for the given field type will return meaningful results. * virtual const char *Entry::Input(int index) * virtual double Entry::Scale(int index) * virtual std::complex Entry::CScale(int index) * virtual double Entry::Offset(int index) * virtual std::complex Entry::COffset(int index) * virtual double Entry::Coefficient(int index) * virtual std::complex Entry::CCoefficient(int index) * virtual const char *Entry::Scalar(int index) * virtual int Entry::ScalaIndex(int index) These methods will return an element from the gd_entry_t members in_fields[], m[], or b[], indexed by the supplied parameter. Attempts to access elements out of range for the field that the Entry class describes will return zero or NULL. ENTRY CHILD CLASSES =================== The following classes are provided to create Entry objects of the corresponding field type. They inherit from Entry, and behave in the same way: if they are associated, changing field parameters, will result in a call to the C API to update the entry in the dirfile. RawEntry Class -------------- Defined in getdata/rawentry.h * RawEntry::RawEntry() This creates a new RAW entry object with default parameters. * RawEntry::RawEntry(const char *field_code, DataType data_type, unsigned int spf, int fragment_index = 0) * const char *RawEntry::FileName() This calls gd_raw_filename(3) and returns the pathname of the binary file associated with the RAW field. * virtual unsigned int RawEntry::SamplesPerFrame() * virtual DataType RawEntry::RawType() * virtual const char *Scalar(int index = 0) * virtual int ScalarIndex(int index = 0) These methods, re-implemented from the Entry class, return the corresponding field parameter. * int RawEntry::SetSamplesPerFrame(unsigned int spf, int recode = 0) * int RawEntry::SetSamplesPerFrame(const char *spf, int recode = 0) * int RawEntry::SetType(DataType type, int recode = 0) These methods will change the specified field parameter by calling gd_alter_raw(3). If recode is non-zero, the binary file will also be translated. To use a CONST field code as the sample per frame, pass a string to SetSamplesPerFrame(). LincomEntry Class ----------------- Defined in getdata/lincomentry.h * LincomEntry::LincomEntry() This creates a new LINCOM entry object with default parameters. * LincomEntry::LincomEntry(const char *field_code, int n_fields, const char **in_fields, double *m, double *b, int fragment_index = 0) * LincomEntry::LincomEntry(const char *field_code, int n_fields, const char **in_fields, std::complex *m, std::complex *b, int fragment_index = 0) * virtual const char *LincomEntry::Input(int index) * virtual int LincomEntry::ComplexScalars() * virtual int LincomEntry::NFields() * virtual double LincomEntry::Scale(int index) * virtual std::complex LincomEntry::CScale(int index) * virtual double LincomEntry::Offset(int index) * virtual std::complex LincomEntry::COffset(int index) * virtual const char *LincomEntry::Scalar(int index) * virtual int LincomEntry::ScalarIndex(int index) These methods, re-implemented from the Entry class, return the corresponding field parameter. * int LincomEntry::SetInput(const char *field, int index) * int LincomEntry::SetScale(double scale, int index) * int LincomEntry::SetScale(const char* scale, int index) * int LincomEntry::SetScale(std::complex scale, int index) * int LincomEntry::SetOffset(double offset, int index) * int LincomEntry::SetOffset(const char* scale, int index) * int LincomEntry::SetOffset(std::complex offset, int index) These functions will change the specified field parameter associated with the input field with the given index, which should be between zero and two. To use a CONST field code as a parameter, pass a string to the appropriate function. The complex scalar flag will be updated automatically as appropriate. * int LincomEntry::SetNFields(int nfields) This will set the number of input fields for the LINCOM. If this is greater than its previous value, the Set methods above should be used to initialise the data. LinterpEntry Class ------------------ Defined in getdata/linterpentry.h * LinterpEntry::LinterpEntry() This creates a new LINTERP entry object with default parameters. * LinterpEntry::LinterpEntry(const char *field_code, const char *in_field, const char *table, int fragment_index = 0) * virtual const char *Entry::Input(int index = 0) * virtual const char *LinterpEntry::Table() These methods, re-implemented from the Entry class, return the corresponding field parameter. * int LinterpEntry::SetInput(const char *field) * int LinterpEntry::SetTable(const char *table, int move_table = 0) These methods will change the specified field parameter by calling gd_alter_raw(3). If move_table is non-zero, the existing look-up table will be renamed to account for the change in name. BitEntry and SBitEntry Classes ------------------------------ Defined in getdata/bitentry.h and getdata/sbitentry.h * BitEntry::BitEntry() * SBitEntry::SBitEntry() These creates a new BIT or SBIT entry object with default parameters. * BitEntry::BitEntry(const char *field_code, const char *in_field, int bitnum, int numbits = 1, int fragment_index = 0) * SBitEntry::SBitEntry(const char *field_code, const char *in_field, int bitnum, int numbits = 1, int fragment_index = 0) * virtual const char *Input(int index = 0) * virtual int FirstBit() * virtual int NumBits() * virtual const char *Scalar(int index) * virtual int ScalarIndex(int index) These methods, re-implemented from the Entry class, return the corresponding field parameter. * int (S)BitEntry::SetInput(const char *field) * int (S)BitEntry::SetFirstBit(int first_bit) * int (S)BitEntry::SetFirstBit(const char *first_bit) * int (S)BitEntry::SetNumBits(int num_bits) * int (S)BitEntry::SetNumBits(const char *num_bits) These methods will change the specified field parameter. To use a CONST field code as a parameter, pass a string to the appropriate function. MultiplyEntry Class ------------------- Defined in getdata/multiplyentry.h * MultiplyEntry::MultiplyEntry() This creates a new MULTIPLY entry object with default parameters. * MultiplyEntry::MultiplyEntry(const char *field_code, const char *in_field1, const char *in_field2, int fragment_index = 0) * virtual const char *MultiplyEntry::Input(int index) This method, re-implemented from the Entry class, returns one of the input fields. * int MultiplyEntry::SetInput(const char *field, int index) This function will change the specified input field with the given index, which should be zero or one. PhaseEntry Class ---------------- Defined in getdata/phaseentry.h * PhaseEntry::PhaseEntry() This creates a new PHASE entry object with default parameters. * PhaseEntry::PhaseEntry(const char *field_code, const char *in_field, int shift, int fragment_index = 0) * virtual const char *PhaseEntry::Input(int index = 0) * virtual long int PhaseEntry::Shift() * virtual const char *PhasEntry::Scalar(int index = 0) * virtual int PhaseEntry::ScalarIndex(int index = 0) These methods, re-implemented from the Entry class, return the corresponding field parameter. * int PhaseEntry::SetInput(const char *field) * int PhaseEntry::SetShift(long int shift) * int PhaseEntry::SetShift(const char *shift) These functions will change the specified input field with the given index, which should be between zero or one. PolynomEntry Class ------------------- Defined in getdata/lincomentry.h * PolynomEntry::PolynomEntry() This creates a new LINCOM entry object with default parameters. * PolynomEntry::PolynomEntry(const char *field_code, int poly_ord, const char *in_field, double *a, int fragment_index = 0) * PolynomEntry::PolynomEntry(const char *field_code, int poly_ord, const char *in_field, std::complex *a int fragment_index = 0) * virtual const char *PolynomEntry::Input(int index = 0) * virtual int PolynomEntry::ComplexScalars() * virtual int PolynomEntry::PolyOrd() * virtual double PolynomEntry::Coefficient(int index) * virtual std::complex PolynomEntry::CCoefficient(int index) * virtual const char *PolynomEntry::Scalar(int index) * virtual int PolynomEntry::ScalarIndex(int index) These methods, re-implemented from the Entry class, return the corresponding field parameter. * int PolynomEntry::SetInput(const char *field) * int PolynomEntry::SetCoefficient(double scale, int index) * int PolynomEntry::SetCoefficient(const char* scale, int index) * int PolynomEntry::SetCoefficient(std::complex scale, int index) These functions will change the specified field parameter associated with the input field with the given index, which should be between zero and two. To use a CONST field code as a parameter, pass a string to the appropriate function. The complex scalar flag will be updated automatically as appropriate. * int PolynomEntry::SetPolyOrd(int nfields) This will set the polynomial order for the POLYNOM. If this is greater than its previous value, the Set methods above should be used to initialise the data. DivideEntry Class ------------------- Defined in getdata/divideentry.h * DivideEntry::DivideEntry() This creates a new DIVIDE entry object with default parameters. * DivideEntry::DivideEntry(const char *field_code, const char *in_field1, const char *in_field2, int fragment_index = 0) * virtual const char *DivideEntry::Input(int index) This method, re-implemented from the Entry class, returns one of the input fields. * int DivideEntry::SetInput(const char *field, int index) This function will change the specified input field with the given index, which should be zero or one. RecipEntry Class ------------------- Defined in getdata/recipentry.h * RecipEntry::RecipEntry() This creates a new RECIP entry object with default parameters. * RecipEntry::RecipEntry(const char *field_code, const char *in_field1, const char *in_field2, int fragment_index = 0) * virtual const char *RecipEntry::Input(int index = 0) * virtual int RecipEntry::ComplexScalars() * virtual double RecipEntry::Dividend() * virtual std::complex RecipEntry::CDividend() * virtual const char *RecipEntry::Scalar() * virtual int RecipEntry::ScalarIndex(int index = 0) These methods, re-implemented from the Entry class, return the corresponding field parameter. * int RecipEntry::SetInput(const char *field) * int RecipEntry::SetDividend(double coeff) * int RecipEntry::SetDividend(const char* coeff) * int RecipEntry::SetDividend(std::complex coeff) These functions will change the specified input field or the field dividend to the the value or field code supplied. WindowEntry Class ------------------- Defined in getdata/windowentry.h * WindowEntry::WindowEntry() This creates a new WINDOW entry object with default parameters. * WindowEntry::WindowEntry(const char *field_code, const char *in_field, const char *check_field, int fragment_index = 0) * virtual const char *WindowEntry::Input(int index) * virtual const char *WindowEntry::Scalar(int index = 0) * virtual int WindowEntry::ScalarIndex(int index = 0) * virtual WindOpType WindowEntry::WindOp() * virtual gd_triplet_t WindowEntry::Threshold() These methods, re-implemented from the Entry class, return the corresponding field parameter. * int WindowEntry::SetInput(const char *field, int index) * int WindowEntry::SetWindOp(WindOpType coeff) * int WindowEntry::SetThreshold(gd_triplet_t threshold) * int WindowEntry::SetThreshold(const char *threhsold) These functions will change the specified input field, check field, or the window operation or threshold to the the value or field code supplied. For allowed values of variables of type WindOpType, see the CONSTANTS section above. MplexEntry Class ------------------- Defined in getdata/mplex.h * Mplex::MplexEntry() This creates a new MPLEX entry object with default parameters. * MplexEntry::MplexEntry(const char *field_code, const char *in_field, const char *check_field, int fragment_index = 0) * virtual const char *MplexEntry::Input(int index) * virtual const char *MplexEntry::Scalar(int index) * virtual int MplexEntry::ScalarIndex(int index) * virtual int MplexEntry::CountVal() * virtual int MplexEntry::Period() These methods, re-implemented from the Entry class, return the corresponding field parameter. * int MplexEntry::SetInput(const char *field, int index) * int MplexEntry::SetWindOp(WindOpType coeff) * int MplexEntry::SetCountVal(int count_val) * int MplexEntry::SetCountVal(const char *count_val) * int MplexEntry::SetPeriod(int period) * int MplexEntry::SetPeriod(const char *period) These functions will change the specified input field, check field, or the count value or max to the value or field code supplied. CarraytEntry Class ---------------- Defined in getdata/constentry.h * CarraytEntry::CarraytEntry() This creates a new CONST entry object with default parameters. * CarraytEntry::CarraytEntry(const char *field_code, DataType type, int fragment_index = 0) * virtual DataType CarraytEntry::ConstType() * virtual size_t Carray::ArrayLen() This method, re-implemented from the Entry class, returns the data type of the CONST field. * int SetArrayLen(size_t array_len) * int SetType(DataType field) These method will change the data type or length of the CARRAY field. They return non-zero on error. ConstEntry Class ---------------- Defined in getdata/constentry.h * ConstEntry::ConstEntry() This creates a new CONST entry object with default parameters. * ConstEntry::ConstEntry(const char *field_code, DataType type, int fragment_index = 0) * virtual DataType ConstEntry::ConstType() This method, re-implemented from the Entry class, returns the data type of the CONST field. * int SetType(DataType field) This method will change the data type of the CONST field. It returns non-zero on error. StringEntry Class ----------------- Defined in getdata/stringentry.h * StringEntry::StringEntry() This creates a new STRING entry object with default parameters. * StringEntry::StringEntry(const char *field_code, int fragment_index = 0) IndexEntry Class ---------------- Defined in getdata/indexentry.h The IndexEntry has no public constructor, nor any methods other than the ones provided by the Entry base class. libgetdata-0.9.0/doc/Makefile.am0000640000175000017500000000266112614323564016612 0ustar alastairalastair# Copyright (C) 2008, 2009, 2012, 2013 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign if MAKE_CXXBINDINGS READMECXX=README.cxx endif if MAKE_F77BINDINGS READMEF77=README.f77 endif if MAKE_F95BINDINGS READMEF95=README.f95 endif if MAKE_IDLBINDINGS READMEIDL=README.idl endif if MAKE_MATLABBINDINGS READMEMATLAB=README.matlab endif if MAKE_PERLBINDINGS READMEPERL=README.perl endif if MAKE_PYBINDINGS READMEPYTHON=README.python endif dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \ ${READMEMATLAB} ${READMEPERL} ${READMEPYTHON} \ unclean_database_recovery.txt clean-local: rm -rf *~ libgetdata-0.9.0/doc/unclean_database_recovery.txt0000640000175000017500000001465612614323564022515 0ustar alastairalastairUNCLEAN DATABASE RECOVERY PROCEDURE =================================== A function returning the dreaded GD_E_UNCLEAN_DB error indicates that the call has left the open dirfile database in an "unclean" state. This document outlines procedures to recover such an unclean dirfile. It is expected that this process will largely be automated in the future. This file is current as of the GetData 0.7.0 library. 0 Contents =-=-=-=-=-= 1 Preamble 2 Mitigation 3 Recovery 4 Checking 1 Preamble =-=-=-=-=-= If you are not interested in the mechanism of how an unclean database comes about, you may skip directly to the next section (Mitigation). The GD_E_UNCLEAN_DB error may be returned by the following functions when they are asked to modify binary data: - dirfile_alter_encoding() - dirfile_alter_endianness() - dirfile_alter_frameoffset() If they aren't asked to modify binary data, GD_E_UNCLEAN_DB will never be returned. In an abstract sense, all these functions modify binary data with the following procedure: 1. copies are made of all the binary data files, after modification, for the fragment 2a. If an error occurred in step one, the binary file copies are deleted. 2b. If no error occurred in step one, the binary data files are moved into place. In the case of dirfile_alter_endianness() and dirfile_alter_frameoffset(), the files are moved over top of the old files. In the case of dirfile_alter_encoding(), the files have a new name, due to the differing extension, so after moving the new files, the old files are deleted. Steps 1 and 2a never produces GD_E_UNCLEAN_DB. Step 2b will produce GD_E_UNCLEAN_DB if moving the new files fails, or if the delete of the old file fails. A move is accomplished through the rename(2) system call. A delete is accomplished through through the unlink(2) system call. See their man pages for reasons they might fail. An unclean database will suffer from one or more of the following problems: - Binary data files with incorrect names. - Both pre- and post-modification copies of the binary data. If multiple fragments are modified by a single call of these functions by passing GD_ALL_FRAGMENTS as the fragment index, the operation proceeds one fragment at a time, aborting early in the case of error. As a result, at most one fragment will ever be unclean (the ones before the unclean fragment will have been successfully modified, the ones after will be still in their unmodified state). 2 Mitigation =-=-=-=-=-=-= Once GD_E_UNCLEAN_DB is encountered by an application, the open DIRFILE object should be closed using gd_close(3) or gd_discard(3) since further use of the dirfile may corrupt the database. The GetData library encourages this behaviour by marking the database as invalid, which will cause most calls on the dirfile to fail. If the pathname of the fragment in which the error occurred is not known (possibly because GD_ALL_FRAGMENTS was used), gd_error_string(3) may be called before closing the dirfile to get the pathname of the affected fragment. 3 Recovery =-=-=-=-=-= The procedure for database recovery should be as follows: 3.1 Determination of affected fragment --------------------------------------- Before recovery can be accomplished, the unclean fragment must be determined. The easiest way to do this is to call get_error_string(3) before closing the dirfile. The error string for the GD_E_UNCLEAN_DB error contains the path to the unclean fragment. If this has not been done, the unclean fragment may be locatable by searching for temporary or duplicate files (see below) which haven't been cleaned up. 3.2 Fragment preparation ------------------------- Edit the unclean fragment with a text editor. The error will have caused GetData to not update the fragment with the new encoding/ endianness/frame offset. Update this now. Make a list of RAW fields defined in the unclean fragment. 3.3 RAW field classification ----------------------------- Now go through the RAW field list. Each RAW field should fall into one of these classes: Class A: A temporary file exists with a name of the form _XXXXXX where the "XXXXXX" represents an arbitrary set of six characters. In this case there should also be a file with the proper binary file name, i.e. the field name, possibly appended with an encoding suffix. Class B: No temporary file exists, the only file is the one with the proper binary file name (with the new encoding suffix, if appropriate). Of these two classes, RAW fields of Class B can be ignored: they are already clean. The RAW fields of Class A need to be cleaned. 3.4 RAW Field Cleaning ----------------------- Cleaning is a simple procedure: the temporary file contains the newly modified binary data, but it has the wrong name. The correctly named binary file contains the old unmodified data. If the encoding was not changed (i.e. GD_E_UNCLEAN_DB was returned by a function other than dirfile_alter_encoding(3)), the field should be cleaned by simply moving the temporary file over top of the existing binary file with the correct name. If the encoding was changed (i.e. GD_E_UNCLEAN_DB was returned by dirfile_alter_encoding(3)), the field should be cleaned by renaming the temporary file and replacing the "_XXXXXX" part with the correct encoding suffix (see dirfile-encoding(5)). The old file should then be deleted. The important point here is: the temporary file contains the correct data. It must be kept. This procedure should be repeated for each RAW file in Class A. 4 Checking =-=-=-=-=-= Once the dirfile has been cleaned, it should be checked by opening it read-only and attempting to read each of the RAW fields in the (formerly) unclean fragment. If the procedure has been performed correctly, the expected data should be returned. If the data returned appear corrupted, it is possible that the old data file was not deleted; recheck the dirfile. If an I/O error occurs, it is possible that the replacement file has an incorrect name or permissions; again, recheck the dirfile. ----------------------------------- Copyright (C) 2008 D. V. Wiebe This document is part of the GetData project. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the `COPYING.DOC' file as part of this distribution. libgetdata-0.9.0/doc/README.python0000640000175000017500000000135012614323564016750 0ustar alastairalastairPYTHON BINDINGS FOR GETDATA =========================== The python bindings consist of a python extension module, `pygetdata.so'. They should work with Python version 2.3, or any later 2.x version. Numerical Python (NumPy) is required to build and use the bindings. By default, data returned from the bindings will be returned in NumPy arrays, but the bindings can be persuaded to return data as Python lists, if desired. Full documentation for the Python bindings to the GetData library is contained within the pygetdata module itself. To read this documentation, execute $ pydoc pygetdata from the system shell, or >>> import pygetdata >>> help(pygetdata) from within the Python interpreter, after the bindings have been installed. libgetdata-0.9.0/test/0000740000175000017500000000000012614323564014761 5ustar alastairalastairlibgetdata-0.9.0/test/get_window_gt.c0000640000175000017500000000401412614323564017766 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data GT 44\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i > 4) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/parse_include_nonexistent.c0000640000175000017500000000303412614323564022402 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "INCLUDE non_existent_file\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_IO); return r; } libgetdata-0.9.0/test/parse_alias_dup.c0000640000175000017500000000270612614323564020267 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n" "cata RAW UINT8 1\n" "/ALIAS cata data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/alter_const_c2r.c0000640000175000017500000000340512614323564020214 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST COMPLEX128 8.3;9.4\n"; int fd, ret, error, n, r = 0; DIRFILE *D; double d; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_const(D, "const", GD_FLOAT64); error = gd_error(D); n = gd_get_constant(D, "const", GD_FLOAT64, &d); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKF(d, 8.3); return r; } libgetdata-0.9.0/test/del_derived.c0000640000175000017500000000321212614323564017373 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nlincom LINCOM 1 data 1 0\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DELETE); CHECKI(ret, -1); return r; } libgetdata-0.9.0/test/creat_rdonly.c0000640000175000017500000000276512614323564017626 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, unlink_ret, rmdir_ret, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY | GD_CREAT | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1, 0); e2 = gd_add_spec(D, "test CONST UINT8 1", 0); CHECKI(e2, 0); gd_discard(D); unlink_ret = unlink(format); rmdir_ret = rmdir(filedir); CHECKI(unlink_ret, 0); CHECKI(rmdir_ret, 0); return r; } libgetdata-0.9.0/test/open_sym_al.c0000640000175000017500000000332012614323564017432 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD return 77; #else const char *filedir = "dirfile/link"; const char *format = "dirfile/format"; char *targ; int error, r = 0; int cwd_size = 2048; char *ptr, *cwd = NULL; DIRFILE *D; gdtest_getcwd(ptr, cwd, cwd_size); rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ targ = (char*)malloc(cwd_size + 8); sprintf(targ, "%s/dirfile/", cwd); symlink(targ, filedir); free(targ); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); free(cwd); return r; #endif } libgetdata-0.9.0/test/gzip_move_from.c0000640000175000017500000000625512614323564020161 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *gzdata = "dirfile/data.gz"; const char *format_data = "/INCLUDE format1\ndata RAW UINT16 11\nENCODING gzip\n"; const char *format1_data = "ENCODING none\n"; uint16_t data_data[128]; char command[4096]; int fd, ret, ge_ret, unlink_data, unlink_gzdata, e1, e2, r = 0; DIRFILE *D; gd_entry_t E; #ifdef USE_GZIP uint16_t d; int i = 0; #endif rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = fd * 0x201; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_VERBOSE | GD_UNENCODED); #else D = gd_open(filedir, GD_RDWR | GD_UNENCODED); #endif ret = gd_move(D, "data", 1, 1); e1 = gd_error(D); ge_ret = gd_entry(D, "data", &E); CHECKI(ge_ret, 0); e2 = gd_close(D); CHECKI(e2, 0); #ifdef USE_GZIP fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKUi(i, d, i * 0x201); i++; } close(fd); } else { perror("open"); r = 1; } #endif unlink(format1); unlink(format); unlink_data = unlink(data); unlink_gzdata = unlink(gzdata); rmdir(filedir); #ifdef USE_GZIP CHECKI(ret, 0); CHECKI(e1, 0); CHECKI(E.fragment_index, 1); CHECKI(unlink_data, 0); CHECKI(unlink_gzdata, -1); #else CHECKI(ret, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(E.fragment_index, 0); CHECKI(unlink_data, -1); CHECKI(unlink_gzdata, 0); #endif gd_free_entry_strings(&E); return r; #endif } libgetdata-0.9.0/test/parse_duplicate.c0000640000175000017500000000305112614323564020272 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\ndata RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/nmeta_type_hidden.c0000640000175000017500000000366012614323564020614 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1/string\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(nfields, 1); return r; } libgetdata-0.9.0/test/put_null.c0000640000175000017500000000322012614323564016766 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write NULL */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_TYPE); return r; } libgetdata-0.9.0/test/put64.c0000640000175000017500000000414312614323564016113 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define _LARGEFILE64_SOURCE 1 #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, n, e1, e2, i, r = 0; struct stat buf; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata64(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint8_uint16.c0000640000175000017500000000401212614323564021141 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/seek_far.c0000640000175000017500000000366612614323564016721 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(m, 4000); e1 = gd_error(D); CHECKI(e1, 0); n = gd_tell(D, "data"); CHECKI(n, 4000); e2 = gd_error(D); CHECKI(e2, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_int64.c0000640000175000017500000000416712614323564016773 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 40 + i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT64, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int64_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int64_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint32_uint64.c0000640000175000017500000000400312614323564021221 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; uint64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/madd_crecip.c0000640000175000017500000000363712614323564017372 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; #ifdef GD_NO_C99_API const double v[] = {3.2, 3.1}; #else const double complex v = 3.2 + _Complex_I * 3.1; #endif DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_crecip(D, "new", "meta", "in1", v); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_RECIP_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKC(e.EN(recip,cdividend), v); CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/gzip_seek_put.c0000640000175000017500000000413512614323564020002 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" uint32_t d[GD_BUFFER_SIZE]; int main(void) { #ifndef USE_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.gz"; int i, e1, e2, e3, r = 0; size_t n1, n2; off_t nf, n3; DIRFILE *D; for (i = 0; i < GD_BUFFER_SIZE; ++i) d[i] = i; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_CREAT | GD_EXCL | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT32, 1, 0); n1 = gd_putdata(D, "data", 0, 0, 0, GD_BUFFER_SIZE, GD_UINT32, d); CHECKU(n1, GD_BUFFER_SIZE); e1 = gd_error(D); CHECKI(e1, GD_E_OK); gd_close(D); for (i = 0; i < GD_BUFFER_SIZE; ++i) d[i] = i + 0x100000; D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n3 = gd_seek(D, "data", 0, GD_BUFFER_SIZE, GD_SEEK_SET | GD_SEEK_WRITE); CHECKI(n3, GD_BUFFER_SIZE); e3 = gd_error(D); CHECKI(e3, GD_E_OK); n2 = gd_putdata(D, "data", 0, GD_BUFFER_SIZE, 0, GD_BUFFER_SIZE, GD_UINT32, d); CHECKU(n2, GD_BUFFER_SIZE); e2 = gd_error(D); CHECKI(e2, GD_E_OK); nf = gd_nframes(D); CHECKU(nf, GD_BUFFER_SIZE * 2); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/header_complex.c0000640000175000017500000000532712614323564020115 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Check if GD_C89_API produces a useable API */ #define GD_C89_API #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM data 3.3;4.4 5.5;6.6 data 7.7;8.8 9.9;1.1\n"; int fd, error, error2, error3, r = 0; const double ca[] = { 2.1, 3.2, 4.3, 5.4, 6.5, 7.6 }; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "lincom", &E); error = gd_error(D); CHECKI(error, 0); CHECKXi(0, E.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKFi(0,E.EN(lincom,cm)[0][0], 3.3); CHECKFi(0,E.EN(lincom,cm)[0][1], 4.4); CHECKFi(0,E.EN(lincom,cb)[0][0], 5.5); CHECKFi(0,E.EN(lincom,cb)[0][1], 6.6); CHECKFi(0,E.EN(lincom,cm)[1][0], 7.7); CHECKFi(0,E.EN(lincom,cm)[1][1], 8.8); CHECKFi(0,E.EN(lincom,cb)[1][0], 9.9); CHECKFi(0,E.EN(lincom,cb)[1][1], 1.1); gd_free_entry_strings(&E); gd_add_cpolynom(D, "polynom", 2, "in", ca, 0); error2 = gd_error(D); CHECKI(error2, 0); gd_entry(D, "polynom", &E); error3 = gd_error(D); CHECKI(error3, 0); CHECKIi(1,E.EN(polynom,poly_ord),2); CHECKXi(1, E.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKFi(1,E.EN(polynom,ca)[0][0], ca[0]); CHECKFi(1,E.EN(polynom,ca)[0][1], ca[1]); CHECKFi(1,E.EN(polynom,ca)[1][0], ca[2]); CHECKFi(1,E.EN(polynom,ca)[1][1], ca[3]); CHECKFi(1,E.EN(polynom,ca)[2][0], ca[4]); CHECKFi(1,E.EN(polynom,ca)[2][1], ca[5]); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_spec_meta.c0000640000175000017500000000414112614323564020256 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nMETA data phase PHASE data 1\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "data/phase PHASE data 2", 0); error = gd_error(D); n = gd_getdata(D, "data/phase", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i + 42); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/convert_float64_int32.c0000640000175000017500000000376412614323564021177 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/madd_carray.c0000640000175000017500000000370312614323564017400 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val[] = {3, 4, 5, 6, 7}; uint8_t data[5]; int error, n, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_carray(D, "new", "data", GD_UINT8, 5, GD_UINT8, &val); error = gd_error(D); /* check */ gd_entry(D, "new/data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_CARRAY_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } n = (int)gd_array_len(D, "new/data"); CHECKI(n, 5); gd_get_carray(D, "new/data", GD_UINT8, &data); for (n = 0; n < 5; ++n) CHECKIi(n, data[n], 3 + n); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/sie_put_trunc_nf.c0000640000175000017500000000331512614323564020477 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "/ENCODING sie\n/ENDIAN little\n"; unsigned char c[] = {1, 1, 2, 1}; DIRFILE *D; int fd, n1, n2, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT8, 1, 0); gd_putdata(D, "data", 0, 0, 0, 4, GD_UINT8, c); gd_raw_close(D, "data"); n1 = gd_nframes(D); CHECKI(n1, 4); gd_putdata(D, "data", 0, 2, 0, 2, GD_UINT8, c); n2 = gd_nframes(D); CHECKI(n2, 4); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_none.c0000640000175000017500000000352312614323564016730 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 0, GD_UINT8, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/alter_lincom_32.c0000640000175000017500000000437412614323564020113 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 3 data 1 3 phase 2 0 data 3 1\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; const char *in_fields[2] = {"data", "phase"}; const double m[2] = {2, 4}; const double b[2] = {0, 2}; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_lincom(D, "lincom", 2, in_fields, m, b); error = gd_error(D); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (40 + i) * 6 + 6); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/convert_float32_complex64.c0000640000175000017500000000431212614323564022042 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/get_recip_const.c0000640000175000017500000000374612614323564020310 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read DIVIDE */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div RECIP data const\n" "const CONST FLOAT64 2.\n" "data RAW UINT8 1\n"; double c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)(fd + 2); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKF(c, 2. / 7.); return r; } libgetdata-0.9.0/test/get_mplex_nolb.c0000640000175000017500000000424412614323564020131 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 2 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_mplex_lookback(D, 0); e1 = gd_error(D); n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c); e2 = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i == 0) ? 0 : 38 + 3 * ((i + 2) / 3)); return r; } libgetdata-0.9.0/test/parse_include.c0000640000175000017500000000342412614323564017747 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 11); return r; } libgetdata-0.9.0/test/add_bit_scalars.c0000640000175000017500000000375112614323564020233 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int e1, e2, e3, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "bit1"; E.field_type = GD_BIT_ENTRY; E.in_fields[0] = "INDEX"; E.EN(bit,bitnum) = -1; E.EN(bit,numbits) = 1; E.scalar[0] = "const"; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); e1 = gd_error(D); E.field = "bit2"; E.EN(bit,bitnum) = 1; E.EN(bit,numbits) = 0; E.scalar[0] = NULL; E.scalar[1] = "const"; gd_add(D, &E); e2 = gd_error(D); E.field = "bit3"; E.EN(bit,bitnum) = 61; E.EN(bit,numbits) = 5; E.scalar[0] = "const"; E.scalar[1] = "const"; gd_add(D, &E); e3 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(e3, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_int8_int16.c0000640000175000017500000000374312614323564020601 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; int16_t c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/spf_alias_missing.c0000640000175000017500000000270712614323564020627 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS alias data\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); spf = gd_spf(D, "alias"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_BAD_CODE); CHECKI(spf,0); return r; } libgetdata-0.9.0/test/alias_list_alias.c0000640000175000017500000000345012614323564020426 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS e f\n" "/ALIAS a b\n" "/ALIAS b d\n" "/ALIAS c d\n" "/ALIAS d f\n" "f CONST UINT8 1\n"; int fd, e, i = 0, r = 0; int x[256]; DIRFILE *D; const char **al; rmdirfile(); mkdir(filedir, 0777); memset(x, 0, 256 * sizeof(int)); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); al = gd_aliases(D, "a"); e = gd_error(D); CHECKI(e, GD_E_OK); CHECKPN(al); if (!r) for (i = 0; al[i]; ++i) { CHECKUi(i, al[i][1], 0); x[(int)(al[i][0])]++; } CHECKI(i, 6); for (i = 0; i < 256; ++i) CHECKIi(i, x[i], (i >= 'a' && i <= 'f') ? 1 : 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/Makefile.in0000640000175000017500000251533512614323564017046 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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@ TESTS = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \ $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \ $(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \ $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) \ $(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_18) \ $(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \ $(am__EXEEXT_22) $(am__EXEEXT_23) $(am__EXEEXT_24) \ $(am__EXEEXT_25) $(am__EXEEXT_26) $(am__EXEEXT_27) \ $(am__EXEEXT_28) $(am__EXEEXT_29) $(am__EXEEXT_30) \ $(am__EXEEXT_31) $(am__EXEEXT_32) $(am__EXEEXT_33) \ $(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \ $(am__EXEEXT_37) $(am__EXEEXT_38) $(am__EXEEXT_39) \ $(am__EXEEXT_40) $(am__EXEEXT_41) $(am__EXEEXT_42) \ $(am__EXEEXT_43) $(am__EXEEXT_44) $(am__EXEEXT_45) \ $(am__EXEEXT_46) $(am__EXEEXT_47) $(am__EXEEXT_48) \ $(am__EXEEXT_49) $(am__EXEEXT_50) $(am__EXEEXT_51) \ $(am__EXEEXT_52) $(am__EXEEXT_53) $(am__EXEEXT_54) \ $(am__EXEEXT_55) $(am__EXEEXT_56) $(am__EXEEXT_57) \ $(am__EXEEXT_58) $(am__EXEEXT_59) $(am__EXEEXT_60) \ $(am__EXEEXT_61) $(am__EXEEXT_62) check_PROGRAMS = $(am__EXEEXT_63) subdir = test DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = add_add$(EXEEXT) add_affix$(EXEEXT) add_alias$(EXEEXT) \ add_alias_affix$(EXEEXT) add_alias_meta$(EXEEXT) \ add_amb_code7$(EXEEXT) add_bit$(EXEEXT) \ add_bit_bitnum$(EXEEXT) add_bit_bitsize$(EXEEXT) \ add_bit_invalid$(EXEEXT) add_bit_numbits$(EXEEXT) \ add_bit_scalars$(EXEEXT) add_carray$(EXEEXT) \ add_clincom$(EXEEXT) add_code$(EXEEXT) add_const$(EXEEXT) \ add_cpolynom$(EXEEXT) add_crecip$(EXEEXT) \ add_crecip89$(EXEEXT) add_dangle_dup$(EXEEXT) \ add_divide$(EXEEXT) add_divide_invalid$(EXEEXT) \ add_dot5$(EXEEXT) add_dot6$(EXEEXT) add_duplicate$(EXEEXT) \ add_format$(EXEEXT) add_invalid$(EXEEXT) add_lincom$(EXEEXT) \ add_lincom_affix$(EXEEXT) add_lincom_invalid$(EXEEXT) \ add_lincom_nfields$(EXEEXT) add_linterp$(EXEEXT) \ add_linterp_invalid$(EXEEXT) add_meta$(EXEEXT) \ add_meta_alias$(EXEEXT) add_mplex$(EXEEXT) \ add_mplex_scalars$(EXEEXT) add_multiply$(EXEEXT) \ add_multiply_invalid$(EXEEXT) add_phase$(EXEEXT) \ add_phase_invalid$(EXEEXT) add_polynom$(EXEEXT) \ add_polynom_scalar$(EXEEXT) add_protect$(EXEEXT) \ add_raw$(EXEEXT) add_raw_include$(EXEEXT) \ add_raw_invalid$(EXEEXT) add_raw_spf$(EXEEXT) \ add_raw_spf_scalar$(EXEEXT) add_raw_sub$(EXEEXT) \ add_raw_type$(EXEEXT) add_rdonly$(EXEEXT) add_recip$(EXEEXT) \ add_resolv$(EXEEXT) add_sbit$(EXEEXT) add_scalar$(EXEEXT) \ add_scalar_carray$(EXEEXT) add_scalar_carray_bad$(EXEEXT) \ add_sort$(EXEEXT) add_spec$(EXEEXT) \ add_spec_directive$(EXEEXT) add_spec_invalid$(EXEEXT) \ add_spec_meta$(EXEEXT) add_spec_resolv$(EXEEXT) \ add_string$(EXEEXT) add_string_affix$(EXEEXT) \ add_type$(EXEEXT) add_window$(EXEEXT) add_window_op$(EXEEXT) am__EXEEXT_2 = alias_list$(EXEEXT) alias_list_alias$(EXEEXT) \ alias_list_missing$(EXEEXT) alias_num$(EXEEXT) \ alias_num_alias$(EXEEXT) alias_num_missing$(EXEEXT) \ alias_target$(EXEEXT) alias_target_alias$(EXEEXT) \ alias_target_missing$(EXEEXT) am__EXEEXT_3 = alter_bit_bitnum$(EXEEXT) alter_bit_numbits$(EXEEXT) \ alter_carray_len$(EXEEXT) alter_carray_type$(EXEEXT) \ alter_clincom$(EXEEXT) alter_const$(EXEEXT) \ alter_const_c2r$(EXEEXT) alter_const_r2c$(EXEEXT) \ alter_const_r2r$(EXEEXT) alter_cpolynom$(EXEEXT) \ alter_cpolynom_null$(EXEEXT) alter_crecip$(EXEEXT) \ alter_crecip89$(EXEEXT) alter_crecip89_null$(EXEEXT) \ alter_crecip_zero$(EXEEXT) alter_divide$(EXEEXT) \ alter_entry$(EXEEXT) alter_entry_affix$(EXEEXT) \ alter_entry_hidden$(EXEEXT) alter_entry_lincom$(EXEEXT) \ alter_entry_recode$(EXEEXT) alter_entry_recode_recalc$(EXEEXT) \ alter_entry_scalar1$(EXEEXT) alter_entry_scalar2a$(EXEEXT) \ alter_entry_scalar2n$(EXEEXT) alter_entry_scalar3$(EXEEXT) \ alter_entry_scalar3c$(EXEEXT) alter_entry_scalar4$(EXEEXT) \ alter_entry_scalar_amb$(EXEEXT) alter_index$(EXEEXT) \ alter_lincom_23$(EXEEXT) alter_lincom_32$(EXEEXT) \ alter_lincom_affix$(EXEEXT) alter_lincom_input$(EXEEXT) \ alter_lincom_offset$(EXEEXT) alter_lincom_slope$(EXEEXT) \ alter_linterp$(EXEEXT) alter_linterp_move$(EXEEXT) \ alter_mplex$(EXEEXT) alter_mspec$(EXEEXT) \ alter_mspec_affix$(EXEEXT) alter_multiply$(EXEEXT) \ alter_phase$(EXEEXT) alter_polynom_coeff$(EXEEXT) \ alter_polynom_input$(EXEEXT) alter_polynom_ord$(EXEEXT) \ alter_raw_spf$(EXEEXT) alter_raw_type$(EXEEXT) \ alter_recip$(EXEEXT) alter_recip_zero$(EXEEXT) \ alter_scalar_affix$(EXEEXT) alter_spec$(EXEEXT) \ alter_spec_affix$(EXEEXT) alter_spec_meta$(EXEEXT) \ alter_spec_polynom$(EXEEXT) alter_window$(EXEEXT) am__EXEEXT_4 = ascii_add$(EXEEXT) ascii_get$(EXEEXT) \ ascii_get_complex$(EXEEXT) ascii_get_get$(EXEEXT) \ ascii_get_here$(EXEEXT) ascii_get_sub$(EXEEXT) \ ascii_nframes$(EXEEXT) ascii_put$(EXEEXT) \ ascii_put_here$(EXEEXT) ascii_seek$(EXEEXT) \ ascii_seek_far$(EXEEXT) ascii_sync$(EXEEXT) am__EXEEXT_5 = bof$(EXEEXT) bof_bit$(EXEEXT) bof_index$(EXEEXT) \ bof_lincom$(EXEEXT) bof_phase$(EXEEXT) bof_phase_neg$(EXEEXT) am__EXEEXT_6 = bzip_add$(EXEEXT) bzip_get$(EXEEXT) \ bzip_get_far$(EXEEXT) bzip_get_get$(EXEEXT) \ bzip_get_get2$(EXEEXT) bzip_get_put$(EXEEXT) \ bzip_move_from$(EXEEXT) bzip_move_to$(EXEEXT) \ bzip_nframes$(EXEEXT) bzip_put$(EXEEXT) bzip_put_back$(EXEEXT) \ bzip_put_endian$(EXEEXT) bzip_put_get$(EXEEXT) \ bzip_put_pad$(EXEEXT) bzip_put_sub$(EXEEXT) bzip_seek$(EXEEXT) \ bzip_seek_far$(EXEEXT) bzip_sync$(EXEEXT) am__EXEEXT_7 = close_bad$(EXEEXT) close_close$(EXEEXT) \ close_discard$(EXEEXT) close_null$(EXEEXT) am__EXEEXT_8 = convert_complex128_complex64$(EXEEXT) \ convert_complex128_float64$(EXEEXT) \ convert_complex128_int64$(EXEEXT) \ convert_complex128_uint64$(EXEEXT) \ convert_complex64_complex128$(EXEEXT) \ convert_complex64_float64$(EXEEXT) \ convert_complex64_int64$(EXEEXT) \ convert_complex64_uint64$(EXEEXT) \ convert_float32_complex128$(EXEEXT) \ convert_float32_complex64$(EXEEXT) \ convert_float32_float64$(EXEEXT) \ convert_float32_int16$(EXEEXT) convert_float32_int32$(EXEEXT) \ convert_float32_int64$(EXEEXT) convert_float32_int8$(EXEEXT) \ convert_float32_uint16$(EXEEXT) \ convert_float32_uint32$(EXEEXT) \ convert_float32_uint64$(EXEEXT) convert_float32_uint8$(EXEEXT) \ convert_float64_complex128$(EXEEXT) \ convert_float64_complex64$(EXEEXT) \ convert_float64_float32$(EXEEXT) \ convert_float64_int16$(EXEEXT) convert_float64_int32$(EXEEXT) \ convert_float64_int64$(EXEEXT) convert_float64_int8$(EXEEXT) \ convert_float64_uint16$(EXEEXT) \ convert_float64_uint32$(EXEEXT) \ convert_float64_uint64$(EXEEXT) convert_float64_uint8$(EXEEXT) \ convert_int16_complex128$(EXEEXT) \ convert_int16_complex64$(EXEEXT) \ convert_int16_float32$(EXEEXT) convert_int16_float64$(EXEEXT) \ convert_int16_int32$(EXEEXT) convert_int16_int64$(EXEEXT) \ convert_int16_int8$(EXEEXT) convert_int16_uint16$(EXEEXT) \ convert_int16_uint32$(EXEEXT) convert_int16_uint64$(EXEEXT) \ convert_int16_uint8$(EXEEXT) convert_int32_complex128$(EXEEXT) \ convert_int32_complex64$(EXEEXT) \ convert_int32_float32$(EXEEXT) convert_int32_float64$(EXEEXT) \ convert_int32_int16$(EXEEXT) convert_int32_int64$(EXEEXT) \ convert_int32_int8$(EXEEXT) convert_int32_uint16$(EXEEXT) \ convert_int32_uint32$(EXEEXT) convert_int32_uint64$(EXEEXT) \ convert_int32_uint8$(EXEEXT) convert_int64_complex128$(EXEEXT) \ convert_int64_complex64$(EXEEXT) \ convert_int64_float32$(EXEEXT) convert_int64_float64$(EXEEXT) \ convert_int64_int16$(EXEEXT) convert_int64_int32$(EXEEXT) \ convert_int64_int8$(EXEEXT) convert_int64_uint16$(EXEEXT) \ convert_int64_uint32$(EXEEXT) convert_int64_uint64$(EXEEXT) \ convert_int64_uint8$(EXEEXT) convert_int8_complex128$(EXEEXT) \ convert_int8_complex64$(EXEEXT) convert_int8_float32$(EXEEXT) \ convert_int8_float64$(EXEEXT) convert_int8_int16$(EXEEXT) \ convert_int8_int32$(EXEEXT) convert_int8_int64$(EXEEXT) \ convert_int8_uint16$(EXEEXT) convert_int8_uint32$(EXEEXT) \ convert_int8_uint64$(EXEEXT) convert_int8_uint8$(EXEEXT) \ convert_uint16_complex128$(EXEEXT) \ convert_uint16_complex64$(EXEEXT) \ convert_uint16_float32$(EXEEXT) \ convert_uint16_float64$(EXEEXT) convert_uint16_int16$(EXEEXT) \ convert_uint16_int32$(EXEEXT) convert_uint16_int64$(EXEEXT) \ convert_uint16_int8$(EXEEXT) convert_uint16_uint32$(EXEEXT) \ convert_uint16_uint64$(EXEEXT) convert_uint16_uint8$(EXEEXT) \ convert_uint32_complex128$(EXEEXT) \ convert_uint32_complex64$(EXEEXT) \ convert_uint32_float32$(EXEEXT) \ convert_uint32_float64$(EXEEXT) convert_uint32_int16$(EXEEXT) \ convert_uint32_int32$(EXEEXT) convert_uint32_int64$(EXEEXT) \ convert_uint32_int8$(EXEEXT) convert_uint32_uint16$(EXEEXT) \ convert_uint32_uint64$(EXEEXT) convert_uint32_uint8$(EXEEXT) \ convert_uint64_complex128$(EXEEXT) \ convert_uint64_complex64$(EXEEXT) \ convert_uint64_float32$(EXEEXT) \ convert_uint64_float64$(EXEEXT) convert_uint64_int16$(EXEEXT) \ convert_uint64_int32$(EXEEXT) convert_uint64_int64$(EXEEXT) \ convert_uint64_int8$(EXEEXT) convert_uint64_uint16$(EXEEXT) \ convert_uint64_uint32$(EXEEXT) convert_uint64_uint8$(EXEEXT) \ convert_uint8_complex128$(EXEEXT) \ convert_uint8_complex64$(EXEEXT) \ convert_uint8_float32$(EXEEXT) convert_uint8_float64$(EXEEXT) \ convert_uint8_int16$(EXEEXT) convert_uint8_int32$(EXEEXT) \ convert_uint8_int64$(EXEEXT) convert_uint8_int8$(EXEEXT) \ convert_uint8_uint16$(EXEEXT) convert_uint8_uint32$(EXEEXT) \ convert_uint8_uint64$(EXEEXT) am__EXEEXT_9 = creat$(EXEEXT) creat_excl$(EXEEXT) \ creat_rdonly$(EXEEXT) creat_rdonly_exists$(EXEEXT) am__EXEEXT_10 = cvlist$(EXEEXT) cvlist_array$(EXEEXT) \ cvlist_array0$(EXEEXT) cvlist_array_free$(EXEEXT) \ cvlist_array_hidden$(EXEEXT) cvlist_array_meta$(EXEEXT) \ cvlist_array_meta0$(EXEEXT) cvlist_array_meta_free$(EXEEXT) \ cvlist_array_meta_hidden$(EXEEXT) cvlist_hidden$(EXEEXT) \ cvlist_invalid$(EXEEXT) cvlist_meta$(EXEEXT) \ cvlist_meta0$(EXEEXT) cvlist_meta_hidden$(EXEEXT) \ cvlist_meta_invalid$(EXEEXT) am__EXEEXT_11 = del_alias$(EXEEXT) del_carray$(EXEEXT) \ del_carray_deref$(EXEEXT) del_const$(EXEEXT) \ del_const_deref$(EXEEXT) del_const_force$(EXEEXT) \ del_data$(EXEEXT) del_data_enoent$(EXEEXT) \ del_data_open$(EXEEXT) del_derived$(EXEEXT) \ del_derived_after$(EXEEXT) del_derived_force$(EXEEXT) \ del_del$(EXEEXT) del_meta$(EXEEXT) del_meta_force$(EXEEXT) \ del_ref$(EXEEXT) am__EXEEXT_12 = dfes_bit$(EXEEXT) dfes_divide$(EXEEXT) \ dfes_lincom$(EXEEXT) dfes_linterp$(EXEEXT) \ dfes_multiply$(EXEEXT) dfes_null$(EXEEXT) dfes_phase$(EXEEXT) \ dfes_raw$(EXEEXT) dfes_recip$(EXEEXT) dfes_zero$(EXEEXT) am__EXEEXT_13 = desync$(EXEEXT) desync_flush$(EXEEXT) \ desync_path$(EXEEXT) desync_reopen$(EXEEXT) \ desync_reopen_inv$(EXEEXT) am__EXEEXT_14 = elist_alias$(EXEEXT) elist_hidden$(EXEEXT) \ elist_noalias$(EXEEXT) elist_scalar$(EXEEXT) am__EXEEXT_15 = encode_alter$(EXEEXT) encode_alter_all$(EXEEXT) \ encode_alter_open$(EXEEXT) encode_get$(EXEEXT) \ encode_recode$(EXEEXT) encode_recode_open$(EXEEXT) \ encode_support$(EXEEXT) am__EXEEXT_16 = endian_alter$(EXEEXT) endian_alter_all$(EXEEXT) \ endian_alter_sie$(EXEEXT) endian_get$(EXEEXT) \ endian_move$(EXEEXT) am__EXEEXT_17 = entry_bad_code$(EXEEXT) entry_bit$(EXEEXT) \ entry_bit_scalar$(EXEEXT) entry_divide$(EXEEXT) \ entry_invalid$(EXEEXT) entry_lincom$(EXEEXT) \ entry_lincom_scalar$(EXEEXT) entry_linterp$(EXEEXT) \ entry_mplex$(EXEEXT) entry_mplex_scalar$(EXEEXT) \ entry_multiply$(EXEEXT) entry_phase$(EXEEXT) \ entry_phase_scalar$(EXEEXT) entry_polynom$(EXEEXT) \ entry_polynom_scalar$(EXEEXT) entry_raw$(EXEEXT) \ entry_raw_scalar$(EXEEXT) entry_raw_scalar_code$(EXEEXT) \ entry_raw_scalar_type$(EXEEXT) entry_scalar_repr$(EXEEXT) \ entry_recip$(EXEEXT) entry_type$(EXEEXT) \ entry_type_alias$(EXEEXT) entry_window$(EXEEXT) \ entry_window_scalar$(EXEEXT) am__EXEEXT_18 = eof$(EXEEXT) eof_bit$(EXEEXT) eof_index$(EXEEXT) \ eof_lincom$(EXEEXT) eof_phase$(EXEEXT) eof_phase_neg$(EXEEXT) am__EXEEXT_19 = error$(EXEEXT) error_error$(EXEEXT) error_num$(EXEEXT) \ error_short$(EXEEXT) error_verbose$(EXEEXT) \ error_verbose_prefix$(EXEEXT) am__EXEEXT_20 = file$(EXEEXT) file_code$(EXEEXT) file_type$(EXEEXT) am__EXEEXT_21 = flac_add$(EXEEXT) flac_get_big$(EXEEXT) \ flac_get_far$(EXEEXT) flac_get_get$(EXEEXT) \ flac_get_get2$(EXEEXT) flac_get_little$(EXEEXT) \ flac_nframes$(EXEEXT) flac_put_big$(EXEEXT) \ flac_put_complex128$(EXEEXT) flac_put_float64$(EXEEXT) \ flac_put_int32$(EXEEXT) flac_put_little$(EXEEXT) \ flac_seek$(EXEEXT) flac_seek_far$(EXEEXT) flac_sync$(EXEEXT) am__EXEEXT_22 = flist$(EXEEXT) flist0$(EXEEXT) flist2$(EXEEXT) \ flist_hidden$(EXEEXT) flist_invalid$(EXEEXT) \ flist_meta$(EXEEXT) flist_meta2$(EXEEXT) \ flist_meta_hidden$(EXEEXT) flist_meta_invalid$(EXEEXT) \ flist_type$(EXEEXT) flist_type_hidden$(EXEEXT) \ flist_type_invalid$(EXEEXT) flist_type_meta$(EXEEXT) \ flist_type_meta_hidden$(EXEEXT) \ flist_type_meta_invalid$(EXEEXT) am__EXEEXT_23 = flush_all$(EXEEXT) flush_amb_code$(EXEEXT) \ flush_bad_code$(EXEEXT) flush_flush$(EXEEXT) \ flush_hex$(EXEEXT) flush_invalid$(EXEEXT) \ flush_lincom$(EXEEXT) flush_lincom1$(EXEEXT) \ flush_meta$(EXEEXT) flush_mult$(EXEEXT) \ flush_raw_close$(EXEEXT) flush_ref$(EXEEXT) \ flush_spec$(EXEEXT) flush_string$(EXEEXT) flush_sync$(EXEEXT) am__EXEEXT_24 = foffs_alter$(EXEEXT) foffs_alter_all$(EXEEXT) \ foffs_get$(EXEEXT) foffs_move$(EXEEXT) am__EXEEXT_25 = fragment_affix$(EXEEXT) fragment_affix_alter$(EXEEXT) \ fragment_affix_alter2$(EXEEXT) \ fragment_affix_alter_code$(EXEEXT) \ fragment_affix_alter_nop$(EXEEXT) fragment_affix_dup$(EXEEXT) \ fragment_index$(EXEEXT) fragment_index_alias$(EXEEXT) \ fragment_name$(EXEEXT) fragment_name_oor$(EXEEXT) \ fragment_num$(EXEEXT) fragment_parent$(EXEEXT) am__EXEEXT_26 = get64$(EXEEXT) get_affix$(EXEEXT) \ get_bad_code$(EXEEXT) get_bit$(EXEEXT) get_carray$(EXEEXT) \ get_carray_len$(EXEEXT) get_carray_c2r$(EXEEXT) \ get_carray_slice$(EXEEXT) get_char$(EXEEXT) \ get_clincom$(EXEEXT) get_complex128$(EXEEXT) \ get_complex64$(EXEEXT) get_const$(EXEEXT) \ get_const_carray$(EXEEXT) get_const_complex$(EXEEXT) \ get_const_repr$(EXEEXT) get_cpolynom$(EXEEXT) \ get_cpolynom1$(EXEEXT) get_cpolynom_int$(EXEEXT) \ get_dim$(EXEEXT) get_divide$(EXEEXT) get_divide_ccin$(EXEEXT) \ get_divide_crin$(EXEEXT) get_divide_crinr$(EXEEXT) \ get_divide_rcin$(EXEEXT) get_divide_s$(EXEEXT) \ get_endian8$(EXEEXT) get_endian16$(EXEEXT) \ get_endian32$(EXEEXT) get_endian64$(EXEEXT) \ get_endian_complex128_arm$(EXEEXT) \ get_endian_complex128_big$(EXEEXT) \ get_endian_complex128_little$(EXEEXT) \ get_endian_complex64_arm$(EXEEXT) \ get_endian_complex64_big$(EXEEXT) \ get_endian_complex64_little$(EXEEXT) \ get_endian_float32_arm$(EXEEXT) \ get_endian_float32_big$(EXEEXT) \ get_endian_float32_little$(EXEEXT) \ get_endian_float64_arm$(EXEEXT) \ get_endian_float64_big$(EXEEXT) \ get_endian_float64_little$(EXEEXT) get_ff$(EXEEXT) \ get_float32$(EXEEXT) get_float64$(EXEEXT) get_foffs$(EXEEXT) \ get_foffs2$(EXEEXT) get_fs$(EXEEXT) get_here$(EXEEXT) \ get_here_foffs$(EXEEXT) get_heres$(EXEEXT) \ get_index_complex$(EXEEXT) get_int8$(EXEEXT) \ get_int16$(EXEEXT) get_int32$(EXEEXT) get_int64$(EXEEXT) \ get_invalid$(EXEEXT) get_lincom1$(EXEEXT) get_lincom2$(EXEEXT) \ get_lincom2s$(EXEEXT) get_lincom3$(EXEEXT) \ get_lincom3s$(EXEEXT) get_lincom_mdt$(EXEEXT) \ get_lincom_noin$(EXEEXT) get_lincom_non$(EXEEXT) \ get_lincom_null$(EXEEXT) get_lincom_spf$(EXEEXT) \ get_linterp$(EXEEXT) get_linterp1$(EXEEXT) \ get_linterp_abs$(EXEEXT) get_linterp_complex$(EXEEXT) \ get_linterp_empty$(EXEEXT) get_linterp_noin$(EXEEXT) \ get_linterp_notab$(EXEEXT) get_linterp_sort$(EXEEXT) \ get_mplex$(EXEEXT) get_mplex_bof$(EXEEXT) \ get_mplex_complex$(EXEEXT) get_mplex_lb$(EXEEXT) \ get_mplex_lball$(EXEEXT) get_mplex_nolb$(EXEEXT) \ get_mplex_s$(EXEEXT) get_mplex_saved$(EXEEXT) \ get_multiply$(EXEEXT) get_multiply_ccin$(EXEEXT) \ get_multiply_crin$(EXEEXT) get_multiply_crinr$(EXEEXT) \ get_multiply_noin$(EXEEXT) get_multiply_rcin$(EXEEXT) \ get_multiply_s$(EXEEXT) get_neg$(EXEEXT) get_none$(EXEEXT) \ get_nonexistent$(EXEEXT) get_null$(EXEEXT) get_off64$(EXEEXT) \ get_phase$(EXEEXT) get_phase_affix$(EXEEXT) \ get_polynom$(EXEEXT) get_polynom_cmpin$(EXEEXT) \ get_polynom_noin$(EXEEXT) get_recip$(EXEEXT) \ get_recip_const$(EXEEXT) get_recurse$(EXEEXT) \ get_rofs$(EXEEXT) get_sbit$(EXEEXT) get_sf$(EXEEXT) \ get_ss$(EXEEXT) get_string$(EXEEXT) get_type$(EXEEXT) \ get_uint16$(EXEEXT) get_uint32$(EXEEXT) get_uint64$(EXEEXT) \ get_window$(EXEEXT) get_window_clr$(EXEEXT) \ get_window_complex$(EXEEXT) get_window_ge$(EXEEXT) \ get_window_gt$(EXEEXT) get_window_le$(EXEEXT) \ get_window_lt$(EXEEXT) get_window_ne$(EXEEXT) \ get_window_s$(EXEEXT) get_window_set$(EXEEXT) \ get_zero$(EXEEXT) get_zero_complex$(EXEEXT) \ get_zero_float$(EXEEXT) am__EXEEXT_27 = global_flags$(EXEEXT) global_name$(EXEEXT) \ global_ref$(EXEEXT) global_ref_empty$(EXEEXT) \ global_ref_set$(EXEEXT) am__EXEEXT_28 = gzip_add$(EXEEXT) gzip_del$(EXEEXT) gzip_get$(EXEEXT) \ gzip_get_far$(EXEEXT) gzip_get_get$(EXEEXT) \ gzip_get_get2$(EXEEXT) gzip_get_put$(EXEEXT) \ gzip_move_from$(EXEEXT) gzip_move_to$(EXEEXT) \ gzip_nframes$(EXEEXT) gzip_put$(EXEEXT) gzip_put_back$(EXEEXT) \ gzip_put_endian$(EXEEXT) gzip_put_get$(EXEEXT) \ gzip_put_nframes$(EXEEXT) gzip_put_off$(EXEEXT) \ gzip_put_pad$(EXEEXT) gzip_put_sub$(EXEEXT) gzip_seek$(EXEEXT) \ gzip_seek_far$(EXEEXT) gzip_seek_put$(EXEEXT) \ gzip_sync$(EXEEXT) am__EXEEXT_29 = header_complex$(EXEEXT) header_off64t$(EXEEXT) am__EXEEXT_30 = hide$(EXEEXT) hide_hidden$(EXEEXT) \ hide_unhide$(EXEEXT) am__EXEEXT_31 = include_accmode$(EXEEXT) include_affix$(EXEEXT) \ include_auto$(EXEEXT) include_cb$(EXEEXT) \ include_creat$(EXEEXT) include_ignore$(EXEEXT) \ include_include$(EXEEXT) include_index$(EXEEXT) \ include_invalid$(EXEEXT) include_nonexistent$(EXEEXT) \ include_pc$(EXEEXT) include_ref$(EXEEXT) include_sub$(EXEEXT) \ include_syntax$(EXEEXT) am__EXEEXT_32 = index_domain$(EXEEXT) index_index$(EXEEXT) \ index_range$(EXEEXT) index_s$(EXEEXT) index_subset$(EXEEXT) @INCLUDE_LEGACY_API_TRUE@am__EXEEXT_33 = legacy_error$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_estring$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_format$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_get$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_get_put$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_get_rofs$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_nframes$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_nonexistent$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_put$(EXEEXT) \ @INCLUDE_LEGACY_API_TRUE@ legacy_spf$(EXEEXT) am__EXEEXT_34 = lzma_get$(EXEEXT) lzma_nframes$(EXEEXT) \ lzma_put$(EXEEXT) lzma_xz_add$(EXEEXT) lzma_xz_get$(EXEEXT) \ lzma_xz_get_far$(EXEEXT) lzma_xz_get_get$(EXEEXT) \ lzma_xz_get_get2$(EXEEXT) lzma_xz_get_put$(EXEEXT) \ lzma_xz_move_to$(EXEEXT) lzma_xz_nframes$(EXEEXT) \ lzma_xz_put$(EXEEXT) lzma_xz_put_back$(EXEEXT) \ lzma_xz_put_endian$(EXEEXT) lzma_xz_put_get$(EXEEXT) \ lzma_xz_put_pad$(EXEEXT) lzma_xz_seek$(EXEEXT) \ lzma_xz_seek_far$(EXEEXT) lzma_xz_sync$(EXEEXT) am__EXEEXT_35 = madd$(EXEEXT) madd_affix$(EXEEXT) madd_alias$(EXEEXT) \ madd_alias_affix$(EXEEXT) madd_bit$(EXEEXT) \ madd_bit_invalid$(EXEEXT) madd_carray$(EXEEXT) \ madd_clincom$(EXEEXT) madd_const$(EXEEXT) \ madd_cpolynom$(EXEEXT) madd_crecip$(EXEEXT) \ madd_crecip89$(EXEEXT) madd_divide$(EXEEXT) \ madd_index$(EXEEXT) madd_lincom$(EXEEXT) \ madd_lincom_invalid$(EXEEXT) madd_linterp$(EXEEXT) \ madd_linterp_invalid$(EXEEXT) madd_mplex$(EXEEXT) \ madd_multiply$(EXEEXT) madd_multiply_invalid$(EXEEXT) \ madd_phase$(EXEEXT) madd_phase_invalid$(EXEEXT) \ madd_polynom$(EXEEXT) madd_recip$(EXEEXT) madd_sbit$(EXEEXT) \ madd_spec$(EXEEXT) madd_spec_directive$(EXEEXT) \ madd_spec_invalid$(EXEEXT) madd_spec_resolv$(EXEEXT) \ madd_string$(EXEEXT) madd_window$(EXEEXT) am__EXEEXT_36 = move_affix$(EXEEXT) move_affix_dup$(EXEEXT) \ move_affix_meta$(EXEEXT) move_affix_updb$(EXEEXT) \ move_alias$(EXEEXT) move_data_enc_ar$(EXEEXT) \ move_data_enc_ra$(EXEEXT) move_data_endian$(EXEEXT) \ move_data_foffs$(EXEEXT) move_data_foffs_neg$(EXEEXT) \ move_data_nop$(EXEEXT) move_index$(EXEEXT) move_meta$(EXEEXT) \ move_move$(EXEEXT) move_protect$(EXEEXT) move_subdir$(EXEEXT) am__EXEEXT_37 = name_affix$(EXEEXT) name_affix_bad$(EXEEXT) \ name_alias$(EXEEXT) name_dangle$(EXEEXT) name_dot5$(EXEEXT) \ name_dot5r$(EXEEXT) name_dot9$(EXEEXT) name_dup$(EXEEXT) \ name_meta$(EXEEXT) name_move$(EXEEXT) name_move_alias$(EXEEXT) \ name_name$(EXEEXT) name_updb$(EXEEXT) name_updb_affix$(EXEEXT) \ name_updb_alias$(EXEEXT) name_updb_carray$(EXEEXT) \ name_updb_const$(EXEEXT) name_updb_const_alias$(EXEEXT) am__EXEEXT_38 = native_bit$(EXEEXT) native_const$(EXEEXT) \ native_index$(EXEEXT) native_lincom$(EXEEXT) \ native_lincom_cmpin$(EXEEXT) native_lincom_cmpscal$(EXEEXT) \ native_linterp$(EXEEXT) native_linterp_cmp$(EXEEXT) \ native_mult$(EXEEXT) native_mult1$(EXEEXT) \ native_mult2$(EXEEXT) native_polynom$(EXEEXT) \ native_polynom_cmpin$(EXEEXT) native_polynom_cmpscal$(EXEEXT) \ native_raw$(EXEEXT) native_phase$(EXEEXT) \ native_recip$(EXEEXT) native_recip_cmpin$(EXEEXT) \ native_recip_cmpscal$(EXEEXT) native_sbit$(EXEEXT) \ native_string$(EXEEXT) am__EXEEXT_39 = nentries_alias$(EXEEXT) nentries_hidden$(EXEEXT) \ nentries_noalias$(EXEEXT) nentries_scalar$(EXEEXT) am__EXEEXT_40 = nfields_hidden$(EXEEXT) nfields_invalid$(EXEEXT) \ nfields_nfields$(EXEEXT) nfields_type$(EXEEXT) \ nfields_type_hidden$(EXEEXT) nfields_type_invalid$(EXEEXT) \ nfields_vector$(EXEEXT) nfields_vector_hidden$(EXEEXT) \ nfields_vector_invalid$(EXEEXT) am__EXEEXT_41 = nframes64$(EXEEXT) nframes_empty$(EXEEXT) \ nframes_invalid$(EXEEXT) nframes_nframes$(EXEEXT) \ nframes_off64$(EXEEXT) nframes_spf$(EXEEXT) am__EXEEXT_42 = nmeta$(EXEEXT) nmeta_hidden$(EXEEXT) \ nmeta_invalid$(EXEEXT) nmeta_parent$(EXEEXT) \ nmeta_type$(EXEEXT) nmeta_type_hidden$(EXEEXT) \ nmeta_type_invalid$(EXEEXT) nmeta_type_parent$(EXEEXT) \ nmeta_vectors$(EXEEXT) nmeta_vectors_del$(EXEEXT) \ nmeta_vectors_hidden$(EXEEXT) nmeta_vectors_invalid$(EXEEXT) \ nmeta_vectors_parent$(EXEEXT) am__EXEEXT_43 = open_abs$(EXEEXT) open_cb_abort$(EXEEXT) \ open_cb_cont$(EXEEXT) open_cb_ignore$(EXEEXT) \ open_cb_invalid$(EXEEXT) open_cb_rescan$(EXEEXT) \ open_cb_rescan_alloc$(EXEEXT) open_eaccess$(EXEEXT) \ open_invalid$(EXEEXT) open_nonexistent$(EXEEXT) \ open_notdirfile$(EXEEXT) open_open$(EXEEXT) open_rofs$(EXEEXT) \ open_sym_al$(EXEEXT) open_sym_at$(EXEEXT) open_sym_c$(EXEEXT) \ open_sym_cl$(EXEEXT) open_sym_ct$(EXEEXT) open_sym_d$(EXEEXT) \ open_sym_l$(EXEEXT) open_sym_p$(EXEEXT) open_sym_pl$(EXEEXT) \ open_sym_pt$(EXEEXT) am__EXEEXT_44 = parse_alias$(EXEEXT) parse_alias_code$(EXEEXT) \ parse_alias_dup$(EXEEXT) parse_alias_meta$(EXEEXT) \ parse_alias_missing$(EXEEXT) parse_badline$(EXEEXT) \ parse_bit$(EXEEXT) parse_bit4$(EXEEXT) \ parse_bit_bitnum$(EXEEXT) parse_bit_bitsize$(EXEEXT) \ parse_bit_ncols$(EXEEXT) parse_bit_numbits$(EXEEXT) \ parse_bit_scalar$(EXEEXT) parse_carray$(EXEEXT) \ parse_carray_long$(EXEEXT) parse_const$(EXEEXT) \ parse_const_complex$(EXEEXT) parse_const_ncols$(EXEEXT) \ parse_divide$(EXEEXT) parse_double$(EXEEXT) \ parse_duplicate$(EXEEXT) parse_duplicate_ignore$(EXEEXT) \ parse_endian_bad$(EXEEXT) parse_endian_big$(EXEEXT) \ parse_endian_force$(EXEEXT) parse_endian_little$(EXEEXT) \ parse_endian_slash$(EXEEXT) parse_eol$(EXEEXT) \ parse_foffs$(EXEEXT) parse_foffs_include$(EXEEXT) \ parse_foffs_slash$(EXEEXT) parse_hex$(EXEEXT) \ parse_hidden$(EXEEXT) parse_hidden_field$(EXEEXT) \ parse_hidden_meta$(EXEEXT) parse_include$(EXEEXT) \ parse_include_absolute$(EXEEXT) parse_include_absrel$(EXEEXT) \ parse_include_affix_bad$(EXEEXT) \ parse_include_affix_ref$(EXEEXT) parse_include_dir$(EXEEXT) \ parse_include_loop$(EXEEXT) parse_include_nonexistent$(EXEEXT) \ parse_include_prefix$(EXEEXT) \ parse_include_prefix_dup$(EXEEXT) \ parse_include_preprefix$(EXEEXT) parse_include_ref$(EXEEXT) \ parse_include_relabs$(EXEEXT) parse_include_relrel$(EXEEXT) \ parse_include_slash$(EXEEXT) parse_include_suffix$(EXEEXT) \ parse_include_sufsuffix$(EXEEXT) parse_index$(EXEEXT) \ parse_lincom$(EXEEXT) parse_lincom_ncols1$(EXEEXT) \ parse_lincom_ncols2$(EXEEXT) parse_lincom_nfields$(EXEEXT) \ parse_lincom_nofields$(EXEEXT) parse_lincom_non$(EXEEXT) \ parse_lincom_non_ncols$(EXEEXT) parse_lincom_scalar$(EXEEXT) \ parse_linterp$(EXEEXT) parse_linterp_ncols$(EXEEXT) \ parse_literal_cmpbad$(EXEEXT) parse_literal_fltcmp$(EXEEXT) \ parse_literal_fltcmp0$(EXEEXT) parse_literal_intcmp$(EXEEXT) \ parse_literal_intcmp0$(EXEEXT) parse_literal_uintcmp$(EXEEXT) \ parse_literal_uintcmp0$(EXEEXT) parse_malias$(EXEEXT) \ parse_malias_dup$(EXEEXT) parse_malias_meta$(EXEEXT) \ parse_meta$(EXEEXT) parse_meta_affix$(EXEEXT) \ parse_meta_alias$(EXEEXT) parse_meta_frag$(EXEEXT) \ parse_meta_implicit$(EXEEXT) parse_meta_implicit2$(EXEEXT) \ parse_meta_implicit_affix$(EXEEXT) parse_meta_index$(EXEEXT) \ parse_meta_index2$(EXEEXT) parse_meta_jump$(EXEEXT) \ parse_meta_malias$(EXEEXT) parse_meta_meta$(EXEEXT) \ parse_meta_parent$(EXEEXT) parse_meta_raw$(EXEEXT) \ parse_mplex$(EXEEXT) parse_mplex_ncols$(EXEEXT) \ parse_mplex_nomax$(EXEEXT) parse_mplex_scalar$(EXEEXT) \ parse_multiply$(EXEEXT) parse_multiply_ncols$(EXEEXT) \ parse_name$(EXEEXT) parse_name_dot$(EXEEXT) \ parse_name_ext$(EXEEXT) parse_name_pedantic$(EXEEXT) \ parse_ncols$(EXEEXT) parse_octal_zero$(EXEEXT) \ parse_phase$(EXEEXT) parse_phase_ncols$(EXEEXT) \ parse_phase_scalar$(EXEEXT) parse_polynom$(EXEEXT) \ parse_polynom_ncols1$(EXEEXT) parse_polynom_ncols2$(EXEEXT) \ parse_polynom_scalar$(EXEEXT) parse_protect_all$(EXEEXT) \ parse_protect_bad$(EXEEXT) parse_protect_data$(EXEEXT) \ parse_protect_format$(EXEEXT) parse_protect_none$(EXEEXT) \ parse_quote$(EXEEXT) parse_quote_mismatch$(EXEEXT) \ parse_raw$(EXEEXT) parse_raw_char$(EXEEXT) \ parse_raw_char_bad$(EXEEXT) parse_raw_ncols$(EXEEXT) \ parse_raw_scalar$(EXEEXT) parse_raw_spf$(EXEEXT) \ parse_raw_type$(EXEEXT) parse_recip$(EXEEXT) \ parse_ref$(EXEEXT) parse_ref_nonexistent$(EXEEXT) \ parse_sbit$(EXEEXT) parse_scalar1$(EXEEXT) \ parse_scalar2$(EXEEXT) parse_scalar_repr$(EXEEXT) \ parse_sort$(EXEEXT) parse_string$(EXEEXT) \ parse_string_ncols$(EXEEXT) parse_string_null$(EXEEXT) \ parse_utf8$(EXEEXT) parse_utf8_invalid$(EXEEXT) \ parse_utf8_zero$(EXEEXT) parse_version$(EXEEXT) \ parse_version_89$(EXEEXT) parse_version_98$(EXEEXT) \ parse_version_include$(EXEEXT) \ parse_version_permissive$(EXEEXT) parse_version_p8$(EXEEXT) \ parse_version_p9$(EXEEXT) parse_version_slash$(EXEEXT) \ parse_whitespace$(EXEEXT) parse_window$(EXEEXT) \ parse_window_ncols$(EXEEXT) parse_window_op$(EXEEXT) \ parse_window_scalar$(EXEEXT) am__EXEEXT_45 = protect_alter$(EXEEXT) protect_alter_all$(EXEEXT) \ protect_get$(EXEEXT) am__EXEEXT_46 = put64$(EXEEXT) put_bad_code$(EXEEXT) put_bit$(EXEEXT) \ put_bof$(EXEEXT) put_carray$(EXEEXT) \ put_carray_client$(EXEEXT) put_carray_slice$(EXEEXT) \ put_char$(EXEEXT) put_clincom1$(EXEEXT) \ put_complex128$(EXEEXT) put_complex64$(EXEEXT) \ put_const$(EXEEXT) put_const_protect$(EXEEXT) \ put_cpolynom$(EXEEXT) put_crecip$(EXEEXT) put_divide$(EXEEXT) \ put_endian8$(EXEEXT) put_endian16$(EXEEXT) \ put_endian32$(EXEEXT) put_endian64$(EXEEXT) \ put_endian_complex128_arm$(EXEEXT) \ put_endian_complex128_big$(EXEEXT) \ put_endian_complex128_little$(EXEEXT) \ put_endian_complex64_arm$(EXEEXT) \ put_endian_complex64_big$(EXEEXT) \ put_endian_complex64_little$(EXEEXT) \ put_endian_float32_arm$(EXEEXT) \ put_endian_float32_big$(EXEEXT) \ put_endian_float32_little$(EXEEXT) \ put_endian_float64_arm$(EXEEXT) \ put_endian_float64_big$(EXEEXT) \ put_endian_float64_little$(EXEEXT) put_ff$(EXEEXT) \ put_float32$(EXEEXT) put_float64$(EXEEXT) put_foffs$(EXEEXT) \ put_fs$(EXEEXT) put_here$(EXEEXT) put_heres$(EXEEXT) \ put_int8$(EXEEXT) put_int16$(EXEEXT) put_int32$(EXEEXT) \ put_int64$(EXEEXT) put_invalid$(EXEEXT) put_lincom1$(EXEEXT) \ put_lincom2$(EXEEXT) put_lincom_noin$(EXEEXT) \ put_linterp$(EXEEXT) put_linterp_noin$(EXEEXT) \ put_linterp_nomono$(EXEEXT) put_linterp_notab$(EXEEXT) \ put_linterp_reverse$(EXEEXT) put_mplex$(EXEEXT) \ put_mplex_complex$(EXEEXT) put_multiply$(EXEEXT) \ put_nofile$(EXEEXT) put_null$(EXEEXT) put_off64$(EXEEXT) \ put_phase$(EXEEXT) put_phase_noin$(EXEEXT) \ put_polynom1$(EXEEXT) put_polynom2$(EXEEXT) \ put_polynom_noin$(EXEEXT) put_protect$(EXEEXT) \ put_rdonly$(EXEEXT) put_recip$(EXEEXT) put_recurse$(EXEEXT) \ put_repr$(EXEEXT) put_rofs$(EXEEXT) put_sbit$(EXEEXT) \ put_sf$(EXEEXT) put_ss$(EXEEXT) put_string$(EXEEXT) \ put_string_protect$(EXEEXT) put_sub$(EXEEXT) put_type$(EXEEXT) \ put_uint16$(EXEEXT) put_uint32$(EXEEXT) put_uint64$(EXEEXT) \ put_window$(EXEEXT) put_zero$(EXEEXT) am__EXEEXT_47 = ref$(EXEEXT) ref_none$(EXEEXT) ref_two$(EXEEXT) am__EXEEXT_48 = repr_a$(EXEEXT) repr_bad$(EXEEXT) \ repr_float32$(EXEEXT) repr_float64$(EXEEXT) repr_i$(EXEEXT) \ repr_int16$(EXEEXT) repr_int32$(EXEEXT) repr_int64$(EXEEXT) \ repr_int8$(EXEEXT) repr_m$(EXEEXT) repr_r$(EXEEXT) \ repr_real_a$(EXEEXT) repr_real_i$(EXEEXT) repr_real_m$(EXEEXT) \ repr_real_r$(EXEEXT) repr_uint16$(EXEEXT) repr_uint32$(EXEEXT) \ repr_uint64$(EXEEXT) repr_uint8$(EXEEXT) am__EXEEXT_49 = seek64$(EXEEXT) seek_cur$(EXEEXT) seek_end$(EXEEXT) \ seek_far$(EXEEXT) seek_foffs$(EXEEXT) seek_foffs2$(EXEEXT) \ seek_index$(EXEEXT) seek_lincom$(EXEEXT) seek_mult$(EXEEXT) \ seek_neg$(EXEEXT) seek_phase$(EXEEXT) seek_set$(EXEEXT) \ seek_sub$(EXEEXT) am__EXEEXT_50 = sie_get_big$(EXEEXT) sie_get_little$(EXEEXT) \ sie_move_from$(EXEEXT) sie_move_to$(EXEEXT) \ sie_nframes_big$(EXEEXT) sie_nframes_little$(EXEEXT) \ sie_put_append$(EXEEXT) sie_put_append2$(EXEEXT) \ sie_put_back$(EXEEXT) sie_put_big$(EXEEXT) \ sie_put_little$(EXEEXT) sie_put_many$(EXEEXT) \ sie_put_newo$(EXEEXT) sie_put_newo0$(EXEEXT) \ sie_put_pad$(EXEEXT) sie_put_pad0$(EXEEXT) \ sie_put_trunc$(EXEEXT) sie_put_trunc2$(EXEEXT) \ sie_put_trunc_nf$(EXEEXT) sie_seek$(EXEEXT) \ sie_seek_far$(EXEEXT) sie_sync$(EXEEXT) am__EXEEXT_51 = slim_get$(EXEEXT) slim_nframes$(EXEEXT) \ slim_seek$(EXEEXT) slim_seek_far$(EXEEXT) am__EXEEXT_52 = spf_alias$(EXEEXT) spf_alias_missing$(EXEEXT) \ spf_alias_meta$(EXEEXT) spf_divide$(EXEEXT) \ spf_lincom$(EXEEXT) spf_multiply$(EXEEXT) spf_polynom$(EXEEXT) \ spf_raw$(EXEEXT) spf_recip$(EXEEXT) spf_recurse$(EXEEXT) am__EXEEXT_53 = svlist$(EXEEXT) svlist0$(EXEEXT) svlist2$(EXEEXT) \ svlist_hidden$(EXEEXT) svlist_invalid$(EXEEXT) \ svlist_meta$(EXEEXT) svlist_meta0$(EXEEXT) \ svlist_meta_hidden$(EXEEXT) svlist_meta_invalid$(EXEEXT) am__EXEEXT_54 = table$(EXEEXT) table_code$(EXEEXT) table_type$(EXEEXT) am__EXEEXT_55 = tell$(EXEEXT) tell64$(EXEEXT) tell_multidiv$(EXEEXT) \ tell_sub$(EXEEXT) am__EXEEXT_56 = tok_arg$(EXEEXT) tok_escape$(EXEEXT) \ tok_quote$(EXEEXT) am__EXEEXT_57 = trunc$(EXEEXT) trunc_dir$(EXEEXT) \ trunc_rdonly$(EXEEXT) trunc_rofs$(EXEEXT) \ trunc_truncsub$(EXEEXT) am__EXEEXT_58 = unclude$(EXEEXT) unclude_del$(EXEEXT) \ unclude_move$(EXEEXT) unclude_open$(EXEEXT) am__EXEEXT_59 = version_0$(EXEEXT) version_0_write$(EXEEXT) \ version_1$(EXEEXT) version_1_write$(EXEEXT) version_2$(EXEEXT) \ version_2_write$(EXEEXT) version_3$(EXEEXT) \ version_3_write$(EXEEXT) version_4$(EXEEXT) \ version_4_write$(EXEEXT) version_5$(EXEEXT) \ version_5_strict$(EXEEXT) version_5_write$(EXEEXT) \ version_6$(EXEEXT) version_6_strict$(EXEEXT) \ version_6_write$(EXEEXT) version_7$(EXEEXT) \ version_7_strict$(EXEEXT) version_7_write$(EXEEXT) \ version_8$(EXEEXT) version_8_strict$(EXEEXT) \ version_8_write$(EXEEXT) version_9$(EXEEXT) \ version_9_strict$(EXEEXT) version_9_write$(EXEEXT) am__EXEEXT_60 = vlist$(EXEEXT) vlist_alias$(EXEEXT) \ vlist_hidden$(EXEEXT) vlist_invalid$(EXEEXT) \ vlist_meta$(EXEEXT) vlist_meta_hidden$(EXEEXT) \ vlist_meta_invalid$(EXEEXT) am__EXEEXT_61 = zzip_data$(EXEEXT) zzip_get$(EXEEXT) \ zzip_get_get$(EXEEXT) zzip_nframes$(EXEEXT) zzip_seek$(EXEEXT) \ zzip_seek_far$(EXEEXT) am__EXEEXT_62 = zzslim_get$(EXEEXT) zzslim_nframes$(EXEEXT) \ zzslim_seek$(EXEEXT) zzslim_seek_far$(EXEEXT) am__EXEEXT_63 = $(am__EXEEXT_1) $(am__EXEEXT_2) $(am__EXEEXT_3) \ $(am__EXEEXT_4) $(am__EXEEXT_5) $(am__EXEEXT_6) \ $(am__EXEEXT_7) $(am__EXEEXT_8) $(am__EXEEXT_9) \ $(am__EXEEXT_10) $(am__EXEEXT_11) $(am__EXEEXT_12) \ $(am__EXEEXT_13) $(am__EXEEXT_14) $(am__EXEEXT_15) \ $(am__EXEEXT_16) $(am__EXEEXT_17) $(am__EXEEXT_18) \ $(am__EXEEXT_19) $(am__EXEEXT_20) $(am__EXEEXT_21) \ $(am__EXEEXT_22) $(am__EXEEXT_23) $(am__EXEEXT_24) \ $(am__EXEEXT_25) $(am__EXEEXT_26) $(am__EXEEXT_27) \ $(am__EXEEXT_28) $(am__EXEEXT_29) $(am__EXEEXT_30) \ $(am__EXEEXT_31) $(am__EXEEXT_32) $(am__EXEEXT_33) \ $(am__EXEEXT_34) $(am__EXEEXT_35) $(am__EXEEXT_36) \ $(am__EXEEXT_37) $(am__EXEEXT_38) $(am__EXEEXT_39) \ $(am__EXEEXT_40) $(am__EXEEXT_41) $(am__EXEEXT_42) \ $(am__EXEEXT_43) $(am__EXEEXT_44) $(am__EXEEXT_45) \ $(am__EXEEXT_46) $(am__EXEEXT_47) $(am__EXEEXT_48) \ $(am__EXEEXT_49) $(am__EXEEXT_50) $(am__EXEEXT_51) \ $(am__EXEEXT_52) $(am__EXEEXT_53) $(am__EXEEXT_54) \ $(am__EXEEXT_55) $(am__EXEEXT_56) $(am__EXEEXT_57) \ $(am__EXEEXT_58) $(am__EXEEXT_59) $(am__EXEEXT_60) \ $(am__EXEEXT_61) $(am__EXEEXT_62) add_add_SOURCES = add_add.c add_add_OBJECTS = add_add.$(OBJEXT) add_add_LDADD = $(LDADD) add_add_DEPENDENCIES = ../src/libgetdata.la 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 = add_affix_SOURCES = add_affix.c add_affix_OBJECTS = add_affix.$(OBJEXT) add_affix_LDADD = $(LDADD) add_affix_DEPENDENCIES = ../src/libgetdata.la add_alias_SOURCES = add_alias.c add_alias_OBJECTS = add_alias.$(OBJEXT) add_alias_LDADD = $(LDADD) add_alias_DEPENDENCIES = ../src/libgetdata.la add_alias_affix_SOURCES = add_alias_affix.c add_alias_affix_OBJECTS = add_alias_affix.$(OBJEXT) add_alias_affix_LDADD = $(LDADD) add_alias_affix_DEPENDENCIES = ../src/libgetdata.la add_alias_meta_SOURCES = add_alias_meta.c add_alias_meta_OBJECTS = add_alias_meta.$(OBJEXT) add_alias_meta_LDADD = $(LDADD) add_alias_meta_DEPENDENCIES = ../src/libgetdata.la add_amb_code7_SOURCES = add_amb_code7.c add_amb_code7_OBJECTS = add_amb_code7.$(OBJEXT) add_amb_code7_LDADD = $(LDADD) add_amb_code7_DEPENDENCIES = ../src/libgetdata.la add_bit_SOURCES = add_bit.c add_bit_OBJECTS = add_bit.$(OBJEXT) add_bit_LDADD = $(LDADD) add_bit_DEPENDENCIES = ../src/libgetdata.la add_bit_bitnum_SOURCES = add_bit_bitnum.c add_bit_bitnum_OBJECTS = add_bit_bitnum.$(OBJEXT) add_bit_bitnum_LDADD = $(LDADD) add_bit_bitnum_DEPENDENCIES = ../src/libgetdata.la add_bit_bitsize_SOURCES = add_bit_bitsize.c add_bit_bitsize_OBJECTS = add_bit_bitsize.$(OBJEXT) add_bit_bitsize_LDADD = $(LDADD) add_bit_bitsize_DEPENDENCIES = ../src/libgetdata.la add_bit_invalid_SOURCES = add_bit_invalid.c add_bit_invalid_OBJECTS = add_bit_invalid.$(OBJEXT) add_bit_invalid_LDADD = $(LDADD) add_bit_invalid_DEPENDENCIES = ../src/libgetdata.la add_bit_numbits_SOURCES = add_bit_numbits.c add_bit_numbits_OBJECTS = add_bit_numbits.$(OBJEXT) add_bit_numbits_LDADD = $(LDADD) add_bit_numbits_DEPENDENCIES = ../src/libgetdata.la add_bit_scalars_SOURCES = add_bit_scalars.c add_bit_scalars_OBJECTS = add_bit_scalars.$(OBJEXT) add_bit_scalars_LDADD = $(LDADD) add_bit_scalars_DEPENDENCIES = ../src/libgetdata.la add_carray_SOURCES = add_carray.c add_carray_OBJECTS = add_carray.$(OBJEXT) add_carray_LDADD = $(LDADD) add_carray_DEPENDENCIES = ../src/libgetdata.la add_clincom_SOURCES = add_clincom.c add_clincom_OBJECTS = add_clincom.$(OBJEXT) add_clincom_LDADD = $(LDADD) add_clincom_DEPENDENCIES = ../src/libgetdata.la add_code_SOURCES = add_code.c add_code_OBJECTS = add_code.$(OBJEXT) add_code_LDADD = $(LDADD) add_code_DEPENDENCIES = ../src/libgetdata.la add_const_SOURCES = add_const.c add_const_OBJECTS = add_const.$(OBJEXT) add_const_LDADD = $(LDADD) add_const_DEPENDENCIES = ../src/libgetdata.la add_cpolynom_SOURCES = add_cpolynom.c add_cpolynom_OBJECTS = add_cpolynom.$(OBJEXT) add_cpolynom_LDADD = $(LDADD) add_cpolynom_DEPENDENCIES = ../src/libgetdata.la add_crecip_SOURCES = add_crecip.c add_crecip_OBJECTS = add_crecip.$(OBJEXT) add_crecip_LDADD = $(LDADD) add_crecip_DEPENDENCIES = ../src/libgetdata.la add_crecip89_SOURCES = add_crecip89.c add_crecip89_OBJECTS = add_crecip89.$(OBJEXT) add_crecip89_LDADD = $(LDADD) add_crecip89_DEPENDENCIES = ../src/libgetdata.la add_dangle_dup_SOURCES = add_dangle_dup.c add_dangle_dup_OBJECTS = add_dangle_dup.$(OBJEXT) add_dangle_dup_LDADD = $(LDADD) add_dangle_dup_DEPENDENCIES = ../src/libgetdata.la add_divide_SOURCES = add_divide.c add_divide_OBJECTS = add_divide.$(OBJEXT) add_divide_LDADD = $(LDADD) add_divide_DEPENDENCIES = ../src/libgetdata.la add_divide_invalid_SOURCES = add_divide_invalid.c add_divide_invalid_OBJECTS = add_divide_invalid.$(OBJEXT) add_divide_invalid_LDADD = $(LDADD) add_divide_invalid_DEPENDENCIES = ../src/libgetdata.la add_dot5_SOURCES = add_dot5.c add_dot5_OBJECTS = add_dot5.$(OBJEXT) add_dot5_LDADD = $(LDADD) add_dot5_DEPENDENCIES = ../src/libgetdata.la add_dot6_SOURCES = add_dot6.c add_dot6_OBJECTS = add_dot6.$(OBJEXT) add_dot6_LDADD = $(LDADD) add_dot6_DEPENDENCIES = ../src/libgetdata.la add_duplicate_SOURCES = add_duplicate.c add_duplicate_OBJECTS = add_duplicate.$(OBJEXT) add_duplicate_LDADD = $(LDADD) add_duplicate_DEPENDENCIES = ../src/libgetdata.la add_format_SOURCES = add_format.c add_format_OBJECTS = add_format.$(OBJEXT) add_format_LDADD = $(LDADD) add_format_DEPENDENCIES = ../src/libgetdata.la add_invalid_SOURCES = add_invalid.c add_invalid_OBJECTS = add_invalid.$(OBJEXT) add_invalid_LDADD = $(LDADD) add_invalid_DEPENDENCIES = ../src/libgetdata.la add_lincom_SOURCES = add_lincom.c add_lincom_OBJECTS = add_lincom.$(OBJEXT) add_lincom_LDADD = $(LDADD) add_lincom_DEPENDENCIES = ../src/libgetdata.la add_lincom_affix_SOURCES = add_lincom_affix.c add_lincom_affix_OBJECTS = add_lincom_affix.$(OBJEXT) add_lincom_affix_LDADD = $(LDADD) add_lincom_affix_DEPENDENCIES = ../src/libgetdata.la add_lincom_invalid_SOURCES = add_lincom_invalid.c add_lincom_invalid_OBJECTS = add_lincom_invalid.$(OBJEXT) add_lincom_invalid_LDADD = $(LDADD) add_lincom_invalid_DEPENDENCIES = ../src/libgetdata.la add_lincom_nfields_SOURCES = add_lincom_nfields.c add_lincom_nfields_OBJECTS = add_lincom_nfields.$(OBJEXT) add_lincom_nfields_LDADD = $(LDADD) add_lincom_nfields_DEPENDENCIES = ../src/libgetdata.la add_linterp_SOURCES = add_linterp.c add_linterp_OBJECTS = add_linterp.$(OBJEXT) add_linterp_LDADD = $(LDADD) add_linterp_DEPENDENCIES = ../src/libgetdata.la add_linterp_invalid_SOURCES = add_linterp_invalid.c add_linterp_invalid_OBJECTS = add_linterp_invalid.$(OBJEXT) add_linterp_invalid_LDADD = $(LDADD) add_linterp_invalid_DEPENDENCIES = ../src/libgetdata.la add_meta_SOURCES = add_meta.c add_meta_OBJECTS = add_meta.$(OBJEXT) add_meta_LDADD = $(LDADD) add_meta_DEPENDENCIES = ../src/libgetdata.la add_meta_alias_SOURCES = add_meta_alias.c add_meta_alias_OBJECTS = add_meta_alias.$(OBJEXT) add_meta_alias_LDADD = $(LDADD) add_meta_alias_DEPENDENCIES = ../src/libgetdata.la add_mplex_SOURCES = add_mplex.c add_mplex_OBJECTS = add_mplex.$(OBJEXT) add_mplex_LDADD = $(LDADD) add_mplex_DEPENDENCIES = ../src/libgetdata.la add_mplex_scalars_SOURCES = add_mplex_scalars.c add_mplex_scalars_OBJECTS = add_mplex_scalars.$(OBJEXT) add_mplex_scalars_LDADD = $(LDADD) add_mplex_scalars_DEPENDENCIES = ../src/libgetdata.la add_multiply_SOURCES = add_multiply.c add_multiply_OBJECTS = add_multiply.$(OBJEXT) add_multiply_LDADD = $(LDADD) add_multiply_DEPENDENCIES = ../src/libgetdata.la add_multiply_invalid_SOURCES = add_multiply_invalid.c add_multiply_invalid_OBJECTS = add_multiply_invalid.$(OBJEXT) add_multiply_invalid_LDADD = $(LDADD) add_multiply_invalid_DEPENDENCIES = ../src/libgetdata.la add_phase_SOURCES = add_phase.c add_phase_OBJECTS = add_phase.$(OBJEXT) add_phase_LDADD = $(LDADD) add_phase_DEPENDENCIES = ../src/libgetdata.la add_phase_invalid_SOURCES = add_phase_invalid.c add_phase_invalid_OBJECTS = add_phase_invalid.$(OBJEXT) add_phase_invalid_LDADD = $(LDADD) add_phase_invalid_DEPENDENCIES = ../src/libgetdata.la add_polynom_SOURCES = add_polynom.c add_polynom_OBJECTS = add_polynom.$(OBJEXT) add_polynom_LDADD = $(LDADD) add_polynom_DEPENDENCIES = ../src/libgetdata.la add_polynom_scalar_SOURCES = add_polynom_scalar.c add_polynom_scalar_OBJECTS = add_polynom_scalar.$(OBJEXT) add_polynom_scalar_LDADD = $(LDADD) add_polynom_scalar_DEPENDENCIES = ../src/libgetdata.la add_protect_SOURCES = add_protect.c add_protect_OBJECTS = add_protect.$(OBJEXT) add_protect_LDADD = $(LDADD) add_protect_DEPENDENCIES = ../src/libgetdata.la add_raw_SOURCES = add_raw.c add_raw_OBJECTS = add_raw.$(OBJEXT) add_raw_LDADD = $(LDADD) add_raw_DEPENDENCIES = ../src/libgetdata.la add_raw_include_SOURCES = add_raw_include.c add_raw_include_OBJECTS = add_raw_include.$(OBJEXT) add_raw_include_LDADD = $(LDADD) add_raw_include_DEPENDENCIES = ../src/libgetdata.la add_raw_invalid_SOURCES = add_raw_invalid.c add_raw_invalid_OBJECTS = add_raw_invalid.$(OBJEXT) add_raw_invalid_LDADD = $(LDADD) add_raw_invalid_DEPENDENCIES = ../src/libgetdata.la add_raw_spf_SOURCES = add_raw_spf.c add_raw_spf_OBJECTS = add_raw_spf.$(OBJEXT) add_raw_spf_LDADD = $(LDADD) add_raw_spf_DEPENDENCIES = ../src/libgetdata.la add_raw_spf_scalar_SOURCES = add_raw_spf_scalar.c add_raw_spf_scalar_OBJECTS = add_raw_spf_scalar.$(OBJEXT) add_raw_spf_scalar_LDADD = $(LDADD) add_raw_spf_scalar_DEPENDENCIES = ../src/libgetdata.la add_raw_sub_SOURCES = add_raw_sub.c add_raw_sub_OBJECTS = add_raw_sub.$(OBJEXT) add_raw_sub_LDADD = $(LDADD) add_raw_sub_DEPENDENCIES = ../src/libgetdata.la add_raw_type_SOURCES = add_raw_type.c add_raw_type_OBJECTS = add_raw_type.$(OBJEXT) add_raw_type_LDADD = $(LDADD) add_raw_type_DEPENDENCIES = ../src/libgetdata.la add_rdonly_SOURCES = add_rdonly.c add_rdonly_OBJECTS = add_rdonly.$(OBJEXT) add_rdonly_LDADD = $(LDADD) add_rdonly_DEPENDENCIES = ../src/libgetdata.la add_recip_SOURCES = add_recip.c add_recip_OBJECTS = add_recip.$(OBJEXT) add_recip_LDADD = $(LDADD) add_recip_DEPENDENCIES = ../src/libgetdata.la add_resolv_SOURCES = add_resolv.c add_resolv_OBJECTS = add_resolv.$(OBJEXT) add_resolv_LDADD = $(LDADD) add_resolv_DEPENDENCIES = ../src/libgetdata.la add_sbit_SOURCES = add_sbit.c add_sbit_OBJECTS = add_sbit.$(OBJEXT) add_sbit_LDADD = $(LDADD) add_sbit_DEPENDENCIES = ../src/libgetdata.la add_scalar_SOURCES = add_scalar.c add_scalar_OBJECTS = add_scalar.$(OBJEXT) add_scalar_LDADD = $(LDADD) add_scalar_DEPENDENCIES = ../src/libgetdata.la add_scalar_carray_SOURCES = add_scalar_carray.c add_scalar_carray_OBJECTS = add_scalar_carray.$(OBJEXT) add_scalar_carray_LDADD = $(LDADD) add_scalar_carray_DEPENDENCIES = ../src/libgetdata.la add_scalar_carray_bad_SOURCES = add_scalar_carray_bad.c add_scalar_carray_bad_OBJECTS = add_scalar_carray_bad.$(OBJEXT) add_scalar_carray_bad_LDADD = $(LDADD) add_scalar_carray_bad_DEPENDENCIES = ../src/libgetdata.la add_sort_SOURCES = add_sort.c add_sort_OBJECTS = add_sort.$(OBJEXT) add_sort_LDADD = $(LDADD) add_sort_DEPENDENCIES = ../src/libgetdata.la add_spec_SOURCES = add_spec.c add_spec_OBJECTS = add_spec.$(OBJEXT) add_spec_LDADD = $(LDADD) add_spec_DEPENDENCIES = ../src/libgetdata.la add_spec_directive_SOURCES = add_spec_directive.c add_spec_directive_OBJECTS = add_spec_directive.$(OBJEXT) add_spec_directive_LDADD = $(LDADD) add_spec_directive_DEPENDENCIES = ../src/libgetdata.la add_spec_invalid_SOURCES = add_spec_invalid.c add_spec_invalid_OBJECTS = add_spec_invalid.$(OBJEXT) add_spec_invalid_LDADD = $(LDADD) add_spec_invalid_DEPENDENCIES = ../src/libgetdata.la add_spec_meta_SOURCES = add_spec_meta.c add_spec_meta_OBJECTS = add_spec_meta.$(OBJEXT) add_spec_meta_LDADD = $(LDADD) add_spec_meta_DEPENDENCIES = ../src/libgetdata.la add_spec_resolv_SOURCES = add_spec_resolv.c add_spec_resolv_OBJECTS = add_spec_resolv.$(OBJEXT) add_spec_resolv_LDADD = $(LDADD) add_spec_resolv_DEPENDENCIES = ../src/libgetdata.la add_string_SOURCES = add_string.c add_string_OBJECTS = add_string.$(OBJEXT) add_string_LDADD = $(LDADD) add_string_DEPENDENCIES = ../src/libgetdata.la add_string_affix_SOURCES = add_string_affix.c add_string_affix_OBJECTS = add_string_affix.$(OBJEXT) add_string_affix_LDADD = $(LDADD) add_string_affix_DEPENDENCIES = ../src/libgetdata.la add_type_SOURCES = add_type.c add_type_OBJECTS = add_type.$(OBJEXT) add_type_LDADD = $(LDADD) add_type_DEPENDENCIES = ../src/libgetdata.la add_window_SOURCES = add_window.c add_window_OBJECTS = add_window.$(OBJEXT) add_window_LDADD = $(LDADD) add_window_DEPENDENCIES = ../src/libgetdata.la add_window_op_SOURCES = add_window_op.c add_window_op_OBJECTS = add_window_op.$(OBJEXT) add_window_op_LDADD = $(LDADD) add_window_op_DEPENDENCIES = ../src/libgetdata.la alias_list_SOURCES = alias_list.c alias_list_OBJECTS = alias_list.$(OBJEXT) alias_list_LDADD = $(LDADD) alias_list_DEPENDENCIES = ../src/libgetdata.la alias_list_alias_SOURCES = alias_list_alias.c alias_list_alias_OBJECTS = alias_list_alias.$(OBJEXT) alias_list_alias_LDADD = $(LDADD) alias_list_alias_DEPENDENCIES = ../src/libgetdata.la alias_list_missing_SOURCES = alias_list_missing.c alias_list_missing_OBJECTS = alias_list_missing.$(OBJEXT) alias_list_missing_LDADD = $(LDADD) alias_list_missing_DEPENDENCIES = ../src/libgetdata.la alias_num_SOURCES = alias_num.c alias_num_OBJECTS = alias_num.$(OBJEXT) alias_num_LDADD = $(LDADD) alias_num_DEPENDENCIES = ../src/libgetdata.la alias_num_alias_SOURCES = alias_num_alias.c alias_num_alias_OBJECTS = alias_num_alias.$(OBJEXT) alias_num_alias_LDADD = $(LDADD) alias_num_alias_DEPENDENCIES = ../src/libgetdata.la alias_num_missing_SOURCES = alias_num_missing.c alias_num_missing_OBJECTS = alias_num_missing.$(OBJEXT) alias_num_missing_LDADD = $(LDADD) alias_num_missing_DEPENDENCIES = ../src/libgetdata.la alias_target_SOURCES = alias_target.c alias_target_OBJECTS = alias_target.$(OBJEXT) alias_target_LDADD = $(LDADD) alias_target_DEPENDENCIES = ../src/libgetdata.la alias_target_alias_SOURCES = alias_target_alias.c alias_target_alias_OBJECTS = alias_target_alias.$(OBJEXT) alias_target_alias_LDADD = $(LDADD) alias_target_alias_DEPENDENCIES = ../src/libgetdata.la alias_target_missing_SOURCES = alias_target_missing.c alias_target_missing_OBJECTS = alias_target_missing.$(OBJEXT) alias_target_missing_LDADD = $(LDADD) alias_target_missing_DEPENDENCIES = ../src/libgetdata.la alter_bit_bitnum_SOURCES = alter_bit_bitnum.c alter_bit_bitnum_OBJECTS = alter_bit_bitnum.$(OBJEXT) alter_bit_bitnum_LDADD = $(LDADD) alter_bit_bitnum_DEPENDENCIES = ../src/libgetdata.la alter_bit_numbits_SOURCES = alter_bit_numbits.c alter_bit_numbits_OBJECTS = alter_bit_numbits.$(OBJEXT) alter_bit_numbits_LDADD = $(LDADD) alter_bit_numbits_DEPENDENCIES = ../src/libgetdata.la alter_carray_len_SOURCES = alter_carray_len.c alter_carray_len_OBJECTS = alter_carray_len.$(OBJEXT) alter_carray_len_LDADD = $(LDADD) alter_carray_len_DEPENDENCIES = ../src/libgetdata.la alter_carray_type_SOURCES = alter_carray_type.c alter_carray_type_OBJECTS = alter_carray_type.$(OBJEXT) alter_carray_type_LDADD = $(LDADD) alter_carray_type_DEPENDENCIES = ../src/libgetdata.la alter_clincom_SOURCES = alter_clincom.c alter_clincom_OBJECTS = alter_clincom.$(OBJEXT) alter_clincom_LDADD = $(LDADD) alter_clincom_DEPENDENCIES = ../src/libgetdata.la alter_const_SOURCES = alter_const.c alter_const_OBJECTS = alter_const.$(OBJEXT) alter_const_LDADD = $(LDADD) alter_const_DEPENDENCIES = ../src/libgetdata.la alter_const_c2r_SOURCES = alter_const_c2r.c alter_const_c2r_OBJECTS = alter_const_c2r.$(OBJEXT) alter_const_c2r_LDADD = $(LDADD) alter_const_c2r_DEPENDENCIES = ../src/libgetdata.la alter_const_r2c_SOURCES = alter_const_r2c.c alter_const_r2c_OBJECTS = alter_const_r2c.$(OBJEXT) alter_const_r2c_LDADD = $(LDADD) alter_const_r2c_DEPENDENCIES = ../src/libgetdata.la alter_const_r2r_SOURCES = alter_const_r2r.c alter_const_r2r_OBJECTS = alter_const_r2r.$(OBJEXT) alter_const_r2r_LDADD = $(LDADD) alter_const_r2r_DEPENDENCIES = ../src/libgetdata.la alter_cpolynom_SOURCES = alter_cpolynom.c alter_cpolynom_OBJECTS = alter_cpolynom.$(OBJEXT) alter_cpolynom_LDADD = $(LDADD) alter_cpolynom_DEPENDENCIES = ../src/libgetdata.la alter_cpolynom_null_SOURCES = alter_cpolynom_null.c alter_cpolynom_null_OBJECTS = alter_cpolynom_null.$(OBJEXT) alter_cpolynom_null_LDADD = $(LDADD) alter_cpolynom_null_DEPENDENCIES = ../src/libgetdata.la alter_crecip_SOURCES = alter_crecip.c alter_crecip_OBJECTS = alter_crecip.$(OBJEXT) alter_crecip_LDADD = $(LDADD) alter_crecip_DEPENDENCIES = ../src/libgetdata.la alter_crecip89_SOURCES = alter_crecip89.c alter_crecip89_OBJECTS = alter_crecip89.$(OBJEXT) alter_crecip89_LDADD = $(LDADD) alter_crecip89_DEPENDENCIES = ../src/libgetdata.la alter_crecip89_null_SOURCES = alter_crecip89_null.c alter_crecip89_null_OBJECTS = alter_crecip89_null.$(OBJEXT) alter_crecip89_null_LDADD = $(LDADD) alter_crecip89_null_DEPENDENCIES = ../src/libgetdata.la alter_crecip_zero_SOURCES = alter_crecip_zero.c alter_crecip_zero_OBJECTS = alter_crecip_zero.$(OBJEXT) alter_crecip_zero_LDADD = $(LDADD) alter_crecip_zero_DEPENDENCIES = ../src/libgetdata.la alter_divide_SOURCES = alter_divide.c alter_divide_OBJECTS = alter_divide.$(OBJEXT) alter_divide_LDADD = $(LDADD) alter_divide_DEPENDENCIES = ../src/libgetdata.la alter_entry_SOURCES = alter_entry.c alter_entry_OBJECTS = alter_entry.$(OBJEXT) alter_entry_LDADD = $(LDADD) alter_entry_DEPENDENCIES = ../src/libgetdata.la alter_entry_affix_SOURCES = alter_entry_affix.c alter_entry_affix_OBJECTS = alter_entry_affix.$(OBJEXT) alter_entry_affix_LDADD = $(LDADD) alter_entry_affix_DEPENDENCIES = ../src/libgetdata.la alter_entry_hidden_SOURCES = alter_entry_hidden.c alter_entry_hidden_OBJECTS = alter_entry_hidden.$(OBJEXT) alter_entry_hidden_LDADD = $(LDADD) alter_entry_hidden_DEPENDENCIES = ../src/libgetdata.la alter_entry_lincom_SOURCES = alter_entry_lincom.c alter_entry_lincom_OBJECTS = alter_entry_lincom.$(OBJEXT) alter_entry_lincom_LDADD = $(LDADD) alter_entry_lincom_DEPENDENCIES = ../src/libgetdata.la alter_entry_recode_SOURCES = alter_entry_recode.c alter_entry_recode_OBJECTS = alter_entry_recode.$(OBJEXT) alter_entry_recode_LDADD = $(LDADD) alter_entry_recode_DEPENDENCIES = ../src/libgetdata.la alter_entry_recode_recalc_SOURCES = alter_entry_recode_recalc.c alter_entry_recode_recalc_OBJECTS = \ alter_entry_recode_recalc.$(OBJEXT) alter_entry_recode_recalc_LDADD = $(LDADD) alter_entry_recode_recalc_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar1_SOURCES = alter_entry_scalar1.c alter_entry_scalar1_OBJECTS = alter_entry_scalar1.$(OBJEXT) alter_entry_scalar1_LDADD = $(LDADD) alter_entry_scalar1_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar2a_SOURCES = alter_entry_scalar2a.c alter_entry_scalar2a_OBJECTS = alter_entry_scalar2a.$(OBJEXT) alter_entry_scalar2a_LDADD = $(LDADD) alter_entry_scalar2a_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar2n_SOURCES = alter_entry_scalar2n.c alter_entry_scalar2n_OBJECTS = alter_entry_scalar2n.$(OBJEXT) alter_entry_scalar2n_LDADD = $(LDADD) alter_entry_scalar2n_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar3_SOURCES = alter_entry_scalar3.c alter_entry_scalar3_OBJECTS = alter_entry_scalar3.$(OBJEXT) alter_entry_scalar3_LDADD = $(LDADD) alter_entry_scalar3_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar3c_SOURCES = alter_entry_scalar3c.c alter_entry_scalar3c_OBJECTS = alter_entry_scalar3c.$(OBJEXT) alter_entry_scalar3c_LDADD = $(LDADD) alter_entry_scalar3c_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar4_SOURCES = alter_entry_scalar4.c alter_entry_scalar4_OBJECTS = alter_entry_scalar4.$(OBJEXT) alter_entry_scalar4_LDADD = $(LDADD) alter_entry_scalar4_DEPENDENCIES = ../src/libgetdata.la alter_entry_scalar_amb_SOURCES = alter_entry_scalar_amb.c alter_entry_scalar_amb_OBJECTS = alter_entry_scalar_amb.$(OBJEXT) alter_entry_scalar_amb_LDADD = $(LDADD) alter_entry_scalar_amb_DEPENDENCIES = ../src/libgetdata.la alter_index_SOURCES = alter_index.c alter_index_OBJECTS = alter_index.$(OBJEXT) alter_index_LDADD = $(LDADD) alter_index_DEPENDENCIES = ../src/libgetdata.la alter_lincom_23_SOURCES = alter_lincom_23.c alter_lincom_23_OBJECTS = alter_lincom_23.$(OBJEXT) alter_lincom_23_LDADD = $(LDADD) alter_lincom_23_DEPENDENCIES = ../src/libgetdata.la alter_lincom_32_SOURCES = alter_lincom_32.c alter_lincom_32_OBJECTS = alter_lincom_32.$(OBJEXT) alter_lincom_32_LDADD = $(LDADD) alter_lincom_32_DEPENDENCIES = ../src/libgetdata.la alter_lincom_affix_SOURCES = alter_lincom_affix.c alter_lincom_affix_OBJECTS = alter_lincom_affix.$(OBJEXT) alter_lincom_affix_LDADD = $(LDADD) alter_lincom_affix_DEPENDENCIES = ../src/libgetdata.la alter_lincom_input_SOURCES = alter_lincom_input.c alter_lincom_input_OBJECTS = alter_lincom_input.$(OBJEXT) alter_lincom_input_LDADD = $(LDADD) alter_lincom_input_DEPENDENCIES = ../src/libgetdata.la alter_lincom_offset_SOURCES = alter_lincom_offset.c alter_lincom_offset_OBJECTS = alter_lincom_offset.$(OBJEXT) alter_lincom_offset_LDADD = $(LDADD) alter_lincom_offset_DEPENDENCIES = ../src/libgetdata.la alter_lincom_slope_SOURCES = alter_lincom_slope.c alter_lincom_slope_OBJECTS = alter_lincom_slope.$(OBJEXT) alter_lincom_slope_LDADD = $(LDADD) alter_lincom_slope_DEPENDENCIES = ../src/libgetdata.la alter_linterp_SOURCES = alter_linterp.c alter_linterp_OBJECTS = alter_linterp.$(OBJEXT) alter_linterp_LDADD = $(LDADD) alter_linterp_DEPENDENCIES = ../src/libgetdata.la alter_linterp_move_SOURCES = alter_linterp_move.c alter_linterp_move_OBJECTS = alter_linterp_move.$(OBJEXT) alter_linterp_move_LDADD = $(LDADD) alter_linterp_move_DEPENDENCIES = ../src/libgetdata.la alter_mplex_SOURCES = alter_mplex.c alter_mplex_OBJECTS = alter_mplex.$(OBJEXT) alter_mplex_LDADD = $(LDADD) alter_mplex_DEPENDENCIES = ../src/libgetdata.la alter_mspec_SOURCES = alter_mspec.c alter_mspec_OBJECTS = alter_mspec.$(OBJEXT) alter_mspec_LDADD = $(LDADD) alter_mspec_DEPENDENCIES = ../src/libgetdata.la alter_mspec_affix_SOURCES = alter_mspec_affix.c alter_mspec_affix_OBJECTS = alter_mspec_affix.$(OBJEXT) alter_mspec_affix_LDADD = $(LDADD) alter_mspec_affix_DEPENDENCIES = ../src/libgetdata.la alter_multiply_SOURCES = alter_multiply.c alter_multiply_OBJECTS = alter_multiply.$(OBJEXT) alter_multiply_LDADD = $(LDADD) alter_multiply_DEPENDENCIES = ../src/libgetdata.la alter_phase_SOURCES = alter_phase.c alter_phase_OBJECTS = alter_phase.$(OBJEXT) alter_phase_LDADD = $(LDADD) alter_phase_DEPENDENCIES = ../src/libgetdata.la alter_polynom_coeff_SOURCES = alter_polynom_coeff.c alter_polynom_coeff_OBJECTS = alter_polynom_coeff.$(OBJEXT) alter_polynom_coeff_LDADD = $(LDADD) alter_polynom_coeff_DEPENDENCIES = ../src/libgetdata.la alter_polynom_input_SOURCES = alter_polynom_input.c alter_polynom_input_OBJECTS = alter_polynom_input.$(OBJEXT) alter_polynom_input_LDADD = $(LDADD) alter_polynom_input_DEPENDENCIES = ../src/libgetdata.la alter_polynom_ord_SOURCES = alter_polynom_ord.c alter_polynom_ord_OBJECTS = alter_polynom_ord.$(OBJEXT) alter_polynom_ord_LDADD = $(LDADD) alter_polynom_ord_DEPENDENCIES = ../src/libgetdata.la alter_raw_spf_SOURCES = alter_raw_spf.c alter_raw_spf_OBJECTS = alter_raw_spf.$(OBJEXT) alter_raw_spf_LDADD = $(LDADD) alter_raw_spf_DEPENDENCIES = ../src/libgetdata.la alter_raw_type_SOURCES = alter_raw_type.c alter_raw_type_OBJECTS = alter_raw_type.$(OBJEXT) alter_raw_type_LDADD = $(LDADD) alter_raw_type_DEPENDENCIES = ../src/libgetdata.la alter_recip_SOURCES = alter_recip.c alter_recip_OBJECTS = alter_recip.$(OBJEXT) alter_recip_LDADD = $(LDADD) alter_recip_DEPENDENCIES = ../src/libgetdata.la alter_recip_zero_SOURCES = alter_recip_zero.c alter_recip_zero_OBJECTS = alter_recip_zero.$(OBJEXT) alter_recip_zero_LDADD = $(LDADD) alter_recip_zero_DEPENDENCIES = ../src/libgetdata.la alter_scalar_affix_SOURCES = alter_scalar_affix.c alter_scalar_affix_OBJECTS = alter_scalar_affix.$(OBJEXT) alter_scalar_affix_LDADD = $(LDADD) alter_scalar_affix_DEPENDENCIES = ../src/libgetdata.la alter_spec_SOURCES = alter_spec.c alter_spec_OBJECTS = alter_spec.$(OBJEXT) alter_spec_LDADD = $(LDADD) alter_spec_DEPENDENCIES = ../src/libgetdata.la alter_spec_affix_SOURCES = alter_spec_affix.c alter_spec_affix_OBJECTS = alter_spec_affix.$(OBJEXT) alter_spec_affix_LDADD = $(LDADD) alter_spec_affix_DEPENDENCIES = ../src/libgetdata.la alter_spec_meta_SOURCES = alter_spec_meta.c alter_spec_meta_OBJECTS = alter_spec_meta.$(OBJEXT) alter_spec_meta_LDADD = $(LDADD) alter_spec_meta_DEPENDENCIES = ../src/libgetdata.la alter_spec_polynom_SOURCES = alter_spec_polynom.c alter_spec_polynom_OBJECTS = alter_spec_polynom.$(OBJEXT) alter_spec_polynom_LDADD = $(LDADD) alter_spec_polynom_DEPENDENCIES = ../src/libgetdata.la alter_window_SOURCES = alter_window.c alter_window_OBJECTS = alter_window.$(OBJEXT) alter_window_LDADD = $(LDADD) alter_window_DEPENDENCIES = ../src/libgetdata.la ascii_add_SOURCES = ascii_add.c ascii_add_OBJECTS = ascii_add.$(OBJEXT) ascii_add_LDADD = $(LDADD) ascii_add_DEPENDENCIES = ../src/libgetdata.la ascii_get_SOURCES = ascii_get.c ascii_get_OBJECTS = ascii_get.$(OBJEXT) ascii_get_LDADD = $(LDADD) ascii_get_DEPENDENCIES = ../src/libgetdata.la ascii_get_complex_SOURCES = ascii_get_complex.c ascii_get_complex_OBJECTS = ascii_get_complex.$(OBJEXT) ascii_get_complex_LDADD = $(LDADD) ascii_get_complex_DEPENDENCIES = ../src/libgetdata.la ascii_get_get_SOURCES = ascii_get_get.c ascii_get_get_OBJECTS = ascii_get_get.$(OBJEXT) ascii_get_get_LDADD = $(LDADD) ascii_get_get_DEPENDENCIES = ../src/libgetdata.la ascii_get_here_SOURCES = ascii_get_here.c ascii_get_here_OBJECTS = ascii_get_here.$(OBJEXT) ascii_get_here_LDADD = $(LDADD) ascii_get_here_DEPENDENCIES = ../src/libgetdata.la ascii_get_sub_SOURCES = ascii_get_sub.c ascii_get_sub_OBJECTS = ascii_get_sub.$(OBJEXT) ascii_get_sub_LDADD = $(LDADD) ascii_get_sub_DEPENDENCIES = ../src/libgetdata.la ascii_nframes_SOURCES = ascii_nframes.c ascii_nframes_OBJECTS = ascii_nframes.$(OBJEXT) ascii_nframes_LDADD = $(LDADD) ascii_nframes_DEPENDENCIES = ../src/libgetdata.la ascii_put_SOURCES = ascii_put.c ascii_put_OBJECTS = ascii_put.$(OBJEXT) ascii_put_LDADD = $(LDADD) ascii_put_DEPENDENCIES = ../src/libgetdata.la ascii_put_here_SOURCES = ascii_put_here.c ascii_put_here_OBJECTS = ascii_put_here.$(OBJEXT) ascii_put_here_LDADD = $(LDADD) ascii_put_here_DEPENDENCIES = ../src/libgetdata.la ascii_seek_SOURCES = ascii_seek.c ascii_seek_OBJECTS = ascii_seek.$(OBJEXT) ascii_seek_LDADD = $(LDADD) ascii_seek_DEPENDENCIES = ../src/libgetdata.la ascii_seek_far_SOURCES = ascii_seek_far.c ascii_seek_far_OBJECTS = ascii_seek_far.$(OBJEXT) ascii_seek_far_LDADD = $(LDADD) ascii_seek_far_DEPENDENCIES = ../src/libgetdata.la ascii_sync_SOURCES = ascii_sync.c ascii_sync_OBJECTS = ascii_sync.$(OBJEXT) ascii_sync_LDADD = $(LDADD) ascii_sync_DEPENDENCIES = ../src/libgetdata.la bof_SOURCES = bof.c bof_OBJECTS = bof.$(OBJEXT) bof_LDADD = $(LDADD) bof_DEPENDENCIES = ../src/libgetdata.la bof_bit_SOURCES = bof_bit.c bof_bit_OBJECTS = bof_bit.$(OBJEXT) bof_bit_LDADD = $(LDADD) bof_bit_DEPENDENCIES = ../src/libgetdata.la bof_index_SOURCES = bof_index.c bof_index_OBJECTS = bof_index.$(OBJEXT) bof_index_LDADD = $(LDADD) bof_index_DEPENDENCIES = ../src/libgetdata.la bof_lincom_SOURCES = bof_lincom.c bof_lincom_OBJECTS = bof_lincom.$(OBJEXT) bof_lincom_LDADD = $(LDADD) bof_lincom_DEPENDENCIES = ../src/libgetdata.la bof_phase_SOURCES = bof_phase.c bof_phase_OBJECTS = bof_phase.$(OBJEXT) bof_phase_LDADD = $(LDADD) bof_phase_DEPENDENCIES = ../src/libgetdata.la bof_phase_neg_SOURCES = bof_phase_neg.c bof_phase_neg_OBJECTS = bof_phase_neg.$(OBJEXT) bof_phase_neg_LDADD = $(LDADD) bof_phase_neg_DEPENDENCIES = ../src/libgetdata.la bzip_add_SOURCES = bzip_add.c bzip_add_OBJECTS = bzip_add.$(OBJEXT) bzip_add_LDADD = $(LDADD) bzip_add_DEPENDENCIES = ../src/libgetdata.la bzip_get_SOURCES = bzip_get.c bzip_get_OBJECTS = bzip_get.$(OBJEXT) bzip_get_LDADD = $(LDADD) bzip_get_DEPENDENCIES = ../src/libgetdata.la bzip_get_far_SOURCES = bzip_get_far.c bzip_get_far_OBJECTS = bzip_get_far.$(OBJEXT) bzip_get_far_LDADD = $(LDADD) bzip_get_far_DEPENDENCIES = ../src/libgetdata.la bzip_get_get_SOURCES = bzip_get_get.c bzip_get_get_OBJECTS = bzip_get_get.$(OBJEXT) bzip_get_get_LDADD = $(LDADD) bzip_get_get_DEPENDENCIES = ../src/libgetdata.la bzip_get_get2_SOURCES = bzip_get_get2.c bzip_get_get2_OBJECTS = bzip_get_get2.$(OBJEXT) bzip_get_get2_LDADD = $(LDADD) bzip_get_get2_DEPENDENCIES = ../src/libgetdata.la bzip_get_put_SOURCES = bzip_get_put.c bzip_get_put_OBJECTS = bzip_get_put.$(OBJEXT) bzip_get_put_LDADD = $(LDADD) bzip_get_put_DEPENDENCIES = ../src/libgetdata.la bzip_move_from_SOURCES = bzip_move_from.c bzip_move_from_OBJECTS = bzip_move_from.$(OBJEXT) bzip_move_from_LDADD = $(LDADD) bzip_move_from_DEPENDENCIES = ../src/libgetdata.la bzip_move_to_SOURCES = bzip_move_to.c bzip_move_to_OBJECTS = bzip_move_to.$(OBJEXT) bzip_move_to_LDADD = $(LDADD) bzip_move_to_DEPENDENCIES = ../src/libgetdata.la bzip_nframes_SOURCES = bzip_nframes.c bzip_nframes_OBJECTS = bzip_nframes.$(OBJEXT) bzip_nframes_LDADD = $(LDADD) bzip_nframes_DEPENDENCIES = ../src/libgetdata.la bzip_put_SOURCES = bzip_put.c bzip_put_OBJECTS = bzip_put.$(OBJEXT) bzip_put_LDADD = $(LDADD) bzip_put_DEPENDENCIES = ../src/libgetdata.la bzip_put_back_SOURCES = bzip_put_back.c bzip_put_back_OBJECTS = bzip_put_back.$(OBJEXT) bzip_put_back_LDADD = $(LDADD) bzip_put_back_DEPENDENCIES = ../src/libgetdata.la bzip_put_endian_SOURCES = bzip_put_endian.c bzip_put_endian_OBJECTS = bzip_put_endian.$(OBJEXT) bzip_put_endian_LDADD = $(LDADD) bzip_put_endian_DEPENDENCIES = ../src/libgetdata.la bzip_put_get_SOURCES = bzip_put_get.c bzip_put_get_OBJECTS = bzip_put_get.$(OBJEXT) bzip_put_get_LDADD = $(LDADD) bzip_put_get_DEPENDENCIES = ../src/libgetdata.la bzip_put_pad_SOURCES = bzip_put_pad.c bzip_put_pad_OBJECTS = bzip_put_pad.$(OBJEXT) bzip_put_pad_LDADD = $(LDADD) bzip_put_pad_DEPENDENCIES = ../src/libgetdata.la bzip_put_sub_SOURCES = bzip_put_sub.c bzip_put_sub_OBJECTS = bzip_put_sub.$(OBJEXT) bzip_put_sub_LDADD = $(LDADD) bzip_put_sub_DEPENDENCIES = ../src/libgetdata.la bzip_seek_SOURCES = bzip_seek.c bzip_seek_OBJECTS = bzip_seek.$(OBJEXT) bzip_seek_LDADD = $(LDADD) bzip_seek_DEPENDENCIES = ../src/libgetdata.la bzip_seek_far_SOURCES = bzip_seek_far.c bzip_seek_far_OBJECTS = bzip_seek_far.$(OBJEXT) bzip_seek_far_LDADD = $(LDADD) bzip_seek_far_DEPENDENCIES = ../src/libgetdata.la bzip_sync_SOURCES = bzip_sync.c bzip_sync_OBJECTS = bzip_sync.$(OBJEXT) bzip_sync_LDADD = $(LDADD) bzip_sync_DEPENDENCIES = ../src/libgetdata.la close_bad_SOURCES = close_bad.c close_bad_OBJECTS = close_bad.$(OBJEXT) close_bad_LDADD = $(LDADD) close_bad_DEPENDENCIES = ../src/libgetdata.la close_close_SOURCES = close_close.c close_close_OBJECTS = close_close.$(OBJEXT) close_close_LDADD = $(LDADD) close_close_DEPENDENCIES = ../src/libgetdata.la close_discard_SOURCES = close_discard.c close_discard_OBJECTS = close_discard.$(OBJEXT) close_discard_LDADD = $(LDADD) close_discard_DEPENDENCIES = ../src/libgetdata.la close_null_SOURCES = close_null.c close_null_OBJECTS = close_null.$(OBJEXT) close_null_LDADD = $(LDADD) close_null_DEPENDENCIES = ../src/libgetdata.la convert_complex128_complex64_SOURCES = convert_complex128_complex64.c convert_complex128_complex64_OBJECTS = \ convert_complex128_complex64.$(OBJEXT) convert_complex128_complex64_LDADD = $(LDADD) convert_complex128_complex64_DEPENDENCIES = ../src/libgetdata.la convert_complex128_float64_SOURCES = convert_complex128_float64.c convert_complex128_float64_OBJECTS = \ convert_complex128_float64.$(OBJEXT) convert_complex128_float64_LDADD = $(LDADD) convert_complex128_float64_DEPENDENCIES = ../src/libgetdata.la convert_complex128_int64_SOURCES = convert_complex128_int64.c convert_complex128_int64_OBJECTS = convert_complex128_int64.$(OBJEXT) convert_complex128_int64_LDADD = $(LDADD) convert_complex128_int64_DEPENDENCIES = ../src/libgetdata.la convert_complex128_uint64_SOURCES = convert_complex128_uint64.c convert_complex128_uint64_OBJECTS = \ convert_complex128_uint64.$(OBJEXT) convert_complex128_uint64_LDADD = $(LDADD) convert_complex128_uint64_DEPENDENCIES = ../src/libgetdata.la convert_complex64_complex128_SOURCES = convert_complex64_complex128.c convert_complex64_complex128_OBJECTS = \ convert_complex64_complex128.$(OBJEXT) convert_complex64_complex128_LDADD = $(LDADD) convert_complex64_complex128_DEPENDENCIES = ../src/libgetdata.la convert_complex64_float64_SOURCES = convert_complex64_float64.c convert_complex64_float64_OBJECTS = \ convert_complex64_float64.$(OBJEXT) convert_complex64_float64_LDADD = $(LDADD) convert_complex64_float64_DEPENDENCIES = ../src/libgetdata.la convert_complex64_int64_SOURCES = convert_complex64_int64.c convert_complex64_int64_OBJECTS = convert_complex64_int64.$(OBJEXT) convert_complex64_int64_LDADD = $(LDADD) convert_complex64_int64_DEPENDENCIES = ../src/libgetdata.la convert_complex64_uint64_SOURCES = convert_complex64_uint64.c convert_complex64_uint64_OBJECTS = convert_complex64_uint64.$(OBJEXT) convert_complex64_uint64_LDADD = $(LDADD) convert_complex64_uint64_DEPENDENCIES = ../src/libgetdata.la convert_float32_complex128_SOURCES = convert_float32_complex128.c convert_float32_complex128_OBJECTS = \ convert_float32_complex128.$(OBJEXT) convert_float32_complex128_LDADD = $(LDADD) convert_float32_complex128_DEPENDENCIES = ../src/libgetdata.la convert_float32_complex64_SOURCES = convert_float32_complex64.c convert_float32_complex64_OBJECTS = \ convert_float32_complex64.$(OBJEXT) convert_float32_complex64_LDADD = $(LDADD) convert_float32_complex64_DEPENDENCIES = ../src/libgetdata.la convert_float32_float64_SOURCES = convert_float32_float64.c convert_float32_float64_OBJECTS = convert_float32_float64.$(OBJEXT) convert_float32_float64_LDADD = $(LDADD) convert_float32_float64_DEPENDENCIES = ../src/libgetdata.la convert_float32_int16_SOURCES = convert_float32_int16.c convert_float32_int16_OBJECTS = convert_float32_int16.$(OBJEXT) convert_float32_int16_LDADD = $(LDADD) convert_float32_int16_DEPENDENCIES = ../src/libgetdata.la convert_float32_int32_SOURCES = convert_float32_int32.c convert_float32_int32_OBJECTS = convert_float32_int32.$(OBJEXT) convert_float32_int32_LDADD = $(LDADD) convert_float32_int32_DEPENDENCIES = ../src/libgetdata.la convert_float32_int64_SOURCES = convert_float32_int64.c convert_float32_int64_OBJECTS = convert_float32_int64.$(OBJEXT) convert_float32_int64_LDADD = $(LDADD) convert_float32_int64_DEPENDENCIES = ../src/libgetdata.la convert_float32_int8_SOURCES = convert_float32_int8.c convert_float32_int8_OBJECTS = convert_float32_int8.$(OBJEXT) convert_float32_int8_LDADD = $(LDADD) convert_float32_int8_DEPENDENCIES = ../src/libgetdata.la convert_float32_uint16_SOURCES = convert_float32_uint16.c convert_float32_uint16_OBJECTS = convert_float32_uint16.$(OBJEXT) convert_float32_uint16_LDADD = $(LDADD) convert_float32_uint16_DEPENDENCIES = ../src/libgetdata.la convert_float32_uint32_SOURCES = convert_float32_uint32.c convert_float32_uint32_OBJECTS = convert_float32_uint32.$(OBJEXT) convert_float32_uint32_LDADD = $(LDADD) convert_float32_uint32_DEPENDENCIES = ../src/libgetdata.la convert_float32_uint64_SOURCES = convert_float32_uint64.c convert_float32_uint64_OBJECTS = convert_float32_uint64.$(OBJEXT) convert_float32_uint64_LDADD = $(LDADD) convert_float32_uint64_DEPENDENCIES = ../src/libgetdata.la convert_float32_uint8_SOURCES = convert_float32_uint8.c convert_float32_uint8_OBJECTS = convert_float32_uint8.$(OBJEXT) convert_float32_uint8_LDADD = $(LDADD) convert_float32_uint8_DEPENDENCIES = ../src/libgetdata.la convert_float64_complex128_SOURCES = convert_float64_complex128.c convert_float64_complex128_OBJECTS = \ convert_float64_complex128.$(OBJEXT) convert_float64_complex128_LDADD = $(LDADD) convert_float64_complex128_DEPENDENCIES = ../src/libgetdata.la convert_float64_complex64_SOURCES = convert_float64_complex64.c convert_float64_complex64_OBJECTS = \ convert_float64_complex64.$(OBJEXT) convert_float64_complex64_LDADD = $(LDADD) convert_float64_complex64_DEPENDENCIES = ../src/libgetdata.la convert_float64_float32_SOURCES = convert_float64_float32.c convert_float64_float32_OBJECTS = convert_float64_float32.$(OBJEXT) convert_float64_float32_LDADD = $(LDADD) convert_float64_float32_DEPENDENCIES = ../src/libgetdata.la convert_float64_int16_SOURCES = convert_float64_int16.c convert_float64_int16_OBJECTS = convert_float64_int16.$(OBJEXT) convert_float64_int16_LDADD = $(LDADD) convert_float64_int16_DEPENDENCIES = ../src/libgetdata.la convert_float64_int32_SOURCES = convert_float64_int32.c convert_float64_int32_OBJECTS = convert_float64_int32.$(OBJEXT) convert_float64_int32_LDADD = $(LDADD) convert_float64_int32_DEPENDENCIES = ../src/libgetdata.la convert_float64_int64_SOURCES = convert_float64_int64.c convert_float64_int64_OBJECTS = convert_float64_int64.$(OBJEXT) convert_float64_int64_LDADD = $(LDADD) convert_float64_int64_DEPENDENCIES = ../src/libgetdata.la convert_float64_int8_SOURCES = convert_float64_int8.c convert_float64_int8_OBJECTS = convert_float64_int8.$(OBJEXT) convert_float64_int8_LDADD = $(LDADD) convert_float64_int8_DEPENDENCIES = ../src/libgetdata.la convert_float64_uint16_SOURCES = convert_float64_uint16.c convert_float64_uint16_OBJECTS = convert_float64_uint16.$(OBJEXT) convert_float64_uint16_LDADD = $(LDADD) convert_float64_uint16_DEPENDENCIES = ../src/libgetdata.la convert_float64_uint32_SOURCES = convert_float64_uint32.c convert_float64_uint32_OBJECTS = convert_float64_uint32.$(OBJEXT) convert_float64_uint32_LDADD = $(LDADD) convert_float64_uint32_DEPENDENCIES = ../src/libgetdata.la convert_float64_uint64_SOURCES = convert_float64_uint64.c convert_float64_uint64_OBJECTS = convert_float64_uint64.$(OBJEXT) convert_float64_uint64_LDADD = $(LDADD) convert_float64_uint64_DEPENDENCIES = ../src/libgetdata.la convert_float64_uint8_SOURCES = convert_float64_uint8.c convert_float64_uint8_OBJECTS = convert_float64_uint8.$(OBJEXT) convert_float64_uint8_LDADD = $(LDADD) convert_float64_uint8_DEPENDENCIES = ../src/libgetdata.la convert_int16_complex128_SOURCES = convert_int16_complex128.c convert_int16_complex128_OBJECTS = convert_int16_complex128.$(OBJEXT) convert_int16_complex128_LDADD = $(LDADD) convert_int16_complex128_DEPENDENCIES = ../src/libgetdata.la convert_int16_complex64_SOURCES = convert_int16_complex64.c convert_int16_complex64_OBJECTS = convert_int16_complex64.$(OBJEXT) convert_int16_complex64_LDADD = $(LDADD) convert_int16_complex64_DEPENDENCIES = ../src/libgetdata.la convert_int16_float32_SOURCES = convert_int16_float32.c convert_int16_float32_OBJECTS = convert_int16_float32.$(OBJEXT) convert_int16_float32_LDADD = $(LDADD) convert_int16_float32_DEPENDENCIES = ../src/libgetdata.la convert_int16_float64_SOURCES = convert_int16_float64.c convert_int16_float64_OBJECTS = convert_int16_float64.$(OBJEXT) convert_int16_float64_LDADD = $(LDADD) convert_int16_float64_DEPENDENCIES = ../src/libgetdata.la convert_int16_int32_SOURCES = convert_int16_int32.c convert_int16_int32_OBJECTS = convert_int16_int32.$(OBJEXT) convert_int16_int32_LDADD = $(LDADD) convert_int16_int32_DEPENDENCIES = ../src/libgetdata.la convert_int16_int64_SOURCES = convert_int16_int64.c convert_int16_int64_OBJECTS = convert_int16_int64.$(OBJEXT) convert_int16_int64_LDADD = $(LDADD) convert_int16_int64_DEPENDENCIES = ../src/libgetdata.la convert_int16_int8_SOURCES = convert_int16_int8.c convert_int16_int8_OBJECTS = convert_int16_int8.$(OBJEXT) convert_int16_int8_LDADD = $(LDADD) convert_int16_int8_DEPENDENCIES = ../src/libgetdata.la convert_int16_uint16_SOURCES = convert_int16_uint16.c convert_int16_uint16_OBJECTS = convert_int16_uint16.$(OBJEXT) convert_int16_uint16_LDADD = $(LDADD) convert_int16_uint16_DEPENDENCIES = ../src/libgetdata.la convert_int16_uint32_SOURCES = convert_int16_uint32.c convert_int16_uint32_OBJECTS = convert_int16_uint32.$(OBJEXT) convert_int16_uint32_LDADD = $(LDADD) convert_int16_uint32_DEPENDENCIES = ../src/libgetdata.la convert_int16_uint64_SOURCES = convert_int16_uint64.c convert_int16_uint64_OBJECTS = convert_int16_uint64.$(OBJEXT) convert_int16_uint64_LDADD = $(LDADD) convert_int16_uint64_DEPENDENCIES = ../src/libgetdata.la convert_int16_uint8_SOURCES = convert_int16_uint8.c convert_int16_uint8_OBJECTS = convert_int16_uint8.$(OBJEXT) convert_int16_uint8_LDADD = $(LDADD) convert_int16_uint8_DEPENDENCIES = ../src/libgetdata.la convert_int32_complex128_SOURCES = convert_int32_complex128.c convert_int32_complex128_OBJECTS = convert_int32_complex128.$(OBJEXT) convert_int32_complex128_LDADD = $(LDADD) convert_int32_complex128_DEPENDENCIES = ../src/libgetdata.la convert_int32_complex64_SOURCES = convert_int32_complex64.c convert_int32_complex64_OBJECTS = convert_int32_complex64.$(OBJEXT) convert_int32_complex64_LDADD = $(LDADD) convert_int32_complex64_DEPENDENCIES = ../src/libgetdata.la convert_int32_float32_SOURCES = convert_int32_float32.c convert_int32_float32_OBJECTS = convert_int32_float32.$(OBJEXT) convert_int32_float32_LDADD = $(LDADD) convert_int32_float32_DEPENDENCIES = ../src/libgetdata.la convert_int32_float64_SOURCES = convert_int32_float64.c convert_int32_float64_OBJECTS = convert_int32_float64.$(OBJEXT) convert_int32_float64_LDADD = $(LDADD) convert_int32_float64_DEPENDENCIES = ../src/libgetdata.la convert_int32_int16_SOURCES = convert_int32_int16.c convert_int32_int16_OBJECTS = convert_int32_int16.$(OBJEXT) convert_int32_int16_LDADD = $(LDADD) convert_int32_int16_DEPENDENCIES = ../src/libgetdata.la convert_int32_int64_SOURCES = convert_int32_int64.c convert_int32_int64_OBJECTS = convert_int32_int64.$(OBJEXT) convert_int32_int64_LDADD = $(LDADD) convert_int32_int64_DEPENDENCIES = ../src/libgetdata.la convert_int32_int8_SOURCES = convert_int32_int8.c convert_int32_int8_OBJECTS = convert_int32_int8.$(OBJEXT) convert_int32_int8_LDADD = $(LDADD) convert_int32_int8_DEPENDENCIES = ../src/libgetdata.la convert_int32_uint16_SOURCES = convert_int32_uint16.c convert_int32_uint16_OBJECTS = convert_int32_uint16.$(OBJEXT) convert_int32_uint16_LDADD = $(LDADD) convert_int32_uint16_DEPENDENCIES = ../src/libgetdata.la convert_int32_uint32_SOURCES = convert_int32_uint32.c convert_int32_uint32_OBJECTS = convert_int32_uint32.$(OBJEXT) convert_int32_uint32_LDADD = $(LDADD) convert_int32_uint32_DEPENDENCIES = ../src/libgetdata.la convert_int32_uint64_SOURCES = convert_int32_uint64.c convert_int32_uint64_OBJECTS = convert_int32_uint64.$(OBJEXT) convert_int32_uint64_LDADD = $(LDADD) convert_int32_uint64_DEPENDENCIES = ../src/libgetdata.la convert_int32_uint8_SOURCES = convert_int32_uint8.c convert_int32_uint8_OBJECTS = convert_int32_uint8.$(OBJEXT) convert_int32_uint8_LDADD = $(LDADD) convert_int32_uint8_DEPENDENCIES = ../src/libgetdata.la convert_int64_complex128_SOURCES = convert_int64_complex128.c convert_int64_complex128_OBJECTS = convert_int64_complex128.$(OBJEXT) convert_int64_complex128_LDADD = $(LDADD) convert_int64_complex128_DEPENDENCIES = ../src/libgetdata.la convert_int64_complex64_SOURCES = convert_int64_complex64.c convert_int64_complex64_OBJECTS = convert_int64_complex64.$(OBJEXT) convert_int64_complex64_LDADD = $(LDADD) convert_int64_complex64_DEPENDENCIES = ../src/libgetdata.la convert_int64_float32_SOURCES = convert_int64_float32.c convert_int64_float32_OBJECTS = convert_int64_float32.$(OBJEXT) convert_int64_float32_LDADD = $(LDADD) convert_int64_float32_DEPENDENCIES = ../src/libgetdata.la convert_int64_float64_SOURCES = convert_int64_float64.c convert_int64_float64_OBJECTS = convert_int64_float64.$(OBJEXT) convert_int64_float64_LDADD = $(LDADD) convert_int64_float64_DEPENDENCIES = ../src/libgetdata.la convert_int64_int16_SOURCES = convert_int64_int16.c convert_int64_int16_OBJECTS = convert_int64_int16.$(OBJEXT) convert_int64_int16_LDADD = $(LDADD) convert_int64_int16_DEPENDENCIES = ../src/libgetdata.la convert_int64_int32_SOURCES = convert_int64_int32.c convert_int64_int32_OBJECTS = convert_int64_int32.$(OBJEXT) convert_int64_int32_LDADD = $(LDADD) convert_int64_int32_DEPENDENCIES = ../src/libgetdata.la convert_int64_int8_SOURCES = convert_int64_int8.c convert_int64_int8_OBJECTS = convert_int64_int8.$(OBJEXT) convert_int64_int8_LDADD = $(LDADD) convert_int64_int8_DEPENDENCIES = ../src/libgetdata.la convert_int64_uint16_SOURCES = convert_int64_uint16.c convert_int64_uint16_OBJECTS = convert_int64_uint16.$(OBJEXT) convert_int64_uint16_LDADD = $(LDADD) convert_int64_uint16_DEPENDENCIES = ../src/libgetdata.la convert_int64_uint32_SOURCES = convert_int64_uint32.c convert_int64_uint32_OBJECTS = convert_int64_uint32.$(OBJEXT) convert_int64_uint32_LDADD = $(LDADD) convert_int64_uint32_DEPENDENCIES = ../src/libgetdata.la convert_int64_uint64_SOURCES = convert_int64_uint64.c convert_int64_uint64_OBJECTS = convert_int64_uint64.$(OBJEXT) convert_int64_uint64_LDADD = $(LDADD) convert_int64_uint64_DEPENDENCIES = ../src/libgetdata.la convert_int64_uint8_SOURCES = convert_int64_uint8.c convert_int64_uint8_OBJECTS = convert_int64_uint8.$(OBJEXT) convert_int64_uint8_LDADD = $(LDADD) convert_int64_uint8_DEPENDENCIES = ../src/libgetdata.la convert_int8_complex128_SOURCES = convert_int8_complex128.c convert_int8_complex128_OBJECTS = convert_int8_complex128.$(OBJEXT) convert_int8_complex128_LDADD = $(LDADD) convert_int8_complex128_DEPENDENCIES = ../src/libgetdata.la convert_int8_complex64_SOURCES = convert_int8_complex64.c convert_int8_complex64_OBJECTS = convert_int8_complex64.$(OBJEXT) convert_int8_complex64_LDADD = $(LDADD) convert_int8_complex64_DEPENDENCIES = ../src/libgetdata.la convert_int8_float32_SOURCES = convert_int8_float32.c convert_int8_float32_OBJECTS = convert_int8_float32.$(OBJEXT) convert_int8_float32_LDADD = $(LDADD) convert_int8_float32_DEPENDENCIES = ../src/libgetdata.la convert_int8_float64_SOURCES = convert_int8_float64.c convert_int8_float64_OBJECTS = convert_int8_float64.$(OBJEXT) convert_int8_float64_LDADD = $(LDADD) convert_int8_float64_DEPENDENCIES = ../src/libgetdata.la convert_int8_int16_SOURCES = convert_int8_int16.c convert_int8_int16_OBJECTS = convert_int8_int16.$(OBJEXT) convert_int8_int16_LDADD = $(LDADD) convert_int8_int16_DEPENDENCIES = ../src/libgetdata.la convert_int8_int32_SOURCES = convert_int8_int32.c convert_int8_int32_OBJECTS = convert_int8_int32.$(OBJEXT) convert_int8_int32_LDADD = $(LDADD) convert_int8_int32_DEPENDENCIES = ../src/libgetdata.la convert_int8_int64_SOURCES = convert_int8_int64.c convert_int8_int64_OBJECTS = convert_int8_int64.$(OBJEXT) convert_int8_int64_LDADD = $(LDADD) convert_int8_int64_DEPENDENCIES = ../src/libgetdata.la convert_int8_uint16_SOURCES = convert_int8_uint16.c convert_int8_uint16_OBJECTS = convert_int8_uint16.$(OBJEXT) convert_int8_uint16_LDADD = $(LDADD) convert_int8_uint16_DEPENDENCIES = ../src/libgetdata.la convert_int8_uint32_SOURCES = convert_int8_uint32.c convert_int8_uint32_OBJECTS = convert_int8_uint32.$(OBJEXT) convert_int8_uint32_LDADD = $(LDADD) convert_int8_uint32_DEPENDENCIES = ../src/libgetdata.la convert_int8_uint64_SOURCES = convert_int8_uint64.c convert_int8_uint64_OBJECTS = convert_int8_uint64.$(OBJEXT) convert_int8_uint64_LDADD = $(LDADD) convert_int8_uint64_DEPENDENCIES = ../src/libgetdata.la convert_int8_uint8_SOURCES = convert_int8_uint8.c convert_int8_uint8_OBJECTS = convert_int8_uint8.$(OBJEXT) convert_int8_uint8_LDADD = $(LDADD) convert_int8_uint8_DEPENDENCIES = ../src/libgetdata.la convert_uint16_complex128_SOURCES = convert_uint16_complex128.c convert_uint16_complex128_OBJECTS = \ convert_uint16_complex128.$(OBJEXT) convert_uint16_complex128_LDADD = $(LDADD) convert_uint16_complex128_DEPENDENCIES = ../src/libgetdata.la convert_uint16_complex64_SOURCES = convert_uint16_complex64.c convert_uint16_complex64_OBJECTS = convert_uint16_complex64.$(OBJEXT) convert_uint16_complex64_LDADD = $(LDADD) convert_uint16_complex64_DEPENDENCIES = ../src/libgetdata.la convert_uint16_float32_SOURCES = convert_uint16_float32.c convert_uint16_float32_OBJECTS = convert_uint16_float32.$(OBJEXT) convert_uint16_float32_LDADD = $(LDADD) convert_uint16_float32_DEPENDENCIES = ../src/libgetdata.la convert_uint16_float64_SOURCES = convert_uint16_float64.c convert_uint16_float64_OBJECTS = convert_uint16_float64.$(OBJEXT) convert_uint16_float64_LDADD = $(LDADD) convert_uint16_float64_DEPENDENCIES = ../src/libgetdata.la convert_uint16_int16_SOURCES = convert_uint16_int16.c convert_uint16_int16_OBJECTS = convert_uint16_int16.$(OBJEXT) convert_uint16_int16_LDADD = $(LDADD) convert_uint16_int16_DEPENDENCIES = ../src/libgetdata.la convert_uint16_int32_SOURCES = convert_uint16_int32.c convert_uint16_int32_OBJECTS = convert_uint16_int32.$(OBJEXT) convert_uint16_int32_LDADD = $(LDADD) convert_uint16_int32_DEPENDENCIES = ../src/libgetdata.la convert_uint16_int64_SOURCES = convert_uint16_int64.c convert_uint16_int64_OBJECTS = convert_uint16_int64.$(OBJEXT) convert_uint16_int64_LDADD = $(LDADD) convert_uint16_int64_DEPENDENCIES = ../src/libgetdata.la convert_uint16_int8_SOURCES = convert_uint16_int8.c convert_uint16_int8_OBJECTS = convert_uint16_int8.$(OBJEXT) convert_uint16_int8_LDADD = $(LDADD) convert_uint16_int8_DEPENDENCIES = ../src/libgetdata.la convert_uint16_uint32_SOURCES = convert_uint16_uint32.c convert_uint16_uint32_OBJECTS = convert_uint16_uint32.$(OBJEXT) convert_uint16_uint32_LDADD = $(LDADD) convert_uint16_uint32_DEPENDENCIES = ../src/libgetdata.la convert_uint16_uint64_SOURCES = convert_uint16_uint64.c convert_uint16_uint64_OBJECTS = convert_uint16_uint64.$(OBJEXT) convert_uint16_uint64_LDADD = $(LDADD) convert_uint16_uint64_DEPENDENCIES = ../src/libgetdata.la convert_uint16_uint8_SOURCES = convert_uint16_uint8.c convert_uint16_uint8_OBJECTS = convert_uint16_uint8.$(OBJEXT) convert_uint16_uint8_LDADD = $(LDADD) convert_uint16_uint8_DEPENDENCIES = ../src/libgetdata.la convert_uint32_complex128_SOURCES = convert_uint32_complex128.c convert_uint32_complex128_OBJECTS = \ convert_uint32_complex128.$(OBJEXT) convert_uint32_complex128_LDADD = $(LDADD) convert_uint32_complex128_DEPENDENCIES = ../src/libgetdata.la convert_uint32_complex64_SOURCES = convert_uint32_complex64.c convert_uint32_complex64_OBJECTS = convert_uint32_complex64.$(OBJEXT) convert_uint32_complex64_LDADD = $(LDADD) convert_uint32_complex64_DEPENDENCIES = ../src/libgetdata.la convert_uint32_float32_SOURCES = convert_uint32_float32.c convert_uint32_float32_OBJECTS = convert_uint32_float32.$(OBJEXT) convert_uint32_float32_LDADD = $(LDADD) convert_uint32_float32_DEPENDENCIES = ../src/libgetdata.la convert_uint32_float64_SOURCES = convert_uint32_float64.c convert_uint32_float64_OBJECTS = convert_uint32_float64.$(OBJEXT) convert_uint32_float64_LDADD = $(LDADD) convert_uint32_float64_DEPENDENCIES = ../src/libgetdata.la convert_uint32_int16_SOURCES = convert_uint32_int16.c convert_uint32_int16_OBJECTS = convert_uint32_int16.$(OBJEXT) convert_uint32_int16_LDADD = $(LDADD) convert_uint32_int16_DEPENDENCIES = ../src/libgetdata.la convert_uint32_int32_SOURCES = convert_uint32_int32.c convert_uint32_int32_OBJECTS = convert_uint32_int32.$(OBJEXT) convert_uint32_int32_LDADD = $(LDADD) convert_uint32_int32_DEPENDENCIES = ../src/libgetdata.la convert_uint32_int64_SOURCES = convert_uint32_int64.c convert_uint32_int64_OBJECTS = convert_uint32_int64.$(OBJEXT) convert_uint32_int64_LDADD = $(LDADD) convert_uint32_int64_DEPENDENCIES = ../src/libgetdata.la convert_uint32_int8_SOURCES = convert_uint32_int8.c convert_uint32_int8_OBJECTS = convert_uint32_int8.$(OBJEXT) convert_uint32_int8_LDADD = $(LDADD) convert_uint32_int8_DEPENDENCIES = ../src/libgetdata.la convert_uint32_uint16_SOURCES = convert_uint32_uint16.c convert_uint32_uint16_OBJECTS = convert_uint32_uint16.$(OBJEXT) convert_uint32_uint16_LDADD = $(LDADD) convert_uint32_uint16_DEPENDENCIES = ../src/libgetdata.la convert_uint32_uint64_SOURCES = convert_uint32_uint64.c convert_uint32_uint64_OBJECTS = convert_uint32_uint64.$(OBJEXT) convert_uint32_uint64_LDADD = $(LDADD) convert_uint32_uint64_DEPENDENCIES = ../src/libgetdata.la convert_uint32_uint8_SOURCES = convert_uint32_uint8.c convert_uint32_uint8_OBJECTS = convert_uint32_uint8.$(OBJEXT) convert_uint32_uint8_LDADD = $(LDADD) convert_uint32_uint8_DEPENDENCIES = ../src/libgetdata.la convert_uint64_complex128_SOURCES = convert_uint64_complex128.c convert_uint64_complex128_OBJECTS = \ convert_uint64_complex128.$(OBJEXT) convert_uint64_complex128_LDADD = $(LDADD) convert_uint64_complex128_DEPENDENCIES = ../src/libgetdata.la convert_uint64_complex64_SOURCES = convert_uint64_complex64.c convert_uint64_complex64_OBJECTS = convert_uint64_complex64.$(OBJEXT) convert_uint64_complex64_LDADD = $(LDADD) convert_uint64_complex64_DEPENDENCIES = ../src/libgetdata.la convert_uint64_float32_SOURCES = convert_uint64_float32.c convert_uint64_float32_OBJECTS = convert_uint64_float32.$(OBJEXT) convert_uint64_float32_LDADD = $(LDADD) convert_uint64_float32_DEPENDENCIES = ../src/libgetdata.la convert_uint64_float64_SOURCES = convert_uint64_float64.c convert_uint64_float64_OBJECTS = convert_uint64_float64.$(OBJEXT) convert_uint64_float64_LDADD = $(LDADD) convert_uint64_float64_DEPENDENCIES = ../src/libgetdata.la convert_uint64_int16_SOURCES = convert_uint64_int16.c convert_uint64_int16_OBJECTS = convert_uint64_int16.$(OBJEXT) convert_uint64_int16_LDADD = $(LDADD) convert_uint64_int16_DEPENDENCIES = ../src/libgetdata.la convert_uint64_int32_SOURCES = convert_uint64_int32.c convert_uint64_int32_OBJECTS = convert_uint64_int32.$(OBJEXT) convert_uint64_int32_LDADD = $(LDADD) convert_uint64_int32_DEPENDENCIES = ../src/libgetdata.la convert_uint64_int64_SOURCES = convert_uint64_int64.c convert_uint64_int64_OBJECTS = convert_uint64_int64.$(OBJEXT) convert_uint64_int64_LDADD = $(LDADD) convert_uint64_int64_DEPENDENCIES = ../src/libgetdata.la convert_uint64_int8_SOURCES = convert_uint64_int8.c convert_uint64_int8_OBJECTS = convert_uint64_int8.$(OBJEXT) convert_uint64_int8_LDADD = $(LDADD) convert_uint64_int8_DEPENDENCIES = ../src/libgetdata.la convert_uint64_uint16_SOURCES = convert_uint64_uint16.c convert_uint64_uint16_OBJECTS = convert_uint64_uint16.$(OBJEXT) convert_uint64_uint16_LDADD = $(LDADD) convert_uint64_uint16_DEPENDENCIES = ../src/libgetdata.la convert_uint64_uint32_SOURCES = convert_uint64_uint32.c convert_uint64_uint32_OBJECTS = convert_uint64_uint32.$(OBJEXT) convert_uint64_uint32_LDADD = $(LDADD) convert_uint64_uint32_DEPENDENCIES = ../src/libgetdata.la convert_uint64_uint8_SOURCES = convert_uint64_uint8.c convert_uint64_uint8_OBJECTS = convert_uint64_uint8.$(OBJEXT) convert_uint64_uint8_LDADD = $(LDADD) convert_uint64_uint8_DEPENDENCIES = ../src/libgetdata.la convert_uint8_complex128_SOURCES = convert_uint8_complex128.c convert_uint8_complex128_OBJECTS = convert_uint8_complex128.$(OBJEXT) convert_uint8_complex128_LDADD = $(LDADD) convert_uint8_complex128_DEPENDENCIES = ../src/libgetdata.la convert_uint8_complex64_SOURCES = convert_uint8_complex64.c convert_uint8_complex64_OBJECTS = convert_uint8_complex64.$(OBJEXT) convert_uint8_complex64_LDADD = $(LDADD) convert_uint8_complex64_DEPENDENCIES = ../src/libgetdata.la convert_uint8_float32_SOURCES = convert_uint8_float32.c convert_uint8_float32_OBJECTS = convert_uint8_float32.$(OBJEXT) convert_uint8_float32_LDADD = $(LDADD) convert_uint8_float32_DEPENDENCIES = ../src/libgetdata.la convert_uint8_float64_SOURCES = convert_uint8_float64.c convert_uint8_float64_OBJECTS = convert_uint8_float64.$(OBJEXT) convert_uint8_float64_LDADD = $(LDADD) convert_uint8_float64_DEPENDENCIES = ../src/libgetdata.la convert_uint8_int16_SOURCES = convert_uint8_int16.c convert_uint8_int16_OBJECTS = convert_uint8_int16.$(OBJEXT) convert_uint8_int16_LDADD = $(LDADD) convert_uint8_int16_DEPENDENCIES = ../src/libgetdata.la convert_uint8_int32_SOURCES = convert_uint8_int32.c convert_uint8_int32_OBJECTS = convert_uint8_int32.$(OBJEXT) convert_uint8_int32_LDADD = $(LDADD) convert_uint8_int32_DEPENDENCIES = ../src/libgetdata.la convert_uint8_int64_SOURCES = convert_uint8_int64.c convert_uint8_int64_OBJECTS = convert_uint8_int64.$(OBJEXT) convert_uint8_int64_LDADD = $(LDADD) convert_uint8_int64_DEPENDENCIES = ../src/libgetdata.la convert_uint8_int8_SOURCES = convert_uint8_int8.c convert_uint8_int8_OBJECTS = convert_uint8_int8.$(OBJEXT) convert_uint8_int8_LDADD = $(LDADD) convert_uint8_int8_DEPENDENCIES = ../src/libgetdata.la convert_uint8_uint16_SOURCES = convert_uint8_uint16.c convert_uint8_uint16_OBJECTS = convert_uint8_uint16.$(OBJEXT) convert_uint8_uint16_LDADD = $(LDADD) convert_uint8_uint16_DEPENDENCIES = ../src/libgetdata.la convert_uint8_uint32_SOURCES = convert_uint8_uint32.c convert_uint8_uint32_OBJECTS = convert_uint8_uint32.$(OBJEXT) convert_uint8_uint32_LDADD = $(LDADD) convert_uint8_uint32_DEPENDENCIES = ../src/libgetdata.la convert_uint8_uint64_SOURCES = convert_uint8_uint64.c convert_uint8_uint64_OBJECTS = convert_uint8_uint64.$(OBJEXT) convert_uint8_uint64_LDADD = $(LDADD) convert_uint8_uint64_DEPENDENCIES = ../src/libgetdata.la creat_SOURCES = creat.c creat_OBJECTS = creat.$(OBJEXT) creat_LDADD = $(LDADD) creat_DEPENDENCIES = ../src/libgetdata.la creat_excl_SOURCES = creat_excl.c creat_excl_OBJECTS = creat_excl.$(OBJEXT) creat_excl_LDADD = $(LDADD) creat_excl_DEPENDENCIES = ../src/libgetdata.la creat_rdonly_SOURCES = creat_rdonly.c creat_rdonly_OBJECTS = creat_rdonly.$(OBJEXT) creat_rdonly_LDADD = $(LDADD) creat_rdonly_DEPENDENCIES = ../src/libgetdata.la creat_rdonly_exists_SOURCES = creat_rdonly_exists.c creat_rdonly_exists_OBJECTS = creat_rdonly_exists.$(OBJEXT) creat_rdonly_exists_LDADD = $(LDADD) creat_rdonly_exists_DEPENDENCIES = ../src/libgetdata.la cvlist_SOURCES = cvlist.c cvlist_OBJECTS = cvlist.$(OBJEXT) cvlist_LDADD = $(LDADD) cvlist_DEPENDENCIES = ../src/libgetdata.la cvlist_array_SOURCES = cvlist_array.c cvlist_array_OBJECTS = cvlist_array.$(OBJEXT) cvlist_array_LDADD = $(LDADD) cvlist_array_DEPENDENCIES = ../src/libgetdata.la cvlist_array0_SOURCES = cvlist_array0.c cvlist_array0_OBJECTS = cvlist_array0.$(OBJEXT) cvlist_array0_LDADD = $(LDADD) cvlist_array0_DEPENDENCIES = ../src/libgetdata.la cvlist_array_free_SOURCES = cvlist_array_free.c cvlist_array_free_OBJECTS = cvlist_array_free.$(OBJEXT) cvlist_array_free_LDADD = $(LDADD) cvlist_array_free_DEPENDENCIES = ../src/libgetdata.la cvlist_array_hidden_SOURCES = cvlist_array_hidden.c cvlist_array_hidden_OBJECTS = cvlist_array_hidden.$(OBJEXT) cvlist_array_hidden_LDADD = $(LDADD) cvlist_array_hidden_DEPENDENCIES = ../src/libgetdata.la cvlist_array_meta_SOURCES = cvlist_array_meta.c cvlist_array_meta_OBJECTS = cvlist_array_meta.$(OBJEXT) cvlist_array_meta_LDADD = $(LDADD) cvlist_array_meta_DEPENDENCIES = ../src/libgetdata.la cvlist_array_meta0_SOURCES = cvlist_array_meta0.c cvlist_array_meta0_OBJECTS = cvlist_array_meta0.$(OBJEXT) cvlist_array_meta0_LDADD = $(LDADD) cvlist_array_meta0_DEPENDENCIES = ../src/libgetdata.la cvlist_array_meta_free_SOURCES = cvlist_array_meta_free.c cvlist_array_meta_free_OBJECTS = cvlist_array_meta_free.$(OBJEXT) cvlist_array_meta_free_LDADD = $(LDADD) cvlist_array_meta_free_DEPENDENCIES = ../src/libgetdata.la cvlist_array_meta_hidden_SOURCES = cvlist_array_meta_hidden.c cvlist_array_meta_hidden_OBJECTS = cvlist_array_meta_hidden.$(OBJEXT) cvlist_array_meta_hidden_LDADD = $(LDADD) cvlist_array_meta_hidden_DEPENDENCIES = ../src/libgetdata.la cvlist_hidden_SOURCES = cvlist_hidden.c cvlist_hidden_OBJECTS = cvlist_hidden.$(OBJEXT) cvlist_hidden_LDADD = $(LDADD) cvlist_hidden_DEPENDENCIES = ../src/libgetdata.la cvlist_invalid_SOURCES = cvlist_invalid.c cvlist_invalid_OBJECTS = cvlist_invalid.$(OBJEXT) cvlist_invalid_LDADD = $(LDADD) cvlist_invalid_DEPENDENCIES = ../src/libgetdata.la cvlist_meta_SOURCES = cvlist_meta.c cvlist_meta_OBJECTS = cvlist_meta.$(OBJEXT) cvlist_meta_LDADD = $(LDADD) cvlist_meta_DEPENDENCIES = ../src/libgetdata.la cvlist_meta0_SOURCES = cvlist_meta0.c cvlist_meta0_OBJECTS = cvlist_meta0.$(OBJEXT) cvlist_meta0_LDADD = $(LDADD) cvlist_meta0_DEPENDENCIES = ../src/libgetdata.la cvlist_meta_hidden_SOURCES = cvlist_meta_hidden.c cvlist_meta_hidden_OBJECTS = cvlist_meta_hidden.$(OBJEXT) cvlist_meta_hidden_LDADD = $(LDADD) cvlist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la cvlist_meta_invalid_SOURCES = cvlist_meta_invalid.c cvlist_meta_invalid_OBJECTS = cvlist_meta_invalid.$(OBJEXT) cvlist_meta_invalid_LDADD = $(LDADD) cvlist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la del_alias_SOURCES = del_alias.c del_alias_OBJECTS = del_alias.$(OBJEXT) del_alias_LDADD = $(LDADD) del_alias_DEPENDENCIES = ../src/libgetdata.la del_carray_SOURCES = del_carray.c del_carray_OBJECTS = del_carray.$(OBJEXT) del_carray_LDADD = $(LDADD) del_carray_DEPENDENCIES = ../src/libgetdata.la del_carray_deref_SOURCES = del_carray_deref.c del_carray_deref_OBJECTS = del_carray_deref.$(OBJEXT) del_carray_deref_LDADD = $(LDADD) del_carray_deref_DEPENDENCIES = ../src/libgetdata.la del_const_SOURCES = del_const.c del_const_OBJECTS = del_const.$(OBJEXT) del_const_LDADD = $(LDADD) del_const_DEPENDENCIES = ../src/libgetdata.la del_const_deref_SOURCES = del_const_deref.c del_const_deref_OBJECTS = del_const_deref.$(OBJEXT) del_const_deref_LDADD = $(LDADD) del_const_deref_DEPENDENCIES = ../src/libgetdata.la del_const_force_SOURCES = del_const_force.c del_const_force_OBJECTS = del_const_force.$(OBJEXT) del_const_force_LDADD = $(LDADD) del_const_force_DEPENDENCIES = ../src/libgetdata.la del_data_SOURCES = del_data.c del_data_OBJECTS = del_data.$(OBJEXT) del_data_LDADD = $(LDADD) del_data_DEPENDENCIES = ../src/libgetdata.la del_data_enoent_SOURCES = del_data_enoent.c del_data_enoent_OBJECTS = del_data_enoent.$(OBJEXT) del_data_enoent_LDADD = $(LDADD) del_data_enoent_DEPENDENCIES = ../src/libgetdata.la del_data_open_SOURCES = del_data_open.c del_data_open_OBJECTS = del_data_open.$(OBJEXT) del_data_open_LDADD = $(LDADD) del_data_open_DEPENDENCIES = ../src/libgetdata.la del_del_SOURCES = del_del.c del_del_OBJECTS = del_del.$(OBJEXT) del_del_LDADD = $(LDADD) del_del_DEPENDENCIES = ../src/libgetdata.la del_derived_SOURCES = del_derived.c del_derived_OBJECTS = del_derived.$(OBJEXT) del_derived_LDADD = $(LDADD) del_derived_DEPENDENCIES = ../src/libgetdata.la del_derived_after_SOURCES = del_derived_after.c del_derived_after_OBJECTS = del_derived_after.$(OBJEXT) del_derived_after_LDADD = $(LDADD) del_derived_after_DEPENDENCIES = ../src/libgetdata.la del_derived_force_SOURCES = del_derived_force.c del_derived_force_OBJECTS = del_derived_force.$(OBJEXT) del_derived_force_LDADD = $(LDADD) del_derived_force_DEPENDENCIES = ../src/libgetdata.la del_meta_SOURCES = del_meta.c del_meta_OBJECTS = del_meta.$(OBJEXT) del_meta_LDADD = $(LDADD) del_meta_DEPENDENCIES = ../src/libgetdata.la del_meta_force_SOURCES = del_meta_force.c del_meta_force_OBJECTS = del_meta_force.$(OBJEXT) del_meta_force_LDADD = $(LDADD) del_meta_force_DEPENDENCIES = ../src/libgetdata.la del_ref_SOURCES = del_ref.c del_ref_OBJECTS = del_ref.$(OBJEXT) del_ref_LDADD = $(LDADD) del_ref_DEPENDENCIES = ../src/libgetdata.la desync_SOURCES = desync.c desync_OBJECTS = desync.$(OBJEXT) desync_LDADD = $(LDADD) desync_DEPENDENCIES = ../src/libgetdata.la desync_flush_SOURCES = desync_flush.c desync_flush_OBJECTS = desync_flush.$(OBJEXT) desync_flush_LDADD = $(LDADD) desync_flush_DEPENDENCIES = ../src/libgetdata.la desync_path_SOURCES = desync_path.c desync_path_OBJECTS = desync_path.$(OBJEXT) desync_path_LDADD = $(LDADD) desync_path_DEPENDENCIES = ../src/libgetdata.la desync_reopen_SOURCES = desync_reopen.c desync_reopen_OBJECTS = desync_reopen.$(OBJEXT) desync_reopen_LDADD = $(LDADD) desync_reopen_DEPENDENCIES = ../src/libgetdata.la desync_reopen_inv_SOURCES = desync_reopen_inv.c desync_reopen_inv_OBJECTS = desync_reopen_inv.$(OBJEXT) desync_reopen_inv_LDADD = $(LDADD) desync_reopen_inv_DEPENDENCIES = ../src/libgetdata.la dfes_bit_SOURCES = dfes_bit.c dfes_bit_OBJECTS = dfes_bit.$(OBJEXT) dfes_bit_LDADD = $(LDADD) dfes_bit_DEPENDENCIES = ../src/libgetdata.la dfes_divide_SOURCES = dfes_divide.c dfes_divide_OBJECTS = dfes_divide.$(OBJEXT) dfes_divide_LDADD = $(LDADD) dfes_divide_DEPENDENCIES = ../src/libgetdata.la dfes_lincom_SOURCES = dfes_lincom.c dfes_lincom_OBJECTS = dfes_lincom.$(OBJEXT) dfes_lincom_LDADD = $(LDADD) dfes_lincom_DEPENDENCIES = ../src/libgetdata.la dfes_linterp_SOURCES = dfes_linterp.c dfes_linterp_OBJECTS = dfes_linterp.$(OBJEXT) dfes_linterp_LDADD = $(LDADD) dfes_linterp_DEPENDENCIES = ../src/libgetdata.la dfes_multiply_SOURCES = dfes_multiply.c dfes_multiply_OBJECTS = dfes_multiply.$(OBJEXT) dfes_multiply_LDADD = $(LDADD) dfes_multiply_DEPENDENCIES = ../src/libgetdata.la dfes_null_SOURCES = dfes_null.c dfes_null_OBJECTS = dfes_null.$(OBJEXT) dfes_null_LDADD = $(LDADD) dfes_null_DEPENDENCIES = ../src/libgetdata.la dfes_phase_SOURCES = dfes_phase.c dfes_phase_OBJECTS = dfes_phase.$(OBJEXT) dfes_phase_LDADD = $(LDADD) dfes_phase_DEPENDENCIES = ../src/libgetdata.la dfes_raw_SOURCES = dfes_raw.c dfes_raw_OBJECTS = dfes_raw.$(OBJEXT) dfes_raw_LDADD = $(LDADD) dfes_raw_DEPENDENCIES = ../src/libgetdata.la dfes_recip_SOURCES = dfes_recip.c dfes_recip_OBJECTS = dfes_recip.$(OBJEXT) dfes_recip_LDADD = $(LDADD) dfes_recip_DEPENDENCIES = ../src/libgetdata.la dfes_zero_SOURCES = dfes_zero.c dfes_zero_OBJECTS = dfes_zero.$(OBJEXT) dfes_zero_LDADD = $(LDADD) dfes_zero_DEPENDENCIES = ../src/libgetdata.la elist_alias_SOURCES = elist_alias.c elist_alias_OBJECTS = elist_alias.$(OBJEXT) elist_alias_LDADD = $(LDADD) elist_alias_DEPENDENCIES = ../src/libgetdata.la elist_hidden_SOURCES = elist_hidden.c elist_hidden_OBJECTS = elist_hidden.$(OBJEXT) elist_hidden_LDADD = $(LDADD) elist_hidden_DEPENDENCIES = ../src/libgetdata.la elist_noalias_SOURCES = elist_noalias.c elist_noalias_OBJECTS = elist_noalias.$(OBJEXT) elist_noalias_LDADD = $(LDADD) elist_noalias_DEPENDENCIES = ../src/libgetdata.la elist_scalar_SOURCES = elist_scalar.c elist_scalar_OBJECTS = elist_scalar.$(OBJEXT) elist_scalar_LDADD = $(LDADD) elist_scalar_DEPENDENCIES = ../src/libgetdata.la encode_alter_SOURCES = encode_alter.c encode_alter_OBJECTS = encode_alter.$(OBJEXT) encode_alter_LDADD = $(LDADD) encode_alter_DEPENDENCIES = ../src/libgetdata.la encode_alter_all_SOURCES = encode_alter_all.c encode_alter_all_OBJECTS = encode_alter_all.$(OBJEXT) encode_alter_all_LDADD = $(LDADD) encode_alter_all_DEPENDENCIES = ../src/libgetdata.la encode_alter_open_SOURCES = encode_alter_open.c encode_alter_open_OBJECTS = encode_alter_open.$(OBJEXT) encode_alter_open_LDADD = $(LDADD) encode_alter_open_DEPENDENCIES = ../src/libgetdata.la encode_get_SOURCES = encode_get.c encode_get_OBJECTS = encode_get.$(OBJEXT) encode_get_LDADD = $(LDADD) encode_get_DEPENDENCIES = ../src/libgetdata.la encode_recode_SOURCES = encode_recode.c encode_recode_OBJECTS = encode_recode.$(OBJEXT) encode_recode_LDADD = $(LDADD) encode_recode_DEPENDENCIES = ../src/libgetdata.la encode_recode_open_SOURCES = encode_recode_open.c encode_recode_open_OBJECTS = encode_recode_open.$(OBJEXT) encode_recode_open_LDADD = $(LDADD) encode_recode_open_DEPENDENCIES = ../src/libgetdata.la encode_support_SOURCES = encode_support.c encode_support_OBJECTS = encode_support.$(OBJEXT) encode_support_LDADD = $(LDADD) encode_support_DEPENDENCIES = ../src/libgetdata.la endian_alter_SOURCES = endian_alter.c endian_alter_OBJECTS = endian_alter.$(OBJEXT) endian_alter_LDADD = $(LDADD) endian_alter_DEPENDENCIES = ../src/libgetdata.la endian_alter_all_SOURCES = endian_alter_all.c endian_alter_all_OBJECTS = endian_alter_all.$(OBJEXT) endian_alter_all_LDADD = $(LDADD) endian_alter_all_DEPENDENCIES = ../src/libgetdata.la endian_alter_sie_SOURCES = endian_alter_sie.c endian_alter_sie_OBJECTS = endian_alter_sie.$(OBJEXT) endian_alter_sie_LDADD = $(LDADD) endian_alter_sie_DEPENDENCIES = ../src/libgetdata.la endian_get_SOURCES = endian_get.c endian_get_OBJECTS = endian_get.$(OBJEXT) endian_get_LDADD = $(LDADD) endian_get_DEPENDENCIES = ../src/libgetdata.la endian_move_SOURCES = endian_move.c endian_move_OBJECTS = endian_move.$(OBJEXT) endian_move_LDADD = $(LDADD) endian_move_DEPENDENCIES = ../src/libgetdata.la entry_bad_code_SOURCES = entry_bad_code.c entry_bad_code_OBJECTS = entry_bad_code.$(OBJEXT) entry_bad_code_LDADD = $(LDADD) entry_bad_code_DEPENDENCIES = ../src/libgetdata.la entry_bit_SOURCES = entry_bit.c entry_bit_OBJECTS = entry_bit.$(OBJEXT) entry_bit_LDADD = $(LDADD) entry_bit_DEPENDENCIES = ../src/libgetdata.la entry_bit_scalar_SOURCES = entry_bit_scalar.c entry_bit_scalar_OBJECTS = entry_bit_scalar.$(OBJEXT) entry_bit_scalar_LDADD = $(LDADD) entry_bit_scalar_DEPENDENCIES = ../src/libgetdata.la entry_divide_SOURCES = entry_divide.c entry_divide_OBJECTS = entry_divide.$(OBJEXT) entry_divide_LDADD = $(LDADD) entry_divide_DEPENDENCIES = ../src/libgetdata.la entry_invalid_SOURCES = entry_invalid.c entry_invalid_OBJECTS = entry_invalid.$(OBJEXT) entry_invalid_LDADD = $(LDADD) entry_invalid_DEPENDENCIES = ../src/libgetdata.la entry_lincom_SOURCES = entry_lincom.c entry_lincom_OBJECTS = entry_lincom.$(OBJEXT) entry_lincom_LDADD = $(LDADD) entry_lincom_DEPENDENCIES = ../src/libgetdata.la entry_lincom_scalar_SOURCES = entry_lincom_scalar.c entry_lincom_scalar_OBJECTS = entry_lincom_scalar.$(OBJEXT) entry_lincom_scalar_LDADD = $(LDADD) entry_lincom_scalar_DEPENDENCIES = ../src/libgetdata.la entry_linterp_SOURCES = entry_linterp.c entry_linterp_OBJECTS = entry_linterp.$(OBJEXT) entry_linterp_LDADD = $(LDADD) entry_linterp_DEPENDENCIES = ../src/libgetdata.la entry_mplex_SOURCES = entry_mplex.c entry_mplex_OBJECTS = entry_mplex.$(OBJEXT) entry_mplex_LDADD = $(LDADD) entry_mplex_DEPENDENCIES = ../src/libgetdata.la entry_mplex_scalar_SOURCES = entry_mplex_scalar.c entry_mplex_scalar_OBJECTS = entry_mplex_scalar.$(OBJEXT) entry_mplex_scalar_LDADD = $(LDADD) entry_mplex_scalar_DEPENDENCIES = ../src/libgetdata.la entry_multiply_SOURCES = entry_multiply.c entry_multiply_OBJECTS = entry_multiply.$(OBJEXT) entry_multiply_LDADD = $(LDADD) entry_multiply_DEPENDENCIES = ../src/libgetdata.la entry_phase_SOURCES = entry_phase.c entry_phase_OBJECTS = entry_phase.$(OBJEXT) entry_phase_LDADD = $(LDADD) entry_phase_DEPENDENCIES = ../src/libgetdata.la entry_phase_scalar_SOURCES = entry_phase_scalar.c entry_phase_scalar_OBJECTS = entry_phase_scalar.$(OBJEXT) entry_phase_scalar_LDADD = $(LDADD) entry_phase_scalar_DEPENDENCIES = ../src/libgetdata.la entry_polynom_SOURCES = entry_polynom.c entry_polynom_OBJECTS = entry_polynom.$(OBJEXT) entry_polynom_LDADD = $(LDADD) entry_polynom_DEPENDENCIES = ../src/libgetdata.la entry_polynom_scalar_SOURCES = entry_polynom_scalar.c entry_polynom_scalar_OBJECTS = entry_polynom_scalar.$(OBJEXT) entry_polynom_scalar_LDADD = $(LDADD) entry_polynom_scalar_DEPENDENCIES = ../src/libgetdata.la entry_raw_SOURCES = entry_raw.c entry_raw_OBJECTS = entry_raw.$(OBJEXT) entry_raw_LDADD = $(LDADD) entry_raw_DEPENDENCIES = ../src/libgetdata.la entry_raw_scalar_SOURCES = entry_raw_scalar.c entry_raw_scalar_OBJECTS = entry_raw_scalar.$(OBJEXT) entry_raw_scalar_LDADD = $(LDADD) entry_raw_scalar_DEPENDENCIES = ../src/libgetdata.la entry_raw_scalar_code_SOURCES = entry_raw_scalar_code.c entry_raw_scalar_code_OBJECTS = entry_raw_scalar_code.$(OBJEXT) entry_raw_scalar_code_LDADD = $(LDADD) entry_raw_scalar_code_DEPENDENCIES = ../src/libgetdata.la entry_raw_scalar_type_SOURCES = entry_raw_scalar_type.c entry_raw_scalar_type_OBJECTS = entry_raw_scalar_type.$(OBJEXT) entry_raw_scalar_type_LDADD = $(LDADD) entry_raw_scalar_type_DEPENDENCIES = ../src/libgetdata.la entry_recip_SOURCES = entry_recip.c entry_recip_OBJECTS = entry_recip.$(OBJEXT) entry_recip_LDADD = $(LDADD) entry_recip_DEPENDENCIES = ../src/libgetdata.la entry_scalar_repr_SOURCES = entry_scalar_repr.c entry_scalar_repr_OBJECTS = entry_scalar_repr.$(OBJEXT) entry_scalar_repr_LDADD = $(LDADD) entry_scalar_repr_DEPENDENCIES = ../src/libgetdata.la entry_type_SOURCES = entry_type.c entry_type_OBJECTS = entry_type.$(OBJEXT) entry_type_LDADD = $(LDADD) entry_type_DEPENDENCIES = ../src/libgetdata.la entry_type_alias_SOURCES = entry_type_alias.c entry_type_alias_OBJECTS = entry_type_alias.$(OBJEXT) entry_type_alias_LDADD = $(LDADD) entry_type_alias_DEPENDENCIES = ../src/libgetdata.la entry_window_SOURCES = entry_window.c entry_window_OBJECTS = entry_window.$(OBJEXT) entry_window_LDADD = $(LDADD) entry_window_DEPENDENCIES = ../src/libgetdata.la entry_window_scalar_SOURCES = entry_window_scalar.c entry_window_scalar_OBJECTS = entry_window_scalar.$(OBJEXT) entry_window_scalar_LDADD = $(LDADD) entry_window_scalar_DEPENDENCIES = ../src/libgetdata.la eof_SOURCES = eof.c eof_OBJECTS = eof.$(OBJEXT) eof_LDADD = $(LDADD) eof_DEPENDENCIES = ../src/libgetdata.la eof_bit_SOURCES = eof_bit.c eof_bit_OBJECTS = eof_bit.$(OBJEXT) eof_bit_LDADD = $(LDADD) eof_bit_DEPENDENCIES = ../src/libgetdata.la eof_index_SOURCES = eof_index.c eof_index_OBJECTS = eof_index.$(OBJEXT) eof_index_LDADD = $(LDADD) eof_index_DEPENDENCIES = ../src/libgetdata.la eof_lincom_SOURCES = eof_lincom.c eof_lincom_OBJECTS = eof_lincom.$(OBJEXT) eof_lincom_LDADD = $(LDADD) eof_lincom_DEPENDENCIES = ../src/libgetdata.la eof_phase_SOURCES = eof_phase.c eof_phase_OBJECTS = eof_phase.$(OBJEXT) eof_phase_LDADD = $(LDADD) eof_phase_DEPENDENCIES = ../src/libgetdata.la eof_phase_neg_SOURCES = eof_phase_neg.c eof_phase_neg_OBJECTS = eof_phase_neg.$(OBJEXT) eof_phase_neg_LDADD = $(LDADD) eof_phase_neg_DEPENDENCIES = ../src/libgetdata.la error_SOURCES = error.c error_OBJECTS = error.$(OBJEXT) error_LDADD = $(LDADD) error_DEPENDENCIES = ../src/libgetdata.la error_error_SOURCES = error_error.c error_error_OBJECTS = error_error.$(OBJEXT) error_error_LDADD = $(LDADD) error_error_DEPENDENCIES = ../src/libgetdata.la error_num_SOURCES = error_num.c error_num_OBJECTS = error_num.$(OBJEXT) error_num_LDADD = $(LDADD) error_num_DEPENDENCIES = ../src/libgetdata.la error_short_SOURCES = error_short.c error_short_OBJECTS = error_short.$(OBJEXT) error_short_LDADD = $(LDADD) error_short_DEPENDENCIES = ../src/libgetdata.la error_verbose_SOURCES = error_verbose.c error_verbose_OBJECTS = error_verbose.$(OBJEXT) error_verbose_LDADD = $(LDADD) error_verbose_DEPENDENCIES = ../src/libgetdata.la error_verbose_prefix_SOURCES = error_verbose_prefix.c error_verbose_prefix_OBJECTS = error_verbose_prefix.$(OBJEXT) error_verbose_prefix_LDADD = $(LDADD) error_verbose_prefix_DEPENDENCIES = ../src/libgetdata.la file_SOURCES = file.c file_OBJECTS = file.$(OBJEXT) file_LDADD = $(LDADD) file_DEPENDENCIES = ../src/libgetdata.la file_code_SOURCES = file_code.c file_code_OBJECTS = file_code.$(OBJEXT) file_code_LDADD = $(LDADD) file_code_DEPENDENCIES = ../src/libgetdata.la file_type_SOURCES = file_type.c file_type_OBJECTS = file_type.$(OBJEXT) file_type_LDADD = $(LDADD) file_type_DEPENDENCIES = ../src/libgetdata.la flac_add_SOURCES = flac_add.c flac_add_OBJECTS = flac_add.$(OBJEXT) flac_add_LDADD = $(LDADD) flac_add_DEPENDENCIES = ../src/libgetdata.la flac_get_big_SOURCES = flac_get_big.c flac_get_big_OBJECTS = flac_get_big.$(OBJEXT) flac_get_big_LDADD = $(LDADD) flac_get_big_DEPENDENCIES = ../src/libgetdata.la flac_get_far_SOURCES = flac_get_far.c flac_get_far_OBJECTS = flac_get_far.$(OBJEXT) flac_get_far_LDADD = $(LDADD) flac_get_far_DEPENDENCIES = ../src/libgetdata.la flac_get_get_SOURCES = flac_get_get.c flac_get_get_OBJECTS = flac_get_get.$(OBJEXT) flac_get_get_LDADD = $(LDADD) flac_get_get_DEPENDENCIES = ../src/libgetdata.la flac_get_get2_SOURCES = flac_get_get2.c flac_get_get2_OBJECTS = flac_get_get2.$(OBJEXT) flac_get_get2_LDADD = $(LDADD) flac_get_get2_DEPENDENCIES = ../src/libgetdata.la flac_get_little_SOURCES = flac_get_little.c flac_get_little_OBJECTS = flac_get_little.$(OBJEXT) flac_get_little_LDADD = $(LDADD) flac_get_little_DEPENDENCIES = ../src/libgetdata.la flac_nframes_SOURCES = flac_nframes.c flac_nframes_OBJECTS = flac_nframes.$(OBJEXT) flac_nframes_LDADD = $(LDADD) flac_nframes_DEPENDENCIES = ../src/libgetdata.la flac_put_big_SOURCES = flac_put_big.c flac_put_big_OBJECTS = flac_put_big.$(OBJEXT) flac_put_big_LDADD = $(LDADD) flac_put_big_DEPENDENCIES = ../src/libgetdata.la flac_put_complex128_SOURCES = flac_put_complex128.c flac_put_complex128_OBJECTS = flac_put_complex128.$(OBJEXT) flac_put_complex128_LDADD = $(LDADD) flac_put_complex128_DEPENDENCIES = ../src/libgetdata.la flac_put_float64_SOURCES = flac_put_float64.c flac_put_float64_OBJECTS = flac_put_float64.$(OBJEXT) flac_put_float64_LDADD = $(LDADD) flac_put_float64_DEPENDENCIES = ../src/libgetdata.la flac_put_int32_SOURCES = flac_put_int32.c flac_put_int32_OBJECTS = flac_put_int32.$(OBJEXT) flac_put_int32_LDADD = $(LDADD) flac_put_int32_DEPENDENCIES = ../src/libgetdata.la flac_put_little_SOURCES = flac_put_little.c flac_put_little_OBJECTS = flac_put_little.$(OBJEXT) flac_put_little_LDADD = $(LDADD) flac_put_little_DEPENDENCIES = ../src/libgetdata.la flac_seek_SOURCES = flac_seek.c flac_seek_OBJECTS = flac_seek.$(OBJEXT) flac_seek_LDADD = $(LDADD) flac_seek_DEPENDENCIES = ../src/libgetdata.la flac_seek_far_SOURCES = flac_seek_far.c flac_seek_far_OBJECTS = flac_seek_far.$(OBJEXT) flac_seek_far_LDADD = $(LDADD) flac_seek_far_DEPENDENCIES = ../src/libgetdata.la flac_sync_SOURCES = flac_sync.c flac_sync_OBJECTS = flac_sync.$(OBJEXT) flac_sync_LDADD = $(LDADD) flac_sync_DEPENDENCIES = ../src/libgetdata.la flist_SOURCES = flist.c flist_OBJECTS = flist.$(OBJEXT) flist_LDADD = $(LDADD) flist_DEPENDENCIES = ../src/libgetdata.la flist0_SOURCES = flist0.c flist0_OBJECTS = flist0.$(OBJEXT) flist0_LDADD = $(LDADD) flist0_DEPENDENCIES = ../src/libgetdata.la flist2_SOURCES = flist2.c flist2_OBJECTS = flist2.$(OBJEXT) flist2_LDADD = $(LDADD) flist2_DEPENDENCIES = ../src/libgetdata.la flist_hidden_SOURCES = flist_hidden.c flist_hidden_OBJECTS = flist_hidden.$(OBJEXT) flist_hidden_LDADD = $(LDADD) flist_hidden_DEPENDENCIES = ../src/libgetdata.la flist_invalid_SOURCES = flist_invalid.c flist_invalid_OBJECTS = flist_invalid.$(OBJEXT) flist_invalid_LDADD = $(LDADD) flist_invalid_DEPENDENCIES = ../src/libgetdata.la flist_meta_SOURCES = flist_meta.c flist_meta_OBJECTS = flist_meta.$(OBJEXT) flist_meta_LDADD = $(LDADD) flist_meta_DEPENDENCIES = ../src/libgetdata.la flist_meta2_SOURCES = flist_meta2.c flist_meta2_OBJECTS = flist_meta2.$(OBJEXT) flist_meta2_LDADD = $(LDADD) flist_meta2_DEPENDENCIES = ../src/libgetdata.la flist_meta_hidden_SOURCES = flist_meta_hidden.c flist_meta_hidden_OBJECTS = flist_meta_hidden.$(OBJEXT) flist_meta_hidden_LDADD = $(LDADD) flist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la flist_meta_invalid_SOURCES = flist_meta_invalid.c flist_meta_invalid_OBJECTS = flist_meta_invalid.$(OBJEXT) flist_meta_invalid_LDADD = $(LDADD) flist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la flist_type_SOURCES = flist_type.c flist_type_OBJECTS = flist_type.$(OBJEXT) flist_type_LDADD = $(LDADD) flist_type_DEPENDENCIES = ../src/libgetdata.la flist_type_hidden_SOURCES = flist_type_hidden.c flist_type_hidden_OBJECTS = flist_type_hidden.$(OBJEXT) flist_type_hidden_LDADD = $(LDADD) flist_type_hidden_DEPENDENCIES = ../src/libgetdata.la flist_type_invalid_SOURCES = flist_type_invalid.c flist_type_invalid_OBJECTS = flist_type_invalid.$(OBJEXT) flist_type_invalid_LDADD = $(LDADD) flist_type_invalid_DEPENDENCIES = ../src/libgetdata.la flist_type_meta_SOURCES = flist_type_meta.c flist_type_meta_OBJECTS = flist_type_meta.$(OBJEXT) flist_type_meta_LDADD = $(LDADD) flist_type_meta_DEPENDENCIES = ../src/libgetdata.la flist_type_meta_hidden_SOURCES = flist_type_meta_hidden.c flist_type_meta_hidden_OBJECTS = flist_type_meta_hidden.$(OBJEXT) flist_type_meta_hidden_LDADD = $(LDADD) flist_type_meta_hidden_DEPENDENCIES = ../src/libgetdata.la flist_type_meta_invalid_SOURCES = flist_type_meta_invalid.c flist_type_meta_invalid_OBJECTS = flist_type_meta_invalid.$(OBJEXT) flist_type_meta_invalid_LDADD = $(LDADD) flist_type_meta_invalid_DEPENDENCIES = ../src/libgetdata.la flush_all_SOURCES = flush_all.c flush_all_OBJECTS = flush_all.$(OBJEXT) flush_all_LDADD = $(LDADD) flush_all_DEPENDENCIES = ../src/libgetdata.la flush_amb_code_SOURCES = flush_amb_code.c flush_amb_code_OBJECTS = flush_amb_code.$(OBJEXT) flush_amb_code_LDADD = $(LDADD) flush_amb_code_DEPENDENCIES = ../src/libgetdata.la flush_bad_code_SOURCES = flush_bad_code.c flush_bad_code_OBJECTS = flush_bad_code.$(OBJEXT) flush_bad_code_LDADD = $(LDADD) flush_bad_code_DEPENDENCIES = ../src/libgetdata.la flush_flush_SOURCES = flush_flush.c flush_flush_OBJECTS = flush_flush.$(OBJEXT) flush_flush_LDADD = $(LDADD) flush_flush_DEPENDENCIES = ../src/libgetdata.la flush_hex_SOURCES = flush_hex.c flush_hex_OBJECTS = flush_hex.$(OBJEXT) flush_hex_LDADD = $(LDADD) flush_hex_DEPENDENCIES = ../src/libgetdata.la flush_invalid_SOURCES = flush_invalid.c flush_invalid_OBJECTS = flush_invalid.$(OBJEXT) flush_invalid_LDADD = $(LDADD) flush_invalid_DEPENDENCIES = ../src/libgetdata.la flush_lincom_SOURCES = flush_lincom.c flush_lincom_OBJECTS = flush_lincom.$(OBJEXT) flush_lincom_LDADD = $(LDADD) flush_lincom_DEPENDENCIES = ../src/libgetdata.la flush_lincom1_SOURCES = flush_lincom1.c flush_lincom1_OBJECTS = flush_lincom1.$(OBJEXT) flush_lincom1_LDADD = $(LDADD) flush_lincom1_DEPENDENCIES = ../src/libgetdata.la flush_meta_SOURCES = flush_meta.c flush_meta_OBJECTS = flush_meta.$(OBJEXT) flush_meta_LDADD = $(LDADD) flush_meta_DEPENDENCIES = ../src/libgetdata.la flush_mult_SOURCES = flush_mult.c flush_mult_OBJECTS = flush_mult.$(OBJEXT) flush_mult_LDADD = $(LDADD) flush_mult_DEPENDENCIES = ../src/libgetdata.la flush_raw_close_SOURCES = flush_raw_close.c flush_raw_close_OBJECTS = flush_raw_close.$(OBJEXT) flush_raw_close_LDADD = $(LDADD) flush_raw_close_DEPENDENCIES = ../src/libgetdata.la flush_ref_SOURCES = flush_ref.c flush_ref_OBJECTS = flush_ref.$(OBJEXT) flush_ref_LDADD = $(LDADD) flush_ref_DEPENDENCIES = ../src/libgetdata.la flush_spec_SOURCES = flush_spec.c flush_spec_OBJECTS = flush_spec.$(OBJEXT) flush_spec_LDADD = $(LDADD) flush_spec_DEPENDENCIES = ../src/libgetdata.la flush_string_SOURCES = flush_string.c flush_string_OBJECTS = flush_string.$(OBJEXT) flush_string_LDADD = $(LDADD) flush_string_DEPENDENCIES = ../src/libgetdata.la flush_sync_SOURCES = flush_sync.c flush_sync_OBJECTS = flush_sync.$(OBJEXT) flush_sync_LDADD = $(LDADD) flush_sync_DEPENDENCIES = ../src/libgetdata.la foffs_alter_SOURCES = foffs_alter.c foffs_alter_OBJECTS = foffs_alter.$(OBJEXT) foffs_alter_LDADD = $(LDADD) foffs_alter_DEPENDENCIES = ../src/libgetdata.la foffs_alter_all_SOURCES = foffs_alter_all.c foffs_alter_all_OBJECTS = foffs_alter_all.$(OBJEXT) foffs_alter_all_LDADD = $(LDADD) foffs_alter_all_DEPENDENCIES = ../src/libgetdata.la foffs_get_SOURCES = foffs_get.c foffs_get_OBJECTS = foffs_get.$(OBJEXT) foffs_get_LDADD = $(LDADD) foffs_get_DEPENDENCIES = ../src/libgetdata.la foffs_move_SOURCES = foffs_move.c foffs_move_OBJECTS = foffs_move.$(OBJEXT) foffs_move_LDADD = $(LDADD) foffs_move_DEPENDENCIES = ../src/libgetdata.la fragment_affix_SOURCES = fragment_affix.c fragment_affix_OBJECTS = fragment_affix.$(OBJEXT) fragment_affix_LDADD = $(LDADD) fragment_affix_DEPENDENCIES = ../src/libgetdata.la fragment_affix_alter_SOURCES = fragment_affix_alter.c fragment_affix_alter_OBJECTS = fragment_affix_alter.$(OBJEXT) fragment_affix_alter_LDADD = $(LDADD) fragment_affix_alter_DEPENDENCIES = ../src/libgetdata.la fragment_affix_alter2_SOURCES = fragment_affix_alter2.c fragment_affix_alter2_OBJECTS = fragment_affix_alter2.$(OBJEXT) fragment_affix_alter2_LDADD = $(LDADD) fragment_affix_alter2_DEPENDENCIES = ../src/libgetdata.la fragment_affix_alter_code_SOURCES = fragment_affix_alter_code.c fragment_affix_alter_code_OBJECTS = \ fragment_affix_alter_code.$(OBJEXT) fragment_affix_alter_code_LDADD = $(LDADD) fragment_affix_alter_code_DEPENDENCIES = ../src/libgetdata.la fragment_affix_alter_nop_SOURCES = fragment_affix_alter_nop.c fragment_affix_alter_nop_OBJECTS = fragment_affix_alter_nop.$(OBJEXT) fragment_affix_alter_nop_LDADD = $(LDADD) fragment_affix_alter_nop_DEPENDENCIES = ../src/libgetdata.la fragment_affix_dup_SOURCES = fragment_affix_dup.c fragment_affix_dup_OBJECTS = fragment_affix_dup.$(OBJEXT) fragment_affix_dup_LDADD = $(LDADD) fragment_affix_dup_DEPENDENCIES = ../src/libgetdata.la fragment_index_SOURCES = fragment_index.c fragment_index_OBJECTS = fragment_index.$(OBJEXT) fragment_index_LDADD = $(LDADD) fragment_index_DEPENDENCIES = ../src/libgetdata.la fragment_index_alias_SOURCES = fragment_index_alias.c fragment_index_alias_OBJECTS = fragment_index_alias.$(OBJEXT) fragment_index_alias_LDADD = $(LDADD) fragment_index_alias_DEPENDENCIES = ../src/libgetdata.la fragment_name_SOURCES = fragment_name.c fragment_name_OBJECTS = fragment_name.$(OBJEXT) fragment_name_LDADD = $(LDADD) fragment_name_DEPENDENCIES = ../src/libgetdata.la fragment_name_oor_SOURCES = fragment_name_oor.c fragment_name_oor_OBJECTS = fragment_name_oor.$(OBJEXT) fragment_name_oor_LDADD = $(LDADD) fragment_name_oor_DEPENDENCIES = ../src/libgetdata.la fragment_num_SOURCES = fragment_num.c fragment_num_OBJECTS = fragment_num.$(OBJEXT) fragment_num_LDADD = $(LDADD) fragment_num_DEPENDENCIES = ../src/libgetdata.la fragment_parent_SOURCES = fragment_parent.c fragment_parent_OBJECTS = fragment_parent.$(OBJEXT) fragment_parent_LDADD = $(LDADD) fragment_parent_DEPENDENCIES = ../src/libgetdata.la get64_SOURCES = get64.c get64_OBJECTS = get64.$(OBJEXT) get64_LDADD = $(LDADD) get64_DEPENDENCIES = ../src/libgetdata.la get_affix_SOURCES = get_affix.c get_affix_OBJECTS = get_affix.$(OBJEXT) get_affix_LDADD = $(LDADD) get_affix_DEPENDENCIES = ../src/libgetdata.la get_bad_code_SOURCES = get_bad_code.c get_bad_code_OBJECTS = get_bad_code.$(OBJEXT) get_bad_code_LDADD = $(LDADD) get_bad_code_DEPENDENCIES = ../src/libgetdata.la get_bit_SOURCES = get_bit.c get_bit_OBJECTS = get_bit.$(OBJEXT) get_bit_LDADD = $(LDADD) get_bit_DEPENDENCIES = ../src/libgetdata.la get_carray_SOURCES = get_carray.c get_carray_OBJECTS = get_carray.$(OBJEXT) get_carray_LDADD = $(LDADD) get_carray_DEPENDENCIES = ../src/libgetdata.la get_carray_c2r_SOURCES = get_carray_c2r.c get_carray_c2r_OBJECTS = get_carray_c2r.$(OBJEXT) get_carray_c2r_LDADD = $(LDADD) get_carray_c2r_DEPENDENCIES = ../src/libgetdata.la get_carray_len_SOURCES = get_carray_len.c get_carray_len_OBJECTS = get_carray_len.$(OBJEXT) get_carray_len_LDADD = $(LDADD) get_carray_len_DEPENDENCIES = ../src/libgetdata.la get_carray_slice_SOURCES = get_carray_slice.c get_carray_slice_OBJECTS = get_carray_slice.$(OBJEXT) get_carray_slice_LDADD = $(LDADD) get_carray_slice_DEPENDENCIES = ../src/libgetdata.la get_char_SOURCES = get_char.c get_char_OBJECTS = get_char.$(OBJEXT) get_char_LDADD = $(LDADD) get_char_DEPENDENCIES = ../src/libgetdata.la get_clincom_SOURCES = get_clincom.c get_clincom_OBJECTS = get_clincom.$(OBJEXT) get_clincom_LDADD = $(LDADD) get_clincom_DEPENDENCIES = ../src/libgetdata.la get_complex128_SOURCES = get_complex128.c get_complex128_OBJECTS = get_complex128.$(OBJEXT) get_complex128_LDADD = $(LDADD) get_complex128_DEPENDENCIES = ../src/libgetdata.la get_complex64_SOURCES = get_complex64.c get_complex64_OBJECTS = get_complex64.$(OBJEXT) get_complex64_LDADD = $(LDADD) get_complex64_DEPENDENCIES = ../src/libgetdata.la get_const_SOURCES = get_const.c get_const_OBJECTS = get_const.$(OBJEXT) get_const_LDADD = $(LDADD) get_const_DEPENDENCIES = ../src/libgetdata.la get_const_carray_SOURCES = get_const_carray.c get_const_carray_OBJECTS = get_const_carray.$(OBJEXT) get_const_carray_LDADD = $(LDADD) get_const_carray_DEPENDENCIES = ../src/libgetdata.la get_const_complex_SOURCES = get_const_complex.c get_const_complex_OBJECTS = get_const_complex.$(OBJEXT) get_const_complex_LDADD = $(LDADD) get_const_complex_DEPENDENCIES = ../src/libgetdata.la get_const_repr_SOURCES = get_const_repr.c get_const_repr_OBJECTS = get_const_repr.$(OBJEXT) get_const_repr_LDADD = $(LDADD) get_const_repr_DEPENDENCIES = ../src/libgetdata.la get_cpolynom_SOURCES = get_cpolynom.c get_cpolynom_OBJECTS = get_cpolynom.$(OBJEXT) get_cpolynom_LDADD = $(LDADD) get_cpolynom_DEPENDENCIES = ../src/libgetdata.la get_cpolynom1_SOURCES = get_cpolynom1.c get_cpolynom1_OBJECTS = get_cpolynom1.$(OBJEXT) get_cpolynom1_LDADD = $(LDADD) get_cpolynom1_DEPENDENCIES = ../src/libgetdata.la get_cpolynom_int_SOURCES = get_cpolynom_int.c get_cpolynom_int_OBJECTS = get_cpolynom_int.$(OBJEXT) get_cpolynom_int_LDADD = $(LDADD) get_cpolynom_int_DEPENDENCIES = ../src/libgetdata.la get_dim_SOURCES = get_dim.c get_dim_OBJECTS = get_dim.$(OBJEXT) get_dim_LDADD = $(LDADD) get_dim_DEPENDENCIES = ../src/libgetdata.la get_divide_SOURCES = get_divide.c get_divide_OBJECTS = get_divide.$(OBJEXT) get_divide_LDADD = $(LDADD) get_divide_DEPENDENCIES = ../src/libgetdata.la get_divide_ccin_SOURCES = get_divide_ccin.c get_divide_ccin_OBJECTS = get_divide_ccin.$(OBJEXT) get_divide_ccin_LDADD = $(LDADD) get_divide_ccin_DEPENDENCIES = ../src/libgetdata.la get_divide_crin_SOURCES = get_divide_crin.c get_divide_crin_OBJECTS = get_divide_crin.$(OBJEXT) get_divide_crin_LDADD = $(LDADD) get_divide_crin_DEPENDENCIES = ../src/libgetdata.la get_divide_crinr_SOURCES = get_divide_crinr.c get_divide_crinr_OBJECTS = get_divide_crinr.$(OBJEXT) get_divide_crinr_LDADD = $(LDADD) get_divide_crinr_DEPENDENCIES = ../src/libgetdata.la get_divide_rcin_SOURCES = get_divide_rcin.c get_divide_rcin_OBJECTS = get_divide_rcin.$(OBJEXT) get_divide_rcin_LDADD = $(LDADD) get_divide_rcin_DEPENDENCIES = ../src/libgetdata.la get_divide_s_SOURCES = get_divide_s.c get_divide_s_OBJECTS = get_divide_s.$(OBJEXT) get_divide_s_LDADD = $(LDADD) get_divide_s_DEPENDENCIES = ../src/libgetdata.la get_endian16_SOURCES = get_endian16.c get_endian16_OBJECTS = get_endian16.$(OBJEXT) get_endian16_LDADD = $(LDADD) get_endian16_DEPENDENCIES = ../src/libgetdata.la get_endian32_SOURCES = get_endian32.c get_endian32_OBJECTS = get_endian32.$(OBJEXT) get_endian32_LDADD = $(LDADD) get_endian32_DEPENDENCIES = ../src/libgetdata.la get_endian64_SOURCES = get_endian64.c get_endian64_OBJECTS = get_endian64.$(OBJEXT) get_endian64_LDADD = $(LDADD) get_endian64_DEPENDENCIES = ../src/libgetdata.la get_endian8_SOURCES = get_endian8.c get_endian8_OBJECTS = get_endian8.$(OBJEXT) get_endian8_LDADD = $(LDADD) get_endian8_DEPENDENCIES = ../src/libgetdata.la get_endian_complex128_arm_SOURCES = get_endian_complex128_arm.c get_endian_complex128_arm_OBJECTS = \ get_endian_complex128_arm.$(OBJEXT) get_endian_complex128_arm_LDADD = $(LDADD) get_endian_complex128_arm_DEPENDENCIES = ../src/libgetdata.la get_endian_complex128_big_SOURCES = get_endian_complex128_big.c get_endian_complex128_big_OBJECTS = \ get_endian_complex128_big.$(OBJEXT) get_endian_complex128_big_LDADD = $(LDADD) get_endian_complex128_big_DEPENDENCIES = ../src/libgetdata.la get_endian_complex128_little_SOURCES = get_endian_complex128_little.c get_endian_complex128_little_OBJECTS = \ get_endian_complex128_little.$(OBJEXT) get_endian_complex128_little_LDADD = $(LDADD) get_endian_complex128_little_DEPENDENCIES = ../src/libgetdata.la get_endian_complex64_arm_SOURCES = get_endian_complex64_arm.c get_endian_complex64_arm_OBJECTS = get_endian_complex64_arm.$(OBJEXT) get_endian_complex64_arm_LDADD = $(LDADD) get_endian_complex64_arm_DEPENDENCIES = ../src/libgetdata.la get_endian_complex64_big_SOURCES = get_endian_complex64_big.c get_endian_complex64_big_OBJECTS = get_endian_complex64_big.$(OBJEXT) get_endian_complex64_big_LDADD = $(LDADD) get_endian_complex64_big_DEPENDENCIES = ../src/libgetdata.la get_endian_complex64_little_SOURCES = get_endian_complex64_little.c get_endian_complex64_little_OBJECTS = \ get_endian_complex64_little.$(OBJEXT) get_endian_complex64_little_LDADD = $(LDADD) get_endian_complex64_little_DEPENDENCIES = ../src/libgetdata.la get_endian_float32_arm_SOURCES = get_endian_float32_arm.c get_endian_float32_arm_OBJECTS = get_endian_float32_arm.$(OBJEXT) get_endian_float32_arm_LDADD = $(LDADD) get_endian_float32_arm_DEPENDENCIES = ../src/libgetdata.la get_endian_float32_big_SOURCES = get_endian_float32_big.c get_endian_float32_big_OBJECTS = get_endian_float32_big.$(OBJEXT) get_endian_float32_big_LDADD = $(LDADD) get_endian_float32_big_DEPENDENCIES = ../src/libgetdata.la get_endian_float32_little_SOURCES = get_endian_float32_little.c get_endian_float32_little_OBJECTS = \ get_endian_float32_little.$(OBJEXT) get_endian_float32_little_LDADD = $(LDADD) get_endian_float32_little_DEPENDENCIES = ../src/libgetdata.la get_endian_float64_arm_SOURCES = get_endian_float64_arm.c get_endian_float64_arm_OBJECTS = get_endian_float64_arm.$(OBJEXT) get_endian_float64_arm_LDADD = $(LDADD) get_endian_float64_arm_DEPENDENCIES = ../src/libgetdata.la get_endian_float64_big_SOURCES = get_endian_float64_big.c get_endian_float64_big_OBJECTS = get_endian_float64_big.$(OBJEXT) get_endian_float64_big_LDADD = $(LDADD) get_endian_float64_big_DEPENDENCIES = ../src/libgetdata.la get_endian_float64_little_SOURCES = get_endian_float64_little.c get_endian_float64_little_OBJECTS = \ get_endian_float64_little.$(OBJEXT) get_endian_float64_little_LDADD = $(LDADD) get_endian_float64_little_DEPENDENCIES = ../src/libgetdata.la get_ff_SOURCES = get_ff.c get_ff_OBJECTS = get_ff.$(OBJEXT) get_ff_LDADD = $(LDADD) get_ff_DEPENDENCIES = ../src/libgetdata.la get_float32_SOURCES = get_float32.c get_float32_OBJECTS = get_float32.$(OBJEXT) get_float32_LDADD = $(LDADD) get_float32_DEPENDENCIES = ../src/libgetdata.la get_float64_SOURCES = get_float64.c get_float64_OBJECTS = get_float64.$(OBJEXT) get_float64_LDADD = $(LDADD) get_float64_DEPENDENCIES = ../src/libgetdata.la get_foffs_SOURCES = get_foffs.c get_foffs_OBJECTS = get_foffs.$(OBJEXT) get_foffs_LDADD = $(LDADD) get_foffs_DEPENDENCIES = ../src/libgetdata.la get_foffs2_SOURCES = get_foffs2.c get_foffs2_OBJECTS = get_foffs2.$(OBJEXT) get_foffs2_LDADD = $(LDADD) get_foffs2_DEPENDENCIES = ../src/libgetdata.la get_fs_SOURCES = get_fs.c get_fs_OBJECTS = get_fs.$(OBJEXT) get_fs_LDADD = $(LDADD) get_fs_DEPENDENCIES = ../src/libgetdata.la get_here_SOURCES = get_here.c get_here_OBJECTS = get_here.$(OBJEXT) get_here_LDADD = $(LDADD) get_here_DEPENDENCIES = ../src/libgetdata.la get_here_foffs_SOURCES = get_here_foffs.c get_here_foffs_OBJECTS = get_here_foffs.$(OBJEXT) get_here_foffs_LDADD = $(LDADD) get_here_foffs_DEPENDENCIES = ../src/libgetdata.la get_heres_SOURCES = get_heres.c get_heres_OBJECTS = get_heres.$(OBJEXT) get_heres_LDADD = $(LDADD) get_heres_DEPENDENCIES = ../src/libgetdata.la get_index_complex_SOURCES = get_index_complex.c get_index_complex_OBJECTS = get_index_complex.$(OBJEXT) get_index_complex_LDADD = $(LDADD) get_index_complex_DEPENDENCIES = ../src/libgetdata.la get_int16_SOURCES = get_int16.c get_int16_OBJECTS = get_int16.$(OBJEXT) get_int16_LDADD = $(LDADD) get_int16_DEPENDENCIES = ../src/libgetdata.la get_int32_SOURCES = get_int32.c get_int32_OBJECTS = get_int32.$(OBJEXT) get_int32_LDADD = $(LDADD) get_int32_DEPENDENCIES = ../src/libgetdata.la get_int64_SOURCES = get_int64.c get_int64_OBJECTS = get_int64.$(OBJEXT) get_int64_LDADD = $(LDADD) get_int64_DEPENDENCIES = ../src/libgetdata.la get_int8_SOURCES = get_int8.c get_int8_OBJECTS = get_int8.$(OBJEXT) get_int8_LDADD = $(LDADD) get_int8_DEPENDENCIES = ../src/libgetdata.la get_invalid_SOURCES = get_invalid.c get_invalid_OBJECTS = get_invalid.$(OBJEXT) get_invalid_LDADD = $(LDADD) get_invalid_DEPENDENCIES = ../src/libgetdata.la get_lincom1_SOURCES = get_lincom1.c get_lincom1_OBJECTS = get_lincom1.$(OBJEXT) get_lincom1_LDADD = $(LDADD) get_lincom1_DEPENDENCIES = ../src/libgetdata.la get_lincom2_SOURCES = get_lincom2.c get_lincom2_OBJECTS = get_lincom2.$(OBJEXT) get_lincom2_LDADD = $(LDADD) get_lincom2_DEPENDENCIES = ../src/libgetdata.la get_lincom2s_SOURCES = get_lincom2s.c get_lincom2s_OBJECTS = get_lincom2s.$(OBJEXT) get_lincom2s_LDADD = $(LDADD) get_lincom2s_DEPENDENCIES = ../src/libgetdata.la get_lincom3_SOURCES = get_lincom3.c get_lincom3_OBJECTS = get_lincom3.$(OBJEXT) get_lincom3_LDADD = $(LDADD) get_lincom3_DEPENDENCIES = ../src/libgetdata.la get_lincom3s_SOURCES = get_lincom3s.c get_lincom3s_OBJECTS = get_lincom3s.$(OBJEXT) get_lincom3s_LDADD = $(LDADD) get_lincom3s_DEPENDENCIES = ../src/libgetdata.la get_lincom_mdt_SOURCES = get_lincom_mdt.c get_lincom_mdt_OBJECTS = get_lincom_mdt.$(OBJEXT) get_lincom_mdt_LDADD = $(LDADD) get_lincom_mdt_DEPENDENCIES = ../src/libgetdata.la get_lincom_noin_SOURCES = get_lincom_noin.c get_lincom_noin_OBJECTS = get_lincom_noin.$(OBJEXT) get_lincom_noin_LDADD = $(LDADD) get_lincom_noin_DEPENDENCIES = ../src/libgetdata.la get_lincom_non_SOURCES = get_lincom_non.c get_lincom_non_OBJECTS = get_lincom_non.$(OBJEXT) get_lincom_non_LDADD = $(LDADD) get_lincom_non_DEPENDENCIES = ../src/libgetdata.la get_lincom_null_SOURCES = get_lincom_null.c get_lincom_null_OBJECTS = get_lincom_null.$(OBJEXT) get_lincom_null_LDADD = $(LDADD) get_lincom_null_DEPENDENCIES = ../src/libgetdata.la get_lincom_spf_SOURCES = get_lincom_spf.c get_lincom_spf_OBJECTS = get_lincom_spf.$(OBJEXT) get_lincom_spf_LDADD = $(LDADD) get_lincom_spf_DEPENDENCIES = ../src/libgetdata.la get_linterp_SOURCES = get_linterp.c get_linterp_OBJECTS = get_linterp.$(OBJEXT) get_linterp_LDADD = $(LDADD) get_linterp_DEPENDENCIES = ../src/libgetdata.la get_linterp1_SOURCES = get_linterp1.c get_linterp1_OBJECTS = get_linterp1.$(OBJEXT) get_linterp1_LDADD = $(LDADD) get_linterp1_DEPENDENCIES = ../src/libgetdata.la get_linterp_abs_SOURCES = get_linterp_abs.c get_linterp_abs_OBJECTS = get_linterp_abs.$(OBJEXT) get_linterp_abs_LDADD = $(LDADD) get_linterp_abs_DEPENDENCIES = ../src/libgetdata.la get_linterp_complex_SOURCES = get_linterp_complex.c get_linterp_complex_OBJECTS = get_linterp_complex.$(OBJEXT) get_linterp_complex_LDADD = $(LDADD) get_linterp_complex_DEPENDENCIES = ../src/libgetdata.la get_linterp_empty_SOURCES = get_linterp_empty.c get_linterp_empty_OBJECTS = get_linterp_empty.$(OBJEXT) get_linterp_empty_LDADD = $(LDADD) get_linterp_empty_DEPENDENCIES = ../src/libgetdata.la get_linterp_noin_SOURCES = get_linterp_noin.c get_linterp_noin_OBJECTS = get_linterp_noin.$(OBJEXT) get_linterp_noin_LDADD = $(LDADD) get_linterp_noin_DEPENDENCIES = ../src/libgetdata.la get_linterp_notab_SOURCES = get_linterp_notab.c get_linterp_notab_OBJECTS = get_linterp_notab.$(OBJEXT) get_linterp_notab_LDADD = $(LDADD) get_linterp_notab_DEPENDENCIES = ../src/libgetdata.la get_linterp_sort_SOURCES = get_linterp_sort.c get_linterp_sort_OBJECTS = get_linterp_sort.$(OBJEXT) get_linterp_sort_LDADD = $(LDADD) get_linterp_sort_DEPENDENCIES = ../src/libgetdata.la get_mplex_SOURCES = get_mplex.c get_mplex_OBJECTS = get_mplex.$(OBJEXT) get_mplex_LDADD = $(LDADD) get_mplex_DEPENDENCIES = ../src/libgetdata.la get_mplex_bof_SOURCES = get_mplex_bof.c get_mplex_bof_OBJECTS = get_mplex_bof.$(OBJEXT) get_mplex_bof_LDADD = $(LDADD) get_mplex_bof_DEPENDENCIES = ../src/libgetdata.la get_mplex_complex_SOURCES = get_mplex_complex.c get_mplex_complex_OBJECTS = get_mplex_complex.$(OBJEXT) get_mplex_complex_LDADD = $(LDADD) get_mplex_complex_DEPENDENCIES = ../src/libgetdata.la get_mplex_lb_SOURCES = get_mplex_lb.c get_mplex_lb_OBJECTS = get_mplex_lb.$(OBJEXT) get_mplex_lb_LDADD = $(LDADD) get_mplex_lb_DEPENDENCIES = ../src/libgetdata.la get_mplex_lball_SOURCES = get_mplex_lball.c get_mplex_lball_OBJECTS = get_mplex_lball.$(OBJEXT) get_mplex_lball_LDADD = $(LDADD) get_mplex_lball_DEPENDENCIES = ../src/libgetdata.la get_mplex_nolb_SOURCES = get_mplex_nolb.c get_mplex_nolb_OBJECTS = get_mplex_nolb.$(OBJEXT) get_mplex_nolb_LDADD = $(LDADD) get_mplex_nolb_DEPENDENCIES = ../src/libgetdata.la get_mplex_s_SOURCES = get_mplex_s.c get_mplex_s_OBJECTS = get_mplex_s.$(OBJEXT) get_mplex_s_LDADD = $(LDADD) get_mplex_s_DEPENDENCIES = ../src/libgetdata.la get_mplex_saved_SOURCES = get_mplex_saved.c get_mplex_saved_OBJECTS = get_mplex_saved.$(OBJEXT) get_mplex_saved_LDADD = $(LDADD) get_mplex_saved_DEPENDENCIES = ../src/libgetdata.la get_multiply_SOURCES = get_multiply.c get_multiply_OBJECTS = get_multiply.$(OBJEXT) get_multiply_LDADD = $(LDADD) get_multiply_DEPENDENCIES = ../src/libgetdata.la get_multiply_ccin_SOURCES = get_multiply_ccin.c get_multiply_ccin_OBJECTS = get_multiply_ccin.$(OBJEXT) get_multiply_ccin_LDADD = $(LDADD) get_multiply_ccin_DEPENDENCIES = ../src/libgetdata.la get_multiply_crin_SOURCES = get_multiply_crin.c get_multiply_crin_OBJECTS = get_multiply_crin.$(OBJEXT) get_multiply_crin_LDADD = $(LDADD) get_multiply_crin_DEPENDENCIES = ../src/libgetdata.la get_multiply_crinr_SOURCES = get_multiply_crinr.c get_multiply_crinr_OBJECTS = get_multiply_crinr.$(OBJEXT) get_multiply_crinr_LDADD = $(LDADD) get_multiply_crinr_DEPENDENCIES = ../src/libgetdata.la get_multiply_noin_SOURCES = get_multiply_noin.c get_multiply_noin_OBJECTS = get_multiply_noin.$(OBJEXT) get_multiply_noin_LDADD = $(LDADD) get_multiply_noin_DEPENDENCIES = ../src/libgetdata.la get_multiply_rcin_SOURCES = get_multiply_rcin.c get_multiply_rcin_OBJECTS = get_multiply_rcin.$(OBJEXT) get_multiply_rcin_LDADD = $(LDADD) get_multiply_rcin_DEPENDENCIES = ../src/libgetdata.la get_multiply_s_SOURCES = get_multiply_s.c get_multiply_s_OBJECTS = get_multiply_s.$(OBJEXT) get_multiply_s_LDADD = $(LDADD) get_multiply_s_DEPENDENCIES = ../src/libgetdata.la get_neg_SOURCES = get_neg.c get_neg_OBJECTS = get_neg.$(OBJEXT) get_neg_LDADD = $(LDADD) get_neg_DEPENDENCIES = ../src/libgetdata.la get_none_SOURCES = get_none.c get_none_OBJECTS = get_none.$(OBJEXT) get_none_LDADD = $(LDADD) get_none_DEPENDENCIES = ../src/libgetdata.la get_nonexistent_SOURCES = get_nonexistent.c get_nonexistent_OBJECTS = get_nonexistent.$(OBJEXT) get_nonexistent_LDADD = $(LDADD) get_nonexistent_DEPENDENCIES = ../src/libgetdata.la get_null_SOURCES = get_null.c get_null_OBJECTS = get_null.$(OBJEXT) get_null_LDADD = $(LDADD) get_null_DEPENDENCIES = ../src/libgetdata.la get_off64_SOURCES = get_off64.c get_off64_OBJECTS = get_off64.$(OBJEXT) get_off64_LDADD = $(LDADD) get_off64_DEPENDENCIES = ../src/libgetdata.la get_phase_SOURCES = get_phase.c get_phase_OBJECTS = get_phase.$(OBJEXT) get_phase_LDADD = $(LDADD) get_phase_DEPENDENCIES = ../src/libgetdata.la get_phase_affix_SOURCES = get_phase_affix.c get_phase_affix_OBJECTS = get_phase_affix.$(OBJEXT) get_phase_affix_LDADD = $(LDADD) get_phase_affix_DEPENDENCIES = ../src/libgetdata.la get_polynom_SOURCES = get_polynom.c get_polynom_OBJECTS = get_polynom.$(OBJEXT) get_polynom_LDADD = $(LDADD) get_polynom_DEPENDENCIES = ../src/libgetdata.la get_polynom_cmpin_SOURCES = get_polynom_cmpin.c get_polynom_cmpin_OBJECTS = get_polynom_cmpin.$(OBJEXT) get_polynom_cmpin_LDADD = $(LDADD) get_polynom_cmpin_DEPENDENCIES = ../src/libgetdata.la get_polynom_noin_SOURCES = get_polynom_noin.c get_polynom_noin_OBJECTS = get_polynom_noin.$(OBJEXT) get_polynom_noin_LDADD = $(LDADD) get_polynom_noin_DEPENDENCIES = ../src/libgetdata.la get_recip_SOURCES = get_recip.c get_recip_OBJECTS = get_recip.$(OBJEXT) get_recip_LDADD = $(LDADD) get_recip_DEPENDENCIES = ../src/libgetdata.la get_recip_const_SOURCES = get_recip_const.c get_recip_const_OBJECTS = get_recip_const.$(OBJEXT) get_recip_const_LDADD = $(LDADD) get_recip_const_DEPENDENCIES = ../src/libgetdata.la get_recurse_SOURCES = get_recurse.c get_recurse_OBJECTS = get_recurse.$(OBJEXT) get_recurse_LDADD = $(LDADD) get_recurse_DEPENDENCIES = ../src/libgetdata.la get_rofs_SOURCES = get_rofs.c get_rofs_OBJECTS = get_rofs.$(OBJEXT) get_rofs_LDADD = $(LDADD) get_rofs_DEPENDENCIES = ../src/libgetdata.la get_sbit_SOURCES = get_sbit.c get_sbit_OBJECTS = get_sbit.$(OBJEXT) get_sbit_LDADD = $(LDADD) get_sbit_DEPENDENCIES = ../src/libgetdata.la get_sf_SOURCES = get_sf.c get_sf_OBJECTS = get_sf.$(OBJEXT) get_sf_LDADD = $(LDADD) get_sf_DEPENDENCIES = ../src/libgetdata.la get_ss_SOURCES = get_ss.c get_ss_OBJECTS = get_ss.$(OBJEXT) get_ss_LDADD = $(LDADD) get_ss_DEPENDENCIES = ../src/libgetdata.la get_string_SOURCES = get_string.c get_string_OBJECTS = get_string.$(OBJEXT) get_string_LDADD = $(LDADD) get_string_DEPENDENCIES = ../src/libgetdata.la get_type_SOURCES = get_type.c get_type_OBJECTS = get_type.$(OBJEXT) get_type_LDADD = $(LDADD) get_type_DEPENDENCIES = ../src/libgetdata.la get_uint16_SOURCES = get_uint16.c get_uint16_OBJECTS = get_uint16.$(OBJEXT) get_uint16_LDADD = $(LDADD) get_uint16_DEPENDENCIES = ../src/libgetdata.la get_uint32_SOURCES = get_uint32.c get_uint32_OBJECTS = get_uint32.$(OBJEXT) get_uint32_LDADD = $(LDADD) get_uint32_DEPENDENCIES = ../src/libgetdata.la get_uint64_SOURCES = get_uint64.c get_uint64_OBJECTS = get_uint64.$(OBJEXT) get_uint64_LDADD = $(LDADD) get_uint64_DEPENDENCIES = ../src/libgetdata.la get_window_SOURCES = get_window.c get_window_OBJECTS = get_window.$(OBJEXT) get_window_LDADD = $(LDADD) get_window_DEPENDENCIES = ../src/libgetdata.la get_window_clr_SOURCES = get_window_clr.c get_window_clr_OBJECTS = get_window_clr.$(OBJEXT) get_window_clr_LDADD = $(LDADD) get_window_clr_DEPENDENCIES = ../src/libgetdata.la get_window_complex_SOURCES = get_window_complex.c get_window_complex_OBJECTS = get_window_complex.$(OBJEXT) get_window_complex_LDADD = $(LDADD) get_window_complex_DEPENDENCIES = ../src/libgetdata.la get_window_ge_SOURCES = get_window_ge.c get_window_ge_OBJECTS = get_window_ge.$(OBJEXT) get_window_ge_LDADD = $(LDADD) get_window_ge_DEPENDENCIES = ../src/libgetdata.la get_window_gt_SOURCES = get_window_gt.c get_window_gt_OBJECTS = get_window_gt.$(OBJEXT) get_window_gt_LDADD = $(LDADD) get_window_gt_DEPENDENCIES = ../src/libgetdata.la get_window_le_SOURCES = get_window_le.c get_window_le_OBJECTS = get_window_le.$(OBJEXT) get_window_le_LDADD = $(LDADD) get_window_le_DEPENDENCIES = ../src/libgetdata.la get_window_lt_SOURCES = get_window_lt.c get_window_lt_OBJECTS = get_window_lt.$(OBJEXT) get_window_lt_LDADD = $(LDADD) get_window_lt_DEPENDENCIES = ../src/libgetdata.la get_window_ne_SOURCES = get_window_ne.c get_window_ne_OBJECTS = get_window_ne.$(OBJEXT) get_window_ne_LDADD = $(LDADD) get_window_ne_DEPENDENCIES = ../src/libgetdata.la get_window_s_SOURCES = get_window_s.c get_window_s_OBJECTS = get_window_s.$(OBJEXT) get_window_s_LDADD = $(LDADD) get_window_s_DEPENDENCIES = ../src/libgetdata.la get_window_set_SOURCES = get_window_set.c get_window_set_OBJECTS = get_window_set.$(OBJEXT) get_window_set_LDADD = $(LDADD) get_window_set_DEPENDENCIES = ../src/libgetdata.la get_zero_SOURCES = get_zero.c get_zero_OBJECTS = get_zero.$(OBJEXT) get_zero_LDADD = $(LDADD) get_zero_DEPENDENCIES = ../src/libgetdata.la get_zero_complex_SOURCES = get_zero_complex.c get_zero_complex_OBJECTS = get_zero_complex.$(OBJEXT) get_zero_complex_LDADD = $(LDADD) get_zero_complex_DEPENDENCIES = ../src/libgetdata.la get_zero_float_SOURCES = get_zero_float.c get_zero_float_OBJECTS = get_zero_float.$(OBJEXT) get_zero_float_LDADD = $(LDADD) get_zero_float_DEPENDENCIES = ../src/libgetdata.la global_flags_SOURCES = global_flags.c global_flags_OBJECTS = global_flags.$(OBJEXT) global_flags_LDADD = $(LDADD) global_flags_DEPENDENCIES = ../src/libgetdata.la global_name_SOURCES = global_name.c global_name_OBJECTS = global_name.$(OBJEXT) global_name_LDADD = $(LDADD) global_name_DEPENDENCIES = ../src/libgetdata.la global_ref_SOURCES = global_ref.c global_ref_OBJECTS = global_ref.$(OBJEXT) global_ref_LDADD = $(LDADD) global_ref_DEPENDENCIES = ../src/libgetdata.la global_ref_empty_SOURCES = global_ref_empty.c global_ref_empty_OBJECTS = global_ref_empty.$(OBJEXT) global_ref_empty_LDADD = $(LDADD) global_ref_empty_DEPENDENCIES = ../src/libgetdata.la global_ref_set_SOURCES = global_ref_set.c global_ref_set_OBJECTS = global_ref_set.$(OBJEXT) global_ref_set_LDADD = $(LDADD) global_ref_set_DEPENDENCIES = ../src/libgetdata.la gzip_add_SOURCES = gzip_add.c gzip_add_OBJECTS = gzip_add.$(OBJEXT) gzip_add_LDADD = $(LDADD) gzip_add_DEPENDENCIES = ../src/libgetdata.la gzip_del_SOURCES = gzip_del.c gzip_del_OBJECTS = gzip_del.$(OBJEXT) gzip_del_LDADD = $(LDADD) gzip_del_DEPENDENCIES = ../src/libgetdata.la gzip_get_SOURCES = gzip_get.c gzip_get_OBJECTS = gzip_get.$(OBJEXT) gzip_get_LDADD = $(LDADD) gzip_get_DEPENDENCIES = ../src/libgetdata.la gzip_get_far_SOURCES = gzip_get_far.c gzip_get_far_OBJECTS = gzip_get_far.$(OBJEXT) gzip_get_far_LDADD = $(LDADD) gzip_get_far_DEPENDENCIES = ../src/libgetdata.la gzip_get_get_SOURCES = gzip_get_get.c gzip_get_get_OBJECTS = gzip_get_get.$(OBJEXT) gzip_get_get_LDADD = $(LDADD) gzip_get_get_DEPENDENCIES = ../src/libgetdata.la gzip_get_get2_SOURCES = gzip_get_get2.c gzip_get_get2_OBJECTS = gzip_get_get2.$(OBJEXT) gzip_get_get2_LDADD = $(LDADD) gzip_get_get2_DEPENDENCIES = ../src/libgetdata.la gzip_get_put_SOURCES = gzip_get_put.c gzip_get_put_OBJECTS = gzip_get_put.$(OBJEXT) gzip_get_put_LDADD = $(LDADD) gzip_get_put_DEPENDENCIES = ../src/libgetdata.la gzip_move_from_SOURCES = gzip_move_from.c gzip_move_from_OBJECTS = gzip_move_from.$(OBJEXT) gzip_move_from_LDADD = $(LDADD) gzip_move_from_DEPENDENCIES = ../src/libgetdata.la gzip_move_to_SOURCES = gzip_move_to.c gzip_move_to_OBJECTS = gzip_move_to.$(OBJEXT) gzip_move_to_LDADD = $(LDADD) gzip_move_to_DEPENDENCIES = ../src/libgetdata.la gzip_nframes_SOURCES = gzip_nframes.c gzip_nframes_OBJECTS = gzip_nframes.$(OBJEXT) gzip_nframes_LDADD = $(LDADD) gzip_nframes_DEPENDENCIES = ../src/libgetdata.la gzip_put_SOURCES = gzip_put.c gzip_put_OBJECTS = gzip_put.$(OBJEXT) gzip_put_LDADD = $(LDADD) gzip_put_DEPENDENCIES = ../src/libgetdata.la gzip_put_back_SOURCES = gzip_put_back.c gzip_put_back_OBJECTS = gzip_put_back.$(OBJEXT) gzip_put_back_LDADD = $(LDADD) gzip_put_back_DEPENDENCIES = ../src/libgetdata.la gzip_put_endian_SOURCES = gzip_put_endian.c gzip_put_endian_OBJECTS = gzip_put_endian.$(OBJEXT) gzip_put_endian_LDADD = $(LDADD) gzip_put_endian_DEPENDENCIES = ../src/libgetdata.la gzip_put_get_SOURCES = gzip_put_get.c gzip_put_get_OBJECTS = gzip_put_get.$(OBJEXT) gzip_put_get_LDADD = $(LDADD) gzip_put_get_DEPENDENCIES = ../src/libgetdata.la gzip_put_nframes_SOURCES = gzip_put_nframes.c gzip_put_nframes_OBJECTS = gzip_put_nframes.$(OBJEXT) gzip_put_nframes_LDADD = $(LDADD) gzip_put_nframes_DEPENDENCIES = ../src/libgetdata.la gzip_put_off_SOURCES = gzip_put_off.c gzip_put_off_OBJECTS = gzip_put_off.$(OBJEXT) gzip_put_off_LDADD = $(LDADD) gzip_put_off_DEPENDENCIES = ../src/libgetdata.la gzip_put_pad_SOURCES = gzip_put_pad.c gzip_put_pad_OBJECTS = gzip_put_pad.$(OBJEXT) gzip_put_pad_LDADD = $(LDADD) gzip_put_pad_DEPENDENCIES = ../src/libgetdata.la gzip_put_sub_SOURCES = gzip_put_sub.c gzip_put_sub_OBJECTS = gzip_put_sub.$(OBJEXT) gzip_put_sub_LDADD = $(LDADD) gzip_put_sub_DEPENDENCIES = ../src/libgetdata.la gzip_seek_SOURCES = gzip_seek.c gzip_seek_OBJECTS = gzip_seek.$(OBJEXT) gzip_seek_LDADD = $(LDADD) gzip_seek_DEPENDENCIES = ../src/libgetdata.la gzip_seek_far_SOURCES = gzip_seek_far.c gzip_seek_far_OBJECTS = gzip_seek_far.$(OBJEXT) gzip_seek_far_LDADD = $(LDADD) gzip_seek_far_DEPENDENCIES = ../src/libgetdata.la gzip_seek_put_SOURCES = gzip_seek_put.c gzip_seek_put_OBJECTS = gzip_seek_put.$(OBJEXT) gzip_seek_put_LDADD = $(LDADD) gzip_seek_put_DEPENDENCIES = ../src/libgetdata.la gzip_sync_SOURCES = gzip_sync.c gzip_sync_OBJECTS = gzip_sync.$(OBJEXT) gzip_sync_LDADD = $(LDADD) gzip_sync_DEPENDENCIES = ../src/libgetdata.la header_complex_SOURCES = header_complex.c header_complex_OBJECTS = header_complex.$(OBJEXT) header_complex_LDADD = $(LDADD) header_complex_DEPENDENCIES = ../src/libgetdata.la header_off64t_SOURCES = header_off64t.c header_off64t_OBJECTS = header_off64t.$(OBJEXT) header_off64t_LDADD = $(LDADD) header_off64t_DEPENDENCIES = ../src/libgetdata.la hide_SOURCES = hide.c hide_OBJECTS = hide.$(OBJEXT) hide_LDADD = $(LDADD) hide_DEPENDENCIES = ../src/libgetdata.la hide_hidden_SOURCES = hide_hidden.c hide_hidden_OBJECTS = hide_hidden.$(OBJEXT) hide_hidden_LDADD = $(LDADD) hide_hidden_DEPENDENCIES = ../src/libgetdata.la hide_unhide_SOURCES = hide_unhide.c hide_unhide_OBJECTS = hide_unhide.$(OBJEXT) hide_unhide_LDADD = $(LDADD) hide_unhide_DEPENDENCIES = ../src/libgetdata.la include_accmode_SOURCES = include_accmode.c include_accmode_OBJECTS = include_accmode.$(OBJEXT) include_accmode_LDADD = $(LDADD) include_accmode_DEPENDENCIES = ../src/libgetdata.la include_affix_SOURCES = include_affix.c include_affix_OBJECTS = include_affix.$(OBJEXT) include_affix_LDADD = $(LDADD) include_affix_DEPENDENCIES = ../src/libgetdata.la include_auto_SOURCES = include_auto.c include_auto_OBJECTS = include_auto.$(OBJEXT) include_auto_LDADD = $(LDADD) include_auto_DEPENDENCIES = ../src/libgetdata.la include_cb_SOURCES = include_cb.c include_cb_OBJECTS = include_cb.$(OBJEXT) include_cb_LDADD = $(LDADD) include_cb_DEPENDENCIES = ../src/libgetdata.la include_creat_SOURCES = include_creat.c include_creat_OBJECTS = include_creat.$(OBJEXT) include_creat_LDADD = $(LDADD) include_creat_DEPENDENCIES = ../src/libgetdata.la include_ignore_SOURCES = include_ignore.c include_ignore_OBJECTS = include_ignore.$(OBJEXT) include_ignore_LDADD = $(LDADD) include_ignore_DEPENDENCIES = ../src/libgetdata.la include_include_SOURCES = include_include.c include_include_OBJECTS = include_include.$(OBJEXT) include_include_LDADD = $(LDADD) include_include_DEPENDENCIES = ../src/libgetdata.la include_index_SOURCES = include_index.c include_index_OBJECTS = include_index.$(OBJEXT) include_index_LDADD = $(LDADD) include_index_DEPENDENCIES = ../src/libgetdata.la include_invalid_SOURCES = include_invalid.c include_invalid_OBJECTS = include_invalid.$(OBJEXT) include_invalid_LDADD = $(LDADD) include_invalid_DEPENDENCIES = ../src/libgetdata.la include_nonexistent_SOURCES = include_nonexistent.c include_nonexistent_OBJECTS = include_nonexistent.$(OBJEXT) include_nonexistent_LDADD = $(LDADD) include_nonexistent_DEPENDENCIES = ../src/libgetdata.la include_pc_SOURCES = include_pc.c include_pc_OBJECTS = include_pc.$(OBJEXT) include_pc_LDADD = $(LDADD) include_pc_DEPENDENCIES = ../src/libgetdata.la include_ref_SOURCES = include_ref.c include_ref_OBJECTS = include_ref.$(OBJEXT) include_ref_LDADD = $(LDADD) include_ref_DEPENDENCIES = ../src/libgetdata.la include_sub_SOURCES = include_sub.c include_sub_OBJECTS = include_sub.$(OBJEXT) include_sub_LDADD = $(LDADD) include_sub_DEPENDENCIES = ../src/libgetdata.la include_syntax_SOURCES = include_syntax.c include_syntax_OBJECTS = include_syntax.$(OBJEXT) include_syntax_LDADD = $(LDADD) include_syntax_DEPENDENCIES = ../src/libgetdata.la index_domain_SOURCES = index_domain.c index_domain_OBJECTS = index_domain.$(OBJEXT) index_domain_LDADD = $(LDADD) index_domain_DEPENDENCIES = ../src/libgetdata.la index_index_SOURCES = index_index.c index_index_OBJECTS = index_index.$(OBJEXT) index_index_LDADD = $(LDADD) index_index_DEPENDENCIES = ../src/libgetdata.la index_range_SOURCES = index_range.c index_range_OBJECTS = index_range.$(OBJEXT) index_range_LDADD = $(LDADD) index_range_DEPENDENCIES = ../src/libgetdata.la index_s_SOURCES = index_s.c index_s_OBJECTS = index_s.$(OBJEXT) index_s_LDADD = $(LDADD) index_s_DEPENDENCIES = ../src/libgetdata.la index_subset_SOURCES = index_subset.c index_subset_OBJECTS = index_subset.$(OBJEXT) index_subset_LDADD = $(LDADD) index_subset_DEPENDENCIES = ../src/libgetdata.la legacy_error_SOURCES = legacy_error.c legacy_error_OBJECTS = legacy_error.$(OBJEXT) legacy_error_LDADD = $(LDADD) legacy_error_DEPENDENCIES = ../src/libgetdata.la legacy_estring_SOURCES = legacy_estring.c legacy_estring_OBJECTS = legacy_estring.$(OBJEXT) legacy_estring_LDADD = $(LDADD) legacy_estring_DEPENDENCIES = ../src/libgetdata.la legacy_format_SOURCES = legacy_format.c legacy_format_OBJECTS = legacy_format.$(OBJEXT) legacy_format_LDADD = $(LDADD) legacy_format_DEPENDENCIES = ../src/libgetdata.la legacy_get_SOURCES = legacy_get.c legacy_get_OBJECTS = legacy_get.$(OBJEXT) legacy_get_LDADD = $(LDADD) legacy_get_DEPENDENCIES = ../src/libgetdata.la legacy_get_put_SOURCES = legacy_get_put.c legacy_get_put_OBJECTS = legacy_get_put.$(OBJEXT) legacy_get_put_LDADD = $(LDADD) legacy_get_put_DEPENDENCIES = ../src/libgetdata.la legacy_get_rofs_SOURCES = legacy_get_rofs.c legacy_get_rofs_OBJECTS = legacy_get_rofs.$(OBJEXT) legacy_get_rofs_LDADD = $(LDADD) legacy_get_rofs_DEPENDENCIES = ../src/libgetdata.la legacy_nframes_SOURCES = legacy_nframes.c legacy_nframes_OBJECTS = legacy_nframes.$(OBJEXT) legacy_nframes_LDADD = $(LDADD) legacy_nframes_DEPENDENCIES = ../src/libgetdata.la legacy_nonexistent_SOURCES = legacy_nonexistent.c legacy_nonexistent_OBJECTS = legacy_nonexistent.$(OBJEXT) legacy_nonexistent_LDADD = $(LDADD) legacy_nonexistent_DEPENDENCIES = ../src/libgetdata.la legacy_put_SOURCES = legacy_put.c legacy_put_OBJECTS = legacy_put.$(OBJEXT) legacy_put_LDADD = $(LDADD) legacy_put_DEPENDENCIES = ../src/libgetdata.la legacy_spf_SOURCES = legacy_spf.c legacy_spf_OBJECTS = legacy_spf.$(OBJEXT) legacy_spf_LDADD = $(LDADD) legacy_spf_DEPENDENCIES = ../src/libgetdata.la lzma_get_SOURCES = lzma_get.c lzma_get_OBJECTS = lzma_get.$(OBJEXT) lzma_get_LDADD = $(LDADD) lzma_get_DEPENDENCIES = ../src/libgetdata.la lzma_nframes_SOURCES = lzma_nframes.c lzma_nframes_OBJECTS = lzma_nframes.$(OBJEXT) lzma_nframes_LDADD = $(LDADD) lzma_nframes_DEPENDENCIES = ../src/libgetdata.la lzma_put_SOURCES = lzma_put.c lzma_put_OBJECTS = lzma_put.$(OBJEXT) lzma_put_LDADD = $(LDADD) lzma_put_DEPENDENCIES = ../src/libgetdata.la lzma_xz_add_SOURCES = lzma_xz_add.c lzma_xz_add_OBJECTS = lzma_xz_add.$(OBJEXT) lzma_xz_add_LDADD = $(LDADD) lzma_xz_add_DEPENDENCIES = ../src/libgetdata.la lzma_xz_get_SOURCES = lzma_xz_get.c lzma_xz_get_OBJECTS = lzma_xz_get.$(OBJEXT) lzma_xz_get_LDADD = $(LDADD) lzma_xz_get_DEPENDENCIES = ../src/libgetdata.la lzma_xz_get_far_SOURCES = lzma_xz_get_far.c lzma_xz_get_far_OBJECTS = lzma_xz_get_far.$(OBJEXT) lzma_xz_get_far_LDADD = $(LDADD) lzma_xz_get_far_DEPENDENCIES = ../src/libgetdata.la lzma_xz_get_get_SOURCES = lzma_xz_get_get.c lzma_xz_get_get_OBJECTS = lzma_xz_get_get.$(OBJEXT) lzma_xz_get_get_LDADD = $(LDADD) lzma_xz_get_get_DEPENDENCIES = ../src/libgetdata.la lzma_xz_get_get2_SOURCES = lzma_xz_get_get2.c lzma_xz_get_get2_OBJECTS = lzma_xz_get_get2.$(OBJEXT) lzma_xz_get_get2_LDADD = $(LDADD) lzma_xz_get_get2_DEPENDENCIES = ../src/libgetdata.la lzma_xz_get_put_SOURCES = lzma_xz_get_put.c lzma_xz_get_put_OBJECTS = lzma_xz_get_put.$(OBJEXT) lzma_xz_get_put_LDADD = $(LDADD) lzma_xz_get_put_DEPENDENCIES = ../src/libgetdata.la lzma_xz_move_to_SOURCES = lzma_xz_move_to.c lzma_xz_move_to_OBJECTS = lzma_xz_move_to.$(OBJEXT) lzma_xz_move_to_LDADD = $(LDADD) lzma_xz_move_to_DEPENDENCIES = ../src/libgetdata.la lzma_xz_nframes_SOURCES = lzma_xz_nframes.c lzma_xz_nframes_OBJECTS = lzma_xz_nframes.$(OBJEXT) lzma_xz_nframes_LDADD = $(LDADD) lzma_xz_nframes_DEPENDENCIES = ../src/libgetdata.la lzma_xz_put_SOURCES = lzma_xz_put.c lzma_xz_put_OBJECTS = lzma_xz_put.$(OBJEXT) lzma_xz_put_LDADD = $(LDADD) lzma_xz_put_DEPENDENCIES = ../src/libgetdata.la lzma_xz_put_back_SOURCES = lzma_xz_put_back.c lzma_xz_put_back_OBJECTS = lzma_xz_put_back.$(OBJEXT) lzma_xz_put_back_LDADD = $(LDADD) lzma_xz_put_back_DEPENDENCIES = ../src/libgetdata.la lzma_xz_put_endian_SOURCES = lzma_xz_put_endian.c lzma_xz_put_endian_OBJECTS = lzma_xz_put_endian.$(OBJEXT) lzma_xz_put_endian_LDADD = $(LDADD) lzma_xz_put_endian_DEPENDENCIES = ../src/libgetdata.la lzma_xz_put_get_SOURCES = lzma_xz_put_get.c lzma_xz_put_get_OBJECTS = lzma_xz_put_get.$(OBJEXT) lzma_xz_put_get_LDADD = $(LDADD) lzma_xz_put_get_DEPENDENCIES = ../src/libgetdata.la lzma_xz_put_pad_SOURCES = lzma_xz_put_pad.c lzma_xz_put_pad_OBJECTS = lzma_xz_put_pad.$(OBJEXT) lzma_xz_put_pad_LDADD = $(LDADD) lzma_xz_put_pad_DEPENDENCIES = ../src/libgetdata.la lzma_xz_seek_SOURCES = lzma_xz_seek.c lzma_xz_seek_OBJECTS = lzma_xz_seek.$(OBJEXT) lzma_xz_seek_LDADD = $(LDADD) lzma_xz_seek_DEPENDENCIES = ../src/libgetdata.la lzma_xz_seek_far_SOURCES = lzma_xz_seek_far.c lzma_xz_seek_far_OBJECTS = lzma_xz_seek_far.$(OBJEXT) lzma_xz_seek_far_LDADD = $(LDADD) lzma_xz_seek_far_DEPENDENCIES = ../src/libgetdata.la lzma_xz_sync_SOURCES = lzma_xz_sync.c lzma_xz_sync_OBJECTS = lzma_xz_sync.$(OBJEXT) lzma_xz_sync_LDADD = $(LDADD) lzma_xz_sync_DEPENDENCIES = ../src/libgetdata.la madd_SOURCES = madd.c madd_OBJECTS = madd.$(OBJEXT) madd_LDADD = $(LDADD) madd_DEPENDENCIES = ../src/libgetdata.la madd_affix_SOURCES = madd_affix.c madd_affix_OBJECTS = madd_affix.$(OBJEXT) madd_affix_LDADD = $(LDADD) madd_affix_DEPENDENCIES = ../src/libgetdata.la madd_alias_SOURCES = madd_alias.c madd_alias_OBJECTS = madd_alias.$(OBJEXT) madd_alias_LDADD = $(LDADD) madd_alias_DEPENDENCIES = ../src/libgetdata.la madd_alias_affix_SOURCES = madd_alias_affix.c madd_alias_affix_OBJECTS = madd_alias_affix.$(OBJEXT) madd_alias_affix_LDADD = $(LDADD) madd_alias_affix_DEPENDENCIES = ../src/libgetdata.la madd_bit_SOURCES = madd_bit.c madd_bit_OBJECTS = madd_bit.$(OBJEXT) madd_bit_LDADD = $(LDADD) madd_bit_DEPENDENCIES = ../src/libgetdata.la madd_bit_invalid_SOURCES = madd_bit_invalid.c madd_bit_invalid_OBJECTS = madd_bit_invalid.$(OBJEXT) madd_bit_invalid_LDADD = $(LDADD) madd_bit_invalid_DEPENDENCIES = ../src/libgetdata.la madd_carray_SOURCES = madd_carray.c madd_carray_OBJECTS = madd_carray.$(OBJEXT) madd_carray_LDADD = $(LDADD) madd_carray_DEPENDENCIES = ../src/libgetdata.la madd_clincom_SOURCES = madd_clincom.c madd_clincom_OBJECTS = madd_clincom.$(OBJEXT) madd_clincom_LDADD = $(LDADD) madd_clincom_DEPENDENCIES = ../src/libgetdata.la madd_const_SOURCES = madd_const.c madd_const_OBJECTS = madd_const.$(OBJEXT) madd_const_LDADD = $(LDADD) madd_const_DEPENDENCIES = ../src/libgetdata.la madd_cpolynom_SOURCES = madd_cpolynom.c madd_cpolynom_OBJECTS = madd_cpolynom.$(OBJEXT) madd_cpolynom_LDADD = $(LDADD) madd_cpolynom_DEPENDENCIES = ../src/libgetdata.la madd_crecip_SOURCES = madd_crecip.c madd_crecip_OBJECTS = madd_crecip.$(OBJEXT) madd_crecip_LDADD = $(LDADD) madd_crecip_DEPENDENCIES = ../src/libgetdata.la madd_crecip89_SOURCES = madd_crecip89.c madd_crecip89_OBJECTS = madd_crecip89.$(OBJEXT) madd_crecip89_LDADD = $(LDADD) madd_crecip89_DEPENDENCIES = ../src/libgetdata.la madd_divide_SOURCES = madd_divide.c madd_divide_OBJECTS = madd_divide.$(OBJEXT) madd_divide_LDADD = $(LDADD) madd_divide_DEPENDENCIES = ../src/libgetdata.la madd_index_SOURCES = madd_index.c madd_index_OBJECTS = madd_index.$(OBJEXT) madd_index_LDADD = $(LDADD) madd_index_DEPENDENCIES = ../src/libgetdata.la madd_lincom_SOURCES = madd_lincom.c madd_lincom_OBJECTS = madd_lincom.$(OBJEXT) madd_lincom_LDADD = $(LDADD) madd_lincom_DEPENDENCIES = ../src/libgetdata.la madd_lincom_invalid_SOURCES = madd_lincom_invalid.c madd_lincom_invalid_OBJECTS = madd_lincom_invalid.$(OBJEXT) madd_lincom_invalid_LDADD = $(LDADD) madd_lincom_invalid_DEPENDENCIES = ../src/libgetdata.la madd_linterp_SOURCES = madd_linterp.c madd_linterp_OBJECTS = madd_linterp.$(OBJEXT) madd_linterp_LDADD = $(LDADD) madd_linterp_DEPENDENCIES = ../src/libgetdata.la madd_linterp_invalid_SOURCES = madd_linterp_invalid.c madd_linterp_invalid_OBJECTS = madd_linterp_invalid.$(OBJEXT) madd_linterp_invalid_LDADD = $(LDADD) madd_linterp_invalid_DEPENDENCIES = ../src/libgetdata.la madd_mplex_SOURCES = madd_mplex.c madd_mplex_OBJECTS = madd_mplex.$(OBJEXT) madd_mplex_LDADD = $(LDADD) madd_mplex_DEPENDENCIES = ../src/libgetdata.la madd_multiply_SOURCES = madd_multiply.c madd_multiply_OBJECTS = madd_multiply.$(OBJEXT) madd_multiply_LDADD = $(LDADD) madd_multiply_DEPENDENCIES = ../src/libgetdata.la madd_multiply_invalid_SOURCES = madd_multiply_invalid.c madd_multiply_invalid_OBJECTS = madd_multiply_invalid.$(OBJEXT) madd_multiply_invalid_LDADD = $(LDADD) madd_multiply_invalid_DEPENDENCIES = ../src/libgetdata.la madd_phase_SOURCES = madd_phase.c madd_phase_OBJECTS = madd_phase.$(OBJEXT) madd_phase_LDADD = $(LDADD) madd_phase_DEPENDENCIES = ../src/libgetdata.la madd_phase_invalid_SOURCES = madd_phase_invalid.c madd_phase_invalid_OBJECTS = madd_phase_invalid.$(OBJEXT) madd_phase_invalid_LDADD = $(LDADD) madd_phase_invalid_DEPENDENCIES = ../src/libgetdata.la madd_polynom_SOURCES = madd_polynom.c madd_polynom_OBJECTS = madd_polynom.$(OBJEXT) madd_polynom_LDADD = $(LDADD) madd_polynom_DEPENDENCIES = ../src/libgetdata.la madd_recip_SOURCES = madd_recip.c madd_recip_OBJECTS = madd_recip.$(OBJEXT) madd_recip_LDADD = $(LDADD) madd_recip_DEPENDENCIES = ../src/libgetdata.la madd_sbit_SOURCES = madd_sbit.c madd_sbit_OBJECTS = madd_sbit.$(OBJEXT) madd_sbit_LDADD = $(LDADD) madd_sbit_DEPENDENCIES = ../src/libgetdata.la madd_spec_SOURCES = madd_spec.c madd_spec_OBJECTS = madd_spec.$(OBJEXT) madd_spec_LDADD = $(LDADD) madd_spec_DEPENDENCIES = ../src/libgetdata.la madd_spec_directive_SOURCES = madd_spec_directive.c madd_spec_directive_OBJECTS = madd_spec_directive.$(OBJEXT) madd_spec_directive_LDADD = $(LDADD) madd_spec_directive_DEPENDENCIES = ../src/libgetdata.la madd_spec_invalid_SOURCES = madd_spec_invalid.c madd_spec_invalid_OBJECTS = madd_spec_invalid.$(OBJEXT) madd_spec_invalid_LDADD = $(LDADD) madd_spec_invalid_DEPENDENCIES = ../src/libgetdata.la madd_spec_resolv_SOURCES = madd_spec_resolv.c madd_spec_resolv_OBJECTS = madd_spec_resolv.$(OBJEXT) madd_spec_resolv_LDADD = $(LDADD) madd_spec_resolv_DEPENDENCIES = ../src/libgetdata.la madd_string_SOURCES = madd_string.c madd_string_OBJECTS = madd_string.$(OBJEXT) madd_string_LDADD = $(LDADD) madd_string_DEPENDENCIES = ../src/libgetdata.la madd_window_SOURCES = madd_window.c madd_window_OBJECTS = madd_window.$(OBJEXT) madd_window_LDADD = $(LDADD) madd_window_DEPENDENCIES = ../src/libgetdata.la move_affix_SOURCES = move_affix.c move_affix_OBJECTS = move_affix.$(OBJEXT) move_affix_LDADD = $(LDADD) move_affix_DEPENDENCIES = ../src/libgetdata.la move_affix_dup_SOURCES = move_affix_dup.c move_affix_dup_OBJECTS = move_affix_dup.$(OBJEXT) move_affix_dup_LDADD = $(LDADD) move_affix_dup_DEPENDENCIES = ../src/libgetdata.la move_affix_meta_SOURCES = move_affix_meta.c move_affix_meta_OBJECTS = move_affix_meta.$(OBJEXT) move_affix_meta_LDADD = $(LDADD) move_affix_meta_DEPENDENCIES = ../src/libgetdata.la move_affix_updb_SOURCES = move_affix_updb.c move_affix_updb_OBJECTS = move_affix_updb.$(OBJEXT) move_affix_updb_LDADD = $(LDADD) move_affix_updb_DEPENDENCIES = ../src/libgetdata.la move_alias_SOURCES = move_alias.c move_alias_OBJECTS = move_alias.$(OBJEXT) move_alias_LDADD = $(LDADD) move_alias_DEPENDENCIES = ../src/libgetdata.la move_data_enc_ar_SOURCES = move_data_enc_ar.c move_data_enc_ar_OBJECTS = move_data_enc_ar.$(OBJEXT) move_data_enc_ar_LDADD = $(LDADD) move_data_enc_ar_DEPENDENCIES = ../src/libgetdata.la move_data_enc_ra_SOURCES = move_data_enc_ra.c move_data_enc_ra_OBJECTS = move_data_enc_ra.$(OBJEXT) move_data_enc_ra_LDADD = $(LDADD) move_data_enc_ra_DEPENDENCIES = ../src/libgetdata.la move_data_endian_SOURCES = move_data_endian.c move_data_endian_OBJECTS = move_data_endian.$(OBJEXT) move_data_endian_LDADD = $(LDADD) move_data_endian_DEPENDENCIES = ../src/libgetdata.la move_data_foffs_SOURCES = move_data_foffs.c move_data_foffs_OBJECTS = move_data_foffs.$(OBJEXT) move_data_foffs_LDADD = $(LDADD) move_data_foffs_DEPENDENCIES = ../src/libgetdata.la move_data_foffs_neg_SOURCES = move_data_foffs_neg.c move_data_foffs_neg_OBJECTS = move_data_foffs_neg.$(OBJEXT) move_data_foffs_neg_LDADD = $(LDADD) move_data_foffs_neg_DEPENDENCIES = ../src/libgetdata.la move_data_nop_SOURCES = move_data_nop.c move_data_nop_OBJECTS = move_data_nop.$(OBJEXT) move_data_nop_LDADD = $(LDADD) move_data_nop_DEPENDENCIES = ../src/libgetdata.la move_index_SOURCES = move_index.c move_index_OBJECTS = move_index.$(OBJEXT) move_index_LDADD = $(LDADD) move_index_DEPENDENCIES = ../src/libgetdata.la move_meta_SOURCES = move_meta.c move_meta_OBJECTS = move_meta.$(OBJEXT) move_meta_LDADD = $(LDADD) move_meta_DEPENDENCIES = ../src/libgetdata.la move_move_SOURCES = move_move.c move_move_OBJECTS = move_move.$(OBJEXT) move_move_LDADD = $(LDADD) move_move_DEPENDENCIES = ../src/libgetdata.la move_protect_SOURCES = move_protect.c move_protect_OBJECTS = move_protect.$(OBJEXT) move_protect_LDADD = $(LDADD) move_protect_DEPENDENCIES = ../src/libgetdata.la move_subdir_SOURCES = move_subdir.c move_subdir_OBJECTS = move_subdir.$(OBJEXT) move_subdir_LDADD = $(LDADD) move_subdir_DEPENDENCIES = ../src/libgetdata.la name_affix_SOURCES = name_affix.c name_affix_OBJECTS = name_affix.$(OBJEXT) name_affix_LDADD = $(LDADD) name_affix_DEPENDENCIES = ../src/libgetdata.la name_affix_bad_SOURCES = name_affix_bad.c name_affix_bad_OBJECTS = name_affix_bad.$(OBJEXT) name_affix_bad_LDADD = $(LDADD) name_affix_bad_DEPENDENCIES = ../src/libgetdata.la name_alias_SOURCES = name_alias.c name_alias_OBJECTS = name_alias.$(OBJEXT) name_alias_LDADD = $(LDADD) name_alias_DEPENDENCIES = ../src/libgetdata.la name_dangle_SOURCES = name_dangle.c name_dangle_OBJECTS = name_dangle.$(OBJEXT) name_dangle_LDADD = $(LDADD) name_dangle_DEPENDENCIES = ../src/libgetdata.la name_dot5_SOURCES = name_dot5.c name_dot5_OBJECTS = name_dot5.$(OBJEXT) name_dot5_LDADD = $(LDADD) name_dot5_DEPENDENCIES = ../src/libgetdata.la name_dot5r_SOURCES = name_dot5r.c name_dot5r_OBJECTS = name_dot5r.$(OBJEXT) name_dot5r_LDADD = $(LDADD) name_dot5r_DEPENDENCIES = ../src/libgetdata.la name_dot9_SOURCES = name_dot9.c name_dot9_OBJECTS = name_dot9.$(OBJEXT) name_dot9_LDADD = $(LDADD) name_dot9_DEPENDENCIES = ../src/libgetdata.la name_dup_SOURCES = name_dup.c name_dup_OBJECTS = name_dup.$(OBJEXT) name_dup_LDADD = $(LDADD) name_dup_DEPENDENCIES = ../src/libgetdata.la name_meta_SOURCES = name_meta.c name_meta_OBJECTS = name_meta.$(OBJEXT) name_meta_LDADD = $(LDADD) name_meta_DEPENDENCIES = ../src/libgetdata.la name_move_SOURCES = name_move.c name_move_OBJECTS = name_move.$(OBJEXT) name_move_LDADD = $(LDADD) name_move_DEPENDENCIES = ../src/libgetdata.la name_move_alias_SOURCES = name_move_alias.c name_move_alias_OBJECTS = name_move_alias.$(OBJEXT) name_move_alias_LDADD = $(LDADD) name_move_alias_DEPENDENCIES = ../src/libgetdata.la name_name_SOURCES = name_name.c name_name_OBJECTS = name_name.$(OBJEXT) name_name_LDADD = $(LDADD) name_name_DEPENDENCIES = ../src/libgetdata.la name_updb_SOURCES = name_updb.c name_updb_OBJECTS = name_updb.$(OBJEXT) name_updb_LDADD = $(LDADD) name_updb_DEPENDENCIES = ../src/libgetdata.la name_updb_affix_SOURCES = name_updb_affix.c name_updb_affix_OBJECTS = name_updb_affix.$(OBJEXT) name_updb_affix_LDADD = $(LDADD) name_updb_affix_DEPENDENCIES = ../src/libgetdata.la name_updb_alias_SOURCES = name_updb_alias.c name_updb_alias_OBJECTS = name_updb_alias.$(OBJEXT) name_updb_alias_LDADD = $(LDADD) name_updb_alias_DEPENDENCIES = ../src/libgetdata.la name_updb_carray_SOURCES = name_updb_carray.c name_updb_carray_OBJECTS = name_updb_carray.$(OBJEXT) name_updb_carray_LDADD = $(LDADD) name_updb_carray_DEPENDENCIES = ../src/libgetdata.la name_updb_const_SOURCES = name_updb_const.c name_updb_const_OBJECTS = name_updb_const.$(OBJEXT) name_updb_const_LDADD = $(LDADD) name_updb_const_DEPENDENCIES = ../src/libgetdata.la name_updb_const_alias_SOURCES = name_updb_const_alias.c name_updb_const_alias_OBJECTS = name_updb_const_alias.$(OBJEXT) name_updb_const_alias_LDADD = $(LDADD) name_updb_const_alias_DEPENDENCIES = ../src/libgetdata.la native_bit_SOURCES = native_bit.c native_bit_OBJECTS = native_bit.$(OBJEXT) native_bit_LDADD = $(LDADD) native_bit_DEPENDENCIES = ../src/libgetdata.la native_const_SOURCES = native_const.c native_const_OBJECTS = native_const.$(OBJEXT) native_const_LDADD = $(LDADD) native_const_DEPENDENCIES = ../src/libgetdata.la native_index_SOURCES = native_index.c native_index_OBJECTS = native_index.$(OBJEXT) native_index_LDADD = $(LDADD) native_index_DEPENDENCIES = ../src/libgetdata.la native_lincom_SOURCES = native_lincom.c native_lincom_OBJECTS = native_lincom.$(OBJEXT) native_lincom_LDADD = $(LDADD) native_lincom_DEPENDENCIES = ../src/libgetdata.la native_lincom_cmpin_SOURCES = native_lincom_cmpin.c native_lincom_cmpin_OBJECTS = native_lincom_cmpin.$(OBJEXT) native_lincom_cmpin_LDADD = $(LDADD) native_lincom_cmpin_DEPENDENCIES = ../src/libgetdata.la native_lincom_cmpscal_SOURCES = native_lincom_cmpscal.c native_lincom_cmpscal_OBJECTS = native_lincom_cmpscal.$(OBJEXT) native_lincom_cmpscal_LDADD = $(LDADD) native_lincom_cmpscal_DEPENDENCIES = ../src/libgetdata.la native_linterp_SOURCES = native_linterp.c native_linterp_OBJECTS = native_linterp.$(OBJEXT) native_linterp_LDADD = $(LDADD) native_linterp_DEPENDENCIES = ../src/libgetdata.la native_linterp_cmp_SOURCES = native_linterp_cmp.c native_linterp_cmp_OBJECTS = native_linterp_cmp.$(OBJEXT) native_linterp_cmp_LDADD = $(LDADD) native_linterp_cmp_DEPENDENCIES = ../src/libgetdata.la native_mult_SOURCES = native_mult.c native_mult_OBJECTS = native_mult.$(OBJEXT) native_mult_LDADD = $(LDADD) native_mult_DEPENDENCIES = ../src/libgetdata.la native_mult1_SOURCES = native_mult1.c native_mult1_OBJECTS = native_mult1.$(OBJEXT) native_mult1_LDADD = $(LDADD) native_mult1_DEPENDENCIES = ../src/libgetdata.la native_mult2_SOURCES = native_mult2.c native_mult2_OBJECTS = native_mult2.$(OBJEXT) native_mult2_LDADD = $(LDADD) native_mult2_DEPENDENCIES = ../src/libgetdata.la native_phase_SOURCES = native_phase.c native_phase_OBJECTS = native_phase.$(OBJEXT) native_phase_LDADD = $(LDADD) native_phase_DEPENDENCIES = ../src/libgetdata.la native_polynom_SOURCES = native_polynom.c native_polynom_OBJECTS = native_polynom.$(OBJEXT) native_polynom_LDADD = $(LDADD) native_polynom_DEPENDENCIES = ../src/libgetdata.la native_polynom_cmpin_SOURCES = native_polynom_cmpin.c native_polynom_cmpin_OBJECTS = native_polynom_cmpin.$(OBJEXT) native_polynom_cmpin_LDADD = $(LDADD) native_polynom_cmpin_DEPENDENCIES = ../src/libgetdata.la native_polynom_cmpscal_SOURCES = native_polynom_cmpscal.c native_polynom_cmpscal_OBJECTS = native_polynom_cmpscal.$(OBJEXT) native_polynom_cmpscal_LDADD = $(LDADD) native_polynom_cmpscal_DEPENDENCIES = ../src/libgetdata.la native_raw_SOURCES = native_raw.c native_raw_OBJECTS = native_raw.$(OBJEXT) native_raw_LDADD = $(LDADD) native_raw_DEPENDENCIES = ../src/libgetdata.la native_recip_SOURCES = native_recip.c native_recip_OBJECTS = native_recip.$(OBJEXT) native_recip_LDADD = $(LDADD) native_recip_DEPENDENCIES = ../src/libgetdata.la native_recip_cmpin_SOURCES = native_recip_cmpin.c native_recip_cmpin_OBJECTS = native_recip_cmpin.$(OBJEXT) native_recip_cmpin_LDADD = $(LDADD) native_recip_cmpin_DEPENDENCIES = ../src/libgetdata.la native_recip_cmpscal_SOURCES = native_recip_cmpscal.c native_recip_cmpscal_OBJECTS = native_recip_cmpscal.$(OBJEXT) native_recip_cmpscal_LDADD = $(LDADD) native_recip_cmpscal_DEPENDENCIES = ../src/libgetdata.la native_sbit_SOURCES = native_sbit.c native_sbit_OBJECTS = native_sbit.$(OBJEXT) native_sbit_LDADD = $(LDADD) native_sbit_DEPENDENCIES = ../src/libgetdata.la native_string_SOURCES = native_string.c native_string_OBJECTS = native_string.$(OBJEXT) native_string_LDADD = $(LDADD) native_string_DEPENDENCIES = ../src/libgetdata.la nentries_alias_SOURCES = nentries_alias.c nentries_alias_OBJECTS = nentries_alias.$(OBJEXT) nentries_alias_LDADD = $(LDADD) nentries_alias_DEPENDENCIES = ../src/libgetdata.la nentries_hidden_SOURCES = nentries_hidden.c nentries_hidden_OBJECTS = nentries_hidden.$(OBJEXT) nentries_hidden_LDADD = $(LDADD) nentries_hidden_DEPENDENCIES = ../src/libgetdata.la nentries_noalias_SOURCES = nentries_noalias.c nentries_noalias_OBJECTS = nentries_noalias.$(OBJEXT) nentries_noalias_LDADD = $(LDADD) nentries_noalias_DEPENDENCIES = ../src/libgetdata.la nentries_scalar_SOURCES = nentries_scalar.c nentries_scalar_OBJECTS = nentries_scalar.$(OBJEXT) nentries_scalar_LDADD = $(LDADD) nentries_scalar_DEPENDENCIES = ../src/libgetdata.la nfields_hidden_SOURCES = nfields_hidden.c nfields_hidden_OBJECTS = nfields_hidden.$(OBJEXT) nfields_hidden_LDADD = $(LDADD) nfields_hidden_DEPENDENCIES = ../src/libgetdata.la nfields_invalid_SOURCES = nfields_invalid.c nfields_invalid_OBJECTS = nfields_invalid.$(OBJEXT) nfields_invalid_LDADD = $(LDADD) nfields_invalid_DEPENDENCIES = ../src/libgetdata.la nfields_nfields_SOURCES = nfields_nfields.c nfields_nfields_OBJECTS = nfields_nfields.$(OBJEXT) nfields_nfields_LDADD = $(LDADD) nfields_nfields_DEPENDENCIES = ../src/libgetdata.la nfields_type_SOURCES = nfields_type.c nfields_type_OBJECTS = nfields_type.$(OBJEXT) nfields_type_LDADD = $(LDADD) nfields_type_DEPENDENCIES = ../src/libgetdata.la nfields_type_hidden_SOURCES = nfields_type_hidden.c nfields_type_hidden_OBJECTS = nfields_type_hidden.$(OBJEXT) nfields_type_hidden_LDADD = $(LDADD) nfields_type_hidden_DEPENDENCIES = ../src/libgetdata.la nfields_type_invalid_SOURCES = nfields_type_invalid.c nfields_type_invalid_OBJECTS = nfields_type_invalid.$(OBJEXT) nfields_type_invalid_LDADD = $(LDADD) nfields_type_invalid_DEPENDENCIES = ../src/libgetdata.la nfields_vector_SOURCES = nfields_vector.c nfields_vector_OBJECTS = nfields_vector.$(OBJEXT) nfields_vector_LDADD = $(LDADD) nfields_vector_DEPENDENCIES = ../src/libgetdata.la nfields_vector_hidden_SOURCES = nfields_vector_hidden.c nfields_vector_hidden_OBJECTS = nfields_vector_hidden.$(OBJEXT) nfields_vector_hidden_LDADD = $(LDADD) nfields_vector_hidden_DEPENDENCIES = ../src/libgetdata.la nfields_vector_invalid_SOURCES = nfields_vector_invalid.c nfields_vector_invalid_OBJECTS = nfields_vector_invalid.$(OBJEXT) nfields_vector_invalid_LDADD = $(LDADD) nfields_vector_invalid_DEPENDENCIES = ../src/libgetdata.la nframes64_SOURCES = nframes64.c nframes64_OBJECTS = nframes64.$(OBJEXT) nframes64_LDADD = $(LDADD) nframes64_DEPENDENCIES = ../src/libgetdata.la nframes_empty_SOURCES = nframes_empty.c nframes_empty_OBJECTS = nframes_empty.$(OBJEXT) nframes_empty_LDADD = $(LDADD) nframes_empty_DEPENDENCIES = ../src/libgetdata.la nframes_invalid_SOURCES = nframes_invalid.c nframes_invalid_OBJECTS = nframes_invalid.$(OBJEXT) nframes_invalid_LDADD = $(LDADD) nframes_invalid_DEPENDENCIES = ../src/libgetdata.la nframes_nframes_SOURCES = nframes_nframes.c nframes_nframes_OBJECTS = nframes_nframes.$(OBJEXT) nframes_nframes_LDADD = $(LDADD) nframes_nframes_DEPENDENCIES = ../src/libgetdata.la nframes_off64_SOURCES = nframes_off64.c nframes_off64_OBJECTS = nframes_off64.$(OBJEXT) nframes_off64_LDADD = $(LDADD) nframes_off64_DEPENDENCIES = ../src/libgetdata.la nframes_spf_SOURCES = nframes_spf.c nframes_spf_OBJECTS = nframes_spf.$(OBJEXT) nframes_spf_LDADD = $(LDADD) nframes_spf_DEPENDENCIES = ../src/libgetdata.la nmeta_SOURCES = nmeta.c nmeta_OBJECTS = nmeta.$(OBJEXT) nmeta_LDADD = $(LDADD) nmeta_DEPENDENCIES = ../src/libgetdata.la nmeta_hidden_SOURCES = nmeta_hidden.c nmeta_hidden_OBJECTS = nmeta_hidden.$(OBJEXT) nmeta_hidden_LDADD = $(LDADD) nmeta_hidden_DEPENDENCIES = ../src/libgetdata.la nmeta_invalid_SOURCES = nmeta_invalid.c nmeta_invalid_OBJECTS = nmeta_invalid.$(OBJEXT) nmeta_invalid_LDADD = $(LDADD) nmeta_invalid_DEPENDENCIES = ../src/libgetdata.la nmeta_parent_SOURCES = nmeta_parent.c nmeta_parent_OBJECTS = nmeta_parent.$(OBJEXT) nmeta_parent_LDADD = $(LDADD) nmeta_parent_DEPENDENCIES = ../src/libgetdata.la nmeta_type_SOURCES = nmeta_type.c nmeta_type_OBJECTS = nmeta_type.$(OBJEXT) nmeta_type_LDADD = $(LDADD) nmeta_type_DEPENDENCIES = ../src/libgetdata.la nmeta_type_hidden_SOURCES = nmeta_type_hidden.c nmeta_type_hidden_OBJECTS = nmeta_type_hidden.$(OBJEXT) nmeta_type_hidden_LDADD = $(LDADD) nmeta_type_hidden_DEPENDENCIES = ../src/libgetdata.la nmeta_type_invalid_SOURCES = nmeta_type_invalid.c nmeta_type_invalid_OBJECTS = nmeta_type_invalid.$(OBJEXT) nmeta_type_invalid_LDADD = $(LDADD) nmeta_type_invalid_DEPENDENCIES = ../src/libgetdata.la nmeta_type_parent_SOURCES = nmeta_type_parent.c nmeta_type_parent_OBJECTS = nmeta_type_parent.$(OBJEXT) nmeta_type_parent_LDADD = $(LDADD) nmeta_type_parent_DEPENDENCIES = ../src/libgetdata.la nmeta_vectors_SOURCES = nmeta_vectors.c nmeta_vectors_OBJECTS = nmeta_vectors.$(OBJEXT) nmeta_vectors_LDADD = $(LDADD) nmeta_vectors_DEPENDENCIES = ../src/libgetdata.la nmeta_vectors_del_SOURCES = nmeta_vectors_del.c nmeta_vectors_del_OBJECTS = nmeta_vectors_del.$(OBJEXT) nmeta_vectors_del_LDADD = $(LDADD) nmeta_vectors_del_DEPENDENCIES = ../src/libgetdata.la nmeta_vectors_hidden_SOURCES = nmeta_vectors_hidden.c nmeta_vectors_hidden_OBJECTS = nmeta_vectors_hidden.$(OBJEXT) nmeta_vectors_hidden_LDADD = $(LDADD) nmeta_vectors_hidden_DEPENDENCIES = ../src/libgetdata.la nmeta_vectors_invalid_SOURCES = nmeta_vectors_invalid.c nmeta_vectors_invalid_OBJECTS = nmeta_vectors_invalid.$(OBJEXT) nmeta_vectors_invalid_LDADD = $(LDADD) nmeta_vectors_invalid_DEPENDENCIES = ../src/libgetdata.la nmeta_vectors_parent_SOURCES = nmeta_vectors_parent.c nmeta_vectors_parent_OBJECTS = nmeta_vectors_parent.$(OBJEXT) nmeta_vectors_parent_LDADD = $(LDADD) nmeta_vectors_parent_DEPENDENCIES = ../src/libgetdata.la open_abs_SOURCES = open_abs.c open_abs_OBJECTS = open_abs.$(OBJEXT) open_abs_LDADD = $(LDADD) open_abs_DEPENDENCIES = ../src/libgetdata.la open_cb_abort_SOURCES = open_cb_abort.c open_cb_abort_OBJECTS = open_cb_abort.$(OBJEXT) open_cb_abort_LDADD = $(LDADD) open_cb_abort_DEPENDENCIES = ../src/libgetdata.la open_cb_cont_SOURCES = open_cb_cont.c open_cb_cont_OBJECTS = open_cb_cont.$(OBJEXT) open_cb_cont_LDADD = $(LDADD) open_cb_cont_DEPENDENCIES = ../src/libgetdata.la open_cb_ignore_SOURCES = open_cb_ignore.c open_cb_ignore_OBJECTS = open_cb_ignore.$(OBJEXT) open_cb_ignore_LDADD = $(LDADD) open_cb_ignore_DEPENDENCIES = ../src/libgetdata.la open_cb_invalid_SOURCES = open_cb_invalid.c open_cb_invalid_OBJECTS = open_cb_invalid.$(OBJEXT) open_cb_invalid_LDADD = $(LDADD) open_cb_invalid_DEPENDENCIES = ../src/libgetdata.la open_cb_rescan_SOURCES = open_cb_rescan.c open_cb_rescan_OBJECTS = open_cb_rescan.$(OBJEXT) open_cb_rescan_LDADD = $(LDADD) open_cb_rescan_DEPENDENCIES = ../src/libgetdata.la open_cb_rescan_alloc_SOURCES = open_cb_rescan_alloc.c open_cb_rescan_alloc_OBJECTS = open_cb_rescan_alloc.$(OBJEXT) open_cb_rescan_alloc_LDADD = $(LDADD) open_cb_rescan_alloc_DEPENDENCIES = ../src/libgetdata.la open_eaccess_SOURCES = open_eaccess.c open_eaccess_OBJECTS = open_eaccess.$(OBJEXT) open_eaccess_LDADD = $(LDADD) open_eaccess_DEPENDENCIES = ../src/libgetdata.la open_invalid_SOURCES = open_invalid.c open_invalid_OBJECTS = open_invalid.$(OBJEXT) open_invalid_LDADD = $(LDADD) open_invalid_DEPENDENCIES = ../src/libgetdata.la open_nonexistent_SOURCES = open_nonexistent.c open_nonexistent_OBJECTS = open_nonexistent.$(OBJEXT) open_nonexistent_LDADD = $(LDADD) open_nonexistent_DEPENDENCIES = ../src/libgetdata.la open_notdirfile_SOURCES = open_notdirfile.c open_notdirfile_OBJECTS = open_notdirfile.$(OBJEXT) open_notdirfile_LDADD = $(LDADD) open_notdirfile_DEPENDENCIES = ../src/libgetdata.la open_open_SOURCES = open_open.c open_open_OBJECTS = open_open.$(OBJEXT) open_open_LDADD = $(LDADD) open_open_DEPENDENCIES = ../src/libgetdata.la open_rofs_SOURCES = open_rofs.c open_rofs_OBJECTS = open_rofs.$(OBJEXT) open_rofs_LDADD = $(LDADD) open_rofs_DEPENDENCIES = ../src/libgetdata.la open_sym_al_SOURCES = open_sym_al.c open_sym_al_OBJECTS = open_sym_al.$(OBJEXT) open_sym_al_LDADD = $(LDADD) open_sym_al_DEPENDENCIES = ../src/libgetdata.la open_sym_at_SOURCES = open_sym_at.c open_sym_at_OBJECTS = open_sym_at.$(OBJEXT) open_sym_at_LDADD = $(LDADD) open_sym_at_DEPENDENCIES = ../src/libgetdata.la open_sym_c_SOURCES = open_sym_c.c open_sym_c_OBJECTS = open_sym_c.$(OBJEXT) open_sym_c_LDADD = $(LDADD) open_sym_c_DEPENDENCIES = ../src/libgetdata.la open_sym_cl_SOURCES = open_sym_cl.c open_sym_cl_OBJECTS = open_sym_cl.$(OBJEXT) open_sym_cl_LDADD = $(LDADD) open_sym_cl_DEPENDENCIES = ../src/libgetdata.la open_sym_ct_SOURCES = open_sym_ct.c open_sym_ct_OBJECTS = open_sym_ct.$(OBJEXT) open_sym_ct_LDADD = $(LDADD) open_sym_ct_DEPENDENCIES = ../src/libgetdata.la open_sym_d_SOURCES = open_sym_d.c open_sym_d_OBJECTS = open_sym_d.$(OBJEXT) open_sym_d_LDADD = $(LDADD) open_sym_d_DEPENDENCIES = ../src/libgetdata.la open_sym_l_SOURCES = open_sym_l.c open_sym_l_OBJECTS = open_sym_l.$(OBJEXT) open_sym_l_LDADD = $(LDADD) open_sym_l_DEPENDENCIES = ../src/libgetdata.la open_sym_p_SOURCES = open_sym_p.c open_sym_p_OBJECTS = open_sym_p.$(OBJEXT) open_sym_p_LDADD = $(LDADD) open_sym_p_DEPENDENCIES = ../src/libgetdata.la open_sym_pl_SOURCES = open_sym_pl.c open_sym_pl_OBJECTS = open_sym_pl.$(OBJEXT) open_sym_pl_LDADD = $(LDADD) open_sym_pl_DEPENDENCIES = ../src/libgetdata.la open_sym_pt_SOURCES = open_sym_pt.c open_sym_pt_OBJECTS = open_sym_pt.$(OBJEXT) open_sym_pt_LDADD = $(LDADD) open_sym_pt_DEPENDENCIES = ../src/libgetdata.la parse_alias_SOURCES = parse_alias.c parse_alias_OBJECTS = parse_alias.$(OBJEXT) parse_alias_LDADD = $(LDADD) parse_alias_DEPENDENCIES = ../src/libgetdata.la parse_alias_code_SOURCES = parse_alias_code.c parse_alias_code_OBJECTS = parse_alias_code.$(OBJEXT) parse_alias_code_LDADD = $(LDADD) parse_alias_code_DEPENDENCIES = ../src/libgetdata.la parse_alias_dup_SOURCES = parse_alias_dup.c parse_alias_dup_OBJECTS = parse_alias_dup.$(OBJEXT) parse_alias_dup_LDADD = $(LDADD) parse_alias_dup_DEPENDENCIES = ../src/libgetdata.la parse_alias_meta_SOURCES = parse_alias_meta.c parse_alias_meta_OBJECTS = parse_alias_meta.$(OBJEXT) parse_alias_meta_LDADD = $(LDADD) parse_alias_meta_DEPENDENCIES = ../src/libgetdata.la parse_alias_missing_SOURCES = parse_alias_missing.c parse_alias_missing_OBJECTS = parse_alias_missing.$(OBJEXT) parse_alias_missing_LDADD = $(LDADD) parse_alias_missing_DEPENDENCIES = ../src/libgetdata.la parse_badline_SOURCES = parse_badline.c parse_badline_OBJECTS = parse_badline.$(OBJEXT) parse_badline_LDADD = $(LDADD) parse_badline_DEPENDENCIES = ../src/libgetdata.la parse_bit_SOURCES = parse_bit.c parse_bit_OBJECTS = parse_bit.$(OBJEXT) parse_bit_LDADD = $(LDADD) parse_bit_DEPENDENCIES = ../src/libgetdata.la parse_bit4_SOURCES = parse_bit4.c parse_bit4_OBJECTS = parse_bit4.$(OBJEXT) parse_bit4_LDADD = $(LDADD) parse_bit4_DEPENDENCIES = ../src/libgetdata.la parse_bit_bitnum_SOURCES = parse_bit_bitnum.c parse_bit_bitnum_OBJECTS = parse_bit_bitnum.$(OBJEXT) parse_bit_bitnum_LDADD = $(LDADD) parse_bit_bitnum_DEPENDENCIES = ../src/libgetdata.la parse_bit_bitsize_SOURCES = parse_bit_bitsize.c parse_bit_bitsize_OBJECTS = parse_bit_bitsize.$(OBJEXT) parse_bit_bitsize_LDADD = $(LDADD) parse_bit_bitsize_DEPENDENCIES = ../src/libgetdata.la parse_bit_ncols_SOURCES = parse_bit_ncols.c parse_bit_ncols_OBJECTS = parse_bit_ncols.$(OBJEXT) parse_bit_ncols_LDADD = $(LDADD) parse_bit_ncols_DEPENDENCIES = ../src/libgetdata.la parse_bit_numbits_SOURCES = parse_bit_numbits.c parse_bit_numbits_OBJECTS = parse_bit_numbits.$(OBJEXT) parse_bit_numbits_LDADD = $(LDADD) parse_bit_numbits_DEPENDENCIES = ../src/libgetdata.la parse_bit_scalar_SOURCES = parse_bit_scalar.c parse_bit_scalar_OBJECTS = parse_bit_scalar.$(OBJEXT) parse_bit_scalar_LDADD = $(LDADD) parse_bit_scalar_DEPENDENCIES = ../src/libgetdata.la parse_carray_SOURCES = parse_carray.c parse_carray_OBJECTS = parse_carray.$(OBJEXT) parse_carray_LDADD = $(LDADD) parse_carray_DEPENDENCIES = ../src/libgetdata.la parse_carray_long_SOURCES = parse_carray_long.c parse_carray_long_OBJECTS = parse_carray_long.$(OBJEXT) parse_carray_long_LDADD = $(LDADD) parse_carray_long_DEPENDENCIES = ../src/libgetdata.la parse_const_SOURCES = parse_const.c parse_const_OBJECTS = parse_const.$(OBJEXT) parse_const_LDADD = $(LDADD) parse_const_DEPENDENCIES = ../src/libgetdata.la parse_const_complex_SOURCES = parse_const_complex.c parse_const_complex_OBJECTS = parse_const_complex.$(OBJEXT) parse_const_complex_LDADD = $(LDADD) parse_const_complex_DEPENDENCIES = ../src/libgetdata.la parse_const_ncols_SOURCES = parse_const_ncols.c parse_const_ncols_OBJECTS = parse_const_ncols.$(OBJEXT) parse_const_ncols_LDADD = $(LDADD) parse_const_ncols_DEPENDENCIES = ../src/libgetdata.la parse_divide_SOURCES = parse_divide.c parse_divide_OBJECTS = parse_divide.$(OBJEXT) parse_divide_LDADD = $(LDADD) parse_divide_DEPENDENCIES = ../src/libgetdata.la parse_double_SOURCES = parse_double.c parse_double_OBJECTS = parse_double.$(OBJEXT) parse_double_LDADD = $(LDADD) parse_double_DEPENDENCIES = ../src/libgetdata.la parse_duplicate_SOURCES = parse_duplicate.c parse_duplicate_OBJECTS = parse_duplicate.$(OBJEXT) parse_duplicate_LDADD = $(LDADD) parse_duplicate_DEPENDENCIES = ../src/libgetdata.la parse_duplicate_ignore_SOURCES = parse_duplicate_ignore.c parse_duplicate_ignore_OBJECTS = parse_duplicate_ignore.$(OBJEXT) parse_duplicate_ignore_LDADD = $(LDADD) parse_duplicate_ignore_DEPENDENCIES = ../src/libgetdata.la parse_endian_bad_SOURCES = parse_endian_bad.c parse_endian_bad_OBJECTS = parse_endian_bad.$(OBJEXT) parse_endian_bad_LDADD = $(LDADD) parse_endian_bad_DEPENDENCIES = ../src/libgetdata.la parse_endian_big_SOURCES = parse_endian_big.c parse_endian_big_OBJECTS = parse_endian_big.$(OBJEXT) parse_endian_big_LDADD = $(LDADD) parse_endian_big_DEPENDENCIES = ../src/libgetdata.la parse_endian_force_SOURCES = parse_endian_force.c parse_endian_force_OBJECTS = parse_endian_force.$(OBJEXT) parse_endian_force_LDADD = $(LDADD) parse_endian_force_DEPENDENCIES = ../src/libgetdata.la parse_endian_little_SOURCES = parse_endian_little.c parse_endian_little_OBJECTS = parse_endian_little.$(OBJEXT) parse_endian_little_LDADD = $(LDADD) parse_endian_little_DEPENDENCIES = ../src/libgetdata.la parse_endian_slash_SOURCES = parse_endian_slash.c parse_endian_slash_OBJECTS = parse_endian_slash.$(OBJEXT) parse_endian_slash_LDADD = $(LDADD) parse_endian_slash_DEPENDENCIES = ../src/libgetdata.la parse_eol_SOURCES = parse_eol.c parse_eol_OBJECTS = parse_eol.$(OBJEXT) parse_eol_LDADD = $(LDADD) parse_eol_DEPENDENCIES = ../src/libgetdata.la parse_foffs_SOURCES = parse_foffs.c parse_foffs_OBJECTS = parse_foffs.$(OBJEXT) parse_foffs_LDADD = $(LDADD) parse_foffs_DEPENDENCIES = ../src/libgetdata.la parse_foffs_include_SOURCES = parse_foffs_include.c parse_foffs_include_OBJECTS = parse_foffs_include.$(OBJEXT) parse_foffs_include_LDADD = $(LDADD) parse_foffs_include_DEPENDENCIES = ../src/libgetdata.la parse_foffs_slash_SOURCES = parse_foffs_slash.c parse_foffs_slash_OBJECTS = parse_foffs_slash.$(OBJEXT) parse_foffs_slash_LDADD = $(LDADD) parse_foffs_slash_DEPENDENCIES = ../src/libgetdata.la parse_hex_SOURCES = parse_hex.c parse_hex_OBJECTS = parse_hex.$(OBJEXT) parse_hex_LDADD = $(LDADD) parse_hex_DEPENDENCIES = ../src/libgetdata.la parse_hidden_SOURCES = parse_hidden.c parse_hidden_OBJECTS = parse_hidden.$(OBJEXT) parse_hidden_LDADD = $(LDADD) parse_hidden_DEPENDENCIES = ../src/libgetdata.la parse_hidden_field_SOURCES = parse_hidden_field.c parse_hidden_field_OBJECTS = parse_hidden_field.$(OBJEXT) parse_hidden_field_LDADD = $(LDADD) parse_hidden_field_DEPENDENCIES = ../src/libgetdata.la parse_hidden_meta_SOURCES = parse_hidden_meta.c parse_hidden_meta_OBJECTS = parse_hidden_meta.$(OBJEXT) parse_hidden_meta_LDADD = $(LDADD) parse_hidden_meta_DEPENDENCIES = ../src/libgetdata.la parse_include_SOURCES = parse_include.c parse_include_OBJECTS = parse_include.$(OBJEXT) parse_include_LDADD = $(LDADD) parse_include_DEPENDENCIES = ../src/libgetdata.la parse_include_absolute_SOURCES = parse_include_absolute.c parse_include_absolute_OBJECTS = parse_include_absolute.$(OBJEXT) parse_include_absolute_LDADD = $(LDADD) parse_include_absolute_DEPENDENCIES = ../src/libgetdata.la parse_include_absrel_SOURCES = parse_include_absrel.c parse_include_absrel_OBJECTS = parse_include_absrel.$(OBJEXT) parse_include_absrel_LDADD = $(LDADD) parse_include_absrel_DEPENDENCIES = ../src/libgetdata.la parse_include_affix_bad_SOURCES = parse_include_affix_bad.c parse_include_affix_bad_OBJECTS = parse_include_affix_bad.$(OBJEXT) parse_include_affix_bad_LDADD = $(LDADD) parse_include_affix_bad_DEPENDENCIES = ../src/libgetdata.la parse_include_affix_ref_SOURCES = parse_include_affix_ref.c parse_include_affix_ref_OBJECTS = parse_include_affix_ref.$(OBJEXT) parse_include_affix_ref_LDADD = $(LDADD) parse_include_affix_ref_DEPENDENCIES = ../src/libgetdata.la parse_include_dir_SOURCES = parse_include_dir.c parse_include_dir_OBJECTS = parse_include_dir.$(OBJEXT) parse_include_dir_LDADD = $(LDADD) parse_include_dir_DEPENDENCIES = ../src/libgetdata.la parse_include_loop_SOURCES = parse_include_loop.c parse_include_loop_OBJECTS = parse_include_loop.$(OBJEXT) parse_include_loop_LDADD = $(LDADD) parse_include_loop_DEPENDENCIES = ../src/libgetdata.la parse_include_nonexistent_SOURCES = parse_include_nonexistent.c parse_include_nonexistent_OBJECTS = \ parse_include_nonexistent.$(OBJEXT) parse_include_nonexistent_LDADD = $(LDADD) parse_include_nonexistent_DEPENDENCIES = ../src/libgetdata.la parse_include_prefix_SOURCES = parse_include_prefix.c parse_include_prefix_OBJECTS = parse_include_prefix.$(OBJEXT) parse_include_prefix_LDADD = $(LDADD) parse_include_prefix_DEPENDENCIES = ../src/libgetdata.la parse_include_prefix_dup_SOURCES = parse_include_prefix_dup.c parse_include_prefix_dup_OBJECTS = parse_include_prefix_dup.$(OBJEXT) parse_include_prefix_dup_LDADD = $(LDADD) parse_include_prefix_dup_DEPENDENCIES = ../src/libgetdata.la parse_include_preprefix_SOURCES = parse_include_preprefix.c parse_include_preprefix_OBJECTS = parse_include_preprefix.$(OBJEXT) parse_include_preprefix_LDADD = $(LDADD) parse_include_preprefix_DEPENDENCIES = ../src/libgetdata.la parse_include_ref_SOURCES = parse_include_ref.c parse_include_ref_OBJECTS = parse_include_ref.$(OBJEXT) parse_include_ref_LDADD = $(LDADD) parse_include_ref_DEPENDENCIES = ../src/libgetdata.la parse_include_relabs_SOURCES = parse_include_relabs.c parse_include_relabs_OBJECTS = parse_include_relabs.$(OBJEXT) parse_include_relabs_LDADD = $(LDADD) parse_include_relabs_DEPENDENCIES = ../src/libgetdata.la parse_include_relrel_SOURCES = parse_include_relrel.c parse_include_relrel_OBJECTS = parse_include_relrel.$(OBJEXT) parse_include_relrel_LDADD = $(LDADD) parse_include_relrel_DEPENDENCIES = ../src/libgetdata.la parse_include_slash_SOURCES = parse_include_slash.c parse_include_slash_OBJECTS = parse_include_slash.$(OBJEXT) parse_include_slash_LDADD = $(LDADD) parse_include_slash_DEPENDENCIES = ../src/libgetdata.la parse_include_suffix_SOURCES = parse_include_suffix.c parse_include_suffix_OBJECTS = parse_include_suffix.$(OBJEXT) parse_include_suffix_LDADD = $(LDADD) parse_include_suffix_DEPENDENCIES = ../src/libgetdata.la parse_include_sufsuffix_SOURCES = parse_include_sufsuffix.c parse_include_sufsuffix_OBJECTS = parse_include_sufsuffix.$(OBJEXT) parse_include_sufsuffix_LDADD = $(LDADD) parse_include_sufsuffix_DEPENDENCIES = ../src/libgetdata.la parse_index_SOURCES = parse_index.c parse_index_OBJECTS = parse_index.$(OBJEXT) parse_index_LDADD = $(LDADD) parse_index_DEPENDENCIES = ../src/libgetdata.la parse_lincom_SOURCES = parse_lincom.c parse_lincom_OBJECTS = parse_lincom.$(OBJEXT) parse_lincom_LDADD = $(LDADD) parse_lincom_DEPENDENCIES = ../src/libgetdata.la parse_lincom_ncols1_SOURCES = parse_lincom_ncols1.c parse_lincom_ncols1_OBJECTS = parse_lincom_ncols1.$(OBJEXT) parse_lincom_ncols1_LDADD = $(LDADD) parse_lincom_ncols1_DEPENDENCIES = ../src/libgetdata.la parse_lincom_ncols2_SOURCES = parse_lincom_ncols2.c parse_lincom_ncols2_OBJECTS = parse_lincom_ncols2.$(OBJEXT) parse_lincom_ncols2_LDADD = $(LDADD) parse_lincom_ncols2_DEPENDENCIES = ../src/libgetdata.la parse_lincom_nfields_SOURCES = parse_lincom_nfields.c parse_lincom_nfields_OBJECTS = parse_lincom_nfields.$(OBJEXT) parse_lincom_nfields_LDADD = $(LDADD) parse_lincom_nfields_DEPENDENCIES = ../src/libgetdata.la parse_lincom_nofields_SOURCES = parse_lincom_nofields.c parse_lincom_nofields_OBJECTS = parse_lincom_nofields.$(OBJEXT) parse_lincom_nofields_LDADD = $(LDADD) parse_lincom_nofields_DEPENDENCIES = ../src/libgetdata.la parse_lincom_non_SOURCES = parse_lincom_non.c parse_lincom_non_OBJECTS = parse_lincom_non.$(OBJEXT) parse_lincom_non_LDADD = $(LDADD) parse_lincom_non_DEPENDENCIES = ../src/libgetdata.la parse_lincom_non_ncols_SOURCES = parse_lincom_non_ncols.c parse_lincom_non_ncols_OBJECTS = parse_lincom_non_ncols.$(OBJEXT) parse_lincom_non_ncols_LDADD = $(LDADD) parse_lincom_non_ncols_DEPENDENCIES = ../src/libgetdata.la parse_lincom_scalar_SOURCES = parse_lincom_scalar.c parse_lincom_scalar_OBJECTS = parse_lincom_scalar.$(OBJEXT) parse_lincom_scalar_LDADD = $(LDADD) parse_lincom_scalar_DEPENDENCIES = ../src/libgetdata.la parse_linterp_SOURCES = parse_linterp.c parse_linterp_OBJECTS = parse_linterp.$(OBJEXT) parse_linterp_LDADD = $(LDADD) parse_linterp_DEPENDENCIES = ../src/libgetdata.la parse_linterp_ncols_SOURCES = parse_linterp_ncols.c parse_linterp_ncols_OBJECTS = parse_linterp_ncols.$(OBJEXT) parse_linterp_ncols_LDADD = $(LDADD) parse_linterp_ncols_DEPENDENCIES = ../src/libgetdata.la parse_literal_cmpbad_SOURCES = parse_literal_cmpbad.c parse_literal_cmpbad_OBJECTS = parse_literal_cmpbad.$(OBJEXT) parse_literal_cmpbad_LDADD = $(LDADD) parse_literal_cmpbad_DEPENDENCIES = ../src/libgetdata.la parse_literal_fltcmp_SOURCES = parse_literal_fltcmp.c parse_literal_fltcmp_OBJECTS = parse_literal_fltcmp.$(OBJEXT) parse_literal_fltcmp_LDADD = $(LDADD) parse_literal_fltcmp_DEPENDENCIES = ../src/libgetdata.la parse_literal_fltcmp0_SOURCES = parse_literal_fltcmp0.c parse_literal_fltcmp0_OBJECTS = parse_literal_fltcmp0.$(OBJEXT) parse_literal_fltcmp0_LDADD = $(LDADD) parse_literal_fltcmp0_DEPENDENCIES = ../src/libgetdata.la parse_literal_intcmp_SOURCES = parse_literal_intcmp.c parse_literal_intcmp_OBJECTS = parse_literal_intcmp.$(OBJEXT) parse_literal_intcmp_LDADD = $(LDADD) parse_literal_intcmp_DEPENDENCIES = ../src/libgetdata.la parse_literal_intcmp0_SOURCES = parse_literal_intcmp0.c parse_literal_intcmp0_OBJECTS = parse_literal_intcmp0.$(OBJEXT) parse_literal_intcmp0_LDADD = $(LDADD) parse_literal_intcmp0_DEPENDENCIES = ../src/libgetdata.la parse_literal_uintcmp_SOURCES = parse_literal_uintcmp.c parse_literal_uintcmp_OBJECTS = parse_literal_uintcmp.$(OBJEXT) parse_literal_uintcmp_LDADD = $(LDADD) parse_literal_uintcmp_DEPENDENCIES = ../src/libgetdata.la parse_literal_uintcmp0_SOURCES = parse_literal_uintcmp0.c parse_literal_uintcmp0_OBJECTS = parse_literal_uintcmp0.$(OBJEXT) parse_literal_uintcmp0_LDADD = $(LDADD) parse_literal_uintcmp0_DEPENDENCIES = ../src/libgetdata.la parse_malias_SOURCES = parse_malias.c parse_malias_OBJECTS = parse_malias.$(OBJEXT) parse_malias_LDADD = $(LDADD) parse_malias_DEPENDENCIES = ../src/libgetdata.la parse_malias_dup_SOURCES = parse_malias_dup.c parse_malias_dup_OBJECTS = parse_malias_dup.$(OBJEXT) parse_malias_dup_LDADD = $(LDADD) parse_malias_dup_DEPENDENCIES = ../src/libgetdata.la parse_malias_meta_SOURCES = parse_malias_meta.c parse_malias_meta_OBJECTS = parse_malias_meta.$(OBJEXT) parse_malias_meta_LDADD = $(LDADD) parse_malias_meta_DEPENDENCIES = ../src/libgetdata.la parse_meta_SOURCES = parse_meta.c parse_meta_OBJECTS = parse_meta.$(OBJEXT) parse_meta_LDADD = $(LDADD) parse_meta_DEPENDENCIES = ../src/libgetdata.la parse_meta_affix_SOURCES = parse_meta_affix.c parse_meta_affix_OBJECTS = parse_meta_affix.$(OBJEXT) parse_meta_affix_LDADD = $(LDADD) parse_meta_affix_DEPENDENCIES = ../src/libgetdata.la parse_meta_alias_SOURCES = parse_meta_alias.c parse_meta_alias_OBJECTS = parse_meta_alias.$(OBJEXT) parse_meta_alias_LDADD = $(LDADD) parse_meta_alias_DEPENDENCIES = ../src/libgetdata.la parse_meta_frag_SOURCES = parse_meta_frag.c parse_meta_frag_OBJECTS = parse_meta_frag.$(OBJEXT) parse_meta_frag_LDADD = $(LDADD) parse_meta_frag_DEPENDENCIES = ../src/libgetdata.la parse_meta_implicit_SOURCES = parse_meta_implicit.c parse_meta_implicit_OBJECTS = parse_meta_implicit.$(OBJEXT) parse_meta_implicit_LDADD = $(LDADD) parse_meta_implicit_DEPENDENCIES = ../src/libgetdata.la parse_meta_implicit2_SOURCES = parse_meta_implicit2.c parse_meta_implicit2_OBJECTS = parse_meta_implicit2.$(OBJEXT) parse_meta_implicit2_LDADD = $(LDADD) parse_meta_implicit2_DEPENDENCIES = ../src/libgetdata.la parse_meta_implicit_affix_SOURCES = parse_meta_implicit_affix.c parse_meta_implicit_affix_OBJECTS = \ parse_meta_implicit_affix.$(OBJEXT) parse_meta_implicit_affix_LDADD = $(LDADD) parse_meta_implicit_affix_DEPENDENCIES = ../src/libgetdata.la parse_meta_index_SOURCES = parse_meta_index.c parse_meta_index_OBJECTS = parse_meta_index.$(OBJEXT) parse_meta_index_LDADD = $(LDADD) parse_meta_index_DEPENDENCIES = ../src/libgetdata.la parse_meta_index2_SOURCES = parse_meta_index2.c parse_meta_index2_OBJECTS = parse_meta_index2.$(OBJEXT) parse_meta_index2_LDADD = $(LDADD) parse_meta_index2_DEPENDENCIES = ../src/libgetdata.la parse_meta_jump_SOURCES = parse_meta_jump.c parse_meta_jump_OBJECTS = parse_meta_jump.$(OBJEXT) parse_meta_jump_LDADD = $(LDADD) parse_meta_jump_DEPENDENCIES = ../src/libgetdata.la parse_meta_malias_SOURCES = parse_meta_malias.c parse_meta_malias_OBJECTS = parse_meta_malias.$(OBJEXT) parse_meta_malias_LDADD = $(LDADD) parse_meta_malias_DEPENDENCIES = ../src/libgetdata.la parse_meta_meta_SOURCES = parse_meta_meta.c parse_meta_meta_OBJECTS = parse_meta_meta.$(OBJEXT) parse_meta_meta_LDADD = $(LDADD) parse_meta_meta_DEPENDENCIES = ../src/libgetdata.la parse_meta_parent_SOURCES = parse_meta_parent.c parse_meta_parent_OBJECTS = parse_meta_parent.$(OBJEXT) parse_meta_parent_LDADD = $(LDADD) parse_meta_parent_DEPENDENCIES = ../src/libgetdata.la parse_meta_raw_SOURCES = parse_meta_raw.c parse_meta_raw_OBJECTS = parse_meta_raw.$(OBJEXT) parse_meta_raw_LDADD = $(LDADD) parse_meta_raw_DEPENDENCIES = ../src/libgetdata.la parse_mplex_SOURCES = parse_mplex.c parse_mplex_OBJECTS = parse_mplex.$(OBJEXT) parse_mplex_LDADD = $(LDADD) parse_mplex_DEPENDENCIES = ../src/libgetdata.la parse_mplex_ncols_SOURCES = parse_mplex_ncols.c parse_mplex_ncols_OBJECTS = parse_mplex_ncols.$(OBJEXT) parse_mplex_ncols_LDADD = $(LDADD) parse_mplex_ncols_DEPENDENCIES = ../src/libgetdata.la parse_mplex_nomax_SOURCES = parse_mplex_nomax.c parse_mplex_nomax_OBJECTS = parse_mplex_nomax.$(OBJEXT) parse_mplex_nomax_LDADD = $(LDADD) parse_mplex_nomax_DEPENDENCIES = ../src/libgetdata.la parse_mplex_scalar_SOURCES = parse_mplex_scalar.c parse_mplex_scalar_OBJECTS = parse_mplex_scalar.$(OBJEXT) parse_mplex_scalar_LDADD = $(LDADD) parse_mplex_scalar_DEPENDENCIES = ../src/libgetdata.la parse_multiply_SOURCES = parse_multiply.c parse_multiply_OBJECTS = parse_multiply.$(OBJEXT) parse_multiply_LDADD = $(LDADD) parse_multiply_DEPENDENCIES = ../src/libgetdata.la parse_multiply_ncols_SOURCES = parse_multiply_ncols.c parse_multiply_ncols_OBJECTS = parse_multiply_ncols.$(OBJEXT) parse_multiply_ncols_LDADD = $(LDADD) parse_multiply_ncols_DEPENDENCIES = ../src/libgetdata.la parse_name_SOURCES = parse_name.c parse_name_OBJECTS = parse_name.$(OBJEXT) parse_name_LDADD = $(LDADD) parse_name_DEPENDENCIES = ../src/libgetdata.la parse_name_dot_SOURCES = parse_name_dot.c parse_name_dot_OBJECTS = parse_name_dot.$(OBJEXT) parse_name_dot_LDADD = $(LDADD) parse_name_dot_DEPENDENCIES = ../src/libgetdata.la parse_name_ext_SOURCES = parse_name_ext.c parse_name_ext_OBJECTS = parse_name_ext.$(OBJEXT) parse_name_ext_LDADD = $(LDADD) parse_name_ext_DEPENDENCIES = ../src/libgetdata.la parse_name_pedantic_SOURCES = parse_name_pedantic.c parse_name_pedantic_OBJECTS = parse_name_pedantic.$(OBJEXT) parse_name_pedantic_LDADD = $(LDADD) parse_name_pedantic_DEPENDENCIES = ../src/libgetdata.la parse_ncols_SOURCES = parse_ncols.c parse_ncols_OBJECTS = parse_ncols.$(OBJEXT) parse_ncols_LDADD = $(LDADD) parse_ncols_DEPENDENCIES = ../src/libgetdata.la parse_octal_zero_SOURCES = parse_octal_zero.c parse_octal_zero_OBJECTS = parse_octal_zero.$(OBJEXT) parse_octal_zero_LDADD = $(LDADD) parse_octal_zero_DEPENDENCIES = ../src/libgetdata.la parse_phase_SOURCES = parse_phase.c parse_phase_OBJECTS = parse_phase.$(OBJEXT) parse_phase_LDADD = $(LDADD) parse_phase_DEPENDENCIES = ../src/libgetdata.la parse_phase_ncols_SOURCES = parse_phase_ncols.c parse_phase_ncols_OBJECTS = parse_phase_ncols.$(OBJEXT) parse_phase_ncols_LDADD = $(LDADD) parse_phase_ncols_DEPENDENCIES = ../src/libgetdata.la parse_phase_scalar_SOURCES = parse_phase_scalar.c parse_phase_scalar_OBJECTS = parse_phase_scalar.$(OBJEXT) parse_phase_scalar_LDADD = $(LDADD) parse_phase_scalar_DEPENDENCIES = ../src/libgetdata.la parse_polynom_SOURCES = parse_polynom.c parse_polynom_OBJECTS = parse_polynom.$(OBJEXT) parse_polynom_LDADD = $(LDADD) parse_polynom_DEPENDENCIES = ../src/libgetdata.la parse_polynom_ncols1_SOURCES = parse_polynom_ncols1.c parse_polynom_ncols1_OBJECTS = parse_polynom_ncols1.$(OBJEXT) parse_polynom_ncols1_LDADD = $(LDADD) parse_polynom_ncols1_DEPENDENCIES = ../src/libgetdata.la parse_polynom_ncols2_SOURCES = parse_polynom_ncols2.c parse_polynom_ncols2_OBJECTS = parse_polynom_ncols2.$(OBJEXT) parse_polynom_ncols2_LDADD = $(LDADD) parse_polynom_ncols2_DEPENDENCIES = ../src/libgetdata.la parse_polynom_scalar_SOURCES = parse_polynom_scalar.c parse_polynom_scalar_OBJECTS = parse_polynom_scalar.$(OBJEXT) parse_polynom_scalar_LDADD = $(LDADD) parse_polynom_scalar_DEPENDENCIES = ../src/libgetdata.la parse_protect_all_SOURCES = parse_protect_all.c parse_protect_all_OBJECTS = parse_protect_all.$(OBJEXT) parse_protect_all_LDADD = $(LDADD) parse_protect_all_DEPENDENCIES = ../src/libgetdata.la parse_protect_bad_SOURCES = parse_protect_bad.c parse_protect_bad_OBJECTS = parse_protect_bad.$(OBJEXT) parse_protect_bad_LDADD = $(LDADD) parse_protect_bad_DEPENDENCIES = ../src/libgetdata.la parse_protect_data_SOURCES = parse_protect_data.c parse_protect_data_OBJECTS = parse_protect_data.$(OBJEXT) parse_protect_data_LDADD = $(LDADD) parse_protect_data_DEPENDENCIES = ../src/libgetdata.la parse_protect_format_SOURCES = parse_protect_format.c parse_protect_format_OBJECTS = parse_protect_format.$(OBJEXT) parse_protect_format_LDADD = $(LDADD) parse_protect_format_DEPENDENCIES = ../src/libgetdata.la parse_protect_none_SOURCES = parse_protect_none.c parse_protect_none_OBJECTS = parse_protect_none.$(OBJEXT) parse_protect_none_LDADD = $(LDADD) parse_protect_none_DEPENDENCIES = ../src/libgetdata.la parse_quote_SOURCES = parse_quote.c parse_quote_OBJECTS = parse_quote.$(OBJEXT) parse_quote_LDADD = $(LDADD) parse_quote_DEPENDENCIES = ../src/libgetdata.la parse_quote_mismatch_SOURCES = parse_quote_mismatch.c parse_quote_mismatch_OBJECTS = parse_quote_mismatch.$(OBJEXT) parse_quote_mismatch_LDADD = $(LDADD) parse_quote_mismatch_DEPENDENCIES = ../src/libgetdata.la parse_raw_SOURCES = parse_raw.c parse_raw_OBJECTS = parse_raw.$(OBJEXT) parse_raw_LDADD = $(LDADD) parse_raw_DEPENDENCIES = ../src/libgetdata.la parse_raw_char_SOURCES = parse_raw_char.c parse_raw_char_OBJECTS = parse_raw_char.$(OBJEXT) parse_raw_char_LDADD = $(LDADD) parse_raw_char_DEPENDENCIES = ../src/libgetdata.la parse_raw_char_bad_SOURCES = parse_raw_char_bad.c parse_raw_char_bad_OBJECTS = parse_raw_char_bad.$(OBJEXT) parse_raw_char_bad_LDADD = $(LDADD) parse_raw_char_bad_DEPENDENCIES = ../src/libgetdata.la parse_raw_ncols_SOURCES = parse_raw_ncols.c parse_raw_ncols_OBJECTS = parse_raw_ncols.$(OBJEXT) parse_raw_ncols_LDADD = $(LDADD) parse_raw_ncols_DEPENDENCIES = ../src/libgetdata.la parse_raw_scalar_SOURCES = parse_raw_scalar.c parse_raw_scalar_OBJECTS = parse_raw_scalar.$(OBJEXT) parse_raw_scalar_LDADD = $(LDADD) parse_raw_scalar_DEPENDENCIES = ../src/libgetdata.la parse_raw_spf_SOURCES = parse_raw_spf.c parse_raw_spf_OBJECTS = parse_raw_spf.$(OBJEXT) parse_raw_spf_LDADD = $(LDADD) parse_raw_spf_DEPENDENCIES = ../src/libgetdata.la parse_raw_type_SOURCES = parse_raw_type.c parse_raw_type_OBJECTS = parse_raw_type.$(OBJEXT) parse_raw_type_LDADD = $(LDADD) parse_raw_type_DEPENDENCIES = ../src/libgetdata.la parse_recip_SOURCES = parse_recip.c parse_recip_OBJECTS = parse_recip.$(OBJEXT) parse_recip_LDADD = $(LDADD) parse_recip_DEPENDENCIES = ../src/libgetdata.la parse_ref_SOURCES = parse_ref.c parse_ref_OBJECTS = parse_ref.$(OBJEXT) parse_ref_LDADD = $(LDADD) parse_ref_DEPENDENCIES = ../src/libgetdata.la parse_ref_nonexistent_SOURCES = parse_ref_nonexistent.c parse_ref_nonexistent_OBJECTS = parse_ref_nonexistent.$(OBJEXT) parse_ref_nonexistent_LDADD = $(LDADD) parse_ref_nonexistent_DEPENDENCIES = ../src/libgetdata.la parse_sbit_SOURCES = parse_sbit.c parse_sbit_OBJECTS = parse_sbit.$(OBJEXT) parse_sbit_LDADD = $(LDADD) parse_sbit_DEPENDENCIES = ../src/libgetdata.la parse_scalar1_SOURCES = parse_scalar1.c parse_scalar1_OBJECTS = parse_scalar1.$(OBJEXT) parse_scalar1_LDADD = $(LDADD) parse_scalar1_DEPENDENCIES = ../src/libgetdata.la parse_scalar2_SOURCES = parse_scalar2.c parse_scalar2_OBJECTS = parse_scalar2.$(OBJEXT) parse_scalar2_LDADD = $(LDADD) parse_scalar2_DEPENDENCIES = ../src/libgetdata.la parse_scalar_repr_SOURCES = parse_scalar_repr.c parse_scalar_repr_OBJECTS = parse_scalar_repr.$(OBJEXT) parse_scalar_repr_LDADD = $(LDADD) parse_scalar_repr_DEPENDENCIES = ../src/libgetdata.la parse_sort_SOURCES = parse_sort.c parse_sort_OBJECTS = parse_sort.$(OBJEXT) parse_sort_LDADD = $(LDADD) parse_sort_DEPENDENCIES = ../src/libgetdata.la parse_string_SOURCES = parse_string.c parse_string_OBJECTS = parse_string.$(OBJEXT) parse_string_LDADD = $(LDADD) parse_string_DEPENDENCIES = ../src/libgetdata.la parse_string_ncols_SOURCES = parse_string_ncols.c parse_string_ncols_OBJECTS = parse_string_ncols.$(OBJEXT) parse_string_ncols_LDADD = $(LDADD) parse_string_ncols_DEPENDENCIES = ../src/libgetdata.la parse_string_null_SOURCES = parse_string_null.c parse_string_null_OBJECTS = parse_string_null.$(OBJEXT) parse_string_null_LDADD = $(LDADD) parse_string_null_DEPENDENCIES = ../src/libgetdata.la parse_utf8_SOURCES = parse_utf8.c parse_utf8_OBJECTS = parse_utf8.$(OBJEXT) parse_utf8_LDADD = $(LDADD) parse_utf8_DEPENDENCIES = ../src/libgetdata.la parse_utf8_invalid_SOURCES = parse_utf8_invalid.c parse_utf8_invalid_OBJECTS = parse_utf8_invalid.$(OBJEXT) parse_utf8_invalid_LDADD = $(LDADD) parse_utf8_invalid_DEPENDENCIES = ../src/libgetdata.la parse_utf8_zero_SOURCES = parse_utf8_zero.c parse_utf8_zero_OBJECTS = parse_utf8_zero.$(OBJEXT) parse_utf8_zero_LDADD = $(LDADD) parse_utf8_zero_DEPENDENCIES = ../src/libgetdata.la parse_version_SOURCES = parse_version.c parse_version_OBJECTS = parse_version.$(OBJEXT) parse_version_LDADD = $(LDADD) parse_version_DEPENDENCIES = ../src/libgetdata.la parse_version_89_SOURCES = parse_version_89.c parse_version_89_OBJECTS = parse_version_89.$(OBJEXT) parse_version_89_LDADD = $(LDADD) parse_version_89_DEPENDENCIES = ../src/libgetdata.la parse_version_98_SOURCES = parse_version_98.c parse_version_98_OBJECTS = parse_version_98.$(OBJEXT) parse_version_98_LDADD = $(LDADD) parse_version_98_DEPENDENCIES = ../src/libgetdata.la parse_version_include_SOURCES = parse_version_include.c parse_version_include_OBJECTS = parse_version_include.$(OBJEXT) parse_version_include_LDADD = $(LDADD) parse_version_include_DEPENDENCIES = ../src/libgetdata.la parse_version_p8_SOURCES = parse_version_p8.c parse_version_p8_OBJECTS = parse_version_p8.$(OBJEXT) parse_version_p8_LDADD = $(LDADD) parse_version_p8_DEPENDENCIES = ../src/libgetdata.la parse_version_p9_SOURCES = parse_version_p9.c parse_version_p9_OBJECTS = parse_version_p9.$(OBJEXT) parse_version_p9_LDADD = $(LDADD) parse_version_p9_DEPENDENCIES = ../src/libgetdata.la parse_version_permissive_SOURCES = parse_version_permissive.c parse_version_permissive_OBJECTS = parse_version_permissive.$(OBJEXT) parse_version_permissive_LDADD = $(LDADD) parse_version_permissive_DEPENDENCIES = ../src/libgetdata.la parse_version_slash_SOURCES = parse_version_slash.c parse_version_slash_OBJECTS = parse_version_slash.$(OBJEXT) parse_version_slash_LDADD = $(LDADD) parse_version_slash_DEPENDENCIES = ../src/libgetdata.la parse_whitespace_SOURCES = parse_whitespace.c parse_whitespace_OBJECTS = parse_whitespace.$(OBJEXT) parse_whitespace_LDADD = $(LDADD) parse_whitespace_DEPENDENCIES = ../src/libgetdata.la parse_window_SOURCES = parse_window.c parse_window_OBJECTS = parse_window.$(OBJEXT) parse_window_LDADD = $(LDADD) parse_window_DEPENDENCIES = ../src/libgetdata.la parse_window_ncols_SOURCES = parse_window_ncols.c parse_window_ncols_OBJECTS = parse_window_ncols.$(OBJEXT) parse_window_ncols_LDADD = $(LDADD) parse_window_ncols_DEPENDENCIES = ../src/libgetdata.la parse_window_op_SOURCES = parse_window_op.c parse_window_op_OBJECTS = parse_window_op.$(OBJEXT) parse_window_op_LDADD = $(LDADD) parse_window_op_DEPENDENCIES = ../src/libgetdata.la parse_window_scalar_SOURCES = parse_window_scalar.c parse_window_scalar_OBJECTS = parse_window_scalar.$(OBJEXT) parse_window_scalar_LDADD = $(LDADD) parse_window_scalar_DEPENDENCIES = ../src/libgetdata.la protect_alter_SOURCES = protect_alter.c protect_alter_OBJECTS = protect_alter.$(OBJEXT) protect_alter_LDADD = $(LDADD) protect_alter_DEPENDENCIES = ../src/libgetdata.la protect_alter_all_SOURCES = protect_alter_all.c protect_alter_all_OBJECTS = protect_alter_all.$(OBJEXT) protect_alter_all_LDADD = $(LDADD) protect_alter_all_DEPENDENCIES = ../src/libgetdata.la protect_get_SOURCES = protect_get.c protect_get_OBJECTS = protect_get.$(OBJEXT) protect_get_LDADD = $(LDADD) protect_get_DEPENDENCIES = ../src/libgetdata.la put64_SOURCES = put64.c put64_OBJECTS = put64.$(OBJEXT) put64_LDADD = $(LDADD) put64_DEPENDENCIES = ../src/libgetdata.la put_bad_code_SOURCES = put_bad_code.c put_bad_code_OBJECTS = put_bad_code.$(OBJEXT) put_bad_code_LDADD = $(LDADD) put_bad_code_DEPENDENCIES = ../src/libgetdata.la put_bit_SOURCES = put_bit.c put_bit_OBJECTS = put_bit.$(OBJEXT) put_bit_LDADD = $(LDADD) put_bit_DEPENDENCIES = ../src/libgetdata.la put_bof_SOURCES = put_bof.c put_bof_OBJECTS = put_bof.$(OBJEXT) put_bof_LDADD = $(LDADD) put_bof_DEPENDENCIES = ../src/libgetdata.la put_carray_SOURCES = put_carray.c put_carray_OBJECTS = put_carray.$(OBJEXT) put_carray_LDADD = $(LDADD) put_carray_DEPENDENCIES = ../src/libgetdata.la put_carray_client_SOURCES = put_carray_client.c put_carray_client_OBJECTS = put_carray_client.$(OBJEXT) put_carray_client_LDADD = $(LDADD) put_carray_client_DEPENDENCIES = ../src/libgetdata.la put_carray_slice_SOURCES = put_carray_slice.c put_carray_slice_OBJECTS = put_carray_slice.$(OBJEXT) put_carray_slice_LDADD = $(LDADD) put_carray_slice_DEPENDENCIES = ../src/libgetdata.la put_char_SOURCES = put_char.c put_char_OBJECTS = put_char.$(OBJEXT) put_char_LDADD = $(LDADD) put_char_DEPENDENCIES = ../src/libgetdata.la put_clincom1_SOURCES = put_clincom1.c put_clincom1_OBJECTS = put_clincom1.$(OBJEXT) put_clincom1_LDADD = $(LDADD) put_clincom1_DEPENDENCIES = ../src/libgetdata.la put_complex128_SOURCES = put_complex128.c put_complex128_OBJECTS = put_complex128.$(OBJEXT) put_complex128_LDADD = $(LDADD) put_complex128_DEPENDENCIES = ../src/libgetdata.la put_complex64_SOURCES = put_complex64.c put_complex64_OBJECTS = put_complex64.$(OBJEXT) put_complex64_LDADD = $(LDADD) put_complex64_DEPENDENCIES = ../src/libgetdata.la put_const_SOURCES = put_const.c put_const_OBJECTS = put_const.$(OBJEXT) put_const_LDADD = $(LDADD) put_const_DEPENDENCIES = ../src/libgetdata.la put_const_protect_SOURCES = put_const_protect.c put_const_protect_OBJECTS = put_const_protect.$(OBJEXT) put_const_protect_LDADD = $(LDADD) put_const_protect_DEPENDENCIES = ../src/libgetdata.la put_cpolynom_SOURCES = put_cpolynom.c put_cpolynom_OBJECTS = put_cpolynom.$(OBJEXT) put_cpolynom_LDADD = $(LDADD) put_cpolynom_DEPENDENCIES = ../src/libgetdata.la put_crecip_SOURCES = put_crecip.c put_crecip_OBJECTS = put_crecip.$(OBJEXT) put_crecip_LDADD = $(LDADD) put_crecip_DEPENDENCIES = ../src/libgetdata.la put_divide_SOURCES = put_divide.c put_divide_OBJECTS = put_divide.$(OBJEXT) put_divide_LDADD = $(LDADD) put_divide_DEPENDENCIES = ../src/libgetdata.la put_endian16_SOURCES = put_endian16.c put_endian16_OBJECTS = put_endian16.$(OBJEXT) put_endian16_LDADD = $(LDADD) put_endian16_DEPENDENCIES = ../src/libgetdata.la put_endian32_SOURCES = put_endian32.c put_endian32_OBJECTS = put_endian32.$(OBJEXT) put_endian32_LDADD = $(LDADD) put_endian32_DEPENDENCIES = ../src/libgetdata.la put_endian64_SOURCES = put_endian64.c put_endian64_OBJECTS = put_endian64.$(OBJEXT) put_endian64_LDADD = $(LDADD) put_endian64_DEPENDENCIES = ../src/libgetdata.la put_endian8_SOURCES = put_endian8.c put_endian8_OBJECTS = put_endian8.$(OBJEXT) put_endian8_LDADD = $(LDADD) put_endian8_DEPENDENCIES = ../src/libgetdata.la put_endian_complex128_arm_SOURCES = put_endian_complex128_arm.c put_endian_complex128_arm_OBJECTS = \ put_endian_complex128_arm.$(OBJEXT) put_endian_complex128_arm_LDADD = $(LDADD) put_endian_complex128_arm_DEPENDENCIES = ../src/libgetdata.la put_endian_complex128_big_SOURCES = put_endian_complex128_big.c put_endian_complex128_big_OBJECTS = \ put_endian_complex128_big.$(OBJEXT) put_endian_complex128_big_LDADD = $(LDADD) put_endian_complex128_big_DEPENDENCIES = ../src/libgetdata.la put_endian_complex128_little_SOURCES = put_endian_complex128_little.c put_endian_complex128_little_OBJECTS = \ put_endian_complex128_little.$(OBJEXT) put_endian_complex128_little_LDADD = $(LDADD) put_endian_complex128_little_DEPENDENCIES = ../src/libgetdata.la put_endian_complex64_arm_SOURCES = put_endian_complex64_arm.c put_endian_complex64_arm_OBJECTS = put_endian_complex64_arm.$(OBJEXT) put_endian_complex64_arm_LDADD = $(LDADD) put_endian_complex64_arm_DEPENDENCIES = ../src/libgetdata.la put_endian_complex64_big_SOURCES = put_endian_complex64_big.c put_endian_complex64_big_OBJECTS = put_endian_complex64_big.$(OBJEXT) put_endian_complex64_big_LDADD = $(LDADD) put_endian_complex64_big_DEPENDENCIES = ../src/libgetdata.la put_endian_complex64_little_SOURCES = put_endian_complex64_little.c put_endian_complex64_little_OBJECTS = \ put_endian_complex64_little.$(OBJEXT) put_endian_complex64_little_LDADD = $(LDADD) put_endian_complex64_little_DEPENDENCIES = ../src/libgetdata.la put_endian_float32_arm_SOURCES = put_endian_float32_arm.c put_endian_float32_arm_OBJECTS = put_endian_float32_arm.$(OBJEXT) put_endian_float32_arm_LDADD = $(LDADD) put_endian_float32_arm_DEPENDENCIES = ../src/libgetdata.la put_endian_float32_big_SOURCES = put_endian_float32_big.c put_endian_float32_big_OBJECTS = put_endian_float32_big.$(OBJEXT) put_endian_float32_big_LDADD = $(LDADD) put_endian_float32_big_DEPENDENCIES = ../src/libgetdata.la put_endian_float32_little_SOURCES = put_endian_float32_little.c put_endian_float32_little_OBJECTS = \ put_endian_float32_little.$(OBJEXT) put_endian_float32_little_LDADD = $(LDADD) put_endian_float32_little_DEPENDENCIES = ../src/libgetdata.la put_endian_float64_arm_SOURCES = put_endian_float64_arm.c put_endian_float64_arm_OBJECTS = put_endian_float64_arm.$(OBJEXT) put_endian_float64_arm_LDADD = $(LDADD) put_endian_float64_arm_DEPENDENCIES = ../src/libgetdata.la put_endian_float64_big_SOURCES = put_endian_float64_big.c put_endian_float64_big_OBJECTS = put_endian_float64_big.$(OBJEXT) put_endian_float64_big_LDADD = $(LDADD) put_endian_float64_big_DEPENDENCIES = ../src/libgetdata.la put_endian_float64_little_SOURCES = put_endian_float64_little.c put_endian_float64_little_OBJECTS = \ put_endian_float64_little.$(OBJEXT) put_endian_float64_little_LDADD = $(LDADD) put_endian_float64_little_DEPENDENCIES = ../src/libgetdata.la put_ff_SOURCES = put_ff.c put_ff_OBJECTS = put_ff.$(OBJEXT) put_ff_LDADD = $(LDADD) put_ff_DEPENDENCIES = ../src/libgetdata.la put_float32_SOURCES = put_float32.c put_float32_OBJECTS = put_float32.$(OBJEXT) put_float32_LDADD = $(LDADD) put_float32_DEPENDENCIES = ../src/libgetdata.la put_float64_SOURCES = put_float64.c put_float64_OBJECTS = put_float64.$(OBJEXT) put_float64_LDADD = $(LDADD) put_float64_DEPENDENCIES = ../src/libgetdata.la put_foffs_SOURCES = put_foffs.c put_foffs_OBJECTS = put_foffs.$(OBJEXT) put_foffs_LDADD = $(LDADD) put_foffs_DEPENDENCIES = ../src/libgetdata.la put_fs_SOURCES = put_fs.c put_fs_OBJECTS = put_fs.$(OBJEXT) put_fs_LDADD = $(LDADD) put_fs_DEPENDENCIES = ../src/libgetdata.la put_here_SOURCES = put_here.c put_here_OBJECTS = put_here.$(OBJEXT) put_here_LDADD = $(LDADD) put_here_DEPENDENCIES = ../src/libgetdata.la put_heres_SOURCES = put_heres.c put_heres_OBJECTS = put_heres.$(OBJEXT) put_heres_LDADD = $(LDADD) put_heres_DEPENDENCIES = ../src/libgetdata.la put_int16_SOURCES = put_int16.c put_int16_OBJECTS = put_int16.$(OBJEXT) put_int16_LDADD = $(LDADD) put_int16_DEPENDENCIES = ../src/libgetdata.la put_int32_SOURCES = put_int32.c put_int32_OBJECTS = put_int32.$(OBJEXT) put_int32_LDADD = $(LDADD) put_int32_DEPENDENCIES = ../src/libgetdata.la put_int64_SOURCES = put_int64.c put_int64_OBJECTS = put_int64.$(OBJEXT) put_int64_LDADD = $(LDADD) put_int64_DEPENDENCIES = ../src/libgetdata.la put_int8_SOURCES = put_int8.c put_int8_OBJECTS = put_int8.$(OBJEXT) put_int8_LDADD = $(LDADD) put_int8_DEPENDENCIES = ../src/libgetdata.la put_invalid_SOURCES = put_invalid.c put_invalid_OBJECTS = put_invalid.$(OBJEXT) put_invalid_LDADD = $(LDADD) put_invalid_DEPENDENCIES = ../src/libgetdata.la put_lincom1_SOURCES = put_lincom1.c put_lincom1_OBJECTS = put_lincom1.$(OBJEXT) put_lincom1_LDADD = $(LDADD) put_lincom1_DEPENDENCIES = ../src/libgetdata.la put_lincom2_SOURCES = put_lincom2.c put_lincom2_OBJECTS = put_lincom2.$(OBJEXT) put_lincom2_LDADD = $(LDADD) put_lincom2_DEPENDENCIES = ../src/libgetdata.la put_lincom_noin_SOURCES = put_lincom_noin.c put_lincom_noin_OBJECTS = put_lincom_noin.$(OBJEXT) put_lincom_noin_LDADD = $(LDADD) put_lincom_noin_DEPENDENCIES = ../src/libgetdata.la put_linterp_SOURCES = put_linterp.c put_linterp_OBJECTS = put_linterp.$(OBJEXT) put_linterp_LDADD = $(LDADD) put_linterp_DEPENDENCIES = ../src/libgetdata.la put_linterp_noin_SOURCES = put_linterp_noin.c put_linterp_noin_OBJECTS = put_linterp_noin.$(OBJEXT) put_linterp_noin_LDADD = $(LDADD) put_linterp_noin_DEPENDENCIES = ../src/libgetdata.la put_linterp_nomono_SOURCES = put_linterp_nomono.c put_linterp_nomono_OBJECTS = put_linterp_nomono.$(OBJEXT) put_linterp_nomono_LDADD = $(LDADD) put_linterp_nomono_DEPENDENCIES = ../src/libgetdata.la put_linterp_notab_SOURCES = put_linterp_notab.c put_linterp_notab_OBJECTS = put_linterp_notab.$(OBJEXT) put_linterp_notab_LDADD = $(LDADD) put_linterp_notab_DEPENDENCIES = ../src/libgetdata.la put_linterp_reverse_SOURCES = put_linterp_reverse.c put_linterp_reverse_OBJECTS = put_linterp_reverse.$(OBJEXT) put_linterp_reverse_LDADD = $(LDADD) put_linterp_reverse_DEPENDENCIES = ../src/libgetdata.la put_mplex_SOURCES = put_mplex.c put_mplex_OBJECTS = put_mplex.$(OBJEXT) put_mplex_LDADD = $(LDADD) put_mplex_DEPENDENCIES = ../src/libgetdata.la put_mplex_complex_SOURCES = put_mplex_complex.c put_mplex_complex_OBJECTS = put_mplex_complex.$(OBJEXT) put_mplex_complex_LDADD = $(LDADD) put_mplex_complex_DEPENDENCIES = ../src/libgetdata.la put_multiply_SOURCES = put_multiply.c put_multiply_OBJECTS = put_multiply.$(OBJEXT) put_multiply_LDADD = $(LDADD) put_multiply_DEPENDENCIES = ../src/libgetdata.la put_nofile_SOURCES = put_nofile.c put_nofile_OBJECTS = put_nofile.$(OBJEXT) put_nofile_LDADD = $(LDADD) put_nofile_DEPENDENCIES = ../src/libgetdata.la put_null_SOURCES = put_null.c put_null_OBJECTS = put_null.$(OBJEXT) put_null_LDADD = $(LDADD) put_null_DEPENDENCIES = ../src/libgetdata.la put_off64_SOURCES = put_off64.c put_off64_OBJECTS = put_off64.$(OBJEXT) put_off64_LDADD = $(LDADD) put_off64_DEPENDENCIES = ../src/libgetdata.la put_phase_SOURCES = put_phase.c put_phase_OBJECTS = put_phase.$(OBJEXT) put_phase_LDADD = $(LDADD) put_phase_DEPENDENCIES = ../src/libgetdata.la put_phase_noin_SOURCES = put_phase_noin.c put_phase_noin_OBJECTS = put_phase_noin.$(OBJEXT) put_phase_noin_LDADD = $(LDADD) put_phase_noin_DEPENDENCIES = ../src/libgetdata.la put_polynom1_SOURCES = put_polynom1.c put_polynom1_OBJECTS = put_polynom1.$(OBJEXT) put_polynom1_LDADD = $(LDADD) put_polynom1_DEPENDENCIES = ../src/libgetdata.la put_polynom2_SOURCES = put_polynom2.c put_polynom2_OBJECTS = put_polynom2.$(OBJEXT) put_polynom2_LDADD = $(LDADD) put_polynom2_DEPENDENCIES = ../src/libgetdata.la put_polynom_noin_SOURCES = put_polynom_noin.c put_polynom_noin_OBJECTS = put_polynom_noin.$(OBJEXT) put_polynom_noin_LDADD = $(LDADD) put_polynom_noin_DEPENDENCIES = ../src/libgetdata.la put_protect_SOURCES = put_protect.c put_protect_OBJECTS = put_protect.$(OBJEXT) put_protect_LDADD = $(LDADD) put_protect_DEPENDENCIES = ../src/libgetdata.la put_rdonly_SOURCES = put_rdonly.c put_rdonly_OBJECTS = put_rdonly.$(OBJEXT) put_rdonly_LDADD = $(LDADD) put_rdonly_DEPENDENCIES = ../src/libgetdata.la put_recip_SOURCES = put_recip.c put_recip_OBJECTS = put_recip.$(OBJEXT) put_recip_LDADD = $(LDADD) put_recip_DEPENDENCIES = ../src/libgetdata.la put_recurse_SOURCES = put_recurse.c put_recurse_OBJECTS = put_recurse.$(OBJEXT) put_recurse_LDADD = $(LDADD) put_recurse_DEPENDENCIES = ../src/libgetdata.la put_repr_SOURCES = put_repr.c put_repr_OBJECTS = put_repr.$(OBJEXT) put_repr_LDADD = $(LDADD) put_repr_DEPENDENCIES = ../src/libgetdata.la put_rofs_SOURCES = put_rofs.c put_rofs_OBJECTS = put_rofs.$(OBJEXT) put_rofs_LDADD = $(LDADD) put_rofs_DEPENDENCIES = ../src/libgetdata.la put_sbit_SOURCES = put_sbit.c put_sbit_OBJECTS = put_sbit.$(OBJEXT) put_sbit_LDADD = $(LDADD) put_sbit_DEPENDENCIES = ../src/libgetdata.la put_sf_SOURCES = put_sf.c put_sf_OBJECTS = put_sf.$(OBJEXT) put_sf_LDADD = $(LDADD) put_sf_DEPENDENCIES = ../src/libgetdata.la put_ss_SOURCES = put_ss.c put_ss_OBJECTS = put_ss.$(OBJEXT) put_ss_LDADD = $(LDADD) put_ss_DEPENDENCIES = ../src/libgetdata.la put_string_SOURCES = put_string.c put_string_OBJECTS = put_string.$(OBJEXT) put_string_LDADD = $(LDADD) put_string_DEPENDENCIES = ../src/libgetdata.la put_string_protect_SOURCES = put_string_protect.c put_string_protect_OBJECTS = put_string_protect.$(OBJEXT) put_string_protect_LDADD = $(LDADD) put_string_protect_DEPENDENCIES = ../src/libgetdata.la put_sub_SOURCES = put_sub.c put_sub_OBJECTS = put_sub.$(OBJEXT) put_sub_LDADD = $(LDADD) put_sub_DEPENDENCIES = ../src/libgetdata.la put_type_SOURCES = put_type.c put_type_OBJECTS = put_type.$(OBJEXT) put_type_LDADD = $(LDADD) put_type_DEPENDENCIES = ../src/libgetdata.la put_uint16_SOURCES = put_uint16.c put_uint16_OBJECTS = put_uint16.$(OBJEXT) put_uint16_LDADD = $(LDADD) put_uint16_DEPENDENCIES = ../src/libgetdata.la put_uint32_SOURCES = put_uint32.c put_uint32_OBJECTS = put_uint32.$(OBJEXT) put_uint32_LDADD = $(LDADD) put_uint32_DEPENDENCIES = ../src/libgetdata.la put_uint64_SOURCES = put_uint64.c put_uint64_OBJECTS = put_uint64.$(OBJEXT) put_uint64_LDADD = $(LDADD) put_uint64_DEPENDENCIES = ../src/libgetdata.la put_window_SOURCES = put_window.c put_window_OBJECTS = put_window.$(OBJEXT) put_window_LDADD = $(LDADD) put_window_DEPENDENCIES = ../src/libgetdata.la put_zero_SOURCES = put_zero.c put_zero_OBJECTS = put_zero.$(OBJEXT) put_zero_LDADD = $(LDADD) put_zero_DEPENDENCIES = ../src/libgetdata.la ref_SOURCES = ref.c ref_OBJECTS = ref.$(OBJEXT) ref_LDADD = $(LDADD) ref_DEPENDENCIES = ../src/libgetdata.la ref_none_SOURCES = ref_none.c ref_none_OBJECTS = ref_none.$(OBJEXT) ref_none_LDADD = $(LDADD) ref_none_DEPENDENCIES = ../src/libgetdata.la ref_two_SOURCES = ref_two.c ref_two_OBJECTS = ref_two.$(OBJEXT) ref_two_LDADD = $(LDADD) ref_two_DEPENDENCIES = ../src/libgetdata.la repr_a_SOURCES = repr_a.c repr_a_OBJECTS = repr_a.$(OBJEXT) repr_a_LDADD = $(LDADD) repr_a_DEPENDENCIES = ../src/libgetdata.la repr_bad_SOURCES = repr_bad.c repr_bad_OBJECTS = repr_bad.$(OBJEXT) repr_bad_LDADD = $(LDADD) repr_bad_DEPENDENCIES = ../src/libgetdata.la repr_float32_SOURCES = repr_float32.c repr_float32_OBJECTS = repr_float32.$(OBJEXT) repr_float32_LDADD = $(LDADD) repr_float32_DEPENDENCIES = ../src/libgetdata.la repr_float64_SOURCES = repr_float64.c repr_float64_OBJECTS = repr_float64.$(OBJEXT) repr_float64_LDADD = $(LDADD) repr_float64_DEPENDENCIES = ../src/libgetdata.la repr_i_SOURCES = repr_i.c repr_i_OBJECTS = repr_i.$(OBJEXT) repr_i_LDADD = $(LDADD) repr_i_DEPENDENCIES = ../src/libgetdata.la repr_int16_SOURCES = repr_int16.c repr_int16_OBJECTS = repr_int16.$(OBJEXT) repr_int16_LDADD = $(LDADD) repr_int16_DEPENDENCIES = ../src/libgetdata.la repr_int32_SOURCES = repr_int32.c repr_int32_OBJECTS = repr_int32.$(OBJEXT) repr_int32_LDADD = $(LDADD) repr_int32_DEPENDENCIES = ../src/libgetdata.la repr_int64_SOURCES = repr_int64.c repr_int64_OBJECTS = repr_int64.$(OBJEXT) repr_int64_LDADD = $(LDADD) repr_int64_DEPENDENCIES = ../src/libgetdata.la repr_int8_SOURCES = repr_int8.c repr_int8_OBJECTS = repr_int8.$(OBJEXT) repr_int8_LDADD = $(LDADD) repr_int8_DEPENDENCIES = ../src/libgetdata.la repr_m_SOURCES = repr_m.c repr_m_OBJECTS = repr_m.$(OBJEXT) repr_m_LDADD = $(LDADD) repr_m_DEPENDENCIES = ../src/libgetdata.la repr_r_SOURCES = repr_r.c repr_r_OBJECTS = repr_r.$(OBJEXT) repr_r_LDADD = $(LDADD) repr_r_DEPENDENCIES = ../src/libgetdata.la repr_real_a_SOURCES = repr_real_a.c repr_real_a_OBJECTS = repr_real_a.$(OBJEXT) repr_real_a_LDADD = $(LDADD) repr_real_a_DEPENDENCIES = ../src/libgetdata.la repr_real_i_SOURCES = repr_real_i.c repr_real_i_OBJECTS = repr_real_i.$(OBJEXT) repr_real_i_LDADD = $(LDADD) repr_real_i_DEPENDENCIES = ../src/libgetdata.la repr_real_m_SOURCES = repr_real_m.c repr_real_m_OBJECTS = repr_real_m.$(OBJEXT) repr_real_m_LDADD = $(LDADD) repr_real_m_DEPENDENCIES = ../src/libgetdata.la repr_real_r_SOURCES = repr_real_r.c repr_real_r_OBJECTS = repr_real_r.$(OBJEXT) repr_real_r_LDADD = $(LDADD) repr_real_r_DEPENDENCIES = ../src/libgetdata.la repr_uint16_SOURCES = repr_uint16.c repr_uint16_OBJECTS = repr_uint16.$(OBJEXT) repr_uint16_LDADD = $(LDADD) repr_uint16_DEPENDENCIES = ../src/libgetdata.la repr_uint32_SOURCES = repr_uint32.c repr_uint32_OBJECTS = repr_uint32.$(OBJEXT) repr_uint32_LDADD = $(LDADD) repr_uint32_DEPENDENCIES = ../src/libgetdata.la repr_uint64_SOURCES = repr_uint64.c repr_uint64_OBJECTS = repr_uint64.$(OBJEXT) repr_uint64_LDADD = $(LDADD) repr_uint64_DEPENDENCIES = ../src/libgetdata.la repr_uint8_SOURCES = repr_uint8.c repr_uint8_OBJECTS = repr_uint8.$(OBJEXT) repr_uint8_LDADD = $(LDADD) repr_uint8_DEPENDENCIES = ../src/libgetdata.la seek64_SOURCES = seek64.c seek64_OBJECTS = seek64.$(OBJEXT) seek64_LDADD = $(LDADD) seek64_DEPENDENCIES = ../src/libgetdata.la seek_cur_SOURCES = seek_cur.c seek_cur_OBJECTS = seek_cur.$(OBJEXT) seek_cur_LDADD = $(LDADD) seek_cur_DEPENDENCIES = ../src/libgetdata.la seek_end_SOURCES = seek_end.c seek_end_OBJECTS = seek_end.$(OBJEXT) seek_end_LDADD = $(LDADD) seek_end_DEPENDENCIES = ../src/libgetdata.la seek_far_SOURCES = seek_far.c seek_far_OBJECTS = seek_far.$(OBJEXT) seek_far_LDADD = $(LDADD) seek_far_DEPENDENCIES = ../src/libgetdata.la seek_foffs_SOURCES = seek_foffs.c seek_foffs_OBJECTS = seek_foffs.$(OBJEXT) seek_foffs_LDADD = $(LDADD) seek_foffs_DEPENDENCIES = ../src/libgetdata.la seek_foffs2_SOURCES = seek_foffs2.c seek_foffs2_OBJECTS = seek_foffs2.$(OBJEXT) seek_foffs2_LDADD = $(LDADD) seek_foffs2_DEPENDENCIES = ../src/libgetdata.la seek_index_SOURCES = seek_index.c seek_index_OBJECTS = seek_index.$(OBJEXT) seek_index_LDADD = $(LDADD) seek_index_DEPENDENCIES = ../src/libgetdata.la seek_lincom_SOURCES = seek_lincom.c seek_lincom_OBJECTS = seek_lincom.$(OBJEXT) seek_lincom_LDADD = $(LDADD) seek_lincom_DEPENDENCIES = ../src/libgetdata.la seek_mult_SOURCES = seek_mult.c seek_mult_OBJECTS = seek_mult.$(OBJEXT) seek_mult_LDADD = $(LDADD) seek_mult_DEPENDENCIES = ../src/libgetdata.la seek_neg_SOURCES = seek_neg.c seek_neg_OBJECTS = seek_neg.$(OBJEXT) seek_neg_LDADD = $(LDADD) seek_neg_DEPENDENCIES = ../src/libgetdata.la seek_phase_SOURCES = seek_phase.c seek_phase_OBJECTS = seek_phase.$(OBJEXT) seek_phase_LDADD = $(LDADD) seek_phase_DEPENDENCIES = ../src/libgetdata.la seek_set_SOURCES = seek_set.c seek_set_OBJECTS = seek_set.$(OBJEXT) seek_set_LDADD = $(LDADD) seek_set_DEPENDENCIES = ../src/libgetdata.la seek_sub_SOURCES = seek_sub.c seek_sub_OBJECTS = seek_sub.$(OBJEXT) seek_sub_LDADD = $(LDADD) seek_sub_DEPENDENCIES = ../src/libgetdata.la sie_get_big_SOURCES = sie_get_big.c sie_get_big_OBJECTS = sie_get_big.$(OBJEXT) sie_get_big_LDADD = $(LDADD) sie_get_big_DEPENDENCIES = ../src/libgetdata.la sie_get_little_SOURCES = sie_get_little.c sie_get_little_OBJECTS = sie_get_little.$(OBJEXT) sie_get_little_LDADD = $(LDADD) sie_get_little_DEPENDENCIES = ../src/libgetdata.la sie_move_from_SOURCES = sie_move_from.c sie_move_from_OBJECTS = sie_move_from.$(OBJEXT) sie_move_from_LDADD = $(LDADD) sie_move_from_DEPENDENCIES = ../src/libgetdata.la sie_move_to_SOURCES = sie_move_to.c sie_move_to_OBJECTS = sie_move_to.$(OBJEXT) sie_move_to_LDADD = $(LDADD) sie_move_to_DEPENDENCIES = ../src/libgetdata.la sie_nframes_big_SOURCES = sie_nframes_big.c sie_nframes_big_OBJECTS = sie_nframes_big.$(OBJEXT) sie_nframes_big_LDADD = $(LDADD) sie_nframes_big_DEPENDENCIES = ../src/libgetdata.la sie_nframes_little_SOURCES = sie_nframes_little.c sie_nframes_little_OBJECTS = sie_nframes_little.$(OBJEXT) sie_nframes_little_LDADD = $(LDADD) sie_nframes_little_DEPENDENCIES = ../src/libgetdata.la sie_put_append_SOURCES = sie_put_append.c sie_put_append_OBJECTS = sie_put_append.$(OBJEXT) sie_put_append_LDADD = $(LDADD) sie_put_append_DEPENDENCIES = ../src/libgetdata.la sie_put_append2_SOURCES = sie_put_append2.c sie_put_append2_OBJECTS = sie_put_append2.$(OBJEXT) sie_put_append2_LDADD = $(LDADD) sie_put_append2_DEPENDENCIES = ../src/libgetdata.la sie_put_back_SOURCES = sie_put_back.c sie_put_back_OBJECTS = sie_put_back.$(OBJEXT) sie_put_back_LDADD = $(LDADD) sie_put_back_DEPENDENCIES = ../src/libgetdata.la sie_put_big_SOURCES = sie_put_big.c sie_put_big_OBJECTS = sie_put_big.$(OBJEXT) sie_put_big_LDADD = $(LDADD) sie_put_big_DEPENDENCIES = ../src/libgetdata.la sie_put_little_SOURCES = sie_put_little.c sie_put_little_OBJECTS = sie_put_little.$(OBJEXT) sie_put_little_LDADD = $(LDADD) sie_put_little_DEPENDENCIES = ../src/libgetdata.la sie_put_many_SOURCES = sie_put_many.c sie_put_many_OBJECTS = sie_put_many.$(OBJEXT) sie_put_many_LDADD = $(LDADD) sie_put_many_DEPENDENCIES = ../src/libgetdata.la sie_put_newo_SOURCES = sie_put_newo.c sie_put_newo_OBJECTS = sie_put_newo.$(OBJEXT) sie_put_newo_LDADD = $(LDADD) sie_put_newo_DEPENDENCIES = ../src/libgetdata.la sie_put_newo0_SOURCES = sie_put_newo0.c sie_put_newo0_OBJECTS = sie_put_newo0.$(OBJEXT) sie_put_newo0_LDADD = $(LDADD) sie_put_newo0_DEPENDENCIES = ../src/libgetdata.la sie_put_pad_SOURCES = sie_put_pad.c sie_put_pad_OBJECTS = sie_put_pad.$(OBJEXT) sie_put_pad_LDADD = $(LDADD) sie_put_pad_DEPENDENCIES = ../src/libgetdata.la sie_put_pad0_SOURCES = sie_put_pad0.c sie_put_pad0_OBJECTS = sie_put_pad0.$(OBJEXT) sie_put_pad0_LDADD = $(LDADD) sie_put_pad0_DEPENDENCIES = ../src/libgetdata.la sie_put_trunc_SOURCES = sie_put_trunc.c sie_put_trunc_OBJECTS = sie_put_trunc.$(OBJEXT) sie_put_trunc_LDADD = $(LDADD) sie_put_trunc_DEPENDENCIES = ../src/libgetdata.la sie_put_trunc2_SOURCES = sie_put_trunc2.c sie_put_trunc2_OBJECTS = sie_put_trunc2.$(OBJEXT) sie_put_trunc2_LDADD = $(LDADD) sie_put_trunc2_DEPENDENCIES = ../src/libgetdata.la sie_put_trunc_nf_SOURCES = sie_put_trunc_nf.c sie_put_trunc_nf_OBJECTS = sie_put_trunc_nf.$(OBJEXT) sie_put_trunc_nf_LDADD = $(LDADD) sie_put_trunc_nf_DEPENDENCIES = ../src/libgetdata.la sie_seek_SOURCES = sie_seek.c sie_seek_OBJECTS = sie_seek.$(OBJEXT) sie_seek_LDADD = $(LDADD) sie_seek_DEPENDENCIES = ../src/libgetdata.la sie_seek_far_SOURCES = sie_seek_far.c sie_seek_far_OBJECTS = sie_seek_far.$(OBJEXT) sie_seek_far_LDADD = $(LDADD) sie_seek_far_DEPENDENCIES = ../src/libgetdata.la sie_sync_SOURCES = sie_sync.c sie_sync_OBJECTS = sie_sync.$(OBJEXT) sie_sync_LDADD = $(LDADD) sie_sync_DEPENDENCIES = ../src/libgetdata.la slim_get_SOURCES = slim_get.c slim_get_OBJECTS = slim_get.$(OBJEXT) slim_get_LDADD = $(LDADD) slim_get_DEPENDENCIES = ../src/libgetdata.la slim_nframes_SOURCES = slim_nframes.c slim_nframes_OBJECTS = slim_nframes.$(OBJEXT) slim_nframes_LDADD = $(LDADD) slim_nframes_DEPENDENCIES = ../src/libgetdata.la slim_seek_SOURCES = slim_seek.c slim_seek_OBJECTS = slim_seek.$(OBJEXT) slim_seek_LDADD = $(LDADD) slim_seek_DEPENDENCIES = ../src/libgetdata.la slim_seek_far_SOURCES = slim_seek_far.c slim_seek_far_OBJECTS = slim_seek_far.$(OBJEXT) slim_seek_far_LDADD = $(LDADD) slim_seek_far_DEPENDENCIES = ../src/libgetdata.la spf_alias_SOURCES = spf_alias.c spf_alias_OBJECTS = spf_alias.$(OBJEXT) spf_alias_LDADD = $(LDADD) spf_alias_DEPENDENCIES = ../src/libgetdata.la spf_alias_meta_SOURCES = spf_alias_meta.c spf_alias_meta_OBJECTS = spf_alias_meta.$(OBJEXT) spf_alias_meta_LDADD = $(LDADD) spf_alias_meta_DEPENDENCIES = ../src/libgetdata.la spf_alias_missing_SOURCES = spf_alias_missing.c spf_alias_missing_OBJECTS = spf_alias_missing.$(OBJEXT) spf_alias_missing_LDADD = $(LDADD) spf_alias_missing_DEPENDENCIES = ../src/libgetdata.la spf_divide_SOURCES = spf_divide.c spf_divide_OBJECTS = spf_divide.$(OBJEXT) spf_divide_LDADD = $(LDADD) spf_divide_DEPENDENCIES = ../src/libgetdata.la spf_lincom_SOURCES = spf_lincom.c spf_lincom_OBJECTS = spf_lincom.$(OBJEXT) spf_lincom_LDADD = $(LDADD) spf_lincom_DEPENDENCIES = ../src/libgetdata.la spf_multiply_SOURCES = spf_multiply.c spf_multiply_OBJECTS = spf_multiply.$(OBJEXT) spf_multiply_LDADD = $(LDADD) spf_multiply_DEPENDENCIES = ../src/libgetdata.la spf_polynom_SOURCES = spf_polynom.c spf_polynom_OBJECTS = spf_polynom.$(OBJEXT) spf_polynom_LDADD = $(LDADD) spf_polynom_DEPENDENCIES = ../src/libgetdata.la spf_raw_SOURCES = spf_raw.c spf_raw_OBJECTS = spf_raw.$(OBJEXT) spf_raw_LDADD = $(LDADD) spf_raw_DEPENDENCIES = ../src/libgetdata.la spf_recip_SOURCES = spf_recip.c spf_recip_OBJECTS = spf_recip.$(OBJEXT) spf_recip_LDADD = $(LDADD) spf_recip_DEPENDENCIES = ../src/libgetdata.la spf_recurse_SOURCES = spf_recurse.c spf_recurse_OBJECTS = spf_recurse.$(OBJEXT) spf_recurse_LDADD = $(LDADD) spf_recurse_DEPENDENCIES = ../src/libgetdata.la svlist_SOURCES = svlist.c svlist_OBJECTS = svlist.$(OBJEXT) svlist_LDADD = $(LDADD) svlist_DEPENDENCIES = ../src/libgetdata.la svlist0_SOURCES = svlist0.c svlist0_OBJECTS = svlist0.$(OBJEXT) svlist0_LDADD = $(LDADD) svlist0_DEPENDENCIES = ../src/libgetdata.la svlist2_SOURCES = svlist2.c svlist2_OBJECTS = svlist2.$(OBJEXT) svlist2_LDADD = $(LDADD) svlist2_DEPENDENCIES = ../src/libgetdata.la svlist_hidden_SOURCES = svlist_hidden.c svlist_hidden_OBJECTS = svlist_hidden.$(OBJEXT) svlist_hidden_LDADD = $(LDADD) svlist_hidden_DEPENDENCIES = ../src/libgetdata.la svlist_invalid_SOURCES = svlist_invalid.c svlist_invalid_OBJECTS = svlist_invalid.$(OBJEXT) svlist_invalid_LDADD = $(LDADD) svlist_invalid_DEPENDENCIES = ../src/libgetdata.la svlist_meta_SOURCES = svlist_meta.c svlist_meta_OBJECTS = svlist_meta.$(OBJEXT) svlist_meta_LDADD = $(LDADD) svlist_meta_DEPENDENCIES = ../src/libgetdata.la svlist_meta0_SOURCES = svlist_meta0.c svlist_meta0_OBJECTS = svlist_meta0.$(OBJEXT) svlist_meta0_LDADD = $(LDADD) svlist_meta0_DEPENDENCIES = ../src/libgetdata.la svlist_meta_hidden_SOURCES = svlist_meta_hidden.c svlist_meta_hidden_OBJECTS = svlist_meta_hidden.$(OBJEXT) svlist_meta_hidden_LDADD = $(LDADD) svlist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la svlist_meta_invalid_SOURCES = svlist_meta_invalid.c svlist_meta_invalid_OBJECTS = svlist_meta_invalid.$(OBJEXT) svlist_meta_invalid_LDADD = $(LDADD) svlist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la table_SOURCES = table.c table_OBJECTS = table.$(OBJEXT) table_LDADD = $(LDADD) table_DEPENDENCIES = ../src/libgetdata.la table_code_SOURCES = table_code.c table_code_OBJECTS = table_code.$(OBJEXT) table_code_LDADD = $(LDADD) table_code_DEPENDENCIES = ../src/libgetdata.la table_type_SOURCES = table_type.c table_type_OBJECTS = table_type.$(OBJEXT) table_type_LDADD = $(LDADD) table_type_DEPENDENCIES = ../src/libgetdata.la tell_SOURCES = tell.c tell_OBJECTS = tell.$(OBJEXT) tell_LDADD = $(LDADD) tell_DEPENDENCIES = ../src/libgetdata.la tell64_SOURCES = tell64.c tell64_OBJECTS = tell64.$(OBJEXT) tell64_LDADD = $(LDADD) tell64_DEPENDENCIES = ../src/libgetdata.la tell_multidiv_SOURCES = tell_multidiv.c tell_multidiv_OBJECTS = tell_multidiv.$(OBJEXT) tell_multidiv_LDADD = $(LDADD) tell_multidiv_DEPENDENCIES = ../src/libgetdata.la tell_sub_SOURCES = tell_sub.c tell_sub_OBJECTS = tell_sub.$(OBJEXT) tell_sub_LDADD = $(LDADD) tell_sub_DEPENDENCIES = ../src/libgetdata.la tok_arg_SOURCES = tok_arg.c tok_arg_OBJECTS = tok_arg.$(OBJEXT) tok_arg_LDADD = $(LDADD) tok_arg_DEPENDENCIES = ../src/libgetdata.la tok_escape_SOURCES = tok_escape.c tok_escape_OBJECTS = tok_escape.$(OBJEXT) tok_escape_LDADD = $(LDADD) tok_escape_DEPENDENCIES = ../src/libgetdata.la tok_quote_SOURCES = tok_quote.c tok_quote_OBJECTS = tok_quote.$(OBJEXT) tok_quote_LDADD = $(LDADD) tok_quote_DEPENDENCIES = ../src/libgetdata.la trunc_SOURCES = trunc.c trunc_OBJECTS = trunc.$(OBJEXT) trunc_LDADD = $(LDADD) trunc_DEPENDENCIES = ../src/libgetdata.la trunc_dir_SOURCES = trunc_dir.c trunc_dir_OBJECTS = trunc_dir.$(OBJEXT) trunc_dir_LDADD = $(LDADD) trunc_dir_DEPENDENCIES = ../src/libgetdata.la trunc_rdonly_SOURCES = trunc_rdonly.c trunc_rdonly_OBJECTS = trunc_rdonly.$(OBJEXT) trunc_rdonly_LDADD = $(LDADD) trunc_rdonly_DEPENDENCIES = ../src/libgetdata.la trunc_rofs_SOURCES = trunc_rofs.c trunc_rofs_OBJECTS = trunc_rofs.$(OBJEXT) trunc_rofs_LDADD = $(LDADD) trunc_rofs_DEPENDENCIES = ../src/libgetdata.la trunc_truncsub_SOURCES = trunc_truncsub.c trunc_truncsub_OBJECTS = trunc_truncsub.$(OBJEXT) trunc_truncsub_LDADD = $(LDADD) trunc_truncsub_DEPENDENCIES = ../src/libgetdata.la unclude_SOURCES = unclude.c unclude_OBJECTS = unclude.$(OBJEXT) unclude_LDADD = $(LDADD) unclude_DEPENDENCIES = ../src/libgetdata.la unclude_del_SOURCES = unclude_del.c unclude_del_OBJECTS = unclude_del.$(OBJEXT) unclude_del_LDADD = $(LDADD) unclude_del_DEPENDENCIES = ../src/libgetdata.la unclude_move_SOURCES = unclude_move.c unclude_move_OBJECTS = unclude_move.$(OBJEXT) unclude_move_LDADD = $(LDADD) unclude_move_DEPENDENCIES = ../src/libgetdata.la unclude_open_SOURCES = unclude_open.c unclude_open_OBJECTS = unclude_open.$(OBJEXT) unclude_open_LDADD = $(LDADD) unclude_open_DEPENDENCIES = ../src/libgetdata.la version_0_SOURCES = version_0.c version_0_OBJECTS = version_0.$(OBJEXT) version_0_LDADD = $(LDADD) version_0_DEPENDENCIES = ../src/libgetdata.la version_0_write_SOURCES = version_0_write.c version_0_write_OBJECTS = version_0_write.$(OBJEXT) version_0_write_LDADD = $(LDADD) version_0_write_DEPENDENCIES = ../src/libgetdata.la version_1_SOURCES = version_1.c version_1_OBJECTS = version_1.$(OBJEXT) version_1_LDADD = $(LDADD) version_1_DEPENDENCIES = ../src/libgetdata.la version_1_write_SOURCES = version_1_write.c version_1_write_OBJECTS = version_1_write.$(OBJEXT) version_1_write_LDADD = $(LDADD) version_1_write_DEPENDENCIES = ../src/libgetdata.la version_2_SOURCES = version_2.c version_2_OBJECTS = version_2.$(OBJEXT) version_2_LDADD = $(LDADD) version_2_DEPENDENCIES = ../src/libgetdata.la version_2_write_SOURCES = version_2_write.c version_2_write_OBJECTS = version_2_write.$(OBJEXT) version_2_write_LDADD = $(LDADD) version_2_write_DEPENDENCIES = ../src/libgetdata.la version_3_SOURCES = version_3.c version_3_OBJECTS = version_3.$(OBJEXT) version_3_LDADD = $(LDADD) version_3_DEPENDENCIES = ../src/libgetdata.la version_3_write_SOURCES = version_3_write.c version_3_write_OBJECTS = version_3_write.$(OBJEXT) version_3_write_LDADD = $(LDADD) version_3_write_DEPENDENCIES = ../src/libgetdata.la version_4_SOURCES = version_4.c version_4_OBJECTS = version_4.$(OBJEXT) version_4_LDADD = $(LDADD) version_4_DEPENDENCIES = ../src/libgetdata.la version_4_write_SOURCES = version_4_write.c version_4_write_OBJECTS = version_4_write.$(OBJEXT) version_4_write_LDADD = $(LDADD) version_4_write_DEPENDENCIES = ../src/libgetdata.la version_5_SOURCES = version_5.c version_5_OBJECTS = version_5.$(OBJEXT) version_5_LDADD = $(LDADD) version_5_DEPENDENCIES = ../src/libgetdata.la version_5_strict_SOURCES = version_5_strict.c version_5_strict_OBJECTS = version_5_strict.$(OBJEXT) version_5_strict_LDADD = $(LDADD) version_5_strict_DEPENDENCIES = ../src/libgetdata.la version_5_write_SOURCES = version_5_write.c version_5_write_OBJECTS = version_5_write.$(OBJEXT) version_5_write_LDADD = $(LDADD) version_5_write_DEPENDENCIES = ../src/libgetdata.la version_6_SOURCES = version_6.c version_6_OBJECTS = version_6.$(OBJEXT) version_6_LDADD = $(LDADD) version_6_DEPENDENCIES = ../src/libgetdata.la version_6_strict_SOURCES = version_6_strict.c version_6_strict_OBJECTS = version_6_strict.$(OBJEXT) version_6_strict_LDADD = $(LDADD) version_6_strict_DEPENDENCIES = ../src/libgetdata.la version_6_write_SOURCES = version_6_write.c version_6_write_OBJECTS = version_6_write.$(OBJEXT) version_6_write_LDADD = $(LDADD) version_6_write_DEPENDENCIES = ../src/libgetdata.la version_7_SOURCES = version_7.c version_7_OBJECTS = version_7.$(OBJEXT) version_7_LDADD = $(LDADD) version_7_DEPENDENCIES = ../src/libgetdata.la version_7_strict_SOURCES = version_7_strict.c version_7_strict_OBJECTS = version_7_strict.$(OBJEXT) version_7_strict_LDADD = $(LDADD) version_7_strict_DEPENDENCIES = ../src/libgetdata.la version_7_write_SOURCES = version_7_write.c version_7_write_OBJECTS = version_7_write.$(OBJEXT) version_7_write_LDADD = $(LDADD) version_7_write_DEPENDENCIES = ../src/libgetdata.la version_8_SOURCES = version_8.c version_8_OBJECTS = version_8.$(OBJEXT) version_8_LDADD = $(LDADD) version_8_DEPENDENCIES = ../src/libgetdata.la version_8_strict_SOURCES = version_8_strict.c version_8_strict_OBJECTS = version_8_strict.$(OBJEXT) version_8_strict_LDADD = $(LDADD) version_8_strict_DEPENDENCIES = ../src/libgetdata.la version_8_write_SOURCES = version_8_write.c version_8_write_OBJECTS = version_8_write.$(OBJEXT) version_8_write_LDADD = $(LDADD) version_8_write_DEPENDENCIES = ../src/libgetdata.la version_9_SOURCES = version_9.c version_9_OBJECTS = version_9.$(OBJEXT) version_9_LDADD = $(LDADD) version_9_DEPENDENCIES = ../src/libgetdata.la version_9_strict_SOURCES = version_9_strict.c version_9_strict_OBJECTS = version_9_strict.$(OBJEXT) version_9_strict_LDADD = $(LDADD) version_9_strict_DEPENDENCIES = ../src/libgetdata.la version_9_write_SOURCES = version_9_write.c version_9_write_OBJECTS = version_9_write.$(OBJEXT) version_9_write_LDADD = $(LDADD) version_9_write_DEPENDENCIES = ../src/libgetdata.la vlist_SOURCES = vlist.c vlist_OBJECTS = vlist.$(OBJEXT) vlist_LDADD = $(LDADD) vlist_DEPENDENCIES = ../src/libgetdata.la vlist_alias_SOURCES = vlist_alias.c vlist_alias_OBJECTS = vlist_alias.$(OBJEXT) vlist_alias_LDADD = $(LDADD) vlist_alias_DEPENDENCIES = ../src/libgetdata.la vlist_hidden_SOURCES = vlist_hidden.c vlist_hidden_OBJECTS = vlist_hidden.$(OBJEXT) vlist_hidden_LDADD = $(LDADD) vlist_hidden_DEPENDENCIES = ../src/libgetdata.la vlist_invalid_SOURCES = vlist_invalid.c vlist_invalid_OBJECTS = vlist_invalid.$(OBJEXT) vlist_invalid_LDADD = $(LDADD) vlist_invalid_DEPENDENCIES = ../src/libgetdata.la vlist_meta_SOURCES = vlist_meta.c vlist_meta_OBJECTS = vlist_meta.$(OBJEXT) vlist_meta_LDADD = $(LDADD) vlist_meta_DEPENDENCIES = ../src/libgetdata.la vlist_meta_hidden_SOURCES = vlist_meta_hidden.c vlist_meta_hidden_OBJECTS = vlist_meta_hidden.$(OBJEXT) vlist_meta_hidden_LDADD = $(LDADD) vlist_meta_hidden_DEPENDENCIES = ../src/libgetdata.la vlist_meta_invalid_SOURCES = vlist_meta_invalid.c vlist_meta_invalid_OBJECTS = vlist_meta_invalid.$(OBJEXT) vlist_meta_invalid_LDADD = $(LDADD) vlist_meta_invalid_DEPENDENCIES = ../src/libgetdata.la zzip_data_SOURCES = zzip_data.c zzip_data_OBJECTS = zzip_data.$(OBJEXT) zzip_data_LDADD = $(LDADD) zzip_data_DEPENDENCIES = ../src/libgetdata.la zzip_get_SOURCES = zzip_get.c zzip_get_OBJECTS = zzip_get.$(OBJEXT) zzip_get_LDADD = $(LDADD) zzip_get_DEPENDENCIES = ../src/libgetdata.la zzip_get_get_SOURCES = zzip_get_get.c zzip_get_get_OBJECTS = zzip_get_get.$(OBJEXT) zzip_get_get_LDADD = $(LDADD) zzip_get_get_DEPENDENCIES = ../src/libgetdata.la zzip_nframes_SOURCES = zzip_nframes.c zzip_nframes_OBJECTS = zzip_nframes.$(OBJEXT) zzip_nframes_LDADD = $(LDADD) zzip_nframes_DEPENDENCIES = ../src/libgetdata.la zzip_seek_SOURCES = zzip_seek.c zzip_seek_OBJECTS = zzip_seek.$(OBJEXT) zzip_seek_LDADD = $(LDADD) zzip_seek_DEPENDENCIES = ../src/libgetdata.la zzip_seek_far_SOURCES = zzip_seek_far.c zzip_seek_far_OBJECTS = zzip_seek_far.$(OBJEXT) zzip_seek_far_LDADD = $(LDADD) zzip_seek_far_DEPENDENCIES = ../src/libgetdata.la zzslim_get_SOURCES = zzslim_get.c zzslim_get_OBJECTS = zzslim_get.$(OBJEXT) zzslim_get_LDADD = $(LDADD) zzslim_get_DEPENDENCIES = ../src/libgetdata.la zzslim_nframes_SOURCES = zzslim_nframes.c zzslim_nframes_OBJECTS = zzslim_nframes.$(OBJEXT) zzslim_nframes_LDADD = $(LDADD) zzslim_nframes_DEPENDENCIES = ../src/libgetdata.la zzslim_seek_SOURCES = zzslim_seek.c zzslim_seek_OBJECTS = zzslim_seek.$(OBJEXT) zzslim_seek_LDADD = $(LDADD) zzslim_seek_DEPENDENCIES = ../src/libgetdata.la zzslim_seek_far_SOURCES = zzslim_seek_far.c zzslim_seek_far_OBJECTS = zzslim_seek_far.$(OBJEXT) zzslim_seek_far_LDADD = $(LDADD) zzslim_seek_far_DEPENDENCIES = ../src/libgetdata.la 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)/src 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 = add_add.c add_affix.c add_alias.c add_alias_affix.c \ add_alias_meta.c add_amb_code7.c add_bit.c add_bit_bitnum.c \ add_bit_bitsize.c add_bit_invalid.c add_bit_numbits.c \ add_bit_scalars.c add_carray.c add_clincom.c add_code.c \ add_const.c add_cpolynom.c add_crecip.c add_crecip89.c \ add_dangle_dup.c add_divide.c add_divide_invalid.c add_dot5.c \ add_dot6.c add_duplicate.c add_format.c add_invalid.c \ add_lincom.c add_lincom_affix.c add_lincom_invalid.c \ add_lincom_nfields.c add_linterp.c add_linterp_invalid.c \ add_meta.c add_meta_alias.c add_mplex.c add_mplex_scalars.c \ add_multiply.c add_multiply_invalid.c add_phase.c \ add_phase_invalid.c add_polynom.c add_polynom_scalar.c \ add_protect.c add_raw.c add_raw_include.c add_raw_invalid.c \ add_raw_spf.c add_raw_spf_scalar.c add_raw_sub.c \ add_raw_type.c add_rdonly.c add_recip.c add_resolv.c \ add_sbit.c add_scalar.c add_scalar_carray.c \ add_scalar_carray_bad.c add_sort.c add_spec.c \ add_spec_directive.c add_spec_invalid.c add_spec_meta.c \ add_spec_resolv.c add_string.c add_string_affix.c add_type.c \ add_window.c add_window_op.c alias_list.c alias_list_alias.c \ alias_list_missing.c alias_num.c alias_num_alias.c \ alias_num_missing.c alias_target.c alias_target_alias.c \ alias_target_missing.c alter_bit_bitnum.c alter_bit_numbits.c \ alter_carray_len.c alter_carray_type.c alter_clincom.c \ alter_const.c alter_const_c2r.c alter_const_r2c.c \ alter_const_r2r.c alter_cpolynom.c alter_cpolynom_null.c \ alter_crecip.c alter_crecip89.c alter_crecip89_null.c \ alter_crecip_zero.c alter_divide.c alter_entry.c \ alter_entry_affix.c alter_entry_hidden.c alter_entry_lincom.c \ alter_entry_recode.c alter_entry_recode_recalc.c \ alter_entry_scalar1.c alter_entry_scalar2a.c \ alter_entry_scalar2n.c alter_entry_scalar3.c \ alter_entry_scalar3c.c alter_entry_scalar4.c \ alter_entry_scalar_amb.c alter_index.c alter_lincom_23.c \ alter_lincom_32.c alter_lincom_affix.c alter_lincom_input.c \ alter_lincom_offset.c alter_lincom_slope.c alter_linterp.c \ alter_linterp_move.c alter_mplex.c alter_mspec.c \ alter_mspec_affix.c alter_multiply.c alter_phase.c \ alter_polynom_coeff.c alter_polynom_input.c \ alter_polynom_ord.c alter_raw_spf.c alter_raw_type.c \ alter_recip.c alter_recip_zero.c alter_scalar_affix.c \ alter_spec.c alter_spec_affix.c alter_spec_meta.c \ alter_spec_polynom.c alter_window.c ascii_add.c ascii_get.c \ ascii_get_complex.c ascii_get_get.c ascii_get_here.c \ ascii_get_sub.c ascii_nframes.c ascii_put.c ascii_put_here.c \ ascii_seek.c ascii_seek_far.c ascii_sync.c bof.c bof_bit.c \ bof_index.c bof_lincom.c bof_phase.c bof_phase_neg.c \ bzip_add.c bzip_get.c bzip_get_far.c bzip_get_get.c \ bzip_get_get2.c bzip_get_put.c bzip_move_from.c bzip_move_to.c \ bzip_nframes.c bzip_put.c bzip_put_back.c bzip_put_endian.c \ bzip_put_get.c bzip_put_pad.c bzip_put_sub.c bzip_seek.c \ bzip_seek_far.c bzip_sync.c close_bad.c close_close.c \ close_discard.c close_null.c convert_complex128_complex64.c \ convert_complex128_float64.c convert_complex128_int64.c \ convert_complex128_uint64.c convert_complex64_complex128.c \ convert_complex64_float64.c convert_complex64_int64.c \ convert_complex64_uint64.c convert_float32_complex128.c \ convert_float32_complex64.c convert_float32_float64.c \ convert_float32_int16.c convert_float32_int32.c \ convert_float32_int64.c convert_float32_int8.c \ convert_float32_uint16.c convert_float32_uint32.c \ convert_float32_uint64.c convert_float32_uint8.c \ convert_float64_complex128.c convert_float64_complex64.c \ convert_float64_float32.c convert_float64_int16.c \ convert_float64_int32.c convert_float64_int64.c \ convert_float64_int8.c convert_float64_uint16.c \ convert_float64_uint32.c convert_float64_uint64.c \ convert_float64_uint8.c convert_int16_complex128.c \ convert_int16_complex64.c convert_int16_float32.c \ convert_int16_float64.c convert_int16_int32.c \ convert_int16_int64.c convert_int16_int8.c \ convert_int16_uint16.c convert_int16_uint32.c \ convert_int16_uint64.c convert_int16_uint8.c \ convert_int32_complex128.c convert_int32_complex64.c \ convert_int32_float32.c convert_int32_float64.c \ convert_int32_int16.c convert_int32_int64.c \ convert_int32_int8.c convert_int32_uint16.c \ convert_int32_uint32.c convert_int32_uint64.c \ convert_int32_uint8.c convert_int64_complex128.c \ convert_int64_complex64.c convert_int64_float32.c \ convert_int64_float64.c convert_int64_int16.c \ convert_int64_int32.c convert_int64_int8.c \ convert_int64_uint16.c convert_int64_uint32.c \ convert_int64_uint64.c convert_int64_uint8.c \ convert_int8_complex128.c convert_int8_complex64.c \ convert_int8_float32.c convert_int8_float64.c \ convert_int8_int16.c convert_int8_int32.c convert_int8_int64.c \ convert_int8_uint16.c convert_int8_uint32.c \ convert_int8_uint64.c convert_int8_uint8.c \ convert_uint16_complex128.c convert_uint16_complex64.c \ convert_uint16_float32.c convert_uint16_float64.c \ convert_uint16_int16.c convert_uint16_int32.c \ convert_uint16_int64.c convert_uint16_int8.c \ convert_uint16_uint32.c convert_uint16_uint64.c \ convert_uint16_uint8.c convert_uint32_complex128.c \ convert_uint32_complex64.c convert_uint32_float32.c \ convert_uint32_float64.c convert_uint32_int16.c \ convert_uint32_int32.c convert_uint32_int64.c \ convert_uint32_int8.c convert_uint32_uint16.c \ convert_uint32_uint64.c convert_uint32_uint8.c \ convert_uint64_complex128.c convert_uint64_complex64.c \ convert_uint64_float32.c convert_uint64_float64.c \ convert_uint64_int16.c convert_uint64_int32.c \ convert_uint64_int64.c convert_uint64_int8.c \ convert_uint64_uint16.c convert_uint64_uint32.c \ convert_uint64_uint8.c convert_uint8_complex128.c \ convert_uint8_complex64.c convert_uint8_float32.c \ convert_uint8_float64.c convert_uint8_int16.c \ convert_uint8_int32.c convert_uint8_int64.c \ convert_uint8_int8.c convert_uint8_uint16.c \ convert_uint8_uint32.c convert_uint8_uint64.c creat.c \ creat_excl.c creat_rdonly.c creat_rdonly_exists.c cvlist.c \ cvlist_array.c cvlist_array0.c cvlist_array_free.c \ cvlist_array_hidden.c cvlist_array_meta.c cvlist_array_meta0.c \ cvlist_array_meta_free.c cvlist_array_meta_hidden.c \ cvlist_hidden.c cvlist_invalid.c cvlist_meta.c cvlist_meta0.c \ cvlist_meta_hidden.c cvlist_meta_invalid.c del_alias.c \ del_carray.c del_carray_deref.c del_const.c del_const_deref.c \ del_const_force.c del_data.c del_data_enoent.c del_data_open.c \ del_del.c del_derived.c del_derived_after.c \ del_derived_force.c del_meta.c del_meta_force.c del_ref.c \ desync.c desync_flush.c desync_path.c desync_reopen.c \ desync_reopen_inv.c dfes_bit.c dfes_divide.c dfes_lincom.c \ dfes_linterp.c dfes_multiply.c dfes_null.c dfes_phase.c \ dfes_raw.c dfes_recip.c dfes_zero.c elist_alias.c \ elist_hidden.c elist_noalias.c elist_scalar.c encode_alter.c \ encode_alter_all.c encode_alter_open.c encode_get.c \ encode_recode.c encode_recode_open.c encode_support.c \ endian_alter.c endian_alter_all.c endian_alter_sie.c \ endian_get.c endian_move.c entry_bad_code.c entry_bit.c \ entry_bit_scalar.c entry_divide.c entry_invalid.c \ entry_lincom.c entry_lincom_scalar.c entry_linterp.c \ entry_mplex.c entry_mplex_scalar.c entry_multiply.c \ entry_phase.c entry_phase_scalar.c entry_polynom.c \ entry_polynom_scalar.c entry_raw.c entry_raw_scalar.c \ entry_raw_scalar_code.c entry_raw_scalar_type.c entry_recip.c \ entry_scalar_repr.c entry_type.c entry_type_alias.c \ entry_window.c entry_window_scalar.c eof.c eof_bit.c \ eof_index.c eof_lincom.c eof_phase.c eof_phase_neg.c error.c \ error_error.c error_num.c error_short.c error_verbose.c \ error_verbose_prefix.c file.c file_code.c file_type.c \ flac_add.c flac_get_big.c flac_get_far.c flac_get_get.c \ flac_get_get2.c flac_get_little.c flac_nframes.c \ flac_put_big.c flac_put_complex128.c flac_put_float64.c \ flac_put_int32.c flac_put_little.c flac_seek.c flac_seek_far.c \ flac_sync.c flist.c flist0.c flist2.c flist_hidden.c \ flist_invalid.c flist_meta.c flist_meta2.c flist_meta_hidden.c \ flist_meta_invalid.c flist_type.c flist_type_hidden.c \ flist_type_invalid.c flist_type_meta.c \ flist_type_meta_hidden.c flist_type_meta_invalid.c flush_all.c \ flush_amb_code.c flush_bad_code.c flush_flush.c flush_hex.c \ flush_invalid.c flush_lincom.c flush_lincom1.c flush_meta.c \ flush_mult.c flush_raw_close.c flush_ref.c flush_spec.c \ flush_string.c flush_sync.c foffs_alter.c foffs_alter_all.c \ foffs_get.c foffs_move.c fragment_affix.c \ fragment_affix_alter.c fragment_affix_alter2.c \ fragment_affix_alter_code.c fragment_affix_alter_nop.c \ fragment_affix_dup.c fragment_index.c fragment_index_alias.c \ fragment_name.c fragment_name_oor.c fragment_num.c \ fragment_parent.c get64.c get_affix.c get_bad_code.c get_bit.c \ get_carray.c get_carray_c2r.c get_carray_len.c \ get_carray_slice.c get_char.c get_clincom.c get_complex128.c \ get_complex64.c get_const.c get_const_carray.c \ get_const_complex.c get_const_repr.c get_cpolynom.c \ get_cpolynom1.c get_cpolynom_int.c get_dim.c get_divide.c \ get_divide_ccin.c get_divide_crin.c get_divide_crinr.c \ get_divide_rcin.c get_divide_s.c get_endian16.c get_endian32.c \ get_endian64.c get_endian8.c get_endian_complex128_arm.c \ get_endian_complex128_big.c get_endian_complex128_little.c \ get_endian_complex64_arm.c get_endian_complex64_big.c \ get_endian_complex64_little.c get_endian_float32_arm.c \ get_endian_float32_big.c get_endian_float32_little.c \ get_endian_float64_arm.c get_endian_float64_big.c \ get_endian_float64_little.c get_ff.c get_float32.c \ get_float64.c get_foffs.c get_foffs2.c get_fs.c get_here.c \ get_here_foffs.c get_heres.c get_index_complex.c get_int16.c \ get_int32.c get_int64.c get_int8.c get_invalid.c get_lincom1.c \ get_lincom2.c get_lincom2s.c get_lincom3.c get_lincom3s.c \ get_lincom_mdt.c get_lincom_noin.c get_lincom_non.c \ get_lincom_null.c get_lincom_spf.c get_linterp.c \ get_linterp1.c get_linterp_abs.c get_linterp_complex.c \ get_linterp_empty.c get_linterp_noin.c get_linterp_notab.c \ get_linterp_sort.c get_mplex.c get_mplex_bof.c \ get_mplex_complex.c get_mplex_lb.c get_mplex_lball.c \ get_mplex_nolb.c get_mplex_s.c get_mplex_saved.c \ get_multiply.c get_multiply_ccin.c get_multiply_crin.c \ get_multiply_crinr.c get_multiply_noin.c get_multiply_rcin.c \ get_multiply_s.c get_neg.c get_none.c get_nonexistent.c \ get_null.c get_off64.c get_phase.c get_phase_affix.c \ get_polynom.c get_polynom_cmpin.c get_polynom_noin.c \ get_recip.c get_recip_const.c get_recurse.c get_rofs.c \ get_sbit.c get_sf.c get_ss.c get_string.c get_type.c \ get_uint16.c get_uint32.c get_uint64.c get_window.c \ get_window_clr.c get_window_complex.c get_window_ge.c \ get_window_gt.c get_window_le.c get_window_lt.c \ get_window_ne.c get_window_s.c get_window_set.c get_zero.c \ get_zero_complex.c get_zero_float.c global_flags.c \ global_name.c global_ref.c global_ref_empty.c global_ref_set.c \ gzip_add.c gzip_del.c gzip_get.c gzip_get_far.c gzip_get_get.c \ gzip_get_get2.c gzip_get_put.c gzip_move_from.c gzip_move_to.c \ gzip_nframes.c gzip_put.c gzip_put_back.c gzip_put_endian.c \ gzip_put_get.c gzip_put_nframes.c gzip_put_off.c \ gzip_put_pad.c gzip_put_sub.c gzip_seek.c gzip_seek_far.c \ gzip_seek_put.c gzip_sync.c header_complex.c header_off64t.c \ hide.c hide_hidden.c hide_unhide.c include_accmode.c \ include_affix.c include_auto.c include_cb.c include_creat.c \ include_ignore.c include_include.c include_index.c \ include_invalid.c include_nonexistent.c include_pc.c \ include_ref.c include_sub.c include_syntax.c index_domain.c \ index_index.c index_range.c index_s.c index_subset.c \ legacy_error.c legacy_estring.c legacy_format.c legacy_get.c \ legacy_get_put.c legacy_get_rofs.c legacy_nframes.c \ legacy_nonexistent.c legacy_put.c legacy_spf.c lzma_get.c \ lzma_nframes.c lzma_put.c lzma_xz_add.c lzma_xz_get.c \ lzma_xz_get_far.c lzma_xz_get_get.c lzma_xz_get_get2.c \ lzma_xz_get_put.c lzma_xz_move_to.c lzma_xz_nframes.c \ lzma_xz_put.c lzma_xz_put_back.c lzma_xz_put_endian.c \ lzma_xz_put_get.c lzma_xz_put_pad.c lzma_xz_seek.c \ lzma_xz_seek_far.c lzma_xz_sync.c madd.c madd_affix.c \ madd_alias.c madd_alias_affix.c madd_bit.c madd_bit_invalid.c \ madd_carray.c madd_clincom.c madd_const.c madd_cpolynom.c \ madd_crecip.c madd_crecip89.c madd_divide.c madd_index.c \ madd_lincom.c madd_lincom_invalid.c madd_linterp.c \ madd_linterp_invalid.c madd_mplex.c madd_multiply.c \ madd_multiply_invalid.c madd_phase.c madd_phase_invalid.c \ madd_polynom.c madd_recip.c madd_sbit.c madd_spec.c \ madd_spec_directive.c madd_spec_invalid.c madd_spec_resolv.c \ madd_string.c madd_window.c move_affix.c move_affix_dup.c \ move_affix_meta.c move_affix_updb.c move_alias.c \ move_data_enc_ar.c move_data_enc_ra.c move_data_endian.c \ move_data_foffs.c move_data_foffs_neg.c move_data_nop.c \ move_index.c move_meta.c move_move.c move_protect.c \ move_subdir.c name_affix.c name_affix_bad.c name_alias.c \ name_dangle.c name_dot5.c name_dot5r.c name_dot9.c name_dup.c \ name_meta.c name_move.c name_move_alias.c name_name.c \ name_updb.c name_updb_affix.c name_updb_alias.c \ name_updb_carray.c name_updb_const.c name_updb_const_alias.c \ native_bit.c native_const.c native_index.c native_lincom.c \ native_lincom_cmpin.c native_lincom_cmpscal.c native_linterp.c \ native_linterp_cmp.c native_mult.c native_mult1.c \ native_mult2.c native_phase.c native_polynom.c \ native_polynom_cmpin.c native_polynom_cmpscal.c native_raw.c \ native_recip.c native_recip_cmpin.c native_recip_cmpscal.c \ native_sbit.c native_string.c nentries_alias.c \ nentries_hidden.c nentries_noalias.c nentries_scalar.c \ nfields_hidden.c nfields_invalid.c nfields_nfields.c \ nfields_type.c nfields_type_hidden.c nfields_type_invalid.c \ nfields_vector.c nfields_vector_hidden.c \ nfields_vector_invalid.c nframes64.c nframes_empty.c \ nframes_invalid.c nframes_nframes.c nframes_off64.c \ nframes_spf.c nmeta.c nmeta_hidden.c nmeta_invalid.c \ nmeta_parent.c nmeta_type.c nmeta_type_hidden.c \ nmeta_type_invalid.c nmeta_type_parent.c nmeta_vectors.c \ nmeta_vectors_del.c nmeta_vectors_hidden.c \ nmeta_vectors_invalid.c nmeta_vectors_parent.c open_abs.c \ open_cb_abort.c open_cb_cont.c open_cb_ignore.c \ open_cb_invalid.c open_cb_rescan.c open_cb_rescan_alloc.c \ open_eaccess.c open_invalid.c open_nonexistent.c \ open_notdirfile.c open_open.c open_rofs.c open_sym_al.c \ open_sym_at.c open_sym_c.c open_sym_cl.c open_sym_ct.c \ open_sym_d.c open_sym_l.c open_sym_p.c open_sym_pl.c \ open_sym_pt.c parse_alias.c parse_alias_code.c \ parse_alias_dup.c parse_alias_meta.c parse_alias_missing.c \ parse_badline.c parse_bit.c parse_bit4.c parse_bit_bitnum.c \ parse_bit_bitsize.c parse_bit_ncols.c parse_bit_numbits.c \ parse_bit_scalar.c parse_carray.c parse_carray_long.c \ parse_const.c parse_const_complex.c parse_const_ncols.c \ parse_divide.c parse_double.c parse_duplicate.c \ parse_duplicate_ignore.c parse_endian_bad.c parse_endian_big.c \ parse_endian_force.c parse_endian_little.c \ parse_endian_slash.c parse_eol.c parse_foffs.c \ parse_foffs_include.c parse_foffs_slash.c parse_hex.c \ parse_hidden.c parse_hidden_field.c parse_hidden_meta.c \ parse_include.c parse_include_absolute.c \ parse_include_absrel.c parse_include_affix_bad.c \ parse_include_affix_ref.c parse_include_dir.c \ parse_include_loop.c parse_include_nonexistent.c \ parse_include_prefix.c parse_include_prefix_dup.c \ parse_include_preprefix.c parse_include_ref.c \ parse_include_relabs.c parse_include_relrel.c \ parse_include_slash.c parse_include_suffix.c \ parse_include_sufsuffix.c parse_index.c parse_lincom.c \ parse_lincom_ncols1.c parse_lincom_ncols2.c \ parse_lincom_nfields.c parse_lincom_nofields.c \ parse_lincom_non.c parse_lincom_non_ncols.c \ parse_lincom_scalar.c parse_linterp.c parse_linterp_ncols.c \ parse_literal_cmpbad.c parse_literal_fltcmp.c \ parse_literal_fltcmp0.c parse_literal_intcmp.c \ parse_literal_intcmp0.c parse_literal_uintcmp.c \ parse_literal_uintcmp0.c parse_malias.c parse_malias_dup.c \ parse_malias_meta.c parse_meta.c parse_meta_affix.c \ parse_meta_alias.c parse_meta_frag.c parse_meta_implicit.c \ parse_meta_implicit2.c parse_meta_implicit_affix.c \ parse_meta_index.c parse_meta_index2.c parse_meta_jump.c \ parse_meta_malias.c parse_meta_meta.c parse_meta_parent.c \ parse_meta_raw.c parse_mplex.c parse_mplex_ncols.c \ parse_mplex_nomax.c parse_mplex_scalar.c parse_multiply.c \ parse_multiply_ncols.c parse_name.c parse_name_dot.c \ parse_name_ext.c parse_name_pedantic.c parse_ncols.c \ parse_octal_zero.c parse_phase.c parse_phase_ncols.c \ parse_phase_scalar.c parse_polynom.c parse_polynom_ncols1.c \ parse_polynom_ncols2.c parse_polynom_scalar.c \ parse_protect_all.c parse_protect_bad.c parse_protect_data.c \ parse_protect_format.c parse_protect_none.c parse_quote.c \ parse_quote_mismatch.c parse_raw.c parse_raw_char.c \ parse_raw_char_bad.c parse_raw_ncols.c parse_raw_scalar.c \ parse_raw_spf.c parse_raw_type.c parse_recip.c parse_ref.c \ parse_ref_nonexistent.c parse_sbit.c parse_scalar1.c \ parse_scalar2.c parse_scalar_repr.c parse_sort.c \ parse_string.c parse_string_ncols.c parse_string_null.c \ parse_utf8.c parse_utf8_invalid.c parse_utf8_zero.c \ parse_version.c parse_version_89.c parse_version_98.c \ parse_version_include.c parse_version_p8.c parse_version_p9.c \ parse_version_permissive.c parse_version_slash.c \ parse_whitespace.c parse_window.c parse_window_ncols.c \ parse_window_op.c parse_window_scalar.c protect_alter.c \ protect_alter_all.c protect_get.c put64.c put_bad_code.c \ put_bit.c put_bof.c put_carray.c put_carray_client.c \ put_carray_slice.c put_char.c put_clincom1.c put_complex128.c \ put_complex64.c put_const.c put_const_protect.c put_cpolynom.c \ put_crecip.c put_divide.c put_endian16.c put_endian32.c \ put_endian64.c put_endian8.c put_endian_complex128_arm.c \ put_endian_complex128_big.c put_endian_complex128_little.c \ put_endian_complex64_arm.c put_endian_complex64_big.c \ put_endian_complex64_little.c put_endian_float32_arm.c \ put_endian_float32_big.c put_endian_float32_little.c \ put_endian_float64_arm.c put_endian_float64_big.c \ put_endian_float64_little.c put_ff.c put_float32.c \ put_float64.c put_foffs.c put_fs.c put_here.c put_heres.c \ put_int16.c put_int32.c put_int64.c put_int8.c put_invalid.c \ put_lincom1.c put_lincom2.c put_lincom_noin.c put_linterp.c \ put_linterp_noin.c put_linterp_nomono.c put_linterp_notab.c \ put_linterp_reverse.c put_mplex.c put_mplex_complex.c \ put_multiply.c put_nofile.c put_null.c put_off64.c put_phase.c \ put_phase_noin.c put_polynom1.c put_polynom2.c \ put_polynom_noin.c put_protect.c put_rdonly.c put_recip.c \ put_recurse.c put_repr.c put_rofs.c put_sbit.c put_sf.c \ put_ss.c put_string.c put_string_protect.c put_sub.c \ put_type.c put_uint16.c put_uint32.c put_uint64.c put_window.c \ put_zero.c ref.c ref_none.c ref_two.c repr_a.c repr_bad.c \ repr_float32.c repr_float64.c repr_i.c repr_int16.c \ repr_int32.c repr_int64.c repr_int8.c repr_m.c repr_r.c \ repr_real_a.c repr_real_i.c repr_real_m.c repr_real_r.c \ repr_uint16.c repr_uint32.c repr_uint64.c repr_uint8.c \ seek64.c seek_cur.c seek_end.c seek_far.c seek_foffs.c \ seek_foffs2.c seek_index.c seek_lincom.c seek_mult.c \ seek_neg.c seek_phase.c seek_set.c seek_sub.c sie_get_big.c \ sie_get_little.c sie_move_from.c sie_move_to.c \ sie_nframes_big.c sie_nframes_little.c sie_put_append.c \ sie_put_append2.c sie_put_back.c sie_put_big.c \ sie_put_little.c sie_put_many.c sie_put_newo.c sie_put_newo0.c \ sie_put_pad.c sie_put_pad0.c sie_put_trunc.c sie_put_trunc2.c \ sie_put_trunc_nf.c sie_seek.c sie_seek_far.c sie_sync.c \ slim_get.c slim_nframes.c slim_seek.c slim_seek_far.c \ spf_alias.c spf_alias_meta.c spf_alias_missing.c spf_divide.c \ spf_lincom.c spf_multiply.c spf_polynom.c spf_raw.c \ spf_recip.c spf_recurse.c svlist.c svlist0.c svlist2.c \ svlist_hidden.c svlist_invalid.c svlist_meta.c svlist_meta0.c \ svlist_meta_hidden.c svlist_meta_invalid.c table.c \ table_code.c table_type.c tell.c tell64.c tell_multidiv.c \ tell_sub.c tok_arg.c tok_escape.c tok_quote.c trunc.c \ trunc_dir.c trunc_rdonly.c trunc_rofs.c trunc_truncsub.c \ unclude.c unclude_del.c unclude_move.c unclude_open.c \ version_0.c version_0_write.c version_1.c version_1_write.c \ version_2.c version_2_write.c version_3.c version_3_write.c \ version_4.c version_4_write.c version_5.c version_5_strict.c \ version_5_write.c version_6.c version_6_strict.c \ version_6_write.c version_7.c version_7_strict.c \ version_7_write.c version_8.c version_8_strict.c \ version_8_write.c version_9.c version_9_strict.c \ version_9_write.c vlist.c vlist_alias.c vlist_hidden.c \ vlist_invalid.c vlist_meta.c vlist_meta_hidden.c \ vlist_meta_invalid.c zzip_data.c zzip_get.c zzip_get_get.c \ zzip_nframes.c zzip_seek.c zzip_seek_far.c zzslim_get.c \ zzslim_nframes.c zzslim_seek.c zzslim_seek_far.c DIST_SOURCES = add_add.c add_affix.c add_alias.c add_alias_affix.c \ add_alias_meta.c add_amb_code7.c add_bit.c add_bit_bitnum.c \ add_bit_bitsize.c add_bit_invalid.c add_bit_numbits.c \ add_bit_scalars.c add_carray.c add_clincom.c add_code.c \ add_const.c add_cpolynom.c add_crecip.c add_crecip89.c \ add_dangle_dup.c add_divide.c add_divide_invalid.c add_dot5.c \ add_dot6.c add_duplicate.c add_format.c add_invalid.c \ add_lincom.c add_lincom_affix.c add_lincom_invalid.c \ add_lincom_nfields.c add_linterp.c add_linterp_invalid.c \ add_meta.c add_meta_alias.c add_mplex.c add_mplex_scalars.c \ add_multiply.c add_multiply_invalid.c add_phase.c \ add_phase_invalid.c add_polynom.c add_polynom_scalar.c \ add_protect.c add_raw.c add_raw_include.c add_raw_invalid.c \ add_raw_spf.c add_raw_spf_scalar.c add_raw_sub.c \ add_raw_type.c add_rdonly.c add_recip.c add_resolv.c \ add_sbit.c add_scalar.c add_scalar_carray.c \ add_scalar_carray_bad.c add_sort.c add_spec.c \ add_spec_directive.c add_spec_invalid.c add_spec_meta.c \ add_spec_resolv.c add_string.c add_string_affix.c add_type.c \ add_window.c add_window_op.c alias_list.c alias_list_alias.c \ alias_list_missing.c alias_num.c alias_num_alias.c \ alias_num_missing.c alias_target.c alias_target_alias.c \ alias_target_missing.c alter_bit_bitnum.c alter_bit_numbits.c \ alter_carray_len.c alter_carray_type.c alter_clincom.c \ alter_const.c alter_const_c2r.c alter_const_r2c.c \ alter_const_r2r.c alter_cpolynom.c alter_cpolynom_null.c \ alter_crecip.c alter_crecip89.c alter_crecip89_null.c \ alter_crecip_zero.c alter_divide.c alter_entry.c \ alter_entry_affix.c alter_entry_hidden.c alter_entry_lincom.c \ alter_entry_recode.c alter_entry_recode_recalc.c \ alter_entry_scalar1.c alter_entry_scalar2a.c \ alter_entry_scalar2n.c alter_entry_scalar3.c \ alter_entry_scalar3c.c alter_entry_scalar4.c \ alter_entry_scalar_amb.c alter_index.c alter_lincom_23.c \ alter_lincom_32.c alter_lincom_affix.c alter_lincom_input.c \ alter_lincom_offset.c alter_lincom_slope.c alter_linterp.c \ alter_linterp_move.c alter_mplex.c alter_mspec.c \ alter_mspec_affix.c alter_multiply.c alter_phase.c \ alter_polynom_coeff.c alter_polynom_input.c \ alter_polynom_ord.c alter_raw_spf.c alter_raw_type.c \ alter_recip.c alter_recip_zero.c alter_scalar_affix.c \ alter_spec.c alter_spec_affix.c alter_spec_meta.c \ alter_spec_polynom.c alter_window.c ascii_add.c ascii_get.c \ ascii_get_complex.c ascii_get_get.c ascii_get_here.c \ ascii_get_sub.c ascii_nframes.c ascii_put.c ascii_put_here.c \ ascii_seek.c ascii_seek_far.c ascii_sync.c bof.c bof_bit.c \ bof_index.c bof_lincom.c bof_phase.c bof_phase_neg.c \ bzip_add.c bzip_get.c bzip_get_far.c bzip_get_get.c \ bzip_get_get2.c bzip_get_put.c bzip_move_from.c bzip_move_to.c \ bzip_nframes.c bzip_put.c bzip_put_back.c bzip_put_endian.c \ bzip_put_get.c bzip_put_pad.c bzip_put_sub.c bzip_seek.c \ bzip_seek_far.c bzip_sync.c close_bad.c close_close.c \ close_discard.c close_null.c convert_complex128_complex64.c \ convert_complex128_float64.c convert_complex128_int64.c \ convert_complex128_uint64.c convert_complex64_complex128.c \ convert_complex64_float64.c convert_complex64_int64.c \ convert_complex64_uint64.c convert_float32_complex128.c \ convert_float32_complex64.c convert_float32_float64.c \ convert_float32_int16.c convert_float32_int32.c \ convert_float32_int64.c convert_float32_int8.c \ convert_float32_uint16.c convert_float32_uint32.c \ convert_float32_uint64.c convert_float32_uint8.c \ convert_float64_complex128.c convert_float64_complex64.c \ convert_float64_float32.c convert_float64_int16.c \ convert_float64_int32.c convert_float64_int64.c \ convert_float64_int8.c convert_float64_uint16.c \ convert_float64_uint32.c convert_float64_uint64.c \ convert_float64_uint8.c convert_int16_complex128.c \ convert_int16_complex64.c convert_int16_float32.c \ convert_int16_float64.c convert_int16_int32.c \ convert_int16_int64.c convert_int16_int8.c \ convert_int16_uint16.c convert_int16_uint32.c \ convert_int16_uint64.c convert_int16_uint8.c \ convert_int32_complex128.c convert_int32_complex64.c \ convert_int32_float32.c convert_int32_float64.c \ convert_int32_int16.c convert_int32_int64.c \ convert_int32_int8.c convert_int32_uint16.c \ convert_int32_uint32.c convert_int32_uint64.c \ convert_int32_uint8.c convert_int64_complex128.c \ convert_int64_complex64.c convert_int64_float32.c \ convert_int64_float64.c convert_int64_int16.c \ convert_int64_int32.c convert_int64_int8.c \ convert_int64_uint16.c convert_int64_uint32.c \ convert_int64_uint64.c convert_int64_uint8.c \ convert_int8_complex128.c convert_int8_complex64.c \ convert_int8_float32.c convert_int8_float64.c \ convert_int8_int16.c convert_int8_int32.c convert_int8_int64.c \ convert_int8_uint16.c convert_int8_uint32.c \ convert_int8_uint64.c convert_int8_uint8.c \ convert_uint16_complex128.c convert_uint16_complex64.c \ convert_uint16_float32.c convert_uint16_float64.c \ convert_uint16_int16.c convert_uint16_int32.c \ convert_uint16_int64.c convert_uint16_int8.c \ convert_uint16_uint32.c convert_uint16_uint64.c \ convert_uint16_uint8.c convert_uint32_complex128.c \ convert_uint32_complex64.c convert_uint32_float32.c \ convert_uint32_float64.c convert_uint32_int16.c \ convert_uint32_int32.c convert_uint32_int64.c \ convert_uint32_int8.c convert_uint32_uint16.c \ convert_uint32_uint64.c convert_uint32_uint8.c \ convert_uint64_complex128.c convert_uint64_complex64.c \ convert_uint64_float32.c convert_uint64_float64.c \ convert_uint64_int16.c convert_uint64_int32.c \ convert_uint64_int64.c convert_uint64_int8.c \ convert_uint64_uint16.c convert_uint64_uint32.c \ convert_uint64_uint8.c convert_uint8_complex128.c \ convert_uint8_complex64.c convert_uint8_float32.c \ convert_uint8_float64.c convert_uint8_int16.c \ convert_uint8_int32.c convert_uint8_int64.c \ convert_uint8_int8.c convert_uint8_uint16.c \ convert_uint8_uint32.c convert_uint8_uint64.c creat.c \ creat_excl.c creat_rdonly.c creat_rdonly_exists.c cvlist.c \ cvlist_array.c cvlist_array0.c cvlist_array_free.c \ cvlist_array_hidden.c cvlist_array_meta.c cvlist_array_meta0.c \ cvlist_array_meta_free.c cvlist_array_meta_hidden.c \ cvlist_hidden.c cvlist_invalid.c cvlist_meta.c cvlist_meta0.c \ cvlist_meta_hidden.c cvlist_meta_invalid.c del_alias.c \ del_carray.c del_carray_deref.c del_const.c del_const_deref.c \ del_const_force.c del_data.c del_data_enoent.c del_data_open.c \ del_del.c del_derived.c del_derived_after.c \ del_derived_force.c del_meta.c del_meta_force.c del_ref.c \ desync.c desync_flush.c desync_path.c desync_reopen.c \ desync_reopen_inv.c dfes_bit.c dfes_divide.c dfes_lincom.c \ dfes_linterp.c dfes_multiply.c dfes_null.c dfes_phase.c \ dfes_raw.c dfes_recip.c dfes_zero.c elist_alias.c \ elist_hidden.c elist_noalias.c elist_scalar.c encode_alter.c \ encode_alter_all.c encode_alter_open.c encode_get.c \ encode_recode.c encode_recode_open.c encode_support.c \ endian_alter.c endian_alter_all.c endian_alter_sie.c \ endian_get.c endian_move.c entry_bad_code.c entry_bit.c \ entry_bit_scalar.c entry_divide.c entry_invalid.c \ entry_lincom.c entry_lincom_scalar.c entry_linterp.c \ entry_mplex.c entry_mplex_scalar.c entry_multiply.c \ entry_phase.c entry_phase_scalar.c entry_polynom.c \ entry_polynom_scalar.c entry_raw.c entry_raw_scalar.c \ entry_raw_scalar_code.c entry_raw_scalar_type.c entry_recip.c \ entry_scalar_repr.c entry_type.c entry_type_alias.c \ entry_window.c entry_window_scalar.c eof.c eof_bit.c \ eof_index.c eof_lincom.c eof_phase.c eof_phase_neg.c error.c \ error_error.c error_num.c error_short.c error_verbose.c \ error_verbose_prefix.c file.c file_code.c file_type.c \ flac_add.c flac_get_big.c flac_get_far.c flac_get_get.c \ flac_get_get2.c flac_get_little.c flac_nframes.c \ flac_put_big.c flac_put_complex128.c flac_put_float64.c \ flac_put_int32.c flac_put_little.c flac_seek.c flac_seek_far.c \ flac_sync.c flist.c flist0.c flist2.c flist_hidden.c \ flist_invalid.c flist_meta.c flist_meta2.c flist_meta_hidden.c \ flist_meta_invalid.c flist_type.c flist_type_hidden.c \ flist_type_invalid.c flist_type_meta.c \ flist_type_meta_hidden.c flist_type_meta_invalid.c flush_all.c \ flush_amb_code.c flush_bad_code.c flush_flush.c flush_hex.c \ flush_invalid.c flush_lincom.c flush_lincom1.c flush_meta.c \ flush_mult.c flush_raw_close.c flush_ref.c flush_spec.c \ flush_string.c flush_sync.c foffs_alter.c foffs_alter_all.c \ foffs_get.c foffs_move.c fragment_affix.c \ fragment_affix_alter.c fragment_affix_alter2.c \ fragment_affix_alter_code.c fragment_affix_alter_nop.c \ fragment_affix_dup.c fragment_index.c fragment_index_alias.c \ fragment_name.c fragment_name_oor.c fragment_num.c \ fragment_parent.c get64.c get_affix.c get_bad_code.c get_bit.c \ get_carray.c get_carray_c2r.c get_carray_len.c \ get_carray_slice.c get_char.c get_clincom.c get_complex128.c \ get_complex64.c get_const.c get_const_carray.c \ get_const_complex.c get_const_repr.c get_cpolynom.c \ get_cpolynom1.c get_cpolynom_int.c get_dim.c get_divide.c \ get_divide_ccin.c get_divide_crin.c get_divide_crinr.c \ get_divide_rcin.c get_divide_s.c get_endian16.c get_endian32.c \ get_endian64.c get_endian8.c get_endian_complex128_arm.c \ get_endian_complex128_big.c get_endian_complex128_little.c \ get_endian_complex64_arm.c get_endian_complex64_big.c \ get_endian_complex64_little.c get_endian_float32_arm.c \ get_endian_float32_big.c get_endian_float32_little.c \ get_endian_float64_arm.c get_endian_float64_big.c \ get_endian_float64_little.c get_ff.c get_float32.c \ get_float64.c get_foffs.c get_foffs2.c get_fs.c get_here.c \ get_here_foffs.c get_heres.c get_index_complex.c get_int16.c \ get_int32.c get_int64.c get_int8.c get_invalid.c get_lincom1.c \ get_lincom2.c get_lincom2s.c get_lincom3.c get_lincom3s.c \ get_lincom_mdt.c get_lincom_noin.c get_lincom_non.c \ get_lincom_null.c get_lincom_spf.c get_linterp.c \ get_linterp1.c get_linterp_abs.c get_linterp_complex.c \ get_linterp_empty.c get_linterp_noin.c get_linterp_notab.c \ get_linterp_sort.c get_mplex.c get_mplex_bof.c \ get_mplex_complex.c get_mplex_lb.c get_mplex_lball.c \ get_mplex_nolb.c get_mplex_s.c get_mplex_saved.c \ get_multiply.c get_multiply_ccin.c get_multiply_crin.c \ get_multiply_crinr.c get_multiply_noin.c get_multiply_rcin.c \ get_multiply_s.c get_neg.c get_none.c get_nonexistent.c \ get_null.c get_off64.c get_phase.c get_phase_affix.c \ get_polynom.c get_polynom_cmpin.c get_polynom_noin.c \ get_recip.c get_recip_const.c get_recurse.c get_rofs.c \ get_sbit.c get_sf.c get_ss.c get_string.c get_type.c \ get_uint16.c get_uint32.c get_uint64.c get_window.c \ get_window_clr.c get_window_complex.c get_window_ge.c \ get_window_gt.c get_window_le.c get_window_lt.c \ get_window_ne.c get_window_s.c get_window_set.c get_zero.c \ get_zero_complex.c get_zero_float.c global_flags.c \ global_name.c global_ref.c global_ref_empty.c global_ref_set.c \ gzip_add.c gzip_del.c gzip_get.c gzip_get_far.c gzip_get_get.c \ gzip_get_get2.c gzip_get_put.c gzip_move_from.c gzip_move_to.c \ gzip_nframes.c gzip_put.c gzip_put_back.c gzip_put_endian.c \ gzip_put_get.c gzip_put_nframes.c gzip_put_off.c \ gzip_put_pad.c gzip_put_sub.c gzip_seek.c gzip_seek_far.c \ gzip_seek_put.c gzip_sync.c header_complex.c header_off64t.c \ hide.c hide_hidden.c hide_unhide.c include_accmode.c \ include_affix.c include_auto.c include_cb.c include_creat.c \ include_ignore.c include_include.c include_index.c \ include_invalid.c include_nonexistent.c include_pc.c \ include_ref.c include_sub.c include_syntax.c index_domain.c \ index_index.c index_range.c index_s.c index_subset.c \ legacy_error.c legacy_estring.c legacy_format.c legacy_get.c \ legacy_get_put.c legacy_get_rofs.c legacy_nframes.c \ legacy_nonexistent.c legacy_put.c legacy_spf.c lzma_get.c \ lzma_nframes.c lzma_put.c lzma_xz_add.c lzma_xz_get.c \ lzma_xz_get_far.c lzma_xz_get_get.c lzma_xz_get_get2.c \ lzma_xz_get_put.c lzma_xz_move_to.c lzma_xz_nframes.c \ lzma_xz_put.c lzma_xz_put_back.c lzma_xz_put_endian.c \ lzma_xz_put_get.c lzma_xz_put_pad.c lzma_xz_seek.c \ lzma_xz_seek_far.c lzma_xz_sync.c madd.c madd_affix.c \ madd_alias.c madd_alias_affix.c madd_bit.c madd_bit_invalid.c \ madd_carray.c madd_clincom.c madd_const.c madd_cpolynom.c \ madd_crecip.c madd_crecip89.c madd_divide.c madd_index.c \ madd_lincom.c madd_lincom_invalid.c madd_linterp.c \ madd_linterp_invalid.c madd_mplex.c madd_multiply.c \ madd_multiply_invalid.c madd_phase.c madd_phase_invalid.c \ madd_polynom.c madd_recip.c madd_sbit.c madd_spec.c \ madd_spec_directive.c madd_spec_invalid.c madd_spec_resolv.c \ madd_string.c madd_window.c move_affix.c move_affix_dup.c \ move_affix_meta.c move_affix_updb.c move_alias.c \ move_data_enc_ar.c move_data_enc_ra.c move_data_endian.c \ move_data_foffs.c move_data_foffs_neg.c move_data_nop.c \ move_index.c move_meta.c move_move.c move_protect.c \ move_subdir.c name_affix.c name_affix_bad.c name_alias.c \ name_dangle.c name_dot5.c name_dot5r.c name_dot9.c name_dup.c \ name_meta.c name_move.c name_move_alias.c name_name.c \ name_updb.c name_updb_affix.c name_updb_alias.c \ name_updb_carray.c name_updb_const.c name_updb_const_alias.c \ native_bit.c native_const.c native_index.c native_lincom.c \ native_lincom_cmpin.c native_lincom_cmpscal.c native_linterp.c \ native_linterp_cmp.c native_mult.c native_mult1.c \ native_mult2.c native_phase.c native_polynom.c \ native_polynom_cmpin.c native_polynom_cmpscal.c native_raw.c \ native_recip.c native_recip_cmpin.c native_recip_cmpscal.c \ native_sbit.c native_string.c nentries_alias.c \ nentries_hidden.c nentries_noalias.c nentries_scalar.c \ nfields_hidden.c nfields_invalid.c nfields_nfields.c \ nfields_type.c nfields_type_hidden.c nfields_type_invalid.c \ nfields_vector.c nfields_vector_hidden.c \ nfields_vector_invalid.c nframes64.c nframes_empty.c \ nframes_invalid.c nframes_nframes.c nframes_off64.c \ nframes_spf.c nmeta.c nmeta_hidden.c nmeta_invalid.c \ nmeta_parent.c nmeta_type.c nmeta_type_hidden.c \ nmeta_type_invalid.c nmeta_type_parent.c nmeta_vectors.c \ nmeta_vectors_del.c nmeta_vectors_hidden.c \ nmeta_vectors_invalid.c nmeta_vectors_parent.c open_abs.c \ open_cb_abort.c open_cb_cont.c open_cb_ignore.c \ open_cb_invalid.c open_cb_rescan.c open_cb_rescan_alloc.c \ open_eaccess.c open_invalid.c open_nonexistent.c \ open_notdirfile.c open_open.c open_rofs.c open_sym_al.c \ open_sym_at.c open_sym_c.c open_sym_cl.c open_sym_ct.c \ open_sym_d.c open_sym_l.c open_sym_p.c open_sym_pl.c \ open_sym_pt.c parse_alias.c parse_alias_code.c \ parse_alias_dup.c parse_alias_meta.c parse_alias_missing.c \ parse_badline.c parse_bit.c parse_bit4.c parse_bit_bitnum.c \ parse_bit_bitsize.c parse_bit_ncols.c parse_bit_numbits.c \ parse_bit_scalar.c parse_carray.c parse_carray_long.c \ parse_const.c parse_const_complex.c parse_const_ncols.c \ parse_divide.c parse_double.c parse_duplicate.c \ parse_duplicate_ignore.c parse_endian_bad.c parse_endian_big.c \ parse_endian_force.c parse_endian_little.c \ parse_endian_slash.c parse_eol.c parse_foffs.c \ parse_foffs_include.c parse_foffs_slash.c parse_hex.c \ parse_hidden.c parse_hidden_field.c parse_hidden_meta.c \ parse_include.c parse_include_absolute.c \ parse_include_absrel.c parse_include_affix_bad.c \ parse_include_affix_ref.c parse_include_dir.c \ parse_include_loop.c parse_include_nonexistent.c \ parse_include_prefix.c parse_include_prefix_dup.c \ parse_include_preprefix.c parse_include_ref.c \ parse_include_relabs.c parse_include_relrel.c \ parse_include_slash.c parse_include_suffix.c \ parse_include_sufsuffix.c parse_index.c parse_lincom.c \ parse_lincom_ncols1.c parse_lincom_ncols2.c \ parse_lincom_nfields.c parse_lincom_nofields.c \ parse_lincom_non.c parse_lincom_non_ncols.c \ parse_lincom_scalar.c parse_linterp.c parse_linterp_ncols.c \ parse_literal_cmpbad.c parse_literal_fltcmp.c \ parse_literal_fltcmp0.c parse_literal_intcmp.c \ parse_literal_intcmp0.c parse_literal_uintcmp.c \ parse_literal_uintcmp0.c parse_malias.c parse_malias_dup.c \ parse_malias_meta.c parse_meta.c parse_meta_affix.c \ parse_meta_alias.c parse_meta_frag.c parse_meta_implicit.c \ parse_meta_implicit2.c parse_meta_implicit_affix.c \ parse_meta_index.c parse_meta_index2.c parse_meta_jump.c \ parse_meta_malias.c parse_meta_meta.c parse_meta_parent.c \ parse_meta_raw.c parse_mplex.c parse_mplex_ncols.c \ parse_mplex_nomax.c parse_mplex_scalar.c parse_multiply.c \ parse_multiply_ncols.c parse_name.c parse_name_dot.c \ parse_name_ext.c parse_name_pedantic.c parse_ncols.c \ parse_octal_zero.c parse_phase.c parse_phase_ncols.c \ parse_phase_scalar.c parse_polynom.c parse_polynom_ncols1.c \ parse_polynom_ncols2.c parse_polynom_scalar.c \ parse_protect_all.c parse_protect_bad.c parse_protect_data.c \ parse_protect_format.c parse_protect_none.c parse_quote.c \ parse_quote_mismatch.c parse_raw.c parse_raw_char.c \ parse_raw_char_bad.c parse_raw_ncols.c parse_raw_scalar.c \ parse_raw_spf.c parse_raw_type.c parse_recip.c parse_ref.c \ parse_ref_nonexistent.c parse_sbit.c parse_scalar1.c \ parse_scalar2.c parse_scalar_repr.c parse_sort.c \ parse_string.c parse_string_ncols.c parse_string_null.c \ parse_utf8.c parse_utf8_invalid.c parse_utf8_zero.c \ parse_version.c parse_version_89.c parse_version_98.c \ parse_version_include.c parse_version_p8.c parse_version_p9.c \ parse_version_permissive.c parse_version_slash.c \ parse_whitespace.c parse_window.c parse_window_ncols.c \ parse_window_op.c parse_window_scalar.c protect_alter.c \ protect_alter_all.c protect_get.c put64.c put_bad_code.c \ put_bit.c put_bof.c put_carray.c put_carray_client.c \ put_carray_slice.c put_char.c put_clincom1.c put_complex128.c \ put_complex64.c put_const.c put_const_protect.c put_cpolynom.c \ put_crecip.c put_divide.c put_endian16.c put_endian32.c \ put_endian64.c put_endian8.c put_endian_complex128_arm.c \ put_endian_complex128_big.c put_endian_complex128_little.c \ put_endian_complex64_arm.c put_endian_complex64_big.c \ put_endian_complex64_little.c put_endian_float32_arm.c \ put_endian_float32_big.c put_endian_float32_little.c \ put_endian_float64_arm.c put_endian_float64_big.c \ put_endian_float64_little.c put_ff.c put_float32.c \ put_float64.c put_foffs.c put_fs.c put_here.c put_heres.c \ put_int16.c put_int32.c put_int64.c put_int8.c put_invalid.c \ put_lincom1.c put_lincom2.c put_lincom_noin.c put_linterp.c \ put_linterp_noin.c put_linterp_nomono.c put_linterp_notab.c \ put_linterp_reverse.c put_mplex.c put_mplex_complex.c \ put_multiply.c put_nofile.c put_null.c put_off64.c put_phase.c \ put_phase_noin.c put_polynom1.c put_polynom2.c \ put_polynom_noin.c put_protect.c put_rdonly.c put_recip.c \ put_recurse.c put_repr.c put_rofs.c put_sbit.c put_sf.c \ put_ss.c put_string.c put_string_protect.c put_sub.c \ put_type.c put_uint16.c put_uint32.c put_uint64.c put_window.c \ put_zero.c ref.c ref_none.c ref_two.c repr_a.c repr_bad.c \ repr_float32.c repr_float64.c repr_i.c repr_int16.c \ repr_int32.c repr_int64.c repr_int8.c repr_m.c repr_r.c \ repr_real_a.c repr_real_i.c repr_real_m.c repr_real_r.c \ repr_uint16.c repr_uint32.c repr_uint64.c repr_uint8.c \ seek64.c seek_cur.c seek_end.c seek_far.c seek_foffs.c \ seek_foffs2.c seek_index.c seek_lincom.c seek_mult.c \ seek_neg.c seek_phase.c seek_set.c seek_sub.c sie_get_big.c \ sie_get_little.c sie_move_from.c sie_move_to.c \ sie_nframes_big.c sie_nframes_little.c sie_put_append.c \ sie_put_append2.c sie_put_back.c sie_put_big.c \ sie_put_little.c sie_put_many.c sie_put_newo.c sie_put_newo0.c \ sie_put_pad.c sie_put_pad0.c sie_put_trunc.c sie_put_trunc2.c \ sie_put_trunc_nf.c sie_seek.c sie_seek_far.c sie_sync.c \ slim_get.c slim_nframes.c slim_seek.c slim_seek_far.c \ spf_alias.c spf_alias_meta.c spf_alias_missing.c spf_divide.c \ spf_lincom.c spf_multiply.c spf_polynom.c spf_raw.c \ spf_recip.c spf_recurse.c svlist.c svlist0.c svlist2.c \ svlist_hidden.c svlist_invalid.c svlist_meta.c svlist_meta0.c \ svlist_meta_hidden.c svlist_meta_invalid.c table.c \ table_code.c table_type.c tell.c tell64.c tell_multidiv.c \ tell_sub.c tok_arg.c tok_escape.c tok_quote.c trunc.c \ trunc_dir.c trunc_rdonly.c trunc_rofs.c trunc_truncsub.c \ unclude.c unclude_del.c unclude_move.c unclude_open.c \ version_0.c version_0_write.c version_1.c version_1_write.c \ version_2.c version_2_write.c version_3.c version_3_write.c \ version_4.c version_4_write.c version_5.c version_5_strict.c \ version_5_write.c version_6.c version_6_strict.c \ version_6_write.c version_7.c version_7_strict.c \ version_7_write.c version_8.c version_8_strict.c \ version_8_write.c version_9.c version_9_strict.c \ version_9_write.c vlist.c vlist_alias.c vlist_hidden.c \ vlist_invalid.c vlist_meta.c vlist_meta_hidden.c \ vlist_meta_invalid.c zzip_data.c zzip_get.c zzip_get_get.c \ zzip_nframes.c zzip_seek.c zzip_seek_far.c zzslim_get.c \ zzslim_nframes.c zzslim_seek.c zzslim_seek_far.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # 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 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; \ } DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests LDADD = ../src/libgetdata.la AM_CPPFLAGS = ${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src EXTRA_DIST = test.h ADD_TESTS = add_add add_affix add_alias add_alias_affix add_alias_meta \ add_amb_code7 add_bit add_bit_bitnum add_bit_bitsize add_bit_invalid \ add_bit_numbits add_bit_scalars add_carray add_clincom add_code \ add_const add_cpolynom add_crecip add_crecip89 add_dangle_dup \ add_divide add_divide_invalid add_dot5 add_dot6 add_duplicate \ add_format add_invalid add_lincom add_lincom_affix \ add_lincom_invalid add_lincom_nfields add_linterp \ add_linterp_invalid add_meta add_meta_alias add_mplex \ add_mplex_scalars add_multiply add_multiply_invalid add_phase \ add_phase_invalid add_polynom add_polynom_scalar add_protect add_raw \ add_raw_include add_raw_invalid add_raw_spf add_raw_spf_scalar \ add_raw_sub add_raw_type add_rdonly add_recip add_resolv add_sbit \ add_scalar add_scalar_carray add_scalar_carray_bad add_sort add_spec \ add_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \ add_string add_string_affix add_type add_window add_window_op ALIAS_TESTS = alias_list alias_list_alias alias_list_missing alias_num \ alias_num_alias alias_num_missing alias_target alias_target_alias \ alias_target_missing ALTER_TESTS = alter_bit_bitnum alter_bit_numbits alter_carray_len \ alter_carray_type alter_clincom alter_const alter_const_c2r \ alter_const_r2c alter_const_r2r alter_cpolynom alter_cpolynom_null \ alter_crecip alter_crecip89 alter_crecip89_null alter_crecip_zero \ alter_divide alter_entry alter_entry_affix alter_entry_hidden \ alter_entry_lincom alter_entry_recode alter_entry_recode_recalc \ alter_entry_scalar1 alter_entry_scalar2a alter_entry_scalar2n \ alter_entry_scalar3 alter_entry_scalar3c alter_entry_scalar4 \ alter_entry_scalar_amb alter_index alter_lincom_23 alter_lincom_32 \ alter_lincom_affix alter_lincom_input alter_lincom_offset \ alter_lincom_slope alter_linterp alter_linterp_move alter_mplex \ alter_mspec alter_mspec_affix alter_multiply alter_phase \ alter_polynom_coeff alter_polynom_input alter_polynom_ord \ alter_raw_spf alter_raw_type alter_recip alter_recip_zero \ alter_scalar_affix alter_spec alter_spec_affix alter_spec_meta \ alter_spec_polynom alter_window ASCII_TESTS = ascii_add ascii_get ascii_get_complex ascii_get_get ascii_get_here \ ascii_get_sub ascii_nframes ascii_put ascii_put_here ascii_seek \ ascii_seek_far ascii_sync BOF_TESTS = bof bof_bit bof_index bof_lincom bof_phase bof_phase_neg BZIP_TESTS = bzip_add bzip_get bzip_get_far bzip_get_get bzip_get_get2 \ bzip_get_put bzip_move_from bzip_move_to bzip_nframes bzip_put \ bzip_put_back bzip_put_endian bzip_put_get bzip_put_pad \ bzip_put_sub bzip_seek bzip_seek_far bzip_sync CLOSE_TESTS = close_bad close_close close_discard close_null CONVERT_TESTS = convert_complex128_complex64 convert_complex128_float64 \ convert_complex128_int64 convert_complex128_uint64 \ convert_complex64_complex128 convert_complex64_float64 \ convert_complex64_int64 convert_complex64_uint64 \ convert_float32_complex128 convert_float32_complex64 \ convert_float32_float64 convert_float32_int16 \ convert_float32_int32 convert_float32_int64 convert_float32_int8 \ convert_float32_uint16 convert_float32_uint32 \ convert_float32_uint64 convert_float32_uint8 \ convert_float64_complex128 convert_float64_complex64 \ convert_float64_float32 convert_float64_int16 \ convert_float64_int32 convert_float64_int64 convert_float64_int8 \ convert_float64_uint16 convert_float64_uint32 \ convert_float64_uint64 convert_float64_uint8 \ convert_int16_complex128 convert_int16_complex64 \ convert_int16_float32 convert_int16_float64 convert_int16_int32 \ convert_int16_int64 convert_int16_int8 convert_int16_uint16 \ convert_int16_uint32 convert_int16_uint64 convert_int16_uint8 \ convert_int32_complex128 convert_int32_complex64 \ convert_int32_float32 convert_int32_float64 convert_int32_int16 \ convert_int32_int64 convert_int32_int8 convert_int32_uint16 \ convert_int32_uint32 convert_int32_uint64 convert_int32_uint8 \ convert_int64_complex128 convert_int64_complex64 \ convert_int64_float32 convert_int64_float64 convert_int64_int16 \ convert_int64_int32 convert_int64_int8 convert_int64_uint16 \ convert_int64_uint32 convert_int64_uint64 convert_int64_uint8 \ convert_int8_complex128 convert_int8_complex64 \ convert_int8_float32 convert_int8_float64 convert_int8_int16 \ convert_int8_int32 convert_int8_int64 convert_int8_uint16 \ convert_int8_uint32 convert_int8_uint64 convert_int8_uint8 \ convert_uint16_complex128 convert_uint16_complex64 \ convert_uint16_float32 convert_uint16_float64 \ convert_uint16_int16 convert_uint16_int32 convert_uint16_int64 \ convert_uint16_int8 convert_uint16_uint32 convert_uint16_uint64 \ convert_uint16_uint8 convert_uint32_complex128 \ convert_uint32_complex64 convert_uint32_float32 \ convert_uint32_float64 convert_uint32_int16 convert_uint32_int32 \ convert_uint32_int64 convert_uint32_int8 convert_uint32_uint16 \ convert_uint32_uint64 convert_uint32_uint8 \ convert_uint64_complex128 convert_uint64_complex64 \ convert_uint64_float32 convert_uint64_float64 \ convert_uint64_int16 convert_uint64_int32 convert_uint64_int64 \ convert_uint64_int8 convert_uint64_uint16 convert_uint64_uint32 \ convert_uint64_uint8 convert_uint8_complex128 \ convert_uint8_complex64 convert_uint8_float32 \ convert_uint8_float64 convert_uint8_int16 convert_uint8_int32 \ convert_uint8_int64 convert_uint8_int8 convert_uint8_uint16 \ convert_uint8_uint32 convert_uint8_uint64 CREAT_TESTS = creat creat_excl creat_rdonly creat_rdonly_exists CVLIST_TESTS = cvlist cvlist_array cvlist_array0 cvlist_array_free \ cvlist_array_hidden cvlist_array_meta cvlist_array_meta0 \ cvlist_array_meta_free cvlist_array_meta_hidden cvlist_hidden \ cvlist_invalid cvlist_meta cvlist_meta0 cvlist_meta_hidden \ cvlist_meta_invalid DEL_TESTS = del_alias del_carray del_carray_deref del_const del_const_deref \ del_const_force del_data del_data_enoent del_data_open del_derived \ del_derived_after del_derived_force del_del del_meta del_meta_force \ del_ref DESYNC_TESTS = desync desync_flush desync_path desync_reopen desync_reopen_inv DFES_TESTS = dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \ dfes_null dfes_phase dfes_raw dfes_recip dfes_zero ELIST_TESTS = elist_alias elist_hidden elist_noalias elist_scalar ENCODE_TESTS = encode_alter encode_alter_all encode_alter_open encode_get \ encode_recode encode_recode_open encode_support ENDIAN_TESTS = endian_alter endian_alter_all endian_alter_sie endian_get \ endian_move ENTRY_TESTS = entry_bad_code entry_bit entry_bit_scalar entry_divide \ entry_invalid entry_lincom entry_lincom_scalar entry_linterp \ entry_mplex entry_mplex_scalar entry_multiply entry_phase \ entry_phase_scalar entry_polynom entry_polynom_scalar entry_raw \ entry_raw_scalar entry_raw_scalar_code entry_raw_scalar_type \ entry_scalar_repr entry_recip entry_type entry_type_alias \ entry_window entry_window_scalar EOF_TESTS = eof eof_bit eof_index eof_lincom eof_phase eof_phase_neg ERROR_TESTS = error error_error error_num error_short error_verbose \ error_verbose_prefix FILE_TESTS = file file_code file_type FLAC_TESTS = flac_add flac_get_big flac_get_far flac_get_get flac_get_get2 \ flac_get_little flac_nframes flac_put_big flac_put_complex128 \ flac_put_float64 flac_put_int32 flac_put_little flac_seek \ flac_seek_far flac_sync FLIST_TESTS = flist flist0 flist2 flist_hidden flist_invalid flist_meta \ flist_meta2 flist_meta_hidden flist_meta_invalid flist_type \ flist_type_hidden flist_type_invalid flist_type_meta \ flist_type_meta_hidden flist_type_meta_invalid FLUSH_TESTS = flush_all flush_amb_code flush_bad_code flush_flush flush_hex \ flush_invalid flush_lincom flush_lincom1 flush_meta flush_mult \ flush_raw_close flush_ref flush_spec flush_string flush_sync FOFFS_TESTS = foffs_alter foffs_alter_all foffs_get foffs_move FRAGMENT_TESTS = fragment_affix fragment_affix_alter fragment_affix_alter2 \ fragment_affix_alter_code fragment_affix_alter_nop \ fragment_affix_dup fragment_index fragment_index_alias \ fragment_name fragment_name_oor fragment_num fragment_parent GET_TESTS = get64 get_affix get_bad_code get_bit get_carray get_carray_len \ get_carray_c2r get_carray_slice get_char get_clincom get_complex128 \ get_complex64 get_const get_const_carray get_const_complex \ get_const_repr get_cpolynom get_cpolynom1 get_cpolynom_int get_dim \ get_divide get_divide_ccin get_divide_crin get_divide_crinr \ get_divide_rcin get_divide_s get_endian8 get_endian16 get_endian32 \ get_endian64 get_endian_complex128_arm get_endian_complex128_big \ get_endian_complex128_little get_endian_complex64_arm \ get_endian_complex64_big get_endian_complex64_little \ get_endian_float32_arm get_endian_float32_big \ get_endian_float32_little get_endian_float64_arm \ get_endian_float64_big get_endian_float64_little get_ff get_float32 \ get_float64 get_foffs get_foffs2 get_fs get_here get_here_foffs \ get_heres get_index_complex get_int8 get_int16 get_int32 \ get_int64 get_invalid get_lincom1 get_lincom2 get_lincom2s \ get_lincom3 get_lincom3s get_lincom_mdt get_lincom_noin \ get_lincom_non get_lincom_null get_lincom_spf get_linterp \ get_linterp1 get_linterp_abs get_linterp_complex get_linterp_empty \ get_linterp_noin get_linterp_notab get_linterp_sort get_mplex \ get_mplex_bof get_mplex_complex get_mplex_lb get_mplex_lball \ get_mplex_nolb get_mplex_s get_mplex_saved get_multiply \ get_multiply_ccin get_multiply_crin get_multiply_crinr \ get_multiply_noin get_multiply_rcin get_multiply_s get_neg get_none \ get_nonexistent get_null get_off64 get_phase get_phase_affix \ get_polynom get_polynom_cmpin get_polynom_noin get_recip \ get_recip_const get_recurse get_rofs get_sbit get_sf get_ss \ get_string get_type get_uint16 get_uint32 get_uint64 get_window \ get_window_clr get_window_complex get_window_ge get_window_gt \ get_window_le get_window_lt get_window_ne get_window_s \ get_window_set get_zero get_zero_complex get_zero_float GLOBAL_TESTS = global_flags global_name global_ref global_ref_empty global_ref_set GZIP_TESTS = gzip_add gzip_del gzip_get gzip_get_far gzip_get_get gzip_get_get2 \ gzip_get_put gzip_move_from gzip_move_to gzip_nframes gzip_put \ gzip_put_back gzip_put_endian gzip_put_get gzip_put_nframes \ gzip_put_off gzip_put_pad gzip_put_sub gzip_seek gzip_seek_far \ gzip_seek_put gzip_sync HEADER_TESTS = header_complex header_off64t HIDE_TESTS = hide hide_hidden hide_unhide INCLUDE_TESTS = include_accmode include_affix include_auto include_cb \ include_creat include_ignore include_include include_index \ include_invalid include_nonexistent include_pc \ include_ref include_sub include_syntax INDEX_TESTS = index_domain index_index index_range index_s index_subset @INCLUDE_LEGACY_API_TRUE@LEGACY_TESTS = legacy_error legacy_estring legacy_format legacy_get \ @INCLUDE_LEGACY_API_TRUE@ legacy_get_put legacy_get_rofs legacy_nframes legacy_nonexistent \ @INCLUDE_LEGACY_API_TRUE@ legacy_put legacy_spf LZMA_TESTS = lzma_get lzma_nframes lzma_put lzma_xz_add lzma_xz_get \ lzma_xz_get_far lzma_xz_get_get lzma_xz_get_get2 lzma_xz_get_put \ lzma_xz_move_to lzma_xz_nframes lzma_xz_put lzma_xz_put_back \ lzma_xz_put_endian lzma_xz_put_get lzma_xz_put_pad lzma_xz_seek \ lzma_xz_seek_far lzma_xz_sync MADD_TESTS = madd madd_affix madd_alias madd_alias_affix madd_bit \ madd_bit_invalid madd_carray madd_clincom madd_const madd_cpolynom \ madd_crecip madd_crecip89 madd_divide madd_index \ madd_lincom madd_lincom_invalid madd_linterp madd_linterp_invalid \ madd_mplex madd_multiply madd_multiply_invalid madd_phase \ madd_phase_invalid madd_polynom madd_recip madd_sbit \ madd_spec madd_spec_directive madd_spec_invalid \ madd_spec_resolv madd_string madd_window MOVE_TESTS = move_affix move_affix_dup move_affix_meta move_affix_updb \ move_alias move_data_enc_ar move_data_enc_ra move_data_endian \ move_data_foffs move_data_foffs_neg move_data_nop move_index \ move_meta move_move move_protect move_subdir NAME_TESTS = name_affix name_affix_bad name_alias name_dangle name_dot5 \ name_dot5r name_dot9 name_dup name_meta name_move name_move_alias \ name_name name_updb name_updb_affix name_updb_alias \ name_updb_carray name_updb_const name_updb_const_alias NATIVE_TESTS = native_bit native_const native_index native_lincom \ native_lincom_cmpin native_lincom_cmpscal native_linterp \ native_linterp_cmp native_mult native_mult1 native_mult2 \ native_polynom native_polynom_cmpin native_polynom_cmpscal \ native_raw native_phase native_recip native_recip_cmpin \ native_recip_cmpscal native_sbit native_string NENTRIES_TESTS = nentries_alias nentries_hidden nentries_noalias nentries_scalar NFIELDS_TESTS = nfields_hidden nfields_invalid nfields_nfields nfields_type \ nfields_type_hidden nfields_type_invalid nfields_vector \ nfields_vector_hidden nfields_vector_invalid NFRAMES_TESTS = nframes64 nframes_empty nframes_invalid nframes_nframes \ nframes_off64 nframes_spf NMETA_TESTS = nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \ nmeta_type_hidden nmeta_type_invalid nmeta_type_parent \ nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \ nmeta_vectors_invalid nmeta_vectors_parent OPEN_TESTS = open_abs open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \ open_cb_rescan open_cb_rescan_alloc open_eaccess open_invalid \ open_nonexistent open_notdirfile open_open open_rofs open_sym_al \ open_sym_at open_sym_c open_sym_cl open_sym_ct open_sym_d \ open_sym_l open_sym_p open_sym_pl open_sym_pt PARSE_TESTS = parse_alias parse_alias_code parse_alias_dup parse_alias_meta \ parse_alias_missing parse_badline parse_bit parse_bit4 \ parse_bit_bitnum parse_bit_bitsize parse_bit_ncols \ parse_bit_numbits parse_bit_scalar parse_carray parse_carray_long \ parse_const parse_const_complex parse_const_ncols parse_divide \ parse_double parse_duplicate parse_duplicate_ignore \ parse_endian_bad parse_endian_big parse_endian_force \ parse_endian_little parse_endian_slash parse_eol parse_foffs \ parse_foffs_include parse_foffs_slash parse_hex parse_hidden \ parse_hidden_field parse_hidden_meta parse_include \ parse_include_absolute parse_include_absrel \ parse_include_affix_bad parse_include_affix_ref parse_include_dir \ parse_include_loop parse_include_nonexistent parse_include_prefix \ parse_include_prefix_dup parse_include_preprefix parse_include_ref \ parse_include_relabs parse_include_relrel parse_include_slash \ parse_include_suffix parse_include_sufsuffix parse_index \ parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 \ parse_lincom_nfields parse_lincom_nofields parse_lincom_non \ parse_lincom_non_ncols parse_lincom_scalar parse_linterp \ parse_linterp_ncols parse_literal_cmpbad parse_literal_fltcmp \ parse_literal_fltcmp0 parse_literal_intcmp parse_literal_intcmp0 \ parse_literal_uintcmp parse_literal_uintcmp0 parse_malias \ parse_malias_dup parse_malias_meta parse_meta parse_meta_affix \ parse_meta_alias parse_meta_frag parse_meta_implicit \ parse_meta_implicit2 parse_meta_implicit_affix parse_meta_index \ parse_meta_index2 parse_meta_jump parse_meta_malias \ parse_meta_meta parse_meta_parent parse_meta_raw parse_mplex \ parse_mplex_ncols parse_mplex_nomax parse_mplex_scalar \ parse_multiply parse_multiply_ncols parse_name parse_name_dot \ parse_name_ext parse_name_pedantic parse_ncols parse_octal_zero \ parse_phase parse_phase_ncols parse_phase_scalar parse_polynom \ parse_polynom_ncols1 parse_polynom_ncols2 parse_polynom_scalar \ parse_protect_all parse_protect_bad parse_protect_data \ parse_protect_format parse_protect_none parse_quote \ parse_quote_mismatch parse_raw parse_raw_char parse_raw_char_bad \ parse_raw_ncols parse_raw_scalar parse_raw_spf parse_raw_type \ parse_recip parse_ref parse_ref_nonexistent parse_sbit \ parse_scalar1 parse_scalar2 parse_scalar_repr parse_sort \ parse_string parse_string_ncols parse_string_null parse_utf8 \ parse_utf8_invalid parse_utf8_zero parse_version parse_version_89 \ parse_version_98 parse_version_include parse_version_permissive \ parse_version_p8 parse_version_p9 parse_version_slash \ parse_whitespace parse_window parse_window_ncols parse_window_op \ parse_window_scalar PROTECT_TESTS = protect_alter protect_alter_all protect_get PUT_TESTS = put64 put_bad_code put_bit put_bof put_carray put_carray_client \ put_carray_slice put_char put_clincom1 put_complex128 put_complex64 \ put_const put_const_protect put_cpolynom put_crecip put_divide \ put_endian8 put_endian16 put_endian32 put_endian64 \ put_endian_complex128_arm put_endian_complex128_big \ put_endian_complex128_little put_endian_complex64_arm \ put_endian_complex64_big put_endian_complex64_little \ put_endian_float32_arm put_endian_float32_big \ put_endian_float32_little put_endian_float64_arm \ put_endian_float64_big put_endian_float64_little put_ff put_float32 \ put_float64 put_foffs put_fs put_here put_heres put_int8 put_int16 \ put_int32 put_int64 put_invalid put_lincom1 put_lincom2 \ put_lincom_noin put_linterp put_linterp_noin put_linterp_nomono \ put_linterp_notab put_linterp_reverse put_mplex put_mplex_complex \ put_multiply put_nofile put_null put_off64 put_phase put_phase_noin \ put_polynom1 put_polynom2 put_polynom_noin put_protect put_rdonly \ put_recip put_recurse put_repr put_rofs put_sbit put_sf put_ss \ put_string put_string_protect put_sub put_type put_uint16 put_uint32 \ put_uint64 put_window put_zero REF_TESTS = ref ref_none ref_two REPR_TESTS = repr_a repr_bad repr_float32 repr_float64 repr_i repr_int16 \ repr_int32 repr_int64 repr_int8 repr_m repr_r repr_real_a \ repr_real_i repr_real_m repr_real_r repr_uint16 repr_uint32 \ repr_uint64 repr_uint8 SEEK_TESTS = seek64 seek_cur seek_end seek_far seek_foffs seek_foffs2 seek_index \ seek_lincom seek_mult seek_neg seek_phase seek_set seek_sub SIE_TESTS = sie_get_big sie_get_little sie_move_from sie_move_to sie_nframes_big \ sie_nframes_little sie_put_append sie_put_append2 sie_put_back \ sie_put_big sie_put_little sie_put_many sie_put_newo sie_put_newo0 \ sie_put_pad sie_put_pad0 sie_put_trunc sie_put_trunc2 \ sie_put_trunc_nf sie_seek sie_seek_far sie_sync SLIM_TESTS = slim_get slim_nframes slim_seek slim_seek_far SVLIST_TESTS = svlist svlist0 svlist2 svlist_hidden svlist_invalid svlist_meta \ svlist_meta0 svlist_meta_hidden svlist_meta_invalid SPF_TESTS = spf_alias spf_alias_missing spf_alias_meta spf_divide spf_lincom \ spf_multiply spf_polynom spf_raw spf_recip spf_recurse TABLE_TESTS = table table_code table_type TELL_TESTS = tell tell64 tell_multidiv tell_sub TOK_TESTS = tok_arg tok_escape tok_quote TRUNC_TESTS = trunc trunc_dir trunc_rdonly trunc_rofs trunc_truncsub UNCLUDE_TESTS = unclude unclude_del unclude_move unclude_open VERSION_TESTS = version_0 version_0_write version_1 version_1_write version_2 \ version_2_write version_3 version_3_write version_4 \ version_4_write version_5 version_5_strict version_5_write \ version_6 version_6_strict version_6_write version_7 \ version_7_strict version_7_write version_8 version_8_strict \ version_8_write version_9 version_9_strict version_9_write VLIST_TESTS = vlist vlist_alias vlist_hidden vlist_invalid vlist_meta \ vlist_meta_hidden vlist_meta_invalid ZZIP_TESTS = zzip_data zzip_get zzip_get_get zzip_nframes zzip_seek zzip_seek_far ZZSLIM_TESTS = zzslim_get zzslim_nframes zzslim_seek zzslim_seek_far 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 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: $(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-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 add_add$(EXEEXT): $(add_add_OBJECTS) $(add_add_DEPENDENCIES) $(EXTRA_add_add_DEPENDENCIES) @rm -f add_add$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_add_OBJECTS) $(add_add_LDADD) $(LIBS) add_affix$(EXEEXT): $(add_affix_OBJECTS) $(add_affix_DEPENDENCIES) $(EXTRA_add_affix_DEPENDENCIES) @rm -f add_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_affix_OBJECTS) $(add_affix_LDADD) $(LIBS) add_alias$(EXEEXT): $(add_alias_OBJECTS) $(add_alias_DEPENDENCIES) $(EXTRA_add_alias_DEPENDENCIES) @rm -f add_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_alias_OBJECTS) $(add_alias_LDADD) $(LIBS) add_alias_affix$(EXEEXT): $(add_alias_affix_OBJECTS) $(add_alias_affix_DEPENDENCIES) $(EXTRA_add_alias_affix_DEPENDENCIES) @rm -f add_alias_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_alias_affix_OBJECTS) $(add_alias_affix_LDADD) $(LIBS) add_alias_meta$(EXEEXT): $(add_alias_meta_OBJECTS) $(add_alias_meta_DEPENDENCIES) $(EXTRA_add_alias_meta_DEPENDENCIES) @rm -f add_alias_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_alias_meta_OBJECTS) $(add_alias_meta_LDADD) $(LIBS) add_amb_code7$(EXEEXT): $(add_amb_code7_OBJECTS) $(add_amb_code7_DEPENDENCIES) $(EXTRA_add_amb_code7_DEPENDENCIES) @rm -f add_amb_code7$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_amb_code7_OBJECTS) $(add_amb_code7_LDADD) $(LIBS) add_bit$(EXEEXT): $(add_bit_OBJECTS) $(add_bit_DEPENDENCIES) $(EXTRA_add_bit_DEPENDENCIES) @rm -f add_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_bit_OBJECTS) $(add_bit_LDADD) $(LIBS) add_bit_bitnum$(EXEEXT): $(add_bit_bitnum_OBJECTS) $(add_bit_bitnum_DEPENDENCIES) $(EXTRA_add_bit_bitnum_DEPENDENCIES) @rm -f add_bit_bitnum$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_bit_bitnum_OBJECTS) $(add_bit_bitnum_LDADD) $(LIBS) add_bit_bitsize$(EXEEXT): $(add_bit_bitsize_OBJECTS) $(add_bit_bitsize_DEPENDENCIES) $(EXTRA_add_bit_bitsize_DEPENDENCIES) @rm -f add_bit_bitsize$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_bit_bitsize_OBJECTS) $(add_bit_bitsize_LDADD) $(LIBS) add_bit_invalid$(EXEEXT): $(add_bit_invalid_OBJECTS) $(add_bit_invalid_DEPENDENCIES) $(EXTRA_add_bit_invalid_DEPENDENCIES) @rm -f add_bit_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_bit_invalid_OBJECTS) $(add_bit_invalid_LDADD) $(LIBS) add_bit_numbits$(EXEEXT): $(add_bit_numbits_OBJECTS) $(add_bit_numbits_DEPENDENCIES) $(EXTRA_add_bit_numbits_DEPENDENCIES) @rm -f add_bit_numbits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_bit_numbits_OBJECTS) $(add_bit_numbits_LDADD) $(LIBS) add_bit_scalars$(EXEEXT): $(add_bit_scalars_OBJECTS) $(add_bit_scalars_DEPENDENCIES) $(EXTRA_add_bit_scalars_DEPENDENCIES) @rm -f add_bit_scalars$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_bit_scalars_OBJECTS) $(add_bit_scalars_LDADD) $(LIBS) add_carray$(EXEEXT): $(add_carray_OBJECTS) $(add_carray_DEPENDENCIES) $(EXTRA_add_carray_DEPENDENCIES) @rm -f add_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_carray_OBJECTS) $(add_carray_LDADD) $(LIBS) add_clincom$(EXEEXT): $(add_clincom_OBJECTS) $(add_clincom_DEPENDENCIES) $(EXTRA_add_clincom_DEPENDENCIES) @rm -f add_clincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_clincom_OBJECTS) $(add_clincom_LDADD) $(LIBS) add_code$(EXEEXT): $(add_code_OBJECTS) $(add_code_DEPENDENCIES) $(EXTRA_add_code_DEPENDENCIES) @rm -f add_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_code_OBJECTS) $(add_code_LDADD) $(LIBS) add_const$(EXEEXT): $(add_const_OBJECTS) $(add_const_DEPENDENCIES) $(EXTRA_add_const_DEPENDENCIES) @rm -f add_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_const_OBJECTS) $(add_const_LDADD) $(LIBS) add_cpolynom$(EXEEXT): $(add_cpolynom_OBJECTS) $(add_cpolynom_DEPENDENCIES) $(EXTRA_add_cpolynom_DEPENDENCIES) @rm -f add_cpolynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_cpolynom_OBJECTS) $(add_cpolynom_LDADD) $(LIBS) add_crecip$(EXEEXT): $(add_crecip_OBJECTS) $(add_crecip_DEPENDENCIES) $(EXTRA_add_crecip_DEPENDENCIES) @rm -f add_crecip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_crecip_OBJECTS) $(add_crecip_LDADD) $(LIBS) add_crecip89$(EXEEXT): $(add_crecip89_OBJECTS) $(add_crecip89_DEPENDENCIES) $(EXTRA_add_crecip89_DEPENDENCIES) @rm -f add_crecip89$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_crecip89_OBJECTS) $(add_crecip89_LDADD) $(LIBS) add_dangle_dup$(EXEEXT): $(add_dangle_dup_OBJECTS) $(add_dangle_dup_DEPENDENCIES) $(EXTRA_add_dangle_dup_DEPENDENCIES) @rm -f add_dangle_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_dangle_dup_OBJECTS) $(add_dangle_dup_LDADD) $(LIBS) add_divide$(EXEEXT): $(add_divide_OBJECTS) $(add_divide_DEPENDENCIES) $(EXTRA_add_divide_DEPENDENCIES) @rm -f add_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_divide_OBJECTS) $(add_divide_LDADD) $(LIBS) add_divide_invalid$(EXEEXT): $(add_divide_invalid_OBJECTS) $(add_divide_invalid_DEPENDENCIES) $(EXTRA_add_divide_invalid_DEPENDENCIES) @rm -f add_divide_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_divide_invalid_OBJECTS) $(add_divide_invalid_LDADD) $(LIBS) add_dot5$(EXEEXT): $(add_dot5_OBJECTS) $(add_dot5_DEPENDENCIES) $(EXTRA_add_dot5_DEPENDENCIES) @rm -f add_dot5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_dot5_OBJECTS) $(add_dot5_LDADD) $(LIBS) add_dot6$(EXEEXT): $(add_dot6_OBJECTS) $(add_dot6_DEPENDENCIES) $(EXTRA_add_dot6_DEPENDENCIES) @rm -f add_dot6$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_dot6_OBJECTS) $(add_dot6_LDADD) $(LIBS) add_duplicate$(EXEEXT): $(add_duplicate_OBJECTS) $(add_duplicate_DEPENDENCIES) $(EXTRA_add_duplicate_DEPENDENCIES) @rm -f add_duplicate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_duplicate_OBJECTS) $(add_duplicate_LDADD) $(LIBS) add_format$(EXEEXT): $(add_format_OBJECTS) $(add_format_DEPENDENCIES) $(EXTRA_add_format_DEPENDENCIES) @rm -f add_format$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_format_OBJECTS) $(add_format_LDADD) $(LIBS) add_invalid$(EXEEXT): $(add_invalid_OBJECTS) $(add_invalid_DEPENDENCIES) $(EXTRA_add_invalid_DEPENDENCIES) @rm -f add_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_invalid_OBJECTS) $(add_invalid_LDADD) $(LIBS) add_lincom$(EXEEXT): $(add_lincom_OBJECTS) $(add_lincom_DEPENDENCIES) $(EXTRA_add_lincom_DEPENDENCIES) @rm -f add_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_lincom_OBJECTS) $(add_lincom_LDADD) $(LIBS) add_lincom_affix$(EXEEXT): $(add_lincom_affix_OBJECTS) $(add_lincom_affix_DEPENDENCIES) $(EXTRA_add_lincom_affix_DEPENDENCIES) @rm -f add_lincom_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_lincom_affix_OBJECTS) $(add_lincom_affix_LDADD) $(LIBS) add_lincom_invalid$(EXEEXT): $(add_lincom_invalid_OBJECTS) $(add_lincom_invalid_DEPENDENCIES) $(EXTRA_add_lincom_invalid_DEPENDENCIES) @rm -f add_lincom_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_lincom_invalid_OBJECTS) $(add_lincom_invalid_LDADD) $(LIBS) add_lincom_nfields$(EXEEXT): $(add_lincom_nfields_OBJECTS) $(add_lincom_nfields_DEPENDENCIES) $(EXTRA_add_lincom_nfields_DEPENDENCIES) @rm -f add_lincom_nfields$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_lincom_nfields_OBJECTS) $(add_lincom_nfields_LDADD) $(LIBS) add_linterp$(EXEEXT): $(add_linterp_OBJECTS) $(add_linterp_DEPENDENCIES) $(EXTRA_add_linterp_DEPENDENCIES) @rm -f add_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_linterp_OBJECTS) $(add_linterp_LDADD) $(LIBS) add_linterp_invalid$(EXEEXT): $(add_linterp_invalid_OBJECTS) $(add_linterp_invalid_DEPENDENCIES) $(EXTRA_add_linterp_invalid_DEPENDENCIES) @rm -f add_linterp_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_linterp_invalid_OBJECTS) $(add_linterp_invalid_LDADD) $(LIBS) add_meta$(EXEEXT): $(add_meta_OBJECTS) $(add_meta_DEPENDENCIES) $(EXTRA_add_meta_DEPENDENCIES) @rm -f add_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_meta_OBJECTS) $(add_meta_LDADD) $(LIBS) add_meta_alias$(EXEEXT): $(add_meta_alias_OBJECTS) $(add_meta_alias_DEPENDENCIES) $(EXTRA_add_meta_alias_DEPENDENCIES) @rm -f add_meta_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_meta_alias_OBJECTS) $(add_meta_alias_LDADD) $(LIBS) add_mplex$(EXEEXT): $(add_mplex_OBJECTS) $(add_mplex_DEPENDENCIES) $(EXTRA_add_mplex_DEPENDENCIES) @rm -f add_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_mplex_OBJECTS) $(add_mplex_LDADD) $(LIBS) add_mplex_scalars$(EXEEXT): $(add_mplex_scalars_OBJECTS) $(add_mplex_scalars_DEPENDENCIES) $(EXTRA_add_mplex_scalars_DEPENDENCIES) @rm -f add_mplex_scalars$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_mplex_scalars_OBJECTS) $(add_mplex_scalars_LDADD) $(LIBS) add_multiply$(EXEEXT): $(add_multiply_OBJECTS) $(add_multiply_DEPENDENCIES) $(EXTRA_add_multiply_DEPENDENCIES) @rm -f add_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_multiply_OBJECTS) $(add_multiply_LDADD) $(LIBS) add_multiply_invalid$(EXEEXT): $(add_multiply_invalid_OBJECTS) $(add_multiply_invalid_DEPENDENCIES) $(EXTRA_add_multiply_invalid_DEPENDENCIES) @rm -f add_multiply_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_multiply_invalid_OBJECTS) $(add_multiply_invalid_LDADD) $(LIBS) add_phase$(EXEEXT): $(add_phase_OBJECTS) $(add_phase_DEPENDENCIES) $(EXTRA_add_phase_DEPENDENCIES) @rm -f add_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_phase_OBJECTS) $(add_phase_LDADD) $(LIBS) add_phase_invalid$(EXEEXT): $(add_phase_invalid_OBJECTS) $(add_phase_invalid_DEPENDENCIES) $(EXTRA_add_phase_invalid_DEPENDENCIES) @rm -f add_phase_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_phase_invalid_OBJECTS) $(add_phase_invalid_LDADD) $(LIBS) add_polynom$(EXEEXT): $(add_polynom_OBJECTS) $(add_polynom_DEPENDENCIES) $(EXTRA_add_polynom_DEPENDENCIES) @rm -f add_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_polynom_OBJECTS) $(add_polynom_LDADD) $(LIBS) add_polynom_scalar$(EXEEXT): $(add_polynom_scalar_OBJECTS) $(add_polynom_scalar_DEPENDENCIES) $(EXTRA_add_polynom_scalar_DEPENDENCIES) @rm -f add_polynom_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_polynom_scalar_OBJECTS) $(add_polynom_scalar_LDADD) $(LIBS) add_protect$(EXEEXT): $(add_protect_OBJECTS) $(add_protect_DEPENDENCIES) $(EXTRA_add_protect_DEPENDENCIES) @rm -f add_protect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_protect_OBJECTS) $(add_protect_LDADD) $(LIBS) add_raw$(EXEEXT): $(add_raw_OBJECTS) $(add_raw_DEPENDENCIES) $(EXTRA_add_raw_DEPENDENCIES) @rm -f add_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_OBJECTS) $(add_raw_LDADD) $(LIBS) add_raw_include$(EXEEXT): $(add_raw_include_OBJECTS) $(add_raw_include_DEPENDENCIES) $(EXTRA_add_raw_include_DEPENDENCIES) @rm -f add_raw_include$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_include_OBJECTS) $(add_raw_include_LDADD) $(LIBS) add_raw_invalid$(EXEEXT): $(add_raw_invalid_OBJECTS) $(add_raw_invalid_DEPENDENCIES) $(EXTRA_add_raw_invalid_DEPENDENCIES) @rm -f add_raw_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_invalid_OBJECTS) $(add_raw_invalid_LDADD) $(LIBS) add_raw_spf$(EXEEXT): $(add_raw_spf_OBJECTS) $(add_raw_spf_DEPENDENCIES) $(EXTRA_add_raw_spf_DEPENDENCIES) @rm -f add_raw_spf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_spf_OBJECTS) $(add_raw_spf_LDADD) $(LIBS) add_raw_spf_scalar$(EXEEXT): $(add_raw_spf_scalar_OBJECTS) $(add_raw_spf_scalar_DEPENDENCIES) $(EXTRA_add_raw_spf_scalar_DEPENDENCIES) @rm -f add_raw_spf_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_spf_scalar_OBJECTS) $(add_raw_spf_scalar_LDADD) $(LIBS) add_raw_sub$(EXEEXT): $(add_raw_sub_OBJECTS) $(add_raw_sub_DEPENDENCIES) $(EXTRA_add_raw_sub_DEPENDENCIES) @rm -f add_raw_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_sub_OBJECTS) $(add_raw_sub_LDADD) $(LIBS) add_raw_type$(EXEEXT): $(add_raw_type_OBJECTS) $(add_raw_type_DEPENDENCIES) $(EXTRA_add_raw_type_DEPENDENCIES) @rm -f add_raw_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_raw_type_OBJECTS) $(add_raw_type_LDADD) $(LIBS) add_rdonly$(EXEEXT): $(add_rdonly_OBJECTS) $(add_rdonly_DEPENDENCIES) $(EXTRA_add_rdonly_DEPENDENCIES) @rm -f add_rdonly$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_rdonly_OBJECTS) $(add_rdonly_LDADD) $(LIBS) add_recip$(EXEEXT): $(add_recip_OBJECTS) $(add_recip_DEPENDENCIES) $(EXTRA_add_recip_DEPENDENCIES) @rm -f add_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_recip_OBJECTS) $(add_recip_LDADD) $(LIBS) add_resolv$(EXEEXT): $(add_resolv_OBJECTS) $(add_resolv_DEPENDENCIES) $(EXTRA_add_resolv_DEPENDENCIES) @rm -f add_resolv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_resolv_OBJECTS) $(add_resolv_LDADD) $(LIBS) add_sbit$(EXEEXT): $(add_sbit_OBJECTS) $(add_sbit_DEPENDENCIES) $(EXTRA_add_sbit_DEPENDENCIES) @rm -f add_sbit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_sbit_OBJECTS) $(add_sbit_LDADD) $(LIBS) add_scalar$(EXEEXT): $(add_scalar_OBJECTS) $(add_scalar_DEPENDENCIES) $(EXTRA_add_scalar_DEPENDENCIES) @rm -f add_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_scalar_OBJECTS) $(add_scalar_LDADD) $(LIBS) add_scalar_carray$(EXEEXT): $(add_scalar_carray_OBJECTS) $(add_scalar_carray_DEPENDENCIES) $(EXTRA_add_scalar_carray_DEPENDENCIES) @rm -f add_scalar_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_scalar_carray_OBJECTS) $(add_scalar_carray_LDADD) $(LIBS) add_scalar_carray_bad$(EXEEXT): $(add_scalar_carray_bad_OBJECTS) $(add_scalar_carray_bad_DEPENDENCIES) $(EXTRA_add_scalar_carray_bad_DEPENDENCIES) @rm -f add_scalar_carray_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_scalar_carray_bad_OBJECTS) $(add_scalar_carray_bad_LDADD) $(LIBS) add_sort$(EXEEXT): $(add_sort_OBJECTS) $(add_sort_DEPENDENCIES) $(EXTRA_add_sort_DEPENDENCIES) @rm -f add_sort$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_sort_OBJECTS) $(add_sort_LDADD) $(LIBS) add_spec$(EXEEXT): $(add_spec_OBJECTS) $(add_spec_DEPENDENCIES) $(EXTRA_add_spec_DEPENDENCIES) @rm -f add_spec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_spec_OBJECTS) $(add_spec_LDADD) $(LIBS) add_spec_directive$(EXEEXT): $(add_spec_directive_OBJECTS) $(add_spec_directive_DEPENDENCIES) $(EXTRA_add_spec_directive_DEPENDENCIES) @rm -f add_spec_directive$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_spec_directive_OBJECTS) $(add_spec_directive_LDADD) $(LIBS) add_spec_invalid$(EXEEXT): $(add_spec_invalid_OBJECTS) $(add_spec_invalid_DEPENDENCIES) $(EXTRA_add_spec_invalid_DEPENDENCIES) @rm -f add_spec_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_spec_invalid_OBJECTS) $(add_spec_invalid_LDADD) $(LIBS) add_spec_meta$(EXEEXT): $(add_spec_meta_OBJECTS) $(add_spec_meta_DEPENDENCIES) $(EXTRA_add_spec_meta_DEPENDENCIES) @rm -f add_spec_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_spec_meta_OBJECTS) $(add_spec_meta_LDADD) $(LIBS) add_spec_resolv$(EXEEXT): $(add_spec_resolv_OBJECTS) $(add_spec_resolv_DEPENDENCIES) $(EXTRA_add_spec_resolv_DEPENDENCIES) @rm -f add_spec_resolv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_spec_resolv_OBJECTS) $(add_spec_resolv_LDADD) $(LIBS) add_string$(EXEEXT): $(add_string_OBJECTS) $(add_string_DEPENDENCIES) $(EXTRA_add_string_DEPENDENCIES) @rm -f add_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_string_OBJECTS) $(add_string_LDADD) $(LIBS) add_string_affix$(EXEEXT): $(add_string_affix_OBJECTS) $(add_string_affix_DEPENDENCIES) $(EXTRA_add_string_affix_DEPENDENCIES) @rm -f add_string_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_string_affix_OBJECTS) $(add_string_affix_LDADD) $(LIBS) add_type$(EXEEXT): $(add_type_OBJECTS) $(add_type_DEPENDENCIES) $(EXTRA_add_type_DEPENDENCIES) @rm -f add_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_type_OBJECTS) $(add_type_LDADD) $(LIBS) add_window$(EXEEXT): $(add_window_OBJECTS) $(add_window_DEPENDENCIES) $(EXTRA_add_window_DEPENDENCIES) @rm -f add_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_window_OBJECTS) $(add_window_LDADD) $(LIBS) add_window_op$(EXEEXT): $(add_window_op_OBJECTS) $(add_window_op_DEPENDENCIES) $(EXTRA_add_window_op_DEPENDENCIES) @rm -f add_window_op$(EXEEXT) $(AM_V_CCLD)$(LINK) $(add_window_op_OBJECTS) $(add_window_op_LDADD) $(LIBS) alias_list$(EXEEXT): $(alias_list_OBJECTS) $(alias_list_DEPENDENCIES) $(EXTRA_alias_list_DEPENDENCIES) @rm -f alias_list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_list_OBJECTS) $(alias_list_LDADD) $(LIBS) alias_list_alias$(EXEEXT): $(alias_list_alias_OBJECTS) $(alias_list_alias_DEPENDENCIES) $(EXTRA_alias_list_alias_DEPENDENCIES) @rm -f alias_list_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_list_alias_OBJECTS) $(alias_list_alias_LDADD) $(LIBS) alias_list_missing$(EXEEXT): $(alias_list_missing_OBJECTS) $(alias_list_missing_DEPENDENCIES) $(EXTRA_alias_list_missing_DEPENDENCIES) @rm -f alias_list_missing$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_list_missing_OBJECTS) $(alias_list_missing_LDADD) $(LIBS) alias_num$(EXEEXT): $(alias_num_OBJECTS) $(alias_num_DEPENDENCIES) $(EXTRA_alias_num_DEPENDENCIES) @rm -f alias_num$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_num_OBJECTS) $(alias_num_LDADD) $(LIBS) alias_num_alias$(EXEEXT): $(alias_num_alias_OBJECTS) $(alias_num_alias_DEPENDENCIES) $(EXTRA_alias_num_alias_DEPENDENCIES) @rm -f alias_num_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_num_alias_OBJECTS) $(alias_num_alias_LDADD) $(LIBS) alias_num_missing$(EXEEXT): $(alias_num_missing_OBJECTS) $(alias_num_missing_DEPENDENCIES) $(EXTRA_alias_num_missing_DEPENDENCIES) @rm -f alias_num_missing$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_num_missing_OBJECTS) $(alias_num_missing_LDADD) $(LIBS) alias_target$(EXEEXT): $(alias_target_OBJECTS) $(alias_target_DEPENDENCIES) $(EXTRA_alias_target_DEPENDENCIES) @rm -f alias_target$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_target_OBJECTS) $(alias_target_LDADD) $(LIBS) alias_target_alias$(EXEEXT): $(alias_target_alias_OBJECTS) $(alias_target_alias_DEPENDENCIES) $(EXTRA_alias_target_alias_DEPENDENCIES) @rm -f alias_target_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_target_alias_OBJECTS) $(alias_target_alias_LDADD) $(LIBS) alias_target_missing$(EXEEXT): $(alias_target_missing_OBJECTS) $(alias_target_missing_DEPENDENCIES) $(EXTRA_alias_target_missing_DEPENDENCIES) @rm -f alias_target_missing$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alias_target_missing_OBJECTS) $(alias_target_missing_LDADD) $(LIBS) alter_bit_bitnum$(EXEEXT): $(alter_bit_bitnum_OBJECTS) $(alter_bit_bitnum_DEPENDENCIES) $(EXTRA_alter_bit_bitnum_DEPENDENCIES) @rm -f alter_bit_bitnum$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_bit_bitnum_OBJECTS) $(alter_bit_bitnum_LDADD) $(LIBS) alter_bit_numbits$(EXEEXT): $(alter_bit_numbits_OBJECTS) $(alter_bit_numbits_DEPENDENCIES) $(EXTRA_alter_bit_numbits_DEPENDENCIES) @rm -f alter_bit_numbits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_bit_numbits_OBJECTS) $(alter_bit_numbits_LDADD) $(LIBS) alter_carray_len$(EXEEXT): $(alter_carray_len_OBJECTS) $(alter_carray_len_DEPENDENCIES) $(EXTRA_alter_carray_len_DEPENDENCIES) @rm -f alter_carray_len$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_carray_len_OBJECTS) $(alter_carray_len_LDADD) $(LIBS) alter_carray_type$(EXEEXT): $(alter_carray_type_OBJECTS) $(alter_carray_type_DEPENDENCIES) $(EXTRA_alter_carray_type_DEPENDENCIES) @rm -f alter_carray_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_carray_type_OBJECTS) $(alter_carray_type_LDADD) $(LIBS) alter_clincom$(EXEEXT): $(alter_clincom_OBJECTS) $(alter_clincom_DEPENDENCIES) $(EXTRA_alter_clincom_DEPENDENCIES) @rm -f alter_clincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_clincom_OBJECTS) $(alter_clincom_LDADD) $(LIBS) alter_const$(EXEEXT): $(alter_const_OBJECTS) $(alter_const_DEPENDENCIES) $(EXTRA_alter_const_DEPENDENCIES) @rm -f alter_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_const_OBJECTS) $(alter_const_LDADD) $(LIBS) alter_const_c2r$(EXEEXT): $(alter_const_c2r_OBJECTS) $(alter_const_c2r_DEPENDENCIES) $(EXTRA_alter_const_c2r_DEPENDENCIES) @rm -f alter_const_c2r$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_const_c2r_OBJECTS) $(alter_const_c2r_LDADD) $(LIBS) alter_const_r2c$(EXEEXT): $(alter_const_r2c_OBJECTS) $(alter_const_r2c_DEPENDENCIES) $(EXTRA_alter_const_r2c_DEPENDENCIES) @rm -f alter_const_r2c$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_const_r2c_OBJECTS) $(alter_const_r2c_LDADD) $(LIBS) alter_const_r2r$(EXEEXT): $(alter_const_r2r_OBJECTS) $(alter_const_r2r_DEPENDENCIES) $(EXTRA_alter_const_r2r_DEPENDENCIES) @rm -f alter_const_r2r$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_const_r2r_OBJECTS) $(alter_const_r2r_LDADD) $(LIBS) alter_cpolynom$(EXEEXT): $(alter_cpolynom_OBJECTS) $(alter_cpolynom_DEPENDENCIES) $(EXTRA_alter_cpolynom_DEPENDENCIES) @rm -f alter_cpolynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_cpolynom_OBJECTS) $(alter_cpolynom_LDADD) $(LIBS) alter_cpolynom_null$(EXEEXT): $(alter_cpolynom_null_OBJECTS) $(alter_cpolynom_null_DEPENDENCIES) $(EXTRA_alter_cpolynom_null_DEPENDENCIES) @rm -f alter_cpolynom_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_cpolynom_null_OBJECTS) $(alter_cpolynom_null_LDADD) $(LIBS) alter_crecip$(EXEEXT): $(alter_crecip_OBJECTS) $(alter_crecip_DEPENDENCIES) $(EXTRA_alter_crecip_DEPENDENCIES) @rm -f alter_crecip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_crecip_OBJECTS) $(alter_crecip_LDADD) $(LIBS) alter_crecip89$(EXEEXT): $(alter_crecip89_OBJECTS) $(alter_crecip89_DEPENDENCIES) $(EXTRA_alter_crecip89_DEPENDENCIES) @rm -f alter_crecip89$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_crecip89_OBJECTS) $(alter_crecip89_LDADD) $(LIBS) alter_crecip89_null$(EXEEXT): $(alter_crecip89_null_OBJECTS) $(alter_crecip89_null_DEPENDENCIES) $(EXTRA_alter_crecip89_null_DEPENDENCIES) @rm -f alter_crecip89_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_crecip89_null_OBJECTS) $(alter_crecip89_null_LDADD) $(LIBS) alter_crecip_zero$(EXEEXT): $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_DEPENDENCIES) $(EXTRA_alter_crecip_zero_DEPENDENCIES) @rm -f alter_crecip_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_crecip_zero_OBJECTS) $(alter_crecip_zero_LDADD) $(LIBS) alter_divide$(EXEEXT): $(alter_divide_OBJECTS) $(alter_divide_DEPENDENCIES) $(EXTRA_alter_divide_DEPENDENCIES) @rm -f alter_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_divide_OBJECTS) $(alter_divide_LDADD) $(LIBS) alter_entry$(EXEEXT): $(alter_entry_OBJECTS) $(alter_entry_DEPENDENCIES) $(EXTRA_alter_entry_DEPENDENCIES) @rm -f alter_entry$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_OBJECTS) $(alter_entry_LDADD) $(LIBS) alter_entry_affix$(EXEEXT): $(alter_entry_affix_OBJECTS) $(alter_entry_affix_DEPENDENCIES) $(EXTRA_alter_entry_affix_DEPENDENCIES) @rm -f alter_entry_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_affix_OBJECTS) $(alter_entry_affix_LDADD) $(LIBS) alter_entry_hidden$(EXEEXT): $(alter_entry_hidden_OBJECTS) $(alter_entry_hidden_DEPENDENCIES) $(EXTRA_alter_entry_hidden_DEPENDENCIES) @rm -f alter_entry_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_hidden_OBJECTS) $(alter_entry_hidden_LDADD) $(LIBS) alter_entry_lincom$(EXEEXT): $(alter_entry_lincom_OBJECTS) $(alter_entry_lincom_DEPENDENCIES) $(EXTRA_alter_entry_lincom_DEPENDENCIES) @rm -f alter_entry_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_lincom_OBJECTS) $(alter_entry_lincom_LDADD) $(LIBS) alter_entry_recode$(EXEEXT): $(alter_entry_recode_OBJECTS) $(alter_entry_recode_DEPENDENCIES) $(EXTRA_alter_entry_recode_DEPENDENCIES) @rm -f alter_entry_recode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_recode_OBJECTS) $(alter_entry_recode_LDADD) $(LIBS) alter_entry_recode_recalc$(EXEEXT): $(alter_entry_recode_recalc_OBJECTS) $(alter_entry_recode_recalc_DEPENDENCIES) $(EXTRA_alter_entry_recode_recalc_DEPENDENCIES) @rm -f alter_entry_recode_recalc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_recode_recalc_OBJECTS) $(alter_entry_recode_recalc_LDADD) $(LIBS) alter_entry_scalar1$(EXEEXT): $(alter_entry_scalar1_OBJECTS) $(alter_entry_scalar1_DEPENDENCIES) $(EXTRA_alter_entry_scalar1_DEPENDENCIES) @rm -f alter_entry_scalar1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar1_OBJECTS) $(alter_entry_scalar1_LDADD) $(LIBS) alter_entry_scalar2a$(EXEEXT): $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_DEPENDENCIES) $(EXTRA_alter_entry_scalar2a_DEPENDENCIES) @rm -f alter_entry_scalar2a$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar2a_OBJECTS) $(alter_entry_scalar2a_LDADD) $(LIBS) alter_entry_scalar2n$(EXEEXT): $(alter_entry_scalar2n_OBJECTS) $(alter_entry_scalar2n_DEPENDENCIES) $(EXTRA_alter_entry_scalar2n_DEPENDENCIES) @rm -f alter_entry_scalar2n$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar2n_OBJECTS) $(alter_entry_scalar2n_LDADD) $(LIBS) alter_entry_scalar3$(EXEEXT): $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_DEPENDENCIES) $(EXTRA_alter_entry_scalar3_DEPENDENCIES) @rm -f alter_entry_scalar3$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar3_OBJECTS) $(alter_entry_scalar3_LDADD) $(LIBS) alter_entry_scalar3c$(EXEEXT): $(alter_entry_scalar3c_OBJECTS) $(alter_entry_scalar3c_DEPENDENCIES) $(EXTRA_alter_entry_scalar3c_DEPENDENCIES) @rm -f alter_entry_scalar3c$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar3c_OBJECTS) $(alter_entry_scalar3c_LDADD) $(LIBS) alter_entry_scalar4$(EXEEXT): $(alter_entry_scalar4_OBJECTS) $(alter_entry_scalar4_DEPENDENCIES) $(EXTRA_alter_entry_scalar4_DEPENDENCIES) @rm -f alter_entry_scalar4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar4_OBJECTS) $(alter_entry_scalar4_LDADD) $(LIBS) alter_entry_scalar_amb$(EXEEXT): $(alter_entry_scalar_amb_OBJECTS) $(alter_entry_scalar_amb_DEPENDENCIES) $(EXTRA_alter_entry_scalar_amb_DEPENDENCIES) @rm -f alter_entry_scalar_amb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_entry_scalar_amb_OBJECTS) $(alter_entry_scalar_amb_LDADD) $(LIBS) alter_index$(EXEEXT): $(alter_index_OBJECTS) $(alter_index_DEPENDENCIES) $(EXTRA_alter_index_DEPENDENCIES) @rm -f alter_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_index_OBJECTS) $(alter_index_LDADD) $(LIBS) alter_lincom_23$(EXEEXT): $(alter_lincom_23_OBJECTS) $(alter_lincom_23_DEPENDENCIES) $(EXTRA_alter_lincom_23_DEPENDENCIES) @rm -f alter_lincom_23$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_lincom_23_OBJECTS) $(alter_lincom_23_LDADD) $(LIBS) alter_lincom_32$(EXEEXT): $(alter_lincom_32_OBJECTS) $(alter_lincom_32_DEPENDENCIES) $(EXTRA_alter_lincom_32_DEPENDENCIES) @rm -f alter_lincom_32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_lincom_32_OBJECTS) $(alter_lincom_32_LDADD) $(LIBS) alter_lincom_affix$(EXEEXT): $(alter_lincom_affix_OBJECTS) $(alter_lincom_affix_DEPENDENCIES) $(EXTRA_alter_lincom_affix_DEPENDENCIES) @rm -f alter_lincom_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_lincom_affix_OBJECTS) $(alter_lincom_affix_LDADD) $(LIBS) alter_lincom_input$(EXEEXT): $(alter_lincom_input_OBJECTS) $(alter_lincom_input_DEPENDENCIES) $(EXTRA_alter_lincom_input_DEPENDENCIES) @rm -f alter_lincom_input$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_lincom_input_OBJECTS) $(alter_lincom_input_LDADD) $(LIBS) alter_lincom_offset$(EXEEXT): $(alter_lincom_offset_OBJECTS) $(alter_lincom_offset_DEPENDENCIES) $(EXTRA_alter_lincom_offset_DEPENDENCIES) @rm -f alter_lincom_offset$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_lincom_offset_OBJECTS) $(alter_lincom_offset_LDADD) $(LIBS) alter_lincom_slope$(EXEEXT): $(alter_lincom_slope_OBJECTS) $(alter_lincom_slope_DEPENDENCIES) $(EXTRA_alter_lincom_slope_DEPENDENCIES) @rm -f alter_lincom_slope$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_lincom_slope_OBJECTS) $(alter_lincom_slope_LDADD) $(LIBS) alter_linterp$(EXEEXT): $(alter_linterp_OBJECTS) $(alter_linterp_DEPENDENCIES) $(EXTRA_alter_linterp_DEPENDENCIES) @rm -f alter_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_linterp_OBJECTS) $(alter_linterp_LDADD) $(LIBS) alter_linterp_move$(EXEEXT): $(alter_linterp_move_OBJECTS) $(alter_linterp_move_DEPENDENCIES) $(EXTRA_alter_linterp_move_DEPENDENCIES) @rm -f alter_linterp_move$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_linterp_move_OBJECTS) $(alter_linterp_move_LDADD) $(LIBS) alter_mplex$(EXEEXT): $(alter_mplex_OBJECTS) $(alter_mplex_DEPENDENCIES) $(EXTRA_alter_mplex_DEPENDENCIES) @rm -f alter_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_mplex_OBJECTS) $(alter_mplex_LDADD) $(LIBS) alter_mspec$(EXEEXT): $(alter_mspec_OBJECTS) $(alter_mspec_DEPENDENCIES) $(EXTRA_alter_mspec_DEPENDENCIES) @rm -f alter_mspec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_mspec_OBJECTS) $(alter_mspec_LDADD) $(LIBS) alter_mspec_affix$(EXEEXT): $(alter_mspec_affix_OBJECTS) $(alter_mspec_affix_DEPENDENCIES) $(EXTRA_alter_mspec_affix_DEPENDENCIES) @rm -f alter_mspec_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_mspec_affix_OBJECTS) $(alter_mspec_affix_LDADD) $(LIBS) alter_multiply$(EXEEXT): $(alter_multiply_OBJECTS) $(alter_multiply_DEPENDENCIES) $(EXTRA_alter_multiply_DEPENDENCIES) @rm -f alter_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_multiply_OBJECTS) $(alter_multiply_LDADD) $(LIBS) alter_phase$(EXEEXT): $(alter_phase_OBJECTS) $(alter_phase_DEPENDENCIES) $(EXTRA_alter_phase_DEPENDENCIES) @rm -f alter_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_phase_OBJECTS) $(alter_phase_LDADD) $(LIBS) alter_polynom_coeff$(EXEEXT): $(alter_polynom_coeff_OBJECTS) $(alter_polynom_coeff_DEPENDENCIES) $(EXTRA_alter_polynom_coeff_DEPENDENCIES) @rm -f alter_polynom_coeff$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_polynom_coeff_OBJECTS) $(alter_polynom_coeff_LDADD) $(LIBS) alter_polynom_input$(EXEEXT): $(alter_polynom_input_OBJECTS) $(alter_polynom_input_DEPENDENCIES) $(EXTRA_alter_polynom_input_DEPENDENCIES) @rm -f alter_polynom_input$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_polynom_input_OBJECTS) $(alter_polynom_input_LDADD) $(LIBS) alter_polynom_ord$(EXEEXT): $(alter_polynom_ord_OBJECTS) $(alter_polynom_ord_DEPENDENCIES) $(EXTRA_alter_polynom_ord_DEPENDENCIES) @rm -f alter_polynom_ord$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_polynom_ord_OBJECTS) $(alter_polynom_ord_LDADD) $(LIBS) alter_raw_spf$(EXEEXT): $(alter_raw_spf_OBJECTS) $(alter_raw_spf_DEPENDENCIES) $(EXTRA_alter_raw_spf_DEPENDENCIES) @rm -f alter_raw_spf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_raw_spf_OBJECTS) $(alter_raw_spf_LDADD) $(LIBS) alter_raw_type$(EXEEXT): $(alter_raw_type_OBJECTS) $(alter_raw_type_DEPENDENCIES) $(EXTRA_alter_raw_type_DEPENDENCIES) @rm -f alter_raw_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_raw_type_OBJECTS) $(alter_raw_type_LDADD) $(LIBS) alter_recip$(EXEEXT): $(alter_recip_OBJECTS) $(alter_recip_DEPENDENCIES) $(EXTRA_alter_recip_DEPENDENCIES) @rm -f alter_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_recip_OBJECTS) $(alter_recip_LDADD) $(LIBS) alter_recip_zero$(EXEEXT): $(alter_recip_zero_OBJECTS) $(alter_recip_zero_DEPENDENCIES) $(EXTRA_alter_recip_zero_DEPENDENCIES) @rm -f alter_recip_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_recip_zero_OBJECTS) $(alter_recip_zero_LDADD) $(LIBS) alter_scalar_affix$(EXEEXT): $(alter_scalar_affix_OBJECTS) $(alter_scalar_affix_DEPENDENCIES) $(EXTRA_alter_scalar_affix_DEPENDENCIES) @rm -f alter_scalar_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_scalar_affix_OBJECTS) $(alter_scalar_affix_LDADD) $(LIBS) alter_spec$(EXEEXT): $(alter_spec_OBJECTS) $(alter_spec_DEPENDENCIES) $(EXTRA_alter_spec_DEPENDENCIES) @rm -f alter_spec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_spec_OBJECTS) $(alter_spec_LDADD) $(LIBS) alter_spec_affix$(EXEEXT): $(alter_spec_affix_OBJECTS) $(alter_spec_affix_DEPENDENCIES) $(EXTRA_alter_spec_affix_DEPENDENCIES) @rm -f alter_spec_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_spec_affix_OBJECTS) $(alter_spec_affix_LDADD) $(LIBS) alter_spec_meta$(EXEEXT): $(alter_spec_meta_OBJECTS) $(alter_spec_meta_DEPENDENCIES) $(EXTRA_alter_spec_meta_DEPENDENCIES) @rm -f alter_spec_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_spec_meta_OBJECTS) $(alter_spec_meta_LDADD) $(LIBS) alter_spec_polynom$(EXEEXT): $(alter_spec_polynom_OBJECTS) $(alter_spec_polynom_DEPENDENCIES) $(EXTRA_alter_spec_polynom_DEPENDENCIES) @rm -f alter_spec_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_spec_polynom_OBJECTS) $(alter_spec_polynom_LDADD) $(LIBS) alter_window$(EXEEXT): $(alter_window_OBJECTS) $(alter_window_DEPENDENCIES) $(EXTRA_alter_window_DEPENDENCIES) @rm -f alter_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alter_window_OBJECTS) $(alter_window_LDADD) $(LIBS) ascii_add$(EXEEXT): $(ascii_add_OBJECTS) $(ascii_add_DEPENDENCIES) $(EXTRA_ascii_add_DEPENDENCIES) @rm -f ascii_add$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_add_OBJECTS) $(ascii_add_LDADD) $(LIBS) ascii_get$(EXEEXT): $(ascii_get_OBJECTS) $(ascii_get_DEPENDENCIES) $(EXTRA_ascii_get_DEPENDENCIES) @rm -f ascii_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_get_OBJECTS) $(ascii_get_LDADD) $(LIBS) ascii_get_complex$(EXEEXT): $(ascii_get_complex_OBJECTS) $(ascii_get_complex_DEPENDENCIES) $(EXTRA_ascii_get_complex_DEPENDENCIES) @rm -f ascii_get_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_get_complex_OBJECTS) $(ascii_get_complex_LDADD) $(LIBS) ascii_get_get$(EXEEXT): $(ascii_get_get_OBJECTS) $(ascii_get_get_DEPENDENCIES) $(EXTRA_ascii_get_get_DEPENDENCIES) @rm -f ascii_get_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_get_get_OBJECTS) $(ascii_get_get_LDADD) $(LIBS) ascii_get_here$(EXEEXT): $(ascii_get_here_OBJECTS) $(ascii_get_here_DEPENDENCIES) $(EXTRA_ascii_get_here_DEPENDENCIES) @rm -f ascii_get_here$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_get_here_OBJECTS) $(ascii_get_here_LDADD) $(LIBS) ascii_get_sub$(EXEEXT): $(ascii_get_sub_OBJECTS) $(ascii_get_sub_DEPENDENCIES) $(EXTRA_ascii_get_sub_DEPENDENCIES) @rm -f ascii_get_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_get_sub_OBJECTS) $(ascii_get_sub_LDADD) $(LIBS) ascii_nframes$(EXEEXT): $(ascii_nframes_OBJECTS) $(ascii_nframes_DEPENDENCIES) $(EXTRA_ascii_nframes_DEPENDENCIES) @rm -f ascii_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_nframes_OBJECTS) $(ascii_nframes_LDADD) $(LIBS) ascii_put$(EXEEXT): $(ascii_put_OBJECTS) $(ascii_put_DEPENDENCIES) $(EXTRA_ascii_put_DEPENDENCIES) @rm -f ascii_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_put_OBJECTS) $(ascii_put_LDADD) $(LIBS) ascii_put_here$(EXEEXT): $(ascii_put_here_OBJECTS) $(ascii_put_here_DEPENDENCIES) $(EXTRA_ascii_put_here_DEPENDENCIES) @rm -f ascii_put_here$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_put_here_OBJECTS) $(ascii_put_here_LDADD) $(LIBS) ascii_seek$(EXEEXT): $(ascii_seek_OBJECTS) $(ascii_seek_DEPENDENCIES) $(EXTRA_ascii_seek_DEPENDENCIES) @rm -f ascii_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_seek_OBJECTS) $(ascii_seek_LDADD) $(LIBS) ascii_seek_far$(EXEEXT): $(ascii_seek_far_OBJECTS) $(ascii_seek_far_DEPENDENCIES) $(EXTRA_ascii_seek_far_DEPENDENCIES) @rm -f ascii_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_seek_far_OBJECTS) $(ascii_seek_far_LDADD) $(LIBS) ascii_sync$(EXEEXT): $(ascii_sync_OBJECTS) $(ascii_sync_DEPENDENCIES) $(EXTRA_ascii_sync_DEPENDENCIES) @rm -f ascii_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ascii_sync_OBJECTS) $(ascii_sync_LDADD) $(LIBS) bof$(EXEEXT): $(bof_OBJECTS) $(bof_DEPENDENCIES) $(EXTRA_bof_DEPENDENCIES) @rm -f bof$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bof_OBJECTS) $(bof_LDADD) $(LIBS) bof_bit$(EXEEXT): $(bof_bit_OBJECTS) $(bof_bit_DEPENDENCIES) $(EXTRA_bof_bit_DEPENDENCIES) @rm -f bof_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bof_bit_OBJECTS) $(bof_bit_LDADD) $(LIBS) bof_index$(EXEEXT): $(bof_index_OBJECTS) $(bof_index_DEPENDENCIES) $(EXTRA_bof_index_DEPENDENCIES) @rm -f bof_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bof_index_OBJECTS) $(bof_index_LDADD) $(LIBS) bof_lincom$(EXEEXT): $(bof_lincom_OBJECTS) $(bof_lincom_DEPENDENCIES) $(EXTRA_bof_lincom_DEPENDENCIES) @rm -f bof_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bof_lincom_OBJECTS) $(bof_lincom_LDADD) $(LIBS) bof_phase$(EXEEXT): $(bof_phase_OBJECTS) $(bof_phase_DEPENDENCIES) $(EXTRA_bof_phase_DEPENDENCIES) @rm -f bof_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bof_phase_OBJECTS) $(bof_phase_LDADD) $(LIBS) bof_phase_neg$(EXEEXT): $(bof_phase_neg_OBJECTS) $(bof_phase_neg_DEPENDENCIES) $(EXTRA_bof_phase_neg_DEPENDENCIES) @rm -f bof_phase_neg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bof_phase_neg_OBJECTS) $(bof_phase_neg_LDADD) $(LIBS) bzip_add$(EXEEXT): $(bzip_add_OBJECTS) $(bzip_add_DEPENDENCIES) $(EXTRA_bzip_add_DEPENDENCIES) @rm -f bzip_add$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_add_OBJECTS) $(bzip_add_LDADD) $(LIBS) bzip_get$(EXEEXT): $(bzip_get_OBJECTS) $(bzip_get_DEPENDENCIES) $(EXTRA_bzip_get_DEPENDENCIES) @rm -f bzip_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_get_OBJECTS) $(bzip_get_LDADD) $(LIBS) bzip_get_far$(EXEEXT): $(bzip_get_far_OBJECTS) $(bzip_get_far_DEPENDENCIES) $(EXTRA_bzip_get_far_DEPENDENCIES) @rm -f bzip_get_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_get_far_OBJECTS) $(bzip_get_far_LDADD) $(LIBS) bzip_get_get$(EXEEXT): $(bzip_get_get_OBJECTS) $(bzip_get_get_DEPENDENCIES) $(EXTRA_bzip_get_get_DEPENDENCIES) @rm -f bzip_get_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_get_get_OBJECTS) $(bzip_get_get_LDADD) $(LIBS) bzip_get_get2$(EXEEXT): $(bzip_get_get2_OBJECTS) $(bzip_get_get2_DEPENDENCIES) $(EXTRA_bzip_get_get2_DEPENDENCIES) @rm -f bzip_get_get2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_get_get2_OBJECTS) $(bzip_get_get2_LDADD) $(LIBS) bzip_get_put$(EXEEXT): $(bzip_get_put_OBJECTS) $(bzip_get_put_DEPENDENCIES) $(EXTRA_bzip_get_put_DEPENDENCIES) @rm -f bzip_get_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_get_put_OBJECTS) $(bzip_get_put_LDADD) $(LIBS) bzip_move_from$(EXEEXT): $(bzip_move_from_OBJECTS) $(bzip_move_from_DEPENDENCIES) $(EXTRA_bzip_move_from_DEPENDENCIES) @rm -f bzip_move_from$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_move_from_OBJECTS) $(bzip_move_from_LDADD) $(LIBS) bzip_move_to$(EXEEXT): $(bzip_move_to_OBJECTS) $(bzip_move_to_DEPENDENCIES) $(EXTRA_bzip_move_to_DEPENDENCIES) @rm -f bzip_move_to$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_move_to_OBJECTS) $(bzip_move_to_LDADD) $(LIBS) bzip_nframes$(EXEEXT): $(bzip_nframes_OBJECTS) $(bzip_nframes_DEPENDENCIES) $(EXTRA_bzip_nframes_DEPENDENCIES) @rm -f bzip_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_nframes_OBJECTS) $(bzip_nframes_LDADD) $(LIBS) bzip_put$(EXEEXT): $(bzip_put_OBJECTS) $(bzip_put_DEPENDENCIES) $(EXTRA_bzip_put_DEPENDENCIES) @rm -f bzip_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_put_OBJECTS) $(bzip_put_LDADD) $(LIBS) bzip_put_back$(EXEEXT): $(bzip_put_back_OBJECTS) $(bzip_put_back_DEPENDENCIES) $(EXTRA_bzip_put_back_DEPENDENCIES) @rm -f bzip_put_back$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_put_back_OBJECTS) $(bzip_put_back_LDADD) $(LIBS) bzip_put_endian$(EXEEXT): $(bzip_put_endian_OBJECTS) $(bzip_put_endian_DEPENDENCIES) $(EXTRA_bzip_put_endian_DEPENDENCIES) @rm -f bzip_put_endian$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_put_endian_OBJECTS) $(bzip_put_endian_LDADD) $(LIBS) bzip_put_get$(EXEEXT): $(bzip_put_get_OBJECTS) $(bzip_put_get_DEPENDENCIES) $(EXTRA_bzip_put_get_DEPENDENCIES) @rm -f bzip_put_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_put_get_OBJECTS) $(bzip_put_get_LDADD) $(LIBS) bzip_put_pad$(EXEEXT): $(bzip_put_pad_OBJECTS) $(bzip_put_pad_DEPENDENCIES) $(EXTRA_bzip_put_pad_DEPENDENCIES) @rm -f bzip_put_pad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_put_pad_OBJECTS) $(bzip_put_pad_LDADD) $(LIBS) bzip_put_sub$(EXEEXT): $(bzip_put_sub_OBJECTS) $(bzip_put_sub_DEPENDENCIES) $(EXTRA_bzip_put_sub_DEPENDENCIES) @rm -f bzip_put_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_put_sub_OBJECTS) $(bzip_put_sub_LDADD) $(LIBS) bzip_seek$(EXEEXT): $(bzip_seek_OBJECTS) $(bzip_seek_DEPENDENCIES) $(EXTRA_bzip_seek_DEPENDENCIES) @rm -f bzip_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_seek_OBJECTS) $(bzip_seek_LDADD) $(LIBS) bzip_seek_far$(EXEEXT): $(bzip_seek_far_OBJECTS) $(bzip_seek_far_DEPENDENCIES) $(EXTRA_bzip_seek_far_DEPENDENCIES) @rm -f bzip_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_seek_far_OBJECTS) $(bzip_seek_far_LDADD) $(LIBS) bzip_sync$(EXEEXT): $(bzip_sync_OBJECTS) $(bzip_sync_DEPENDENCIES) $(EXTRA_bzip_sync_DEPENDENCIES) @rm -f bzip_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bzip_sync_OBJECTS) $(bzip_sync_LDADD) $(LIBS) close_bad$(EXEEXT): $(close_bad_OBJECTS) $(close_bad_DEPENDENCIES) $(EXTRA_close_bad_DEPENDENCIES) @rm -f close_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(close_bad_OBJECTS) $(close_bad_LDADD) $(LIBS) close_close$(EXEEXT): $(close_close_OBJECTS) $(close_close_DEPENDENCIES) $(EXTRA_close_close_DEPENDENCIES) @rm -f close_close$(EXEEXT) $(AM_V_CCLD)$(LINK) $(close_close_OBJECTS) $(close_close_LDADD) $(LIBS) close_discard$(EXEEXT): $(close_discard_OBJECTS) $(close_discard_DEPENDENCIES) $(EXTRA_close_discard_DEPENDENCIES) @rm -f close_discard$(EXEEXT) $(AM_V_CCLD)$(LINK) $(close_discard_OBJECTS) $(close_discard_LDADD) $(LIBS) close_null$(EXEEXT): $(close_null_OBJECTS) $(close_null_DEPENDENCIES) $(EXTRA_close_null_DEPENDENCIES) @rm -f close_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(close_null_OBJECTS) $(close_null_LDADD) $(LIBS) convert_complex128_complex64$(EXEEXT): $(convert_complex128_complex64_OBJECTS) $(convert_complex128_complex64_DEPENDENCIES) $(EXTRA_convert_complex128_complex64_DEPENDENCIES) @rm -f convert_complex128_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex128_complex64_OBJECTS) $(convert_complex128_complex64_LDADD) $(LIBS) convert_complex128_float64$(EXEEXT): $(convert_complex128_float64_OBJECTS) $(convert_complex128_float64_DEPENDENCIES) $(EXTRA_convert_complex128_float64_DEPENDENCIES) @rm -f convert_complex128_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex128_float64_OBJECTS) $(convert_complex128_float64_LDADD) $(LIBS) convert_complex128_int64$(EXEEXT): $(convert_complex128_int64_OBJECTS) $(convert_complex128_int64_DEPENDENCIES) $(EXTRA_convert_complex128_int64_DEPENDENCIES) @rm -f convert_complex128_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex128_int64_OBJECTS) $(convert_complex128_int64_LDADD) $(LIBS) convert_complex128_uint64$(EXEEXT): $(convert_complex128_uint64_OBJECTS) $(convert_complex128_uint64_DEPENDENCIES) $(EXTRA_convert_complex128_uint64_DEPENDENCIES) @rm -f convert_complex128_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex128_uint64_OBJECTS) $(convert_complex128_uint64_LDADD) $(LIBS) convert_complex64_complex128$(EXEEXT): $(convert_complex64_complex128_OBJECTS) $(convert_complex64_complex128_DEPENDENCIES) $(EXTRA_convert_complex64_complex128_DEPENDENCIES) @rm -f convert_complex64_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex64_complex128_OBJECTS) $(convert_complex64_complex128_LDADD) $(LIBS) convert_complex64_float64$(EXEEXT): $(convert_complex64_float64_OBJECTS) $(convert_complex64_float64_DEPENDENCIES) $(EXTRA_convert_complex64_float64_DEPENDENCIES) @rm -f convert_complex64_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex64_float64_OBJECTS) $(convert_complex64_float64_LDADD) $(LIBS) convert_complex64_int64$(EXEEXT): $(convert_complex64_int64_OBJECTS) $(convert_complex64_int64_DEPENDENCIES) $(EXTRA_convert_complex64_int64_DEPENDENCIES) @rm -f convert_complex64_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex64_int64_OBJECTS) $(convert_complex64_int64_LDADD) $(LIBS) convert_complex64_uint64$(EXEEXT): $(convert_complex64_uint64_OBJECTS) $(convert_complex64_uint64_DEPENDENCIES) $(EXTRA_convert_complex64_uint64_DEPENDENCIES) @rm -f convert_complex64_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_complex64_uint64_OBJECTS) $(convert_complex64_uint64_LDADD) $(LIBS) convert_float32_complex128$(EXEEXT): $(convert_float32_complex128_OBJECTS) $(convert_float32_complex128_DEPENDENCIES) $(EXTRA_convert_float32_complex128_DEPENDENCIES) @rm -f convert_float32_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_complex128_OBJECTS) $(convert_float32_complex128_LDADD) $(LIBS) convert_float32_complex64$(EXEEXT): $(convert_float32_complex64_OBJECTS) $(convert_float32_complex64_DEPENDENCIES) $(EXTRA_convert_float32_complex64_DEPENDENCIES) @rm -f convert_float32_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_complex64_OBJECTS) $(convert_float32_complex64_LDADD) $(LIBS) convert_float32_float64$(EXEEXT): $(convert_float32_float64_OBJECTS) $(convert_float32_float64_DEPENDENCIES) $(EXTRA_convert_float32_float64_DEPENDENCIES) @rm -f convert_float32_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_float64_OBJECTS) $(convert_float32_float64_LDADD) $(LIBS) convert_float32_int16$(EXEEXT): $(convert_float32_int16_OBJECTS) $(convert_float32_int16_DEPENDENCIES) $(EXTRA_convert_float32_int16_DEPENDENCIES) @rm -f convert_float32_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_int16_OBJECTS) $(convert_float32_int16_LDADD) $(LIBS) convert_float32_int32$(EXEEXT): $(convert_float32_int32_OBJECTS) $(convert_float32_int32_DEPENDENCIES) $(EXTRA_convert_float32_int32_DEPENDENCIES) @rm -f convert_float32_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_int32_OBJECTS) $(convert_float32_int32_LDADD) $(LIBS) convert_float32_int64$(EXEEXT): $(convert_float32_int64_OBJECTS) $(convert_float32_int64_DEPENDENCIES) $(EXTRA_convert_float32_int64_DEPENDENCIES) @rm -f convert_float32_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_int64_OBJECTS) $(convert_float32_int64_LDADD) $(LIBS) convert_float32_int8$(EXEEXT): $(convert_float32_int8_OBJECTS) $(convert_float32_int8_DEPENDENCIES) $(EXTRA_convert_float32_int8_DEPENDENCIES) @rm -f convert_float32_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_int8_OBJECTS) $(convert_float32_int8_LDADD) $(LIBS) convert_float32_uint16$(EXEEXT): $(convert_float32_uint16_OBJECTS) $(convert_float32_uint16_DEPENDENCIES) $(EXTRA_convert_float32_uint16_DEPENDENCIES) @rm -f convert_float32_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_uint16_OBJECTS) $(convert_float32_uint16_LDADD) $(LIBS) convert_float32_uint32$(EXEEXT): $(convert_float32_uint32_OBJECTS) $(convert_float32_uint32_DEPENDENCIES) $(EXTRA_convert_float32_uint32_DEPENDENCIES) @rm -f convert_float32_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_uint32_OBJECTS) $(convert_float32_uint32_LDADD) $(LIBS) convert_float32_uint64$(EXEEXT): $(convert_float32_uint64_OBJECTS) $(convert_float32_uint64_DEPENDENCIES) $(EXTRA_convert_float32_uint64_DEPENDENCIES) @rm -f convert_float32_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_uint64_OBJECTS) $(convert_float32_uint64_LDADD) $(LIBS) convert_float32_uint8$(EXEEXT): $(convert_float32_uint8_OBJECTS) $(convert_float32_uint8_DEPENDENCIES) $(EXTRA_convert_float32_uint8_DEPENDENCIES) @rm -f convert_float32_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float32_uint8_OBJECTS) $(convert_float32_uint8_LDADD) $(LIBS) convert_float64_complex128$(EXEEXT): $(convert_float64_complex128_OBJECTS) $(convert_float64_complex128_DEPENDENCIES) $(EXTRA_convert_float64_complex128_DEPENDENCIES) @rm -f convert_float64_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_complex128_OBJECTS) $(convert_float64_complex128_LDADD) $(LIBS) convert_float64_complex64$(EXEEXT): $(convert_float64_complex64_OBJECTS) $(convert_float64_complex64_DEPENDENCIES) $(EXTRA_convert_float64_complex64_DEPENDENCIES) @rm -f convert_float64_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_complex64_OBJECTS) $(convert_float64_complex64_LDADD) $(LIBS) convert_float64_float32$(EXEEXT): $(convert_float64_float32_OBJECTS) $(convert_float64_float32_DEPENDENCIES) $(EXTRA_convert_float64_float32_DEPENDENCIES) @rm -f convert_float64_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_float32_OBJECTS) $(convert_float64_float32_LDADD) $(LIBS) convert_float64_int16$(EXEEXT): $(convert_float64_int16_OBJECTS) $(convert_float64_int16_DEPENDENCIES) $(EXTRA_convert_float64_int16_DEPENDENCIES) @rm -f convert_float64_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_int16_OBJECTS) $(convert_float64_int16_LDADD) $(LIBS) convert_float64_int32$(EXEEXT): $(convert_float64_int32_OBJECTS) $(convert_float64_int32_DEPENDENCIES) $(EXTRA_convert_float64_int32_DEPENDENCIES) @rm -f convert_float64_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_int32_OBJECTS) $(convert_float64_int32_LDADD) $(LIBS) convert_float64_int64$(EXEEXT): $(convert_float64_int64_OBJECTS) $(convert_float64_int64_DEPENDENCIES) $(EXTRA_convert_float64_int64_DEPENDENCIES) @rm -f convert_float64_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_int64_OBJECTS) $(convert_float64_int64_LDADD) $(LIBS) convert_float64_int8$(EXEEXT): $(convert_float64_int8_OBJECTS) $(convert_float64_int8_DEPENDENCIES) $(EXTRA_convert_float64_int8_DEPENDENCIES) @rm -f convert_float64_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_int8_OBJECTS) $(convert_float64_int8_LDADD) $(LIBS) convert_float64_uint16$(EXEEXT): $(convert_float64_uint16_OBJECTS) $(convert_float64_uint16_DEPENDENCIES) $(EXTRA_convert_float64_uint16_DEPENDENCIES) @rm -f convert_float64_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_uint16_OBJECTS) $(convert_float64_uint16_LDADD) $(LIBS) convert_float64_uint32$(EXEEXT): $(convert_float64_uint32_OBJECTS) $(convert_float64_uint32_DEPENDENCIES) $(EXTRA_convert_float64_uint32_DEPENDENCIES) @rm -f convert_float64_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_uint32_OBJECTS) $(convert_float64_uint32_LDADD) $(LIBS) convert_float64_uint64$(EXEEXT): $(convert_float64_uint64_OBJECTS) $(convert_float64_uint64_DEPENDENCIES) $(EXTRA_convert_float64_uint64_DEPENDENCIES) @rm -f convert_float64_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_uint64_OBJECTS) $(convert_float64_uint64_LDADD) $(LIBS) convert_float64_uint8$(EXEEXT): $(convert_float64_uint8_OBJECTS) $(convert_float64_uint8_DEPENDENCIES) $(EXTRA_convert_float64_uint8_DEPENDENCIES) @rm -f convert_float64_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_float64_uint8_OBJECTS) $(convert_float64_uint8_LDADD) $(LIBS) convert_int16_complex128$(EXEEXT): $(convert_int16_complex128_OBJECTS) $(convert_int16_complex128_DEPENDENCIES) $(EXTRA_convert_int16_complex128_DEPENDENCIES) @rm -f convert_int16_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_complex128_OBJECTS) $(convert_int16_complex128_LDADD) $(LIBS) convert_int16_complex64$(EXEEXT): $(convert_int16_complex64_OBJECTS) $(convert_int16_complex64_DEPENDENCIES) $(EXTRA_convert_int16_complex64_DEPENDENCIES) @rm -f convert_int16_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_complex64_OBJECTS) $(convert_int16_complex64_LDADD) $(LIBS) convert_int16_float32$(EXEEXT): $(convert_int16_float32_OBJECTS) $(convert_int16_float32_DEPENDENCIES) $(EXTRA_convert_int16_float32_DEPENDENCIES) @rm -f convert_int16_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_float32_OBJECTS) $(convert_int16_float32_LDADD) $(LIBS) convert_int16_float64$(EXEEXT): $(convert_int16_float64_OBJECTS) $(convert_int16_float64_DEPENDENCIES) $(EXTRA_convert_int16_float64_DEPENDENCIES) @rm -f convert_int16_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_float64_OBJECTS) $(convert_int16_float64_LDADD) $(LIBS) convert_int16_int32$(EXEEXT): $(convert_int16_int32_OBJECTS) $(convert_int16_int32_DEPENDENCIES) $(EXTRA_convert_int16_int32_DEPENDENCIES) @rm -f convert_int16_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_int32_OBJECTS) $(convert_int16_int32_LDADD) $(LIBS) convert_int16_int64$(EXEEXT): $(convert_int16_int64_OBJECTS) $(convert_int16_int64_DEPENDENCIES) $(EXTRA_convert_int16_int64_DEPENDENCIES) @rm -f convert_int16_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_int64_OBJECTS) $(convert_int16_int64_LDADD) $(LIBS) convert_int16_int8$(EXEEXT): $(convert_int16_int8_OBJECTS) $(convert_int16_int8_DEPENDENCIES) $(EXTRA_convert_int16_int8_DEPENDENCIES) @rm -f convert_int16_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_int8_OBJECTS) $(convert_int16_int8_LDADD) $(LIBS) convert_int16_uint16$(EXEEXT): $(convert_int16_uint16_OBJECTS) $(convert_int16_uint16_DEPENDENCIES) $(EXTRA_convert_int16_uint16_DEPENDENCIES) @rm -f convert_int16_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_uint16_OBJECTS) $(convert_int16_uint16_LDADD) $(LIBS) convert_int16_uint32$(EXEEXT): $(convert_int16_uint32_OBJECTS) $(convert_int16_uint32_DEPENDENCIES) $(EXTRA_convert_int16_uint32_DEPENDENCIES) @rm -f convert_int16_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_uint32_OBJECTS) $(convert_int16_uint32_LDADD) $(LIBS) convert_int16_uint64$(EXEEXT): $(convert_int16_uint64_OBJECTS) $(convert_int16_uint64_DEPENDENCIES) $(EXTRA_convert_int16_uint64_DEPENDENCIES) @rm -f convert_int16_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_uint64_OBJECTS) $(convert_int16_uint64_LDADD) $(LIBS) convert_int16_uint8$(EXEEXT): $(convert_int16_uint8_OBJECTS) $(convert_int16_uint8_DEPENDENCIES) $(EXTRA_convert_int16_uint8_DEPENDENCIES) @rm -f convert_int16_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int16_uint8_OBJECTS) $(convert_int16_uint8_LDADD) $(LIBS) convert_int32_complex128$(EXEEXT): $(convert_int32_complex128_OBJECTS) $(convert_int32_complex128_DEPENDENCIES) $(EXTRA_convert_int32_complex128_DEPENDENCIES) @rm -f convert_int32_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_complex128_OBJECTS) $(convert_int32_complex128_LDADD) $(LIBS) convert_int32_complex64$(EXEEXT): $(convert_int32_complex64_OBJECTS) $(convert_int32_complex64_DEPENDENCIES) $(EXTRA_convert_int32_complex64_DEPENDENCIES) @rm -f convert_int32_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_complex64_OBJECTS) $(convert_int32_complex64_LDADD) $(LIBS) convert_int32_float32$(EXEEXT): $(convert_int32_float32_OBJECTS) $(convert_int32_float32_DEPENDENCIES) $(EXTRA_convert_int32_float32_DEPENDENCIES) @rm -f convert_int32_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_float32_OBJECTS) $(convert_int32_float32_LDADD) $(LIBS) convert_int32_float64$(EXEEXT): $(convert_int32_float64_OBJECTS) $(convert_int32_float64_DEPENDENCIES) $(EXTRA_convert_int32_float64_DEPENDENCIES) @rm -f convert_int32_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_float64_OBJECTS) $(convert_int32_float64_LDADD) $(LIBS) convert_int32_int16$(EXEEXT): $(convert_int32_int16_OBJECTS) $(convert_int32_int16_DEPENDENCIES) $(EXTRA_convert_int32_int16_DEPENDENCIES) @rm -f convert_int32_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_int16_OBJECTS) $(convert_int32_int16_LDADD) $(LIBS) convert_int32_int64$(EXEEXT): $(convert_int32_int64_OBJECTS) $(convert_int32_int64_DEPENDENCIES) $(EXTRA_convert_int32_int64_DEPENDENCIES) @rm -f convert_int32_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_int64_OBJECTS) $(convert_int32_int64_LDADD) $(LIBS) convert_int32_int8$(EXEEXT): $(convert_int32_int8_OBJECTS) $(convert_int32_int8_DEPENDENCIES) $(EXTRA_convert_int32_int8_DEPENDENCIES) @rm -f convert_int32_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_int8_OBJECTS) $(convert_int32_int8_LDADD) $(LIBS) convert_int32_uint16$(EXEEXT): $(convert_int32_uint16_OBJECTS) $(convert_int32_uint16_DEPENDENCIES) $(EXTRA_convert_int32_uint16_DEPENDENCIES) @rm -f convert_int32_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_uint16_OBJECTS) $(convert_int32_uint16_LDADD) $(LIBS) convert_int32_uint32$(EXEEXT): $(convert_int32_uint32_OBJECTS) $(convert_int32_uint32_DEPENDENCIES) $(EXTRA_convert_int32_uint32_DEPENDENCIES) @rm -f convert_int32_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_uint32_OBJECTS) $(convert_int32_uint32_LDADD) $(LIBS) convert_int32_uint64$(EXEEXT): $(convert_int32_uint64_OBJECTS) $(convert_int32_uint64_DEPENDENCIES) $(EXTRA_convert_int32_uint64_DEPENDENCIES) @rm -f convert_int32_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_uint64_OBJECTS) $(convert_int32_uint64_LDADD) $(LIBS) convert_int32_uint8$(EXEEXT): $(convert_int32_uint8_OBJECTS) $(convert_int32_uint8_DEPENDENCIES) $(EXTRA_convert_int32_uint8_DEPENDENCIES) @rm -f convert_int32_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int32_uint8_OBJECTS) $(convert_int32_uint8_LDADD) $(LIBS) convert_int64_complex128$(EXEEXT): $(convert_int64_complex128_OBJECTS) $(convert_int64_complex128_DEPENDENCIES) $(EXTRA_convert_int64_complex128_DEPENDENCIES) @rm -f convert_int64_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_complex128_OBJECTS) $(convert_int64_complex128_LDADD) $(LIBS) convert_int64_complex64$(EXEEXT): $(convert_int64_complex64_OBJECTS) $(convert_int64_complex64_DEPENDENCIES) $(EXTRA_convert_int64_complex64_DEPENDENCIES) @rm -f convert_int64_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_complex64_OBJECTS) $(convert_int64_complex64_LDADD) $(LIBS) convert_int64_float32$(EXEEXT): $(convert_int64_float32_OBJECTS) $(convert_int64_float32_DEPENDENCIES) $(EXTRA_convert_int64_float32_DEPENDENCIES) @rm -f convert_int64_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_float32_OBJECTS) $(convert_int64_float32_LDADD) $(LIBS) convert_int64_float64$(EXEEXT): $(convert_int64_float64_OBJECTS) $(convert_int64_float64_DEPENDENCIES) $(EXTRA_convert_int64_float64_DEPENDENCIES) @rm -f convert_int64_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_float64_OBJECTS) $(convert_int64_float64_LDADD) $(LIBS) convert_int64_int16$(EXEEXT): $(convert_int64_int16_OBJECTS) $(convert_int64_int16_DEPENDENCIES) $(EXTRA_convert_int64_int16_DEPENDENCIES) @rm -f convert_int64_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_int16_OBJECTS) $(convert_int64_int16_LDADD) $(LIBS) convert_int64_int32$(EXEEXT): $(convert_int64_int32_OBJECTS) $(convert_int64_int32_DEPENDENCIES) $(EXTRA_convert_int64_int32_DEPENDENCIES) @rm -f convert_int64_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_int32_OBJECTS) $(convert_int64_int32_LDADD) $(LIBS) convert_int64_int8$(EXEEXT): $(convert_int64_int8_OBJECTS) $(convert_int64_int8_DEPENDENCIES) $(EXTRA_convert_int64_int8_DEPENDENCIES) @rm -f convert_int64_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_int8_OBJECTS) $(convert_int64_int8_LDADD) $(LIBS) convert_int64_uint16$(EXEEXT): $(convert_int64_uint16_OBJECTS) $(convert_int64_uint16_DEPENDENCIES) $(EXTRA_convert_int64_uint16_DEPENDENCIES) @rm -f convert_int64_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_uint16_OBJECTS) $(convert_int64_uint16_LDADD) $(LIBS) convert_int64_uint32$(EXEEXT): $(convert_int64_uint32_OBJECTS) $(convert_int64_uint32_DEPENDENCIES) $(EXTRA_convert_int64_uint32_DEPENDENCIES) @rm -f convert_int64_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_uint32_OBJECTS) $(convert_int64_uint32_LDADD) $(LIBS) convert_int64_uint64$(EXEEXT): $(convert_int64_uint64_OBJECTS) $(convert_int64_uint64_DEPENDENCIES) $(EXTRA_convert_int64_uint64_DEPENDENCIES) @rm -f convert_int64_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_uint64_OBJECTS) $(convert_int64_uint64_LDADD) $(LIBS) convert_int64_uint8$(EXEEXT): $(convert_int64_uint8_OBJECTS) $(convert_int64_uint8_DEPENDENCIES) $(EXTRA_convert_int64_uint8_DEPENDENCIES) @rm -f convert_int64_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int64_uint8_OBJECTS) $(convert_int64_uint8_LDADD) $(LIBS) convert_int8_complex128$(EXEEXT): $(convert_int8_complex128_OBJECTS) $(convert_int8_complex128_DEPENDENCIES) $(EXTRA_convert_int8_complex128_DEPENDENCIES) @rm -f convert_int8_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_complex128_OBJECTS) $(convert_int8_complex128_LDADD) $(LIBS) convert_int8_complex64$(EXEEXT): $(convert_int8_complex64_OBJECTS) $(convert_int8_complex64_DEPENDENCIES) $(EXTRA_convert_int8_complex64_DEPENDENCIES) @rm -f convert_int8_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_complex64_OBJECTS) $(convert_int8_complex64_LDADD) $(LIBS) convert_int8_float32$(EXEEXT): $(convert_int8_float32_OBJECTS) $(convert_int8_float32_DEPENDENCIES) $(EXTRA_convert_int8_float32_DEPENDENCIES) @rm -f convert_int8_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_float32_OBJECTS) $(convert_int8_float32_LDADD) $(LIBS) convert_int8_float64$(EXEEXT): $(convert_int8_float64_OBJECTS) $(convert_int8_float64_DEPENDENCIES) $(EXTRA_convert_int8_float64_DEPENDENCIES) @rm -f convert_int8_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_float64_OBJECTS) $(convert_int8_float64_LDADD) $(LIBS) convert_int8_int16$(EXEEXT): $(convert_int8_int16_OBJECTS) $(convert_int8_int16_DEPENDENCIES) $(EXTRA_convert_int8_int16_DEPENDENCIES) @rm -f convert_int8_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_int16_OBJECTS) $(convert_int8_int16_LDADD) $(LIBS) convert_int8_int32$(EXEEXT): $(convert_int8_int32_OBJECTS) $(convert_int8_int32_DEPENDENCIES) $(EXTRA_convert_int8_int32_DEPENDENCIES) @rm -f convert_int8_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_int32_OBJECTS) $(convert_int8_int32_LDADD) $(LIBS) convert_int8_int64$(EXEEXT): $(convert_int8_int64_OBJECTS) $(convert_int8_int64_DEPENDENCIES) $(EXTRA_convert_int8_int64_DEPENDENCIES) @rm -f convert_int8_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_int64_OBJECTS) $(convert_int8_int64_LDADD) $(LIBS) convert_int8_uint16$(EXEEXT): $(convert_int8_uint16_OBJECTS) $(convert_int8_uint16_DEPENDENCIES) $(EXTRA_convert_int8_uint16_DEPENDENCIES) @rm -f convert_int8_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_uint16_OBJECTS) $(convert_int8_uint16_LDADD) $(LIBS) convert_int8_uint32$(EXEEXT): $(convert_int8_uint32_OBJECTS) $(convert_int8_uint32_DEPENDENCIES) $(EXTRA_convert_int8_uint32_DEPENDENCIES) @rm -f convert_int8_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_uint32_OBJECTS) $(convert_int8_uint32_LDADD) $(LIBS) convert_int8_uint64$(EXEEXT): $(convert_int8_uint64_OBJECTS) $(convert_int8_uint64_DEPENDENCIES) $(EXTRA_convert_int8_uint64_DEPENDENCIES) @rm -f convert_int8_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_uint64_OBJECTS) $(convert_int8_uint64_LDADD) $(LIBS) convert_int8_uint8$(EXEEXT): $(convert_int8_uint8_OBJECTS) $(convert_int8_uint8_DEPENDENCIES) $(EXTRA_convert_int8_uint8_DEPENDENCIES) @rm -f convert_int8_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_int8_uint8_OBJECTS) $(convert_int8_uint8_LDADD) $(LIBS) convert_uint16_complex128$(EXEEXT): $(convert_uint16_complex128_OBJECTS) $(convert_uint16_complex128_DEPENDENCIES) $(EXTRA_convert_uint16_complex128_DEPENDENCIES) @rm -f convert_uint16_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_complex128_OBJECTS) $(convert_uint16_complex128_LDADD) $(LIBS) convert_uint16_complex64$(EXEEXT): $(convert_uint16_complex64_OBJECTS) $(convert_uint16_complex64_DEPENDENCIES) $(EXTRA_convert_uint16_complex64_DEPENDENCIES) @rm -f convert_uint16_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_complex64_OBJECTS) $(convert_uint16_complex64_LDADD) $(LIBS) convert_uint16_float32$(EXEEXT): $(convert_uint16_float32_OBJECTS) $(convert_uint16_float32_DEPENDENCIES) $(EXTRA_convert_uint16_float32_DEPENDENCIES) @rm -f convert_uint16_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_float32_OBJECTS) $(convert_uint16_float32_LDADD) $(LIBS) convert_uint16_float64$(EXEEXT): $(convert_uint16_float64_OBJECTS) $(convert_uint16_float64_DEPENDENCIES) $(EXTRA_convert_uint16_float64_DEPENDENCIES) @rm -f convert_uint16_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_float64_OBJECTS) $(convert_uint16_float64_LDADD) $(LIBS) convert_uint16_int16$(EXEEXT): $(convert_uint16_int16_OBJECTS) $(convert_uint16_int16_DEPENDENCIES) $(EXTRA_convert_uint16_int16_DEPENDENCIES) @rm -f convert_uint16_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_int16_OBJECTS) $(convert_uint16_int16_LDADD) $(LIBS) convert_uint16_int32$(EXEEXT): $(convert_uint16_int32_OBJECTS) $(convert_uint16_int32_DEPENDENCIES) $(EXTRA_convert_uint16_int32_DEPENDENCIES) @rm -f convert_uint16_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_int32_OBJECTS) $(convert_uint16_int32_LDADD) $(LIBS) convert_uint16_int64$(EXEEXT): $(convert_uint16_int64_OBJECTS) $(convert_uint16_int64_DEPENDENCIES) $(EXTRA_convert_uint16_int64_DEPENDENCIES) @rm -f convert_uint16_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_int64_OBJECTS) $(convert_uint16_int64_LDADD) $(LIBS) convert_uint16_int8$(EXEEXT): $(convert_uint16_int8_OBJECTS) $(convert_uint16_int8_DEPENDENCIES) $(EXTRA_convert_uint16_int8_DEPENDENCIES) @rm -f convert_uint16_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_int8_OBJECTS) $(convert_uint16_int8_LDADD) $(LIBS) convert_uint16_uint32$(EXEEXT): $(convert_uint16_uint32_OBJECTS) $(convert_uint16_uint32_DEPENDENCIES) $(EXTRA_convert_uint16_uint32_DEPENDENCIES) @rm -f convert_uint16_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_uint32_OBJECTS) $(convert_uint16_uint32_LDADD) $(LIBS) convert_uint16_uint64$(EXEEXT): $(convert_uint16_uint64_OBJECTS) $(convert_uint16_uint64_DEPENDENCIES) $(EXTRA_convert_uint16_uint64_DEPENDENCIES) @rm -f convert_uint16_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_uint64_OBJECTS) $(convert_uint16_uint64_LDADD) $(LIBS) convert_uint16_uint8$(EXEEXT): $(convert_uint16_uint8_OBJECTS) $(convert_uint16_uint8_DEPENDENCIES) $(EXTRA_convert_uint16_uint8_DEPENDENCIES) @rm -f convert_uint16_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint16_uint8_OBJECTS) $(convert_uint16_uint8_LDADD) $(LIBS) convert_uint32_complex128$(EXEEXT): $(convert_uint32_complex128_OBJECTS) $(convert_uint32_complex128_DEPENDENCIES) $(EXTRA_convert_uint32_complex128_DEPENDENCIES) @rm -f convert_uint32_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_complex128_OBJECTS) $(convert_uint32_complex128_LDADD) $(LIBS) convert_uint32_complex64$(EXEEXT): $(convert_uint32_complex64_OBJECTS) $(convert_uint32_complex64_DEPENDENCIES) $(EXTRA_convert_uint32_complex64_DEPENDENCIES) @rm -f convert_uint32_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_complex64_OBJECTS) $(convert_uint32_complex64_LDADD) $(LIBS) convert_uint32_float32$(EXEEXT): $(convert_uint32_float32_OBJECTS) $(convert_uint32_float32_DEPENDENCIES) $(EXTRA_convert_uint32_float32_DEPENDENCIES) @rm -f convert_uint32_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_float32_OBJECTS) $(convert_uint32_float32_LDADD) $(LIBS) convert_uint32_float64$(EXEEXT): $(convert_uint32_float64_OBJECTS) $(convert_uint32_float64_DEPENDENCIES) $(EXTRA_convert_uint32_float64_DEPENDENCIES) @rm -f convert_uint32_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_float64_OBJECTS) $(convert_uint32_float64_LDADD) $(LIBS) convert_uint32_int16$(EXEEXT): $(convert_uint32_int16_OBJECTS) $(convert_uint32_int16_DEPENDENCIES) $(EXTRA_convert_uint32_int16_DEPENDENCIES) @rm -f convert_uint32_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_int16_OBJECTS) $(convert_uint32_int16_LDADD) $(LIBS) convert_uint32_int32$(EXEEXT): $(convert_uint32_int32_OBJECTS) $(convert_uint32_int32_DEPENDENCIES) $(EXTRA_convert_uint32_int32_DEPENDENCIES) @rm -f convert_uint32_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_int32_OBJECTS) $(convert_uint32_int32_LDADD) $(LIBS) convert_uint32_int64$(EXEEXT): $(convert_uint32_int64_OBJECTS) $(convert_uint32_int64_DEPENDENCIES) $(EXTRA_convert_uint32_int64_DEPENDENCIES) @rm -f convert_uint32_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_int64_OBJECTS) $(convert_uint32_int64_LDADD) $(LIBS) convert_uint32_int8$(EXEEXT): $(convert_uint32_int8_OBJECTS) $(convert_uint32_int8_DEPENDENCIES) $(EXTRA_convert_uint32_int8_DEPENDENCIES) @rm -f convert_uint32_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_int8_OBJECTS) $(convert_uint32_int8_LDADD) $(LIBS) convert_uint32_uint16$(EXEEXT): $(convert_uint32_uint16_OBJECTS) $(convert_uint32_uint16_DEPENDENCIES) $(EXTRA_convert_uint32_uint16_DEPENDENCIES) @rm -f convert_uint32_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_uint16_OBJECTS) $(convert_uint32_uint16_LDADD) $(LIBS) convert_uint32_uint64$(EXEEXT): $(convert_uint32_uint64_OBJECTS) $(convert_uint32_uint64_DEPENDENCIES) $(EXTRA_convert_uint32_uint64_DEPENDENCIES) @rm -f convert_uint32_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_uint64_OBJECTS) $(convert_uint32_uint64_LDADD) $(LIBS) convert_uint32_uint8$(EXEEXT): $(convert_uint32_uint8_OBJECTS) $(convert_uint32_uint8_DEPENDENCIES) $(EXTRA_convert_uint32_uint8_DEPENDENCIES) @rm -f convert_uint32_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint32_uint8_OBJECTS) $(convert_uint32_uint8_LDADD) $(LIBS) convert_uint64_complex128$(EXEEXT): $(convert_uint64_complex128_OBJECTS) $(convert_uint64_complex128_DEPENDENCIES) $(EXTRA_convert_uint64_complex128_DEPENDENCIES) @rm -f convert_uint64_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_complex128_OBJECTS) $(convert_uint64_complex128_LDADD) $(LIBS) convert_uint64_complex64$(EXEEXT): $(convert_uint64_complex64_OBJECTS) $(convert_uint64_complex64_DEPENDENCIES) $(EXTRA_convert_uint64_complex64_DEPENDENCIES) @rm -f convert_uint64_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_complex64_OBJECTS) $(convert_uint64_complex64_LDADD) $(LIBS) convert_uint64_float32$(EXEEXT): $(convert_uint64_float32_OBJECTS) $(convert_uint64_float32_DEPENDENCIES) $(EXTRA_convert_uint64_float32_DEPENDENCIES) @rm -f convert_uint64_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_float32_OBJECTS) $(convert_uint64_float32_LDADD) $(LIBS) convert_uint64_float64$(EXEEXT): $(convert_uint64_float64_OBJECTS) $(convert_uint64_float64_DEPENDENCIES) $(EXTRA_convert_uint64_float64_DEPENDENCIES) @rm -f convert_uint64_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_float64_OBJECTS) $(convert_uint64_float64_LDADD) $(LIBS) convert_uint64_int16$(EXEEXT): $(convert_uint64_int16_OBJECTS) $(convert_uint64_int16_DEPENDENCIES) $(EXTRA_convert_uint64_int16_DEPENDENCIES) @rm -f convert_uint64_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_int16_OBJECTS) $(convert_uint64_int16_LDADD) $(LIBS) convert_uint64_int32$(EXEEXT): $(convert_uint64_int32_OBJECTS) $(convert_uint64_int32_DEPENDENCIES) $(EXTRA_convert_uint64_int32_DEPENDENCIES) @rm -f convert_uint64_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_int32_OBJECTS) $(convert_uint64_int32_LDADD) $(LIBS) convert_uint64_int64$(EXEEXT): $(convert_uint64_int64_OBJECTS) $(convert_uint64_int64_DEPENDENCIES) $(EXTRA_convert_uint64_int64_DEPENDENCIES) @rm -f convert_uint64_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_int64_OBJECTS) $(convert_uint64_int64_LDADD) $(LIBS) convert_uint64_int8$(EXEEXT): $(convert_uint64_int8_OBJECTS) $(convert_uint64_int8_DEPENDENCIES) $(EXTRA_convert_uint64_int8_DEPENDENCIES) @rm -f convert_uint64_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_int8_OBJECTS) $(convert_uint64_int8_LDADD) $(LIBS) convert_uint64_uint16$(EXEEXT): $(convert_uint64_uint16_OBJECTS) $(convert_uint64_uint16_DEPENDENCIES) $(EXTRA_convert_uint64_uint16_DEPENDENCIES) @rm -f convert_uint64_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_uint16_OBJECTS) $(convert_uint64_uint16_LDADD) $(LIBS) convert_uint64_uint32$(EXEEXT): $(convert_uint64_uint32_OBJECTS) $(convert_uint64_uint32_DEPENDENCIES) $(EXTRA_convert_uint64_uint32_DEPENDENCIES) @rm -f convert_uint64_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_uint32_OBJECTS) $(convert_uint64_uint32_LDADD) $(LIBS) convert_uint64_uint8$(EXEEXT): $(convert_uint64_uint8_OBJECTS) $(convert_uint64_uint8_DEPENDENCIES) $(EXTRA_convert_uint64_uint8_DEPENDENCIES) @rm -f convert_uint64_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint64_uint8_OBJECTS) $(convert_uint64_uint8_LDADD) $(LIBS) convert_uint8_complex128$(EXEEXT): $(convert_uint8_complex128_OBJECTS) $(convert_uint8_complex128_DEPENDENCIES) $(EXTRA_convert_uint8_complex128_DEPENDENCIES) @rm -f convert_uint8_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_complex128_OBJECTS) $(convert_uint8_complex128_LDADD) $(LIBS) convert_uint8_complex64$(EXEEXT): $(convert_uint8_complex64_OBJECTS) $(convert_uint8_complex64_DEPENDENCIES) $(EXTRA_convert_uint8_complex64_DEPENDENCIES) @rm -f convert_uint8_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_complex64_OBJECTS) $(convert_uint8_complex64_LDADD) $(LIBS) convert_uint8_float32$(EXEEXT): $(convert_uint8_float32_OBJECTS) $(convert_uint8_float32_DEPENDENCIES) $(EXTRA_convert_uint8_float32_DEPENDENCIES) @rm -f convert_uint8_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_float32_OBJECTS) $(convert_uint8_float32_LDADD) $(LIBS) convert_uint8_float64$(EXEEXT): $(convert_uint8_float64_OBJECTS) $(convert_uint8_float64_DEPENDENCIES) $(EXTRA_convert_uint8_float64_DEPENDENCIES) @rm -f convert_uint8_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_float64_OBJECTS) $(convert_uint8_float64_LDADD) $(LIBS) convert_uint8_int16$(EXEEXT): $(convert_uint8_int16_OBJECTS) $(convert_uint8_int16_DEPENDENCIES) $(EXTRA_convert_uint8_int16_DEPENDENCIES) @rm -f convert_uint8_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_int16_OBJECTS) $(convert_uint8_int16_LDADD) $(LIBS) convert_uint8_int32$(EXEEXT): $(convert_uint8_int32_OBJECTS) $(convert_uint8_int32_DEPENDENCIES) $(EXTRA_convert_uint8_int32_DEPENDENCIES) @rm -f convert_uint8_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_int32_OBJECTS) $(convert_uint8_int32_LDADD) $(LIBS) convert_uint8_int64$(EXEEXT): $(convert_uint8_int64_OBJECTS) $(convert_uint8_int64_DEPENDENCIES) $(EXTRA_convert_uint8_int64_DEPENDENCIES) @rm -f convert_uint8_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_int64_OBJECTS) $(convert_uint8_int64_LDADD) $(LIBS) convert_uint8_int8$(EXEEXT): $(convert_uint8_int8_OBJECTS) $(convert_uint8_int8_DEPENDENCIES) $(EXTRA_convert_uint8_int8_DEPENDENCIES) @rm -f convert_uint8_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_int8_OBJECTS) $(convert_uint8_int8_LDADD) $(LIBS) convert_uint8_uint16$(EXEEXT): $(convert_uint8_uint16_OBJECTS) $(convert_uint8_uint16_DEPENDENCIES) $(EXTRA_convert_uint8_uint16_DEPENDENCIES) @rm -f convert_uint8_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_uint16_OBJECTS) $(convert_uint8_uint16_LDADD) $(LIBS) convert_uint8_uint32$(EXEEXT): $(convert_uint8_uint32_OBJECTS) $(convert_uint8_uint32_DEPENDENCIES) $(EXTRA_convert_uint8_uint32_DEPENDENCIES) @rm -f convert_uint8_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_uint32_OBJECTS) $(convert_uint8_uint32_LDADD) $(LIBS) convert_uint8_uint64$(EXEEXT): $(convert_uint8_uint64_OBJECTS) $(convert_uint8_uint64_DEPENDENCIES) $(EXTRA_convert_uint8_uint64_DEPENDENCIES) @rm -f convert_uint8_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(convert_uint8_uint64_OBJECTS) $(convert_uint8_uint64_LDADD) $(LIBS) creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIES) @rm -f creat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) creat_excl$(EXEEXT): $(creat_excl_OBJECTS) $(creat_excl_DEPENDENCIES) $(EXTRA_creat_excl_DEPENDENCIES) @rm -f creat_excl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_excl_OBJECTS) $(creat_excl_LDADD) $(LIBS) creat_rdonly$(EXEEXT): $(creat_rdonly_OBJECTS) $(creat_rdonly_DEPENDENCIES) $(EXTRA_creat_rdonly_DEPENDENCIES) @rm -f creat_rdonly$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_rdonly_OBJECTS) $(creat_rdonly_LDADD) $(LIBS) creat_rdonly_exists$(EXEEXT): $(creat_rdonly_exists_OBJECTS) $(creat_rdonly_exists_DEPENDENCIES) $(EXTRA_creat_rdonly_exists_DEPENDENCIES) @rm -f creat_rdonly_exists$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_rdonly_exists_OBJECTS) $(creat_rdonly_exists_LDADD) $(LIBS) cvlist$(EXEEXT): $(cvlist_OBJECTS) $(cvlist_DEPENDENCIES) $(EXTRA_cvlist_DEPENDENCIES) @rm -f cvlist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_OBJECTS) $(cvlist_LDADD) $(LIBS) cvlist_array$(EXEEXT): $(cvlist_array_OBJECTS) $(cvlist_array_DEPENDENCIES) $(EXTRA_cvlist_array_DEPENDENCIES) @rm -f cvlist_array$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_OBJECTS) $(cvlist_array_LDADD) $(LIBS) cvlist_array0$(EXEEXT): $(cvlist_array0_OBJECTS) $(cvlist_array0_DEPENDENCIES) $(EXTRA_cvlist_array0_DEPENDENCIES) @rm -f cvlist_array0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array0_OBJECTS) $(cvlist_array0_LDADD) $(LIBS) cvlist_array_free$(EXEEXT): $(cvlist_array_free_OBJECTS) $(cvlist_array_free_DEPENDENCIES) $(EXTRA_cvlist_array_free_DEPENDENCIES) @rm -f cvlist_array_free$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_free_OBJECTS) $(cvlist_array_free_LDADD) $(LIBS) cvlist_array_hidden$(EXEEXT): $(cvlist_array_hidden_OBJECTS) $(cvlist_array_hidden_DEPENDENCIES) $(EXTRA_cvlist_array_hidden_DEPENDENCIES) @rm -f cvlist_array_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_hidden_OBJECTS) $(cvlist_array_hidden_LDADD) $(LIBS) cvlist_array_meta$(EXEEXT): $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_DEPENDENCIES) $(EXTRA_cvlist_array_meta_DEPENDENCIES) @rm -f cvlist_array_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_meta_OBJECTS) $(cvlist_array_meta_LDADD) $(LIBS) cvlist_array_meta0$(EXEEXT): $(cvlist_array_meta0_OBJECTS) $(cvlist_array_meta0_DEPENDENCIES) $(EXTRA_cvlist_array_meta0_DEPENDENCIES) @rm -f cvlist_array_meta0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_meta0_OBJECTS) $(cvlist_array_meta0_LDADD) $(LIBS) cvlist_array_meta_free$(EXEEXT): $(cvlist_array_meta_free_OBJECTS) $(cvlist_array_meta_free_DEPENDENCIES) $(EXTRA_cvlist_array_meta_free_DEPENDENCIES) @rm -f cvlist_array_meta_free$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_meta_free_OBJECTS) $(cvlist_array_meta_free_LDADD) $(LIBS) cvlist_array_meta_hidden$(EXEEXT): $(cvlist_array_meta_hidden_OBJECTS) $(cvlist_array_meta_hidden_DEPENDENCIES) $(EXTRA_cvlist_array_meta_hidden_DEPENDENCIES) @rm -f cvlist_array_meta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_array_meta_hidden_OBJECTS) $(cvlist_array_meta_hidden_LDADD) $(LIBS) cvlist_hidden$(EXEEXT): $(cvlist_hidden_OBJECTS) $(cvlist_hidden_DEPENDENCIES) $(EXTRA_cvlist_hidden_DEPENDENCIES) @rm -f cvlist_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_hidden_OBJECTS) $(cvlist_hidden_LDADD) $(LIBS) cvlist_invalid$(EXEEXT): $(cvlist_invalid_OBJECTS) $(cvlist_invalid_DEPENDENCIES) $(EXTRA_cvlist_invalid_DEPENDENCIES) @rm -f cvlist_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_invalid_OBJECTS) $(cvlist_invalid_LDADD) $(LIBS) cvlist_meta$(EXEEXT): $(cvlist_meta_OBJECTS) $(cvlist_meta_DEPENDENCIES) $(EXTRA_cvlist_meta_DEPENDENCIES) @rm -f cvlist_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_meta_OBJECTS) $(cvlist_meta_LDADD) $(LIBS) cvlist_meta0$(EXEEXT): $(cvlist_meta0_OBJECTS) $(cvlist_meta0_DEPENDENCIES) $(EXTRA_cvlist_meta0_DEPENDENCIES) @rm -f cvlist_meta0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_meta0_OBJECTS) $(cvlist_meta0_LDADD) $(LIBS) cvlist_meta_hidden$(EXEEXT): $(cvlist_meta_hidden_OBJECTS) $(cvlist_meta_hidden_DEPENDENCIES) $(EXTRA_cvlist_meta_hidden_DEPENDENCIES) @rm -f cvlist_meta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_meta_hidden_OBJECTS) $(cvlist_meta_hidden_LDADD) $(LIBS) cvlist_meta_invalid$(EXEEXT): $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_DEPENDENCIES) $(EXTRA_cvlist_meta_invalid_DEPENDENCIES) @rm -f cvlist_meta_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(cvlist_meta_invalid_OBJECTS) $(cvlist_meta_invalid_LDADD) $(LIBS) del_alias$(EXEEXT): $(del_alias_OBJECTS) $(del_alias_DEPENDENCIES) $(EXTRA_del_alias_DEPENDENCIES) @rm -f del_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_alias_OBJECTS) $(del_alias_LDADD) $(LIBS) del_carray$(EXEEXT): $(del_carray_OBJECTS) $(del_carray_DEPENDENCIES) $(EXTRA_del_carray_DEPENDENCIES) @rm -f del_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_carray_OBJECTS) $(del_carray_LDADD) $(LIBS) del_carray_deref$(EXEEXT): $(del_carray_deref_OBJECTS) $(del_carray_deref_DEPENDENCIES) $(EXTRA_del_carray_deref_DEPENDENCIES) @rm -f del_carray_deref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_carray_deref_OBJECTS) $(del_carray_deref_LDADD) $(LIBS) del_const$(EXEEXT): $(del_const_OBJECTS) $(del_const_DEPENDENCIES) $(EXTRA_del_const_DEPENDENCIES) @rm -f del_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_const_OBJECTS) $(del_const_LDADD) $(LIBS) del_const_deref$(EXEEXT): $(del_const_deref_OBJECTS) $(del_const_deref_DEPENDENCIES) $(EXTRA_del_const_deref_DEPENDENCIES) @rm -f del_const_deref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_const_deref_OBJECTS) $(del_const_deref_LDADD) $(LIBS) del_const_force$(EXEEXT): $(del_const_force_OBJECTS) $(del_const_force_DEPENDENCIES) $(EXTRA_del_const_force_DEPENDENCIES) @rm -f del_const_force$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_const_force_OBJECTS) $(del_const_force_LDADD) $(LIBS) del_data$(EXEEXT): $(del_data_OBJECTS) $(del_data_DEPENDENCIES) $(EXTRA_del_data_DEPENDENCIES) @rm -f del_data$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_data_OBJECTS) $(del_data_LDADD) $(LIBS) del_data_enoent$(EXEEXT): $(del_data_enoent_OBJECTS) $(del_data_enoent_DEPENDENCIES) $(EXTRA_del_data_enoent_DEPENDENCIES) @rm -f del_data_enoent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_data_enoent_OBJECTS) $(del_data_enoent_LDADD) $(LIBS) del_data_open$(EXEEXT): $(del_data_open_OBJECTS) $(del_data_open_DEPENDENCIES) $(EXTRA_del_data_open_DEPENDENCIES) @rm -f del_data_open$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_data_open_OBJECTS) $(del_data_open_LDADD) $(LIBS) del_del$(EXEEXT): $(del_del_OBJECTS) $(del_del_DEPENDENCIES) $(EXTRA_del_del_DEPENDENCIES) @rm -f del_del$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_del_OBJECTS) $(del_del_LDADD) $(LIBS) del_derived$(EXEEXT): $(del_derived_OBJECTS) $(del_derived_DEPENDENCIES) $(EXTRA_del_derived_DEPENDENCIES) @rm -f del_derived$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_derived_OBJECTS) $(del_derived_LDADD) $(LIBS) del_derived_after$(EXEEXT): $(del_derived_after_OBJECTS) $(del_derived_after_DEPENDENCIES) $(EXTRA_del_derived_after_DEPENDENCIES) @rm -f del_derived_after$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_derived_after_OBJECTS) $(del_derived_after_LDADD) $(LIBS) del_derived_force$(EXEEXT): $(del_derived_force_OBJECTS) $(del_derived_force_DEPENDENCIES) $(EXTRA_del_derived_force_DEPENDENCIES) @rm -f del_derived_force$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_derived_force_OBJECTS) $(del_derived_force_LDADD) $(LIBS) del_meta$(EXEEXT): $(del_meta_OBJECTS) $(del_meta_DEPENDENCIES) $(EXTRA_del_meta_DEPENDENCIES) @rm -f del_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_meta_OBJECTS) $(del_meta_LDADD) $(LIBS) del_meta_force$(EXEEXT): $(del_meta_force_OBJECTS) $(del_meta_force_DEPENDENCIES) $(EXTRA_del_meta_force_DEPENDENCIES) @rm -f del_meta_force$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_meta_force_OBJECTS) $(del_meta_force_LDADD) $(LIBS) del_ref$(EXEEXT): $(del_ref_OBJECTS) $(del_ref_DEPENDENCIES) $(EXTRA_del_ref_DEPENDENCIES) @rm -f del_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(del_ref_OBJECTS) $(del_ref_LDADD) $(LIBS) desync$(EXEEXT): $(desync_OBJECTS) $(desync_DEPENDENCIES) $(EXTRA_desync_DEPENDENCIES) @rm -f desync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(desync_OBJECTS) $(desync_LDADD) $(LIBS) desync_flush$(EXEEXT): $(desync_flush_OBJECTS) $(desync_flush_DEPENDENCIES) $(EXTRA_desync_flush_DEPENDENCIES) @rm -f desync_flush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(desync_flush_OBJECTS) $(desync_flush_LDADD) $(LIBS) desync_path$(EXEEXT): $(desync_path_OBJECTS) $(desync_path_DEPENDENCIES) $(EXTRA_desync_path_DEPENDENCIES) @rm -f desync_path$(EXEEXT) $(AM_V_CCLD)$(LINK) $(desync_path_OBJECTS) $(desync_path_LDADD) $(LIBS) desync_reopen$(EXEEXT): $(desync_reopen_OBJECTS) $(desync_reopen_DEPENDENCIES) $(EXTRA_desync_reopen_DEPENDENCIES) @rm -f desync_reopen$(EXEEXT) $(AM_V_CCLD)$(LINK) $(desync_reopen_OBJECTS) $(desync_reopen_LDADD) $(LIBS) desync_reopen_inv$(EXEEXT): $(desync_reopen_inv_OBJECTS) $(desync_reopen_inv_DEPENDENCIES) $(EXTRA_desync_reopen_inv_DEPENDENCIES) @rm -f desync_reopen_inv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(desync_reopen_inv_OBJECTS) $(desync_reopen_inv_LDADD) $(LIBS) dfes_bit$(EXEEXT): $(dfes_bit_OBJECTS) $(dfes_bit_DEPENDENCIES) $(EXTRA_dfes_bit_DEPENDENCIES) @rm -f dfes_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_bit_OBJECTS) $(dfes_bit_LDADD) $(LIBS) dfes_divide$(EXEEXT): $(dfes_divide_OBJECTS) $(dfes_divide_DEPENDENCIES) $(EXTRA_dfes_divide_DEPENDENCIES) @rm -f dfes_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_divide_OBJECTS) $(dfes_divide_LDADD) $(LIBS) dfes_lincom$(EXEEXT): $(dfes_lincom_OBJECTS) $(dfes_lincom_DEPENDENCIES) $(EXTRA_dfes_lincom_DEPENDENCIES) @rm -f dfes_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_lincom_OBJECTS) $(dfes_lincom_LDADD) $(LIBS) dfes_linterp$(EXEEXT): $(dfes_linterp_OBJECTS) $(dfes_linterp_DEPENDENCIES) $(EXTRA_dfes_linterp_DEPENDENCIES) @rm -f dfes_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_linterp_OBJECTS) $(dfes_linterp_LDADD) $(LIBS) dfes_multiply$(EXEEXT): $(dfes_multiply_OBJECTS) $(dfes_multiply_DEPENDENCIES) $(EXTRA_dfes_multiply_DEPENDENCIES) @rm -f dfes_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_multiply_OBJECTS) $(dfes_multiply_LDADD) $(LIBS) dfes_null$(EXEEXT): $(dfes_null_OBJECTS) $(dfes_null_DEPENDENCIES) $(EXTRA_dfes_null_DEPENDENCIES) @rm -f dfes_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_null_OBJECTS) $(dfes_null_LDADD) $(LIBS) dfes_phase$(EXEEXT): $(dfes_phase_OBJECTS) $(dfes_phase_DEPENDENCIES) $(EXTRA_dfes_phase_DEPENDENCIES) @rm -f dfes_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_phase_OBJECTS) $(dfes_phase_LDADD) $(LIBS) dfes_raw$(EXEEXT): $(dfes_raw_OBJECTS) $(dfes_raw_DEPENDENCIES) $(EXTRA_dfes_raw_DEPENDENCIES) @rm -f dfes_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_raw_OBJECTS) $(dfes_raw_LDADD) $(LIBS) dfes_recip$(EXEEXT): $(dfes_recip_OBJECTS) $(dfes_recip_DEPENDENCIES) $(EXTRA_dfes_recip_DEPENDENCIES) @rm -f dfes_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_recip_OBJECTS) $(dfes_recip_LDADD) $(LIBS) dfes_zero$(EXEEXT): $(dfes_zero_OBJECTS) $(dfes_zero_DEPENDENCIES) $(EXTRA_dfes_zero_DEPENDENCIES) @rm -f dfes_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dfes_zero_OBJECTS) $(dfes_zero_LDADD) $(LIBS) elist_alias$(EXEEXT): $(elist_alias_OBJECTS) $(elist_alias_DEPENDENCIES) $(EXTRA_elist_alias_DEPENDENCIES) @rm -f elist_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(elist_alias_OBJECTS) $(elist_alias_LDADD) $(LIBS) elist_hidden$(EXEEXT): $(elist_hidden_OBJECTS) $(elist_hidden_DEPENDENCIES) $(EXTRA_elist_hidden_DEPENDENCIES) @rm -f elist_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(elist_hidden_OBJECTS) $(elist_hidden_LDADD) $(LIBS) elist_noalias$(EXEEXT): $(elist_noalias_OBJECTS) $(elist_noalias_DEPENDENCIES) $(EXTRA_elist_noalias_DEPENDENCIES) @rm -f elist_noalias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(elist_noalias_OBJECTS) $(elist_noalias_LDADD) $(LIBS) elist_scalar$(EXEEXT): $(elist_scalar_OBJECTS) $(elist_scalar_DEPENDENCIES) $(EXTRA_elist_scalar_DEPENDENCIES) @rm -f elist_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(elist_scalar_OBJECTS) $(elist_scalar_LDADD) $(LIBS) encode_alter$(EXEEXT): $(encode_alter_OBJECTS) $(encode_alter_DEPENDENCIES) $(EXTRA_encode_alter_DEPENDENCIES) @rm -f encode_alter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_alter_OBJECTS) $(encode_alter_LDADD) $(LIBS) encode_alter_all$(EXEEXT): $(encode_alter_all_OBJECTS) $(encode_alter_all_DEPENDENCIES) $(EXTRA_encode_alter_all_DEPENDENCIES) @rm -f encode_alter_all$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_alter_all_OBJECTS) $(encode_alter_all_LDADD) $(LIBS) encode_alter_open$(EXEEXT): $(encode_alter_open_OBJECTS) $(encode_alter_open_DEPENDENCIES) $(EXTRA_encode_alter_open_DEPENDENCIES) @rm -f encode_alter_open$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_alter_open_OBJECTS) $(encode_alter_open_LDADD) $(LIBS) encode_get$(EXEEXT): $(encode_get_OBJECTS) $(encode_get_DEPENDENCIES) $(EXTRA_encode_get_DEPENDENCIES) @rm -f encode_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_get_OBJECTS) $(encode_get_LDADD) $(LIBS) encode_recode$(EXEEXT): $(encode_recode_OBJECTS) $(encode_recode_DEPENDENCIES) $(EXTRA_encode_recode_DEPENDENCIES) @rm -f encode_recode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_recode_OBJECTS) $(encode_recode_LDADD) $(LIBS) encode_recode_open$(EXEEXT): $(encode_recode_open_OBJECTS) $(encode_recode_open_DEPENDENCIES) $(EXTRA_encode_recode_open_DEPENDENCIES) @rm -f encode_recode_open$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_recode_open_OBJECTS) $(encode_recode_open_LDADD) $(LIBS) encode_support$(EXEEXT): $(encode_support_OBJECTS) $(encode_support_DEPENDENCIES) $(EXTRA_encode_support_DEPENDENCIES) @rm -f encode_support$(EXEEXT) $(AM_V_CCLD)$(LINK) $(encode_support_OBJECTS) $(encode_support_LDADD) $(LIBS) endian_alter$(EXEEXT): $(endian_alter_OBJECTS) $(endian_alter_DEPENDENCIES) $(EXTRA_endian_alter_DEPENDENCIES) @rm -f endian_alter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(endian_alter_OBJECTS) $(endian_alter_LDADD) $(LIBS) endian_alter_all$(EXEEXT): $(endian_alter_all_OBJECTS) $(endian_alter_all_DEPENDENCIES) $(EXTRA_endian_alter_all_DEPENDENCIES) @rm -f endian_alter_all$(EXEEXT) $(AM_V_CCLD)$(LINK) $(endian_alter_all_OBJECTS) $(endian_alter_all_LDADD) $(LIBS) endian_alter_sie$(EXEEXT): $(endian_alter_sie_OBJECTS) $(endian_alter_sie_DEPENDENCIES) $(EXTRA_endian_alter_sie_DEPENDENCIES) @rm -f endian_alter_sie$(EXEEXT) $(AM_V_CCLD)$(LINK) $(endian_alter_sie_OBJECTS) $(endian_alter_sie_LDADD) $(LIBS) endian_get$(EXEEXT): $(endian_get_OBJECTS) $(endian_get_DEPENDENCIES) $(EXTRA_endian_get_DEPENDENCIES) @rm -f endian_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(endian_get_OBJECTS) $(endian_get_LDADD) $(LIBS) endian_move$(EXEEXT): $(endian_move_OBJECTS) $(endian_move_DEPENDENCIES) $(EXTRA_endian_move_DEPENDENCIES) @rm -f endian_move$(EXEEXT) $(AM_V_CCLD)$(LINK) $(endian_move_OBJECTS) $(endian_move_LDADD) $(LIBS) entry_bad_code$(EXEEXT): $(entry_bad_code_OBJECTS) $(entry_bad_code_DEPENDENCIES) $(EXTRA_entry_bad_code_DEPENDENCIES) @rm -f entry_bad_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_bad_code_OBJECTS) $(entry_bad_code_LDADD) $(LIBS) entry_bit$(EXEEXT): $(entry_bit_OBJECTS) $(entry_bit_DEPENDENCIES) $(EXTRA_entry_bit_DEPENDENCIES) @rm -f entry_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_bit_OBJECTS) $(entry_bit_LDADD) $(LIBS) entry_bit_scalar$(EXEEXT): $(entry_bit_scalar_OBJECTS) $(entry_bit_scalar_DEPENDENCIES) $(EXTRA_entry_bit_scalar_DEPENDENCIES) @rm -f entry_bit_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_bit_scalar_OBJECTS) $(entry_bit_scalar_LDADD) $(LIBS) entry_divide$(EXEEXT): $(entry_divide_OBJECTS) $(entry_divide_DEPENDENCIES) $(EXTRA_entry_divide_DEPENDENCIES) @rm -f entry_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_divide_OBJECTS) $(entry_divide_LDADD) $(LIBS) entry_invalid$(EXEEXT): $(entry_invalid_OBJECTS) $(entry_invalid_DEPENDENCIES) $(EXTRA_entry_invalid_DEPENDENCIES) @rm -f entry_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_invalid_OBJECTS) $(entry_invalid_LDADD) $(LIBS) entry_lincom$(EXEEXT): $(entry_lincom_OBJECTS) $(entry_lincom_DEPENDENCIES) $(EXTRA_entry_lincom_DEPENDENCIES) @rm -f entry_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_lincom_OBJECTS) $(entry_lincom_LDADD) $(LIBS) entry_lincom_scalar$(EXEEXT): $(entry_lincom_scalar_OBJECTS) $(entry_lincom_scalar_DEPENDENCIES) $(EXTRA_entry_lincom_scalar_DEPENDENCIES) @rm -f entry_lincom_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_lincom_scalar_OBJECTS) $(entry_lincom_scalar_LDADD) $(LIBS) entry_linterp$(EXEEXT): $(entry_linterp_OBJECTS) $(entry_linterp_DEPENDENCIES) $(EXTRA_entry_linterp_DEPENDENCIES) @rm -f entry_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_linterp_OBJECTS) $(entry_linterp_LDADD) $(LIBS) entry_mplex$(EXEEXT): $(entry_mplex_OBJECTS) $(entry_mplex_DEPENDENCIES) $(EXTRA_entry_mplex_DEPENDENCIES) @rm -f entry_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_mplex_OBJECTS) $(entry_mplex_LDADD) $(LIBS) entry_mplex_scalar$(EXEEXT): $(entry_mplex_scalar_OBJECTS) $(entry_mplex_scalar_DEPENDENCIES) $(EXTRA_entry_mplex_scalar_DEPENDENCIES) @rm -f entry_mplex_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_mplex_scalar_OBJECTS) $(entry_mplex_scalar_LDADD) $(LIBS) entry_multiply$(EXEEXT): $(entry_multiply_OBJECTS) $(entry_multiply_DEPENDENCIES) $(EXTRA_entry_multiply_DEPENDENCIES) @rm -f entry_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_multiply_OBJECTS) $(entry_multiply_LDADD) $(LIBS) entry_phase$(EXEEXT): $(entry_phase_OBJECTS) $(entry_phase_DEPENDENCIES) $(EXTRA_entry_phase_DEPENDENCIES) @rm -f entry_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_phase_OBJECTS) $(entry_phase_LDADD) $(LIBS) entry_phase_scalar$(EXEEXT): $(entry_phase_scalar_OBJECTS) $(entry_phase_scalar_DEPENDENCIES) $(EXTRA_entry_phase_scalar_DEPENDENCIES) @rm -f entry_phase_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_phase_scalar_OBJECTS) $(entry_phase_scalar_LDADD) $(LIBS) entry_polynom$(EXEEXT): $(entry_polynom_OBJECTS) $(entry_polynom_DEPENDENCIES) $(EXTRA_entry_polynom_DEPENDENCIES) @rm -f entry_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_polynom_OBJECTS) $(entry_polynom_LDADD) $(LIBS) entry_polynom_scalar$(EXEEXT): $(entry_polynom_scalar_OBJECTS) $(entry_polynom_scalar_DEPENDENCIES) $(EXTRA_entry_polynom_scalar_DEPENDENCIES) @rm -f entry_polynom_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_polynom_scalar_OBJECTS) $(entry_polynom_scalar_LDADD) $(LIBS) entry_raw$(EXEEXT): $(entry_raw_OBJECTS) $(entry_raw_DEPENDENCIES) $(EXTRA_entry_raw_DEPENDENCIES) @rm -f entry_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_raw_OBJECTS) $(entry_raw_LDADD) $(LIBS) entry_raw_scalar$(EXEEXT): $(entry_raw_scalar_OBJECTS) $(entry_raw_scalar_DEPENDENCIES) $(EXTRA_entry_raw_scalar_DEPENDENCIES) @rm -f entry_raw_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_raw_scalar_OBJECTS) $(entry_raw_scalar_LDADD) $(LIBS) entry_raw_scalar_code$(EXEEXT): $(entry_raw_scalar_code_OBJECTS) $(entry_raw_scalar_code_DEPENDENCIES) $(EXTRA_entry_raw_scalar_code_DEPENDENCIES) @rm -f entry_raw_scalar_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_raw_scalar_code_OBJECTS) $(entry_raw_scalar_code_LDADD) $(LIBS) entry_raw_scalar_type$(EXEEXT): $(entry_raw_scalar_type_OBJECTS) $(entry_raw_scalar_type_DEPENDENCIES) $(EXTRA_entry_raw_scalar_type_DEPENDENCIES) @rm -f entry_raw_scalar_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_raw_scalar_type_OBJECTS) $(entry_raw_scalar_type_LDADD) $(LIBS) entry_recip$(EXEEXT): $(entry_recip_OBJECTS) $(entry_recip_DEPENDENCIES) $(EXTRA_entry_recip_DEPENDENCIES) @rm -f entry_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_recip_OBJECTS) $(entry_recip_LDADD) $(LIBS) entry_scalar_repr$(EXEEXT): $(entry_scalar_repr_OBJECTS) $(entry_scalar_repr_DEPENDENCIES) $(EXTRA_entry_scalar_repr_DEPENDENCIES) @rm -f entry_scalar_repr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_scalar_repr_OBJECTS) $(entry_scalar_repr_LDADD) $(LIBS) entry_type$(EXEEXT): $(entry_type_OBJECTS) $(entry_type_DEPENDENCIES) $(EXTRA_entry_type_DEPENDENCIES) @rm -f entry_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_type_OBJECTS) $(entry_type_LDADD) $(LIBS) entry_type_alias$(EXEEXT): $(entry_type_alias_OBJECTS) $(entry_type_alias_DEPENDENCIES) $(EXTRA_entry_type_alias_DEPENDENCIES) @rm -f entry_type_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_type_alias_OBJECTS) $(entry_type_alias_LDADD) $(LIBS) entry_window$(EXEEXT): $(entry_window_OBJECTS) $(entry_window_DEPENDENCIES) $(EXTRA_entry_window_DEPENDENCIES) @rm -f entry_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_window_OBJECTS) $(entry_window_LDADD) $(LIBS) entry_window_scalar$(EXEEXT): $(entry_window_scalar_OBJECTS) $(entry_window_scalar_DEPENDENCIES) $(EXTRA_entry_window_scalar_DEPENDENCIES) @rm -f entry_window_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(entry_window_scalar_OBJECTS) $(entry_window_scalar_LDADD) $(LIBS) eof$(EXEEXT): $(eof_OBJECTS) $(eof_DEPENDENCIES) $(EXTRA_eof_DEPENDENCIES) @rm -f eof$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eof_OBJECTS) $(eof_LDADD) $(LIBS) eof_bit$(EXEEXT): $(eof_bit_OBJECTS) $(eof_bit_DEPENDENCIES) $(EXTRA_eof_bit_DEPENDENCIES) @rm -f eof_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eof_bit_OBJECTS) $(eof_bit_LDADD) $(LIBS) eof_index$(EXEEXT): $(eof_index_OBJECTS) $(eof_index_DEPENDENCIES) $(EXTRA_eof_index_DEPENDENCIES) @rm -f eof_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eof_index_OBJECTS) $(eof_index_LDADD) $(LIBS) eof_lincom$(EXEEXT): $(eof_lincom_OBJECTS) $(eof_lincom_DEPENDENCIES) $(EXTRA_eof_lincom_DEPENDENCIES) @rm -f eof_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eof_lincom_OBJECTS) $(eof_lincom_LDADD) $(LIBS) eof_phase$(EXEEXT): $(eof_phase_OBJECTS) $(eof_phase_DEPENDENCIES) $(EXTRA_eof_phase_DEPENDENCIES) @rm -f eof_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eof_phase_OBJECTS) $(eof_phase_LDADD) $(LIBS) eof_phase_neg$(EXEEXT): $(eof_phase_neg_OBJECTS) $(eof_phase_neg_DEPENDENCIES) $(EXTRA_eof_phase_neg_DEPENDENCIES) @rm -f eof_phase_neg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eof_phase_neg_OBJECTS) $(eof_phase_neg_LDADD) $(LIBS) error$(EXEEXT): $(error_OBJECTS) $(error_DEPENDENCIES) $(EXTRA_error_DEPENDENCIES) @rm -f error$(EXEEXT) $(AM_V_CCLD)$(LINK) $(error_OBJECTS) $(error_LDADD) $(LIBS) error_error$(EXEEXT): $(error_error_OBJECTS) $(error_error_DEPENDENCIES) $(EXTRA_error_error_DEPENDENCIES) @rm -f error_error$(EXEEXT) $(AM_V_CCLD)$(LINK) $(error_error_OBJECTS) $(error_error_LDADD) $(LIBS) error_num$(EXEEXT): $(error_num_OBJECTS) $(error_num_DEPENDENCIES) $(EXTRA_error_num_DEPENDENCIES) @rm -f error_num$(EXEEXT) $(AM_V_CCLD)$(LINK) $(error_num_OBJECTS) $(error_num_LDADD) $(LIBS) error_short$(EXEEXT): $(error_short_OBJECTS) $(error_short_DEPENDENCIES) $(EXTRA_error_short_DEPENDENCIES) @rm -f error_short$(EXEEXT) $(AM_V_CCLD)$(LINK) $(error_short_OBJECTS) $(error_short_LDADD) $(LIBS) error_verbose$(EXEEXT): $(error_verbose_OBJECTS) $(error_verbose_DEPENDENCIES) $(EXTRA_error_verbose_DEPENDENCIES) @rm -f error_verbose$(EXEEXT) $(AM_V_CCLD)$(LINK) $(error_verbose_OBJECTS) $(error_verbose_LDADD) $(LIBS) error_verbose_prefix$(EXEEXT): $(error_verbose_prefix_OBJECTS) $(error_verbose_prefix_DEPENDENCIES) $(EXTRA_error_verbose_prefix_DEPENDENCIES) @rm -f error_verbose_prefix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(error_verbose_prefix_OBJECTS) $(error_verbose_prefix_LDADD) $(LIBS) file$(EXEEXT): $(file_OBJECTS) $(file_DEPENDENCIES) $(EXTRA_file_DEPENDENCIES) @rm -f file$(EXEEXT) $(AM_V_CCLD)$(LINK) $(file_OBJECTS) $(file_LDADD) $(LIBS) file_code$(EXEEXT): $(file_code_OBJECTS) $(file_code_DEPENDENCIES) $(EXTRA_file_code_DEPENDENCIES) @rm -f file_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(file_code_OBJECTS) $(file_code_LDADD) $(LIBS) file_type$(EXEEXT): $(file_type_OBJECTS) $(file_type_DEPENDENCIES) $(EXTRA_file_type_DEPENDENCIES) @rm -f file_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(file_type_OBJECTS) $(file_type_LDADD) $(LIBS) flac_add$(EXEEXT): $(flac_add_OBJECTS) $(flac_add_DEPENDENCIES) $(EXTRA_flac_add_DEPENDENCIES) @rm -f flac_add$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_add_OBJECTS) $(flac_add_LDADD) $(LIBS) flac_get_big$(EXEEXT): $(flac_get_big_OBJECTS) $(flac_get_big_DEPENDENCIES) $(EXTRA_flac_get_big_DEPENDENCIES) @rm -f flac_get_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_get_big_OBJECTS) $(flac_get_big_LDADD) $(LIBS) flac_get_far$(EXEEXT): $(flac_get_far_OBJECTS) $(flac_get_far_DEPENDENCIES) $(EXTRA_flac_get_far_DEPENDENCIES) @rm -f flac_get_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_get_far_OBJECTS) $(flac_get_far_LDADD) $(LIBS) flac_get_get$(EXEEXT): $(flac_get_get_OBJECTS) $(flac_get_get_DEPENDENCIES) $(EXTRA_flac_get_get_DEPENDENCIES) @rm -f flac_get_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_get_get_OBJECTS) $(flac_get_get_LDADD) $(LIBS) flac_get_get2$(EXEEXT): $(flac_get_get2_OBJECTS) $(flac_get_get2_DEPENDENCIES) $(EXTRA_flac_get_get2_DEPENDENCIES) @rm -f flac_get_get2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_get_get2_OBJECTS) $(flac_get_get2_LDADD) $(LIBS) flac_get_little$(EXEEXT): $(flac_get_little_OBJECTS) $(flac_get_little_DEPENDENCIES) $(EXTRA_flac_get_little_DEPENDENCIES) @rm -f flac_get_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_get_little_OBJECTS) $(flac_get_little_LDADD) $(LIBS) flac_nframes$(EXEEXT): $(flac_nframes_OBJECTS) $(flac_nframes_DEPENDENCIES) $(EXTRA_flac_nframes_DEPENDENCIES) @rm -f flac_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_nframes_OBJECTS) $(flac_nframes_LDADD) $(LIBS) flac_put_big$(EXEEXT): $(flac_put_big_OBJECTS) $(flac_put_big_DEPENDENCIES) $(EXTRA_flac_put_big_DEPENDENCIES) @rm -f flac_put_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_put_big_OBJECTS) $(flac_put_big_LDADD) $(LIBS) flac_put_complex128$(EXEEXT): $(flac_put_complex128_OBJECTS) $(flac_put_complex128_DEPENDENCIES) $(EXTRA_flac_put_complex128_DEPENDENCIES) @rm -f flac_put_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_put_complex128_OBJECTS) $(flac_put_complex128_LDADD) $(LIBS) flac_put_float64$(EXEEXT): $(flac_put_float64_OBJECTS) $(flac_put_float64_DEPENDENCIES) $(EXTRA_flac_put_float64_DEPENDENCIES) @rm -f flac_put_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_put_float64_OBJECTS) $(flac_put_float64_LDADD) $(LIBS) flac_put_int32$(EXEEXT): $(flac_put_int32_OBJECTS) $(flac_put_int32_DEPENDENCIES) $(EXTRA_flac_put_int32_DEPENDENCIES) @rm -f flac_put_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_put_int32_OBJECTS) $(flac_put_int32_LDADD) $(LIBS) flac_put_little$(EXEEXT): $(flac_put_little_OBJECTS) $(flac_put_little_DEPENDENCIES) $(EXTRA_flac_put_little_DEPENDENCIES) @rm -f flac_put_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_put_little_OBJECTS) $(flac_put_little_LDADD) $(LIBS) flac_seek$(EXEEXT): $(flac_seek_OBJECTS) $(flac_seek_DEPENDENCIES) $(EXTRA_flac_seek_DEPENDENCIES) @rm -f flac_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_seek_OBJECTS) $(flac_seek_LDADD) $(LIBS) flac_seek_far$(EXEEXT): $(flac_seek_far_OBJECTS) $(flac_seek_far_DEPENDENCIES) $(EXTRA_flac_seek_far_DEPENDENCIES) @rm -f flac_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_seek_far_OBJECTS) $(flac_seek_far_LDADD) $(LIBS) flac_sync$(EXEEXT): $(flac_sync_OBJECTS) $(flac_sync_DEPENDENCIES) $(EXTRA_flac_sync_DEPENDENCIES) @rm -f flac_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flac_sync_OBJECTS) $(flac_sync_LDADD) $(LIBS) flist$(EXEEXT): $(flist_OBJECTS) $(flist_DEPENDENCIES) $(EXTRA_flist_DEPENDENCIES) @rm -f flist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_OBJECTS) $(flist_LDADD) $(LIBS) flist0$(EXEEXT): $(flist0_OBJECTS) $(flist0_DEPENDENCIES) $(EXTRA_flist0_DEPENDENCIES) @rm -f flist0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist0_OBJECTS) $(flist0_LDADD) $(LIBS) flist2$(EXEEXT): $(flist2_OBJECTS) $(flist2_DEPENDENCIES) $(EXTRA_flist2_DEPENDENCIES) @rm -f flist2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist2_OBJECTS) $(flist2_LDADD) $(LIBS) flist_hidden$(EXEEXT): $(flist_hidden_OBJECTS) $(flist_hidden_DEPENDENCIES) $(EXTRA_flist_hidden_DEPENDENCIES) @rm -f flist_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_hidden_OBJECTS) $(flist_hidden_LDADD) $(LIBS) flist_invalid$(EXEEXT): $(flist_invalid_OBJECTS) $(flist_invalid_DEPENDENCIES) $(EXTRA_flist_invalid_DEPENDENCIES) @rm -f flist_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_invalid_OBJECTS) $(flist_invalid_LDADD) $(LIBS) flist_meta$(EXEEXT): $(flist_meta_OBJECTS) $(flist_meta_DEPENDENCIES) $(EXTRA_flist_meta_DEPENDENCIES) @rm -f flist_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_meta_OBJECTS) $(flist_meta_LDADD) $(LIBS) flist_meta2$(EXEEXT): $(flist_meta2_OBJECTS) $(flist_meta2_DEPENDENCIES) $(EXTRA_flist_meta2_DEPENDENCIES) @rm -f flist_meta2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_meta2_OBJECTS) $(flist_meta2_LDADD) $(LIBS) flist_meta_hidden$(EXEEXT): $(flist_meta_hidden_OBJECTS) $(flist_meta_hidden_DEPENDENCIES) $(EXTRA_flist_meta_hidden_DEPENDENCIES) @rm -f flist_meta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_meta_hidden_OBJECTS) $(flist_meta_hidden_LDADD) $(LIBS) flist_meta_invalid$(EXEEXT): $(flist_meta_invalid_OBJECTS) $(flist_meta_invalid_DEPENDENCIES) $(EXTRA_flist_meta_invalid_DEPENDENCIES) @rm -f flist_meta_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_meta_invalid_OBJECTS) $(flist_meta_invalid_LDADD) $(LIBS) flist_type$(EXEEXT): $(flist_type_OBJECTS) $(flist_type_DEPENDENCIES) $(EXTRA_flist_type_DEPENDENCIES) @rm -f flist_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_type_OBJECTS) $(flist_type_LDADD) $(LIBS) flist_type_hidden$(EXEEXT): $(flist_type_hidden_OBJECTS) $(flist_type_hidden_DEPENDENCIES) $(EXTRA_flist_type_hidden_DEPENDENCIES) @rm -f flist_type_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_type_hidden_OBJECTS) $(flist_type_hidden_LDADD) $(LIBS) flist_type_invalid$(EXEEXT): $(flist_type_invalid_OBJECTS) $(flist_type_invalid_DEPENDENCIES) $(EXTRA_flist_type_invalid_DEPENDENCIES) @rm -f flist_type_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_type_invalid_OBJECTS) $(flist_type_invalid_LDADD) $(LIBS) flist_type_meta$(EXEEXT): $(flist_type_meta_OBJECTS) $(flist_type_meta_DEPENDENCIES) $(EXTRA_flist_type_meta_DEPENDENCIES) @rm -f flist_type_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_type_meta_OBJECTS) $(flist_type_meta_LDADD) $(LIBS) flist_type_meta_hidden$(EXEEXT): $(flist_type_meta_hidden_OBJECTS) $(flist_type_meta_hidden_DEPENDENCIES) $(EXTRA_flist_type_meta_hidden_DEPENDENCIES) @rm -f flist_type_meta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_type_meta_hidden_OBJECTS) $(flist_type_meta_hidden_LDADD) $(LIBS) flist_type_meta_invalid$(EXEEXT): $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_DEPENDENCIES) $(EXTRA_flist_type_meta_invalid_DEPENDENCIES) @rm -f flist_type_meta_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flist_type_meta_invalid_OBJECTS) $(flist_type_meta_invalid_LDADD) $(LIBS) flush_all$(EXEEXT): $(flush_all_OBJECTS) $(flush_all_DEPENDENCIES) $(EXTRA_flush_all_DEPENDENCIES) @rm -f flush_all$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_all_OBJECTS) $(flush_all_LDADD) $(LIBS) flush_amb_code$(EXEEXT): $(flush_amb_code_OBJECTS) $(flush_amb_code_DEPENDENCIES) $(EXTRA_flush_amb_code_DEPENDENCIES) @rm -f flush_amb_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_amb_code_OBJECTS) $(flush_amb_code_LDADD) $(LIBS) flush_bad_code$(EXEEXT): $(flush_bad_code_OBJECTS) $(flush_bad_code_DEPENDENCIES) $(EXTRA_flush_bad_code_DEPENDENCIES) @rm -f flush_bad_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_bad_code_OBJECTS) $(flush_bad_code_LDADD) $(LIBS) flush_flush$(EXEEXT): $(flush_flush_OBJECTS) $(flush_flush_DEPENDENCIES) $(EXTRA_flush_flush_DEPENDENCIES) @rm -f flush_flush$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_flush_OBJECTS) $(flush_flush_LDADD) $(LIBS) flush_hex$(EXEEXT): $(flush_hex_OBJECTS) $(flush_hex_DEPENDENCIES) $(EXTRA_flush_hex_DEPENDENCIES) @rm -f flush_hex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_hex_OBJECTS) $(flush_hex_LDADD) $(LIBS) flush_invalid$(EXEEXT): $(flush_invalid_OBJECTS) $(flush_invalid_DEPENDENCIES) $(EXTRA_flush_invalid_DEPENDENCIES) @rm -f flush_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_invalid_OBJECTS) $(flush_invalid_LDADD) $(LIBS) flush_lincom$(EXEEXT): $(flush_lincom_OBJECTS) $(flush_lincom_DEPENDENCIES) $(EXTRA_flush_lincom_DEPENDENCIES) @rm -f flush_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_lincom_OBJECTS) $(flush_lincom_LDADD) $(LIBS) flush_lincom1$(EXEEXT): $(flush_lincom1_OBJECTS) $(flush_lincom1_DEPENDENCIES) $(EXTRA_flush_lincom1_DEPENDENCIES) @rm -f flush_lincom1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_lincom1_OBJECTS) $(flush_lincom1_LDADD) $(LIBS) flush_meta$(EXEEXT): $(flush_meta_OBJECTS) $(flush_meta_DEPENDENCIES) $(EXTRA_flush_meta_DEPENDENCIES) @rm -f flush_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_meta_OBJECTS) $(flush_meta_LDADD) $(LIBS) flush_mult$(EXEEXT): $(flush_mult_OBJECTS) $(flush_mult_DEPENDENCIES) $(EXTRA_flush_mult_DEPENDENCIES) @rm -f flush_mult$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_mult_OBJECTS) $(flush_mult_LDADD) $(LIBS) flush_raw_close$(EXEEXT): $(flush_raw_close_OBJECTS) $(flush_raw_close_DEPENDENCIES) $(EXTRA_flush_raw_close_DEPENDENCIES) @rm -f flush_raw_close$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_raw_close_OBJECTS) $(flush_raw_close_LDADD) $(LIBS) flush_ref$(EXEEXT): $(flush_ref_OBJECTS) $(flush_ref_DEPENDENCIES) $(EXTRA_flush_ref_DEPENDENCIES) @rm -f flush_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_ref_OBJECTS) $(flush_ref_LDADD) $(LIBS) flush_spec$(EXEEXT): $(flush_spec_OBJECTS) $(flush_spec_DEPENDENCIES) $(EXTRA_flush_spec_DEPENDENCIES) @rm -f flush_spec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_spec_OBJECTS) $(flush_spec_LDADD) $(LIBS) flush_string$(EXEEXT): $(flush_string_OBJECTS) $(flush_string_DEPENDENCIES) $(EXTRA_flush_string_DEPENDENCIES) @rm -f flush_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_string_OBJECTS) $(flush_string_LDADD) $(LIBS) flush_sync$(EXEEXT): $(flush_sync_OBJECTS) $(flush_sync_DEPENDENCIES) $(EXTRA_flush_sync_DEPENDENCIES) @rm -f flush_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(flush_sync_OBJECTS) $(flush_sync_LDADD) $(LIBS) foffs_alter$(EXEEXT): $(foffs_alter_OBJECTS) $(foffs_alter_DEPENDENCIES) $(EXTRA_foffs_alter_DEPENDENCIES) @rm -f foffs_alter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(foffs_alter_OBJECTS) $(foffs_alter_LDADD) $(LIBS) foffs_alter_all$(EXEEXT): $(foffs_alter_all_OBJECTS) $(foffs_alter_all_DEPENDENCIES) $(EXTRA_foffs_alter_all_DEPENDENCIES) @rm -f foffs_alter_all$(EXEEXT) $(AM_V_CCLD)$(LINK) $(foffs_alter_all_OBJECTS) $(foffs_alter_all_LDADD) $(LIBS) foffs_get$(EXEEXT): $(foffs_get_OBJECTS) $(foffs_get_DEPENDENCIES) $(EXTRA_foffs_get_DEPENDENCIES) @rm -f foffs_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(foffs_get_OBJECTS) $(foffs_get_LDADD) $(LIBS) foffs_move$(EXEEXT): $(foffs_move_OBJECTS) $(foffs_move_DEPENDENCIES) $(EXTRA_foffs_move_DEPENDENCIES) @rm -f foffs_move$(EXEEXT) $(AM_V_CCLD)$(LINK) $(foffs_move_OBJECTS) $(foffs_move_LDADD) $(LIBS) fragment_affix$(EXEEXT): $(fragment_affix_OBJECTS) $(fragment_affix_DEPENDENCIES) $(EXTRA_fragment_affix_DEPENDENCIES) @rm -f fragment_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_affix_OBJECTS) $(fragment_affix_LDADD) $(LIBS) fragment_affix_alter$(EXEEXT): $(fragment_affix_alter_OBJECTS) $(fragment_affix_alter_DEPENDENCIES) $(EXTRA_fragment_affix_alter_DEPENDENCIES) @rm -f fragment_affix_alter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_affix_alter_OBJECTS) $(fragment_affix_alter_LDADD) $(LIBS) fragment_affix_alter2$(EXEEXT): $(fragment_affix_alter2_OBJECTS) $(fragment_affix_alter2_DEPENDENCIES) $(EXTRA_fragment_affix_alter2_DEPENDENCIES) @rm -f fragment_affix_alter2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_affix_alter2_OBJECTS) $(fragment_affix_alter2_LDADD) $(LIBS) fragment_affix_alter_code$(EXEEXT): $(fragment_affix_alter_code_OBJECTS) $(fragment_affix_alter_code_DEPENDENCIES) $(EXTRA_fragment_affix_alter_code_DEPENDENCIES) @rm -f fragment_affix_alter_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_affix_alter_code_OBJECTS) $(fragment_affix_alter_code_LDADD) $(LIBS) fragment_affix_alter_nop$(EXEEXT): $(fragment_affix_alter_nop_OBJECTS) $(fragment_affix_alter_nop_DEPENDENCIES) $(EXTRA_fragment_affix_alter_nop_DEPENDENCIES) @rm -f fragment_affix_alter_nop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_affix_alter_nop_OBJECTS) $(fragment_affix_alter_nop_LDADD) $(LIBS) fragment_affix_dup$(EXEEXT): $(fragment_affix_dup_OBJECTS) $(fragment_affix_dup_DEPENDENCIES) $(EXTRA_fragment_affix_dup_DEPENDENCIES) @rm -f fragment_affix_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_affix_dup_OBJECTS) $(fragment_affix_dup_LDADD) $(LIBS) fragment_index$(EXEEXT): $(fragment_index_OBJECTS) $(fragment_index_DEPENDENCIES) $(EXTRA_fragment_index_DEPENDENCIES) @rm -f fragment_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_index_OBJECTS) $(fragment_index_LDADD) $(LIBS) fragment_index_alias$(EXEEXT): $(fragment_index_alias_OBJECTS) $(fragment_index_alias_DEPENDENCIES) $(EXTRA_fragment_index_alias_DEPENDENCIES) @rm -f fragment_index_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_index_alias_OBJECTS) $(fragment_index_alias_LDADD) $(LIBS) fragment_name$(EXEEXT): $(fragment_name_OBJECTS) $(fragment_name_DEPENDENCIES) $(EXTRA_fragment_name_DEPENDENCIES) @rm -f fragment_name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_name_OBJECTS) $(fragment_name_LDADD) $(LIBS) fragment_name_oor$(EXEEXT): $(fragment_name_oor_OBJECTS) $(fragment_name_oor_DEPENDENCIES) $(EXTRA_fragment_name_oor_DEPENDENCIES) @rm -f fragment_name_oor$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_name_oor_OBJECTS) $(fragment_name_oor_LDADD) $(LIBS) fragment_num$(EXEEXT): $(fragment_num_OBJECTS) $(fragment_num_DEPENDENCIES) $(EXTRA_fragment_num_DEPENDENCIES) @rm -f fragment_num$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_num_OBJECTS) $(fragment_num_LDADD) $(LIBS) fragment_parent$(EXEEXT): $(fragment_parent_OBJECTS) $(fragment_parent_DEPENDENCIES) $(EXTRA_fragment_parent_DEPENDENCIES) @rm -f fragment_parent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fragment_parent_OBJECTS) $(fragment_parent_LDADD) $(LIBS) get64$(EXEEXT): $(get64_OBJECTS) $(get64_DEPENDENCIES) $(EXTRA_get64_DEPENDENCIES) @rm -f get64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get64_OBJECTS) $(get64_LDADD) $(LIBS) get_affix$(EXEEXT): $(get_affix_OBJECTS) $(get_affix_DEPENDENCIES) $(EXTRA_get_affix_DEPENDENCIES) @rm -f get_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_affix_OBJECTS) $(get_affix_LDADD) $(LIBS) get_bad_code$(EXEEXT): $(get_bad_code_OBJECTS) $(get_bad_code_DEPENDENCIES) $(EXTRA_get_bad_code_DEPENDENCIES) @rm -f get_bad_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_bad_code_OBJECTS) $(get_bad_code_LDADD) $(LIBS) get_bit$(EXEEXT): $(get_bit_OBJECTS) $(get_bit_DEPENDENCIES) $(EXTRA_get_bit_DEPENDENCIES) @rm -f get_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_bit_OBJECTS) $(get_bit_LDADD) $(LIBS) get_carray$(EXEEXT): $(get_carray_OBJECTS) $(get_carray_DEPENDENCIES) $(EXTRA_get_carray_DEPENDENCIES) @rm -f get_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_carray_OBJECTS) $(get_carray_LDADD) $(LIBS) get_carray_c2r$(EXEEXT): $(get_carray_c2r_OBJECTS) $(get_carray_c2r_DEPENDENCIES) $(EXTRA_get_carray_c2r_DEPENDENCIES) @rm -f get_carray_c2r$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_carray_c2r_OBJECTS) $(get_carray_c2r_LDADD) $(LIBS) get_carray_len$(EXEEXT): $(get_carray_len_OBJECTS) $(get_carray_len_DEPENDENCIES) $(EXTRA_get_carray_len_DEPENDENCIES) @rm -f get_carray_len$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_carray_len_OBJECTS) $(get_carray_len_LDADD) $(LIBS) get_carray_slice$(EXEEXT): $(get_carray_slice_OBJECTS) $(get_carray_slice_DEPENDENCIES) $(EXTRA_get_carray_slice_DEPENDENCIES) @rm -f get_carray_slice$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_carray_slice_OBJECTS) $(get_carray_slice_LDADD) $(LIBS) get_char$(EXEEXT): $(get_char_OBJECTS) $(get_char_DEPENDENCIES) $(EXTRA_get_char_DEPENDENCIES) @rm -f get_char$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_char_OBJECTS) $(get_char_LDADD) $(LIBS) get_clincom$(EXEEXT): $(get_clincom_OBJECTS) $(get_clincom_DEPENDENCIES) $(EXTRA_get_clincom_DEPENDENCIES) @rm -f get_clincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_clincom_OBJECTS) $(get_clincom_LDADD) $(LIBS) get_complex128$(EXEEXT): $(get_complex128_OBJECTS) $(get_complex128_DEPENDENCIES) $(EXTRA_get_complex128_DEPENDENCIES) @rm -f get_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_complex128_OBJECTS) $(get_complex128_LDADD) $(LIBS) get_complex64$(EXEEXT): $(get_complex64_OBJECTS) $(get_complex64_DEPENDENCIES) $(EXTRA_get_complex64_DEPENDENCIES) @rm -f get_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_complex64_OBJECTS) $(get_complex64_LDADD) $(LIBS) get_const$(EXEEXT): $(get_const_OBJECTS) $(get_const_DEPENDENCIES) $(EXTRA_get_const_DEPENDENCIES) @rm -f get_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_const_OBJECTS) $(get_const_LDADD) $(LIBS) get_const_carray$(EXEEXT): $(get_const_carray_OBJECTS) $(get_const_carray_DEPENDENCIES) $(EXTRA_get_const_carray_DEPENDENCIES) @rm -f get_const_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_const_carray_OBJECTS) $(get_const_carray_LDADD) $(LIBS) get_const_complex$(EXEEXT): $(get_const_complex_OBJECTS) $(get_const_complex_DEPENDENCIES) $(EXTRA_get_const_complex_DEPENDENCIES) @rm -f get_const_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_const_complex_OBJECTS) $(get_const_complex_LDADD) $(LIBS) get_const_repr$(EXEEXT): $(get_const_repr_OBJECTS) $(get_const_repr_DEPENDENCIES) $(EXTRA_get_const_repr_DEPENDENCIES) @rm -f get_const_repr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_const_repr_OBJECTS) $(get_const_repr_LDADD) $(LIBS) get_cpolynom$(EXEEXT): $(get_cpolynom_OBJECTS) $(get_cpolynom_DEPENDENCIES) $(EXTRA_get_cpolynom_DEPENDENCIES) @rm -f get_cpolynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_cpolynom_OBJECTS) $(get_cpolynom_LDADD) $(LIBS) get_cpolynom1$(EXEEXT): $(get_cpolynom1_OBJECTS) $(get_cpolynom1_DEPENDENCIES) $(EXTRA_get_cpolynom1_DEPENDENCIES) @rm -f get_cpolynom1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_cpolynom1_OBJECTS) $(get_cpolynom1_LDADD) $(LIBS) get_cpolynom_int$(EXEEXT): $(get_cpolynom_int_OBJECTS) $(get_cpolynom_int_DEPENDENCIES) $(EXTRA_get_cpolynom_int_DEPENDENCIES) @rm -f get_cpolynom_int$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_cpolynom_int_OBJECTS) $(get_cpolynom_int_LDADD) $(LIBS) get_dim$(EXEEXT): $(get_dim_OBJECTS) $(get_dim_DEPENDENCIES) $(EXTRA_get_dim_DEPENDENCIES) @rm -f get_dim$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_dim_OBJECTS) $(get_dim_LDADD) $(LIBS) get_divide$(EXEEXT): $(get_divide_OBJECTS) $(get_divide_DEPENDENCIES) $(EXTRA_get_divide_DEPENDENCIES) @rm -f get_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_divide_OBJECTS) $(get_divide_LDADD) $(LIBS) get_divide_ccin$(EXEEXT): $(get_divide_ccin_OBJECTS) $(get_divide_ccin_DEPENDENCIES) $(EXTRA_get_divide_ccin_DEPENDENCIES) @rm -f get_divide_ccin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_divide_ccin_OBJECTS) $(get_divide_ccin_LDADD) $(LIBS) get_divide_crin$(EXEEXT): $(get_divide_crin_OBJECTS) $(get_divide_crin_DEPENDENCIES) $(EXTRA_get_divide_crin_DEPENDENCIES) @rm -f get_divide_crin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_divide_crin_OBJECTS) $(get_divide_crin_LDADD) $(LIBS) get_divide_crinr$(EXEEXT): $(get_divide_crinr_OBJECTS) $(get_divide_crinr_DEPENDENCIES) $(EXTRA_get_divide_crinr_DEPENDENCIES) @rm -f get_divide_crinr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_divide_crinr_OBJECTS) $(get_divide_crinr_LDADD) $(LIBS) get_divide_rcin$(EXEEXT): $(get_divide_rcin_OBJECTS) $(get_divide_rcin_DEPENDENCIES) $(EXTRA_get_divide_rcin_DEPENDENCIES) @rm -f get_divide_rcin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_divide_rcin_OBJECTS) $(get_divide_rcin_LDADD) $(LIBS) get_divide_s$(EXEEXT): $(get_divide_s_OBJECTS) $(get_divide_s_DEPENDENCIES) $(EXTRA_get_divide_s_DEPENDENCIES) @rm -f get_divide_s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_divide_s_OBJECTS) $(get_divide_s_LDADD) $(LIBS) get_endian16$(EXEEXT): $(get_endian16_OBJECTS) $(get_endian16_DEPENDENCIES) $(EXTRA_get_endian16_DEPENDENCIES) @rm -f get_endian16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian16_OBJECTS) $(get_endian16_LDADD) $(LIBS) get_endian32$(EXEEXT): $(get_endian32_OBJECTS) $(get_endian32_DEPENDENCIES) $(EXTRA_get_endian32_DEPENDENCIES) @rm -f get_endian32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian32_OBJECTS) $(get_endian32_LDADD) $(LIBS) get_endian64$(EXEEXT): $(get_endian64_OBJECTS) $(get_endian64_DEPENDENCIES) $(EXTRA_get_endian64_DEPENDENCIES) @rm -f get_endian64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian64_OBJECTS) $(get_endian64_LDADD) $(LIBS) get_endian8$(EXEEXT): $(get_endian8_OBJECTS) $(get_endian8_DEPENDENCIES) $(EXTRA_get_endian8_DEPENDENCIES) @rm -f get_endian8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian8_OBJECTS) $(get_endian8_LDADD) $(LIBS) get_endian_complex128_arm$(EXEEXT): $(get_endian_complex128_arm_OBJECTS) $(get_endian_complex128_arm_DEPENDENCIES) $(EXTRA_get_endian_complex128_arm_DEPENDENCIES) @rm -f get_endian_complex128_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_complex128_arm_OBJECTS) $(get_endian_complex128_arm_LDADD) $(LIBS) get_endian_complex128_big$(EXEEXT): $(get_endian_complex128_big_OBJECTS) $(get_endian_complex128_big_DEPENDENCIES) $(EXTRA_get_endian_complex128_big_DEPENDENCIES) @rm -f get_endian_complex128_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_complex128_big_OBJECTS) $(get_endian_complex128_big_LDADD) $(LIBS) get_endian_complex128_little$(EXEEXT): $(get_endian_complex128_little_OBJECTS) $(get_endian_complex128_little_DEPENDENCIES) $(EXTRA_get_endian_complex128_little_DEPENDENCIES) @rm -f get_endian_complex128_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_complex128_little_OBJECTS) $(get_endian_complex128_little_LDADD) $(LIBS) get_endian_complex64_arm$(EXEEXT): $(get_endian_complex64_arm_OBJECTS) $(get_endian_complex64_arm_DEPENDENCIES) $(EXTRA_get_endian_complex64_arm_DEPENDENCIES) @rm -f get_endian_complex64_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_complex64_arm_OBJECTS) $(get_endian_complex64_arm_LDADD) $(LIBS) get_endian_complex64_big$(EXEEXT): $(get_endian_complex64_big_OBJECTS) $(get_endian_complex64_big_DEPENDENCIES) $(EXTRA_get_endian_complex64_big_DEPENDENCIES) @rm -f get_endian_complex64_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_complex64_big_OBJECTS) $(get_endian_complex64_big_LDADD) $(LIBS) get_endian_complex64_little$(EXEEXT): $(get_endian_complex64_little_OBJECTS) $(get_endian_complex64_little_DEPENDENCIES) $(EXTRA_get_endian_complex64_little_DEPENDENCIES) @rm -f get_endian_complex64_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_complex64_little_OBJECTS) $(get_endian_complex64_little_LDADD) $(LIBS) get_endian_float32_arm$(EXEEXT): $(get_endian_float32_arm_OBJECTS) $(get_endian_float32_arm_DEPENDENCIES) $(EXTRA_get_endian_float32_arm_DEPENDENCIES) @rm -f get_endian_float32_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_float32_arm_OBJECTS) $(get_endian_float32_arm_LDADD) $(LIBS) get_endian_float32_big$(EXEEXT): $(get_endian_float32_big_OBJECTS) $(get_endian_float32_big_DEPENDENCIES) $(EXTRA_get_endian_float32_big_DEPENDENCIES) @rm -f get_endian_float32_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_float32_big_OBJECTS) $(get_endian_float32_big_LDADD) $(LIBS) get_endian_float32_little$(EXEEXT): $(get_endian_float32_little_OBJECTS) $(get_endian_float32_little_DEPENDENCIES) $(EXTRA_get_endian_float32_little_DEPENDENCIES) @rm -f get_endian_float32_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_float32_little_OBJECTS) $(get_endian_float32_little_LDADD) $(LIBS) get_endian_float64_arm$(EXEEXT): $(get_endian_float64_arm_OBJECTS) $(get_endian_float64_arm_DEPENDENCIES) $(EXTRA_get_endian_float64_arm_DEPENDENCIES) @rm -f get_endian_float64_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_float64_arm_OBJECTS) $(get_endian_float64_arm_LDADD) $(LIBS) get_endian_float64_big$(EXEEXT): $(get_endian_float64_big_OBJECTS) $(get_endian_float64_big_DEPENDENCIES) $(EXTRA_get_endian_float64_big_DEPENDENCIES) @rm -f get_endian_float64_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_float64_big_OBJECTS) $(get_endian_float64_big_LDADD) $(LIBS) get_endian_float64_little$(EXEEXT): $(get_endian_float64_little_OBJECTS) $(get_endian_float64_little_DEPENDENCIES) $(EXTRA_get_endian_float64_little_DEPENDENCIES) @rm -f get_endian_float64_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_endian_float64_little_OBJECTS) $(get_endian_float64_little_LDADD) $(LIBS) get_ff$(EXEEXT): $(get_ff_OBJECTS) $(get_ff_DEPENDENCIES) $(EXTRA_get_ff_DEPENDENCIES) @rm -f get_ff$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_ff_OBJECTS) $(get_ff_LDADD) $(LIBS) get_float32$(EXEEXT): $(get_float32_OBJECTS) $(get_float32_DEPENDENCIES) $(EXTRA_get_float32_DEPENDENCIES) @rm -f get_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_float32_OBJECTS) $(get_float32_LDADD) $(LIBS) get_float64$(EXEEXT): $(get_float64_OBJECTS) $(get_float64_DEPENDENCIES) $(EXTRA_get_float64_DEPENDENCIES) @rm -f get_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_float64_OBJECTS) $(get_float64_LDADD) $(LIBS) get_foffs$(EXEEXT): $(get_foffs_OBJECTS) $(get_foffs_DEPENDENCIES) $(EXTRA_get_foffs_DEPENDENCIES) @rm -f get_foffs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_foffs_OBJECTS) $(get_foffs_LDADD) $(LIBS) get_foffs2$(EXEEXT): $(get_foffs2_OBJECTS) $(get_foffs2_DEPENDENCIES) $(EXTRA_get_foffs2_DEPENDENCIES) @rm -f get_foffs2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_foffs2_OBJECTS) $(get_foffs2_LDADD) $(LIBS) get_fs$(EXEEXT): $(get_fs_OBJECTS) $(get_fs_DEPENDENCIES) $(EXTRA_get_fs_DEPENDENCIES) @rm -f get_fs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_fs_OBJECTS) $(get_fs_LDADD) $(LIBS) get_here$(EXEEXT): $(get_here_OBJECTS) $(get_here_DEPENDENCIES) $(EXTRA_get_here_DEPENDENCIES) @rm -f get_here$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_here_OBJECTS) $(get_here_LDADD) $(LIBS) get_here_foffs$(EXEEXT): $(get_here_foffs_OBJECTS) $(get_here_foffs_DEPENDENCIES) $(EXTRA_get_here_foffs_DEPENDENCIES) @rm -f get_here_foffs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_here_foffs_OBJECTS) $(get_here_foffs_LDADD) $(LIBS) get_heres$(EXEEXT): $(get_heres_OBJECTS) $(get_heres_DEPENDENCIES) $(EXTRA_get_heres_DEPENDENCIES) @rm -f get_heres$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_heres_OBJECTS) $(get_heres_LDADD) $(LIBS) get_index_complex$(EXEEXT): $(get_index_complex_OBJECTS) $(get_index_complex_DEPENDENCIES) $(EXTRA_get_index_complex_DEPENDENCIES) @rm -f get_index_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_index_complex_OBJECTS) $(get_index_complex_LDADD) $(LIBS) get_int16$(EXEEXT): $(get_int16_OBJECTS) $(get_int16_DEPENDENCIES) $(EXTRA_get_int16_DEPENDENCIES) @rm -f get_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_int16_OBJECTS) $(get_int16_LDADD) $(LIBS) get_int32$(EXEEXT): $(get_int32_OBJECTS) $(get_int32_DEPENDENCIES) $(EXTRA_get_int32_DEPENDENCIES) @rm -f get_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_int32_OBJECTS) $(get_int32_LDADD) $(LIBS) get_int64$(EXEEXT): $(get_int64_OBJECTS) $(get_int64_DEPENDENCIES) $(EXTRA_get_int64_DEPENDENCIES) @rm -f get_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_int64_OBJECTS) $(get_int64_LDADD) $(LIBS) get_int8$(EXEEXT): $(get_int8_OBJECTS) $(get_int8_DEPENDENCIES) $(EXTRA_get_int8_DEPENDENCIES) @rm -f get_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_int8_OBJECTS) $(get_int8_LDADD) $(LIBS) get_invalid$(EXEEXT): $(get_invalid_OBJECTS) $(get_invalid_DEPENDENCIES) $(EXTRA_get_invalid_DEPENDENCIES) @rm -f get_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_invalid_OBJECTS) $(get_invalid_LDADD) $(LIBS) get_lincom1$(EXEEXT): $(get_lincom1_OBJECTS) $(get_lincom1_DEPENDENCIES) $(EXTRA_get_lincom1_DEPENDENCIES) @rm -f get_lincom1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom1_OBJECTS) $(get_lincom1_LDADD) $(LIBS) get_lincom2$(EXEEXT): $(get_lincom2_OBJECTS) $(get_lincom2_DEPENDENCIES) $(EXTRA_get_lincom2_DEPENDENCIES) @rm -f get_lincom2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom2_OBJECTS) $(get_lincom2_LDADD) $(LIBS) get_lincom2s$(EXEEXT): $(get_lincom2s_OBJECTS) $(get_lincom2s_DEPENDENCIES) $(EXTRA_get_lincom2s_DEPENDENCIES) @rm -f get_lincom2s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom2s_OBJECTS) $(get_lincom2s_LDADD) $(LIBS) get_lincom3$(EXEEXT): $(get_lincom3_OBJECTS) $(get_lincom3_DEPENDENCIES) $(EXTRA_get_lincom3_DEPENDENCIES) @rm -f get_lincom3$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom3_OBJECTS) $(get_lincom3_LDADD) $(LIBS) get_lincom3s$(EXEEXT): $(get_lincom3s_OBJECTS) $(get_lincom3s_DEPENDENCIES) $(EXTRA_get_lincom3s_DEPENDENCIES) @rm -f get_lincom3s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom3s_OBJECTS) $(get_lincom3s_LDADD) $(LIBS) get_lincom_mdt$(EXEEXT): $(get_lincom_mdt_OBJECTS) $(get_lincom_mdt_DEPENDENCIES) $(EXTRA_get_lincom_mdt_DEPENDENCIES) @rm -f get_lincom_mdt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom_mdt_OBJECTS) $(get_lincom_mdt_LDADD) $(LIBS) get_lincom_noin$(EXEEXT): $(get_lincom_noin_OBJECTS) $(get_lincom_noin_DEPENDENCIES) $(EXTRA_get_lincom_noin_DEPENDENCIES) @rm -f get_lincom_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom_noin_OBJECTS) $(get_lincom_noin_LDADD) $(LIBS) get_lincom_non$(EXEEXT): $(get_lincom_non_OBJECTS) $(get_lincom_non_DEPENDENCIES) $(EXTRA_get_lincom_non_DEPENDENCIES) @rm -f get_lincom_non$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom_non_OBJECTS) $(get_lincom_non_LDADD) $(LIBS) get_lincom_null$(EXEEXT): $(get_lincom_null_OBJECTS) $(get_lincom_null_DEPENDENCIES) $(EXTRA_get_lincom_null_DEPENDENCIES) @rm -f get_lincom_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom_null_OBJECTS) $(get_lincom_null_LDADD) $(LIBS) get_lincom_spf$(EXEEXT): $(get_lincom_spf_OBJECTS) $(get_lincom_spf_DEPENDENCIES) $(EXTRA_get_lincom_spf_DEPENDENCIES) @rm -f get_lincom_spf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_lincom_spf_OBJECTS) $(get_lincom_spf_LDADD) $(LIBS) get_linterp$(EXEEXT): $(get_linterp_OBJECTS) $(get_linterp_DEPENDENCIES) $(EXTRA_get_linterp_DEPENDENCIES) @rm -f get_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_OBJECTS) $(get_linterp_LDADD) $(LIBS) get_linterp1$(EXEEXT): $(get_linterp1_OBJECTS) $(get_linterp1_DEPENDENCIES) $(EXTRA_get_linterp1_DEPENDENCIES) @rm -f get_linterp1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp1_OBJECTS) $(get_linterp1_LDADD) $(LIBS) get_linterp_abs$(EXEEXT): $(get_linterp_abs_OBJECTS) $(get_linterp_abs_DEPENDENCIES) $(EXTRA_get_linterp_abs_DEPENDENCIES) @rm -f get_linterp_abs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_abs_OBJECTS) $(get_linterp_abs_LDADD) $(LIBS) get_linterp_complex$(EXEEXT): $(get_linterp_complex_OBJECTS) $(get_linterp_complex_DEPENDENCIES) $(EXTRA_get_linterp_complex_DEPENDENCIES) @rm -f get_linterp_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_complex_OBJECTS) $(get_linterp_complex_LDADD) $(LIBS) get_linterp_empty$(EXEEXT): $(get_linterp_empty_OBJECTS) $(get_linterp_empty_DEPENDENCIES) $(EXTRA_get_linterp_empty_DEPENDENCIES) @rm -f get_linterp_empty$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_empty_OBJECTS) $(get_linterp_empty_LDADD) $(LIBS) get_linterp_noin$(EXEEXT): $(get_linterp_noin_OBJECTS) $(get_linterp_noin_DEPENDENCIES) $(EXTRA_get_linterp_noin_DEPENDENCIES) @rm -f get_linterp_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_noin_OBJECTS) $(get_linterp_noin_LDADD) $(LIBS) get_linterp_notab$(EXEEXT): $(get_linterp_notab_OBJECTS) $(get_linterp_notab_DEPENDENCIES) $(EXTRA_get_linterp_notab_DEPENDENCIES) @rm -f get_linterp_notab$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_notab_OBJECTS) $(get_linterp_notab_LDADD) $(LIBS) get_linterp_sort$(EXEEXT): $(get_linterp_sort_OBJECTS) $(get_linterp_sort_DEPENDENCIES) $(EXTRA_get_linterp_sort_DEPENDENCIES) @rm -f get_linterp_sort$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_linterp_sort_OBJECTS) $(get_linterp_sort_LDADD) $(LIBS) get_mplex$(EXEEXT): $(get_mplex_OBJECTS) $(get_mplex_DEPENDENCIES) $(EXTRA_get_mplex_DEPENDENCIES) @rm -f get_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_OBJECTS) $(get_mplex_LDADD) $(LIBS) get_mplex_bof$(EXEEXT): $(get_mplex_bof_OBJECTS) $(get_mplex_bof_DEPENDENCIES) $(EXTRA_get_mplex_bof_DEPENDENCIES) @rm -f get_mplex_bof$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_bof_OBJECTS) $(get_mplex_bof_LDADD) $(LIBS) get_mplex_complex$(EXEEXT): $(get_mplex_complex_OBJECTS) $(get_mplex_complex_DEPENDENCIES) $(EXTRA_get_mplex_complex_DEPENDENCIES) @rm -f get_mplex_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_complex_OBJECTS) $(get_mplex_complex_LDADD) $(LIBS) get_mplex_lb$(EXEEXT): $(get_mplex_lb_OBJECTS) $(get_mplex_lb_DEPENDENCIES) $(EXTRA_get_mplex_lb_DEPENDENCIES) @rm -f get_mplex_lb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_lb_OBJECTS) $(get_mplex_lb_LDADD) $(LIBS) get_mplex_lball$(EXEEXT): $(get_mplex_lball_OBJECTS) $(get_mplex_lball_DEPENDENCIES) $(EXTRA_get_mplex_lball_DEPENDENCIES) @rm -f get_mplex_lball$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_lball_OBJECTS) $(get_mplex_lball_LDADD) $(LIBS) get_mplex_nolb$(EXEEXT): $(get_mplex_nolb_OBJECTS) $(get_mplex_nolb_DEPENDENCIES) $(EXTRA_get_mplex_nolb_DEPENDENCIES) @rm -f get_mplex_nolb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_nolb_OBJECTS) $(get_mplex_nolb_LDADD) $(LIBS) get_mplex_s$(EXEEXT): $(get_mplex_s_OBJECTS) $(get_mplex_s_DEPENDENCIES) $(EXTRA_get_mplex_s_DEPENDENCIES) @rm -f get_mplex_s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_s_OBJECTS) $(get_mplex_s_LDADD) $(LIBS) get_mplex_saved$(EXEEXT): $(get_mplex_saved_OBJECTS) $(get_mplex_saved_DEPENDENCIES) $(EXTRA_get_mplex_saved_DEPENDENCIES) @rm -f get_mplex_saved$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_mplex_saved_OBJECTS) $(get_mplex_saved_LDADD) $(LIBS) get_multiply$(EXEEXT): $(get_multiply_OBJECTS) $(get_multiply_DEPENDENCIES) $(EXTRA_get_multiply_DEPENDENCIES) @rm -f get_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_OBJECTS) $(get_multiply_LDADD) $(LIBS) get_multiply_ccin$(EXEEXT): $(get_multiply_ccin_OBJECTS) $(get_multiply_ccin_DEPENDENCIES) $(EXTRA_get_multiply_ccin_DEPENDENCIES) @rm -f get_multiply_ccin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_ccin_OBJECTS) $(get_multiply_ccin_LDADD) $(LIBS) get_multiply_crin$(EXEEXT): $(get_multiply_crin_OBJECTS) $(get_multiply_crin_DEPENDENCIES) $(EXTRA_get_multiply_crin_DEPENDENCIES) @rm -f get_multiply_crin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_crin_OBJECTS) $(get_multiply_crin_LDADD) $(LIBS) get_multiply_crinr$(EXEEXT): $(get_multiply_crinr_OBJECTS) $(get_multiply_crinr_DEPENDENCIES) $(EXTRA_get_multiply_crinr_DEPENDENCIES) @rm -f get_multiply_crinr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_crinr_OBJECTS) $(get_multiply_crinr_LDADD) $(LIBS) get_multiply_noin$(EXEEXT): $(get_multiply_noin_OBJECTS) $(get_multiply_noin_DEPENDENCIES) $(EXTRA_get_multiply_noin_DEPENDENCIES) @rm -f get_multiply_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_noin_OBJECTS) $(get_multiply_noin_LDADD) $(LIBS) get_multiply_rcin$(EXEEXT): $(get_multiply_rcin_OBJECTS) $(get_multiply_rcin_DEPENDENCIES) $(EXTRA_get_multiply_rcin_DEPENDENCIES) @rm -f get_multiply_rcin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_rcin_OBJECTS) $(get_multiply_rcin_LDADD) $(LIBS) get_multiply_s$(EXEEXT): $(get_multiply_s_OBJECTS) $(get_multiply_s_DEPENDENCIES) $(EXTRA_get_multiply_s_DEPENDENCIES) @rm -f get_multiply_s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_multiply_s_OBJECTS) $(get_multiply_s_LDADD) $(LIBS) get_neg$(EXEEXT): $(get_neg_OBJECTS) $(get_neg_DEPENDENCIES) $(EXTRA_get_neg_DEPENDENCIES) @rm -f get_neg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_neg_OBJECTS) $(get_neg_LDADD) $(LIBS) get_none$(EXEEXT): $(get_none_OBJECTS) $(get_none_DEPENDENCIES) $(EXTRA_get_none_DEPENDENCIES) @rm -f get_none$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_none_OBJECTS) $(get_none_LDADD) $(LIBS) get_nonexistent$(EXEEXT): $(get_nonexistent_OBJECTS) $(get_nonexistent_DEPENDENCIES) $(EXTRA_get_nonexistent_DEPENDENCIES) @rm -f get_nonexistent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_nonexistent_OBJECTS) $(get_nonexistent_LDADD) $(LIBS) get_null$(EXEEXT): $(get_null_OBJECTS) $(get_null_DEPENDENCIES) $(EXTRA_get_null_DEPENDENCIES) @rm -f get_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_null_OBJECTS) $(get_null_LDADD) $(LIBS) get_off64$(EXEEXT): $(get_off64_OBJECTS) $(get_off64_DEPENDENCIES) $(EXTRA_get_off64_DEPENDENCIES) @rm -f get_off64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_off64_OBJECTS) $(get_off64_LDADD) $(LIBS) get_phase$(EXEEXT): $(get_phase_OBJECTS) $(get_phase_DEPENDENCIES) $(EXTRA_get_phase_DEPENDENCIES) @rm -f get_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_phase_OBJECTS) $(get_phase_LDADD) $(LIBS) get_phase_affix$(EXEEXT): $(get_phase_affix_OBJECTS) $(get_phase_affix_DEPENDENCIES) $(EXTRA_get_phase_affix_DEPENDENCIES) @rm -f get_phase_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_phase_affix_OBJECTS) $(get_phase_affix_LDADD) $(LIBS) get_polynom$(EXEEXT): $(get_polynom_OBJECTS) $(get_polynom_DEPENDENCIES) $(EXTRA_get_polynom_DEPENDENCIES) @rm -f get_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_polynom_OBJECTS) $(get_polynom_LDADD) $(LIBS) get_polynom_cmpin$(EXEEXT): $(get_polynom_cmpin_OBJECTS) $(get_polynom_cmpin_DEPENDENCIES) $(EXTRA_get_polynom_cmpin_DEPENDENCIES) @rm -f get_polynom_cmpin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_polynom_cmpin_OBJECTS) $(get_polynom_cmpin_LDADD) $(LIBS) get_polynom_noin$(EXEEXT): $(get_polynom_noin_OBJECTS) $(get_polynom_noin_DEPENDENCIES) $(EXTRA_get_polynom_noin_DEPENDENCIES) @rm -f get_polynom_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_polynom_noin_OBJECTS) $(get_polynom_noin_LDADD) $(LIBS) get_recip$(EXEEXT): $(get_recip_OBJECTS) $(get_recip_DEPENDENCIES) $(EXTRA_get_recip_DEPENDENCIES) @rm -f get_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_recip_OBJECTS) $(get_recip_LDADD) $(LIBS) get_recip_const$(EXEEXT): $(get_recip_const_OBJECTS) $(get_recip_const_DEPENDENCIES) $(EXTRA_get_recip_const_DEPENDENCIES) @rm -f get_recip_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_recip_const_OBJECTS) $(get_recip_const_LDADD) $(LIBS) get_recurse$(EXEEXT): $(get_recurse_OBJECTS) $(get_recurse_DEPENDENCIES) $(EXTRA_get_recurse_DEPENDENCIES) @rm -f get_recurse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_recurse_OBJECTS) $(get_recurse_LDADD) $(LIBS) get_rofs$(EXEEXT): $(get_rofs_OBJECTS) $(get_rofs_DEPENDENCIES) $(EXTRA_get_rofs_DEPENDENCIES) @rm -f get_rofs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_rofs_OBJECTS) $(get_rofs_LDADD) $(LIBS) get_sbit$(EXEEXT): $(get_sbit_OBJECTS) $(get_sbit_DEPENDENCIES) $(EXTRA_get_sbit_DEPENDENCIES) @rm -f get_sbit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_sbit_OBJECTS) $(get_sbit_LDADD) $(LIBS) get_sf$(EXEEXT): $(get_sf_OBJECTS) $(get_sf_DEPENDENCIES) $(EXTRA_get_sf_DEPENDENCIES) @rm -f get_sf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_sf_OBJECTS) $(get_sf_LDADD) $(LIBS) get_ss$(EXEEXT): $(get_ss_OBJECTS) $(get_ss_DEPENDENCIES) $(EXTRA_get_ss_DEPENDENCIES) @rm -f get_ss$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_ss_OBJECTS) $(get_ss_LDADD) $(LIBS) get_string$(EXEEXT): $(get_string_OBJECTS) $(get_string_DEPENDENCIES) $(EXTRA_get_string_DEPENDENCIES) @rm -f get_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_string_OBJECTS) $(get_string_LDADD) $(LIBS) get_type$(EXEEXT): $(get_type_OBJECTS) $(get_type_DEPENDENCIES) $(EXTRA_get_type_DEPENDENCIES) @rm -f get_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_type_OBJECTS) $(get_type_LDADD) $(LIBS) get_uint16$(EXEEXT): $(get_uint16_OBJECTS) $(get_uint16_DEPENDENCIES) $(EXTRA_get_uint16_DEPENDENCIES) @rm -f get_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_uint16_OBJECTS) $(get_uint16_LDADD) $(LIBS) get_uint32$(EXEEXT): $(get_uint32_OBJECTS) $(get_uint32_DEPENDENCIES) $(EXTRA_get_uint32_DEPENDENCIES) @rm -f get_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_uint32_OBJECTS) $(get_uint32_LDADD) $(LIBS) get_uint64$(EXEEXT): $(get_uint64_OBJECTS) $(get_uint64_DEPENDENCIES) $(EXTRA_get_uint64_DEPENDENCIES) @rm -f get_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_uint64_OBJECTS) $(get_uint64_LDADD) $(LIBS) get_window$(EXEEXT): $(get_window_OBJECTS) $(get_window_DEPENDENCIES) $(EXTRA_get_window_DEPENDENCIES) @rm -f get_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_OBJECTS) $(get_window_LDADD) $(LIBS) get_window_clr$(EXEEXT): $(get_window_clr_OBJECTS) $(get_window_clr_DEPENDENCIES) $(EXTRA_get_window_clr_DEPENDENCIES) @rm -f get_window_clr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_clr_OBJECTS) $(get_window_clr_LDADD) $(LIBS) get_window_complex$(EXEEXT): $(get_window_complex_OBJECTS) $(get_window_complex_DEPENDENCIES) $(EXTRA_get_window_complex_DEPENDENCIES) @rm -f get_window_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_complex_OBJECTS) $(get_window_complex_LDADD) $(LIBS) get_window_ge$(EXEEXT): $(get_window_ge_OBJECTS) $(get_window_ge_DEPENDENCIES) $(EXTRA_get_window_ge_DEPENDENCIES) @rm -f get_window_ge$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_ge_OBJECTS) $(get_window_ge_LDADD) $(LIBS) get_window_gt$(EXEEXT): $(get_window_gt_OBJECTS) $(get_window_gt_DEPENDENCIES) $(EXTRA_get_window_gt_DEPENDENCIES) @rm -f get_window_gt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_gt_OBJECTS) $(get_window_gt_LDADD) $(LIBS) get_window_le$(EXEEXT): $(get_window_le_OBJECTS) $(get_window_le_DEPENDENCIES) $(EXTRA_get_window_le_DEPENDENCIES) @rm -f get_window_le$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_le_OBJECTS) $(get_window_le_LDADD) $(LIBS) get_window_lt$(EXEEXT): $(get_window_lt_OBJECTS) $(get_window_lt_DEPENDENCIES) $(EXTRA_get_window_lt_DEPENDENCIES) @rm -f get_window_lt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_lt_OBJECTS) $(get_window_lt_LDADD) $(LIBS) get_window_ne$(EXEEXT): $(get_window_ne_OBJECTS) $(get_window_ne_DEPENDENCIES) $(EXTRA_get_window_ne_DEPENDENCIES) @rm -f get_window_ne$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_ne_OBJECTS) $(get_window_ne_LDADD) $(LIBS) get_window_s$(EXEEXT): $(get_window_s_OBJECTS) $(get_window_s_DEPENDENCIES) $(EXTRA_get_window_s_DEPENDENCIES) @rm -f get_window_s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_s_OBJECTS) $(get_window_s_LDADD) $(LIBS) get_window_set$(EXEEXT): $(get_window_set_OBJECTS) $(get_window_set_DEPENDENCIES) $(EXTRA_get_window_set_DEPENDENCIES) @rm -f get_window_set$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_window_set_OBJECTS) $(get_window_set_LDADD) $(LIBS) get_zero$(EXEEXT): $(get_zero_OBJECTS) $(get_zero_DEPENDENCIES) $(EXTRA_get_zero_DEPENDENCIES) @rm -f get_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_zero_OBJECTS) $(get_zero_LDADD) $(LIBS) get_zero_complex$(EXEEXT): $(get_zero_complex_OBJECTS) $(get_zero_complex_DEPENDENCIES) $(EXTRA_get_zero_complex_DEPENDENCIES) @rm -f get_zero_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_zero_complex_OBJECTS) $(get_zero_complex_LDADD) $(LIBS) get_zero_float$(EXEEXT): $(get_zero_float_OBJECTS) $(get_zero_float_DEPENDENCIES) $(EXTRA_get_zero_float_DEPENDENCIES) @rm -f get_zero_float$(EXEEXT) $(AM_V_CCLD)$(LINK) $(get_zero_float_OBJECTS) $(get_zero_float_LDADD) $(LIBS) global_flags$(EXEEXT): $(global_flags_OBJECTS) $(global_flags_DEPENDENCIES) $(EXTRA_global_flags_DEPENDENCIES) @rm -f global_flags$(EXEEXT) $(AM_V_CCLD)$(LINK) $(global_flags_OBJECTS) $(global_flags_LDADD) $(LIBS) global_name$(EXEEXT): $(global_name_OBJECTS) $(global_name_DEPENDENCIES) $(EXTRA_global_name_DEPENDENCIES) @rm -f global_name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(global_name_OBJECTS) $(global_name_LDADD) $(LIBS) global_ref$(EXEEXT): $(global_ref_OBJECTS) $(global_ref_DEPENDENCIES) $(EXTRA_global_ref_DEPENDENCIES) @rm -f global_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(global_ref_OBJECTS) $(global_ref_LDADD) $(LIBS) global_ref_empty$(EXEEXT): $(global_ref_empty_OBJECTS) $(global_ref_empty_DEPENDENCIES) $(EXTRA_global_ref_empty_DEPENDENCIES) @rm -f global_ref_empty$(EXEEXT) $(AM_V_CCLD)$(LINK) $(global_ref_empty_OBJECTS) $(global_ref_empty_LDADD) $(LIBS) global_ref_set$(EXEEXT): $(global_ref_set_OBJECTS) $(global_ref_set_DEPENDENCIES) $(EXTRA_global_ref_set_DEPENDENCIES) @rm -f global_ref_set$(EXEEXT) $(AM_V_CCLD)$(LINK) $(global_ref_set_OBJECTS) $(global_ref_set_LDADD) $(LIBS) gzip_add$(EXEEXT): $(gzip_add_OBJECTS) $(gzip_add_DEPENDENCIES) $(EXTRA_gzip_add_DEPENDENCIES) @rm -f gzip_add$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_add_OBJECTS) $(gzip_add_LDADD) $(LIBS) gzip_del$(EXEEXT): $(gzip_del_OBJECTS) $(gzip_del_DEPENDENCIES) $(EXTRA_gzip_del_DEPENDENCIES) @rm -f gzip_del$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_del_OBJECTS) $(gzip_del_LDADD) $(LIBS) gzip_get$(EXEEXT): $(gzip_get_OBJECTS) $(gzip_get_DEPENDENCIES) $(EXTRA_gzip_get_DEPENDENCIES) @rm -f gzip_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_get_OBJECTS) $(gzip_get_LDADD) $(LIBS) gzip_get_far$(EXEEXT): $(gzip_get_far_OBJECTS) $(gzip_get_far_DEPENDENCIES) $(EXTRA_gzip_get_far_DEPENDENCIES) @rm -f gzip_get_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_get_far_OBJECTS) $(gzip_get_far_LDADD) $(LIBS) gzip_get_get$(EXEEXT): $(gzip_get_get_OBJECTS) $(gzip_get_get_DEPENDENCIES) $(EXTRA_gzip_get_get_DEPENDENCIES) @rm -f gzip_get_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_get_get_OBJECTS) $(gzip_get_get_LDADD) $(LIBS) gzip_get_get2$(EXEEXT): $(gzip_get_get2_OBJECTS) $(gzip_get_get2_DEPENDENCIES) $(EXTRA_gzip_get_get2_DEPENDENCIES) @rm -f gzip_get_get2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_get_get2_OBJECTS) $(gzip_get_get2_LDADD) $(LIBS) gzip_get_put$(EXEEXT): $(gzip_get_put_OBJECTS) $(gzip_get_put_DEPENDENCIES) $(EXTRA_gzip_get_put_DEPENDENCIES) @rm -f gzip_get_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_get_put_OBJECTS) $(gzip_get_put_LDADD) $(LIBS) gzip_move_from$(EXEEXT): $(gzip_move_from_OBJECTS) $(gzip_move_from_DEPENDENCIES) $(EXTRA_gzip_move_from_DEPENDENCIES) @rm -f gzip_move_from$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_move_from_OBJECTS) $(gzip_move_from_LDADD) $(LIBS) gzip_move_to$(EXEEXT): $(gzip_move_to_OBJECTS) $(gzip_move_to_DEPENDENCIES) $(EXTRA_gzip_move_to_DEPENDENCIES) @rm -f gzip_move_to$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_move_to_OBJECTS) $(gzip_move_to_LDADD) $(LIBS) gzip_nframes$(EXEEXT): $(gzip_nframes_OBJECTS) $(gzip_nframes_DEPENDENCIES) $(EXTRA_gzip_nframes_DEPENDENCIES) @rm -f gzip_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_nframes_OBJECTS) $(gzip_nframes_LDADD) $(LIBS) gzip_put$(EXEEXT): $(gzip_put_OBJECTS) $(gzip_put_DEPENDENCIES) $(EXTRA_gzip_put_DEPENDENCIES) @rm -f gzip_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_OBJECTS) $(gzip_put_LDADD) $(LIBS) gzip_put_back$(EXEEXT): $(gzip_put_back_OBJECTS) $(gzip_put_back_DEPENDENCIES) $(EXTRA_gzip_put_back_DEPENDENCIES) @rm -f gzip_put_back$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_back_OBJECTS) $(gzip_put_back_LDADD) $(LIBS) gzip_put_endian$(EXEEXT): $(gzip_put_endian_OBJECTS) $(gzip_put_endian_DEPENDENCIES) $(EXTRA_gzip_put_endian_DEPENDENCIES) @rm -f gzip_put_endian$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_endian_OBJECTS) $(gzip_put_endian_LDADD) $(LIBS) gzip_put_get$(EXEEXT): $(gzip_put_get_OBJECTS) $(gzip_put_get_DEPENDENCIES) $(EXTRA_gzip_put_get_DEPENDENCIES) @rm -f gzip_put_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_get_OBJECTS) $(gzip_put_get_LDADD) $(LIBS) gzip_put_nframes$(EXEEXT): $(gzip_put_nframes_OBJECTS) $(gzip_put_nframes_DEPENDENCIES) $(EXTRA_gzip_put_nframes_DEPENDENCIES) @rm -f gzip_put_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_nframes_OBJECTS) $(gzip_put_nframes_LDADD) $(LIBS) gzip_put_off$(EXEEXT): $(gzip_put_off_OBJECTS) $(gzip_put_off_DEPENDENCIES) $(EXTRA_gzip_put_off_DEPENDENCIES) @rm -f gzip_put_off$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_off_OBJECTS) $(gzip_put_off_LDADD) $(LIBS) gzip_put_pad$(EXEEXT): $(gzip_put_pad_OBJECTS) $(gzip_put_pad_DEPENDENCIES) $(EXTRA_gzip_put_pad_DEPENDENCIES) @rm -f gzip_put_pad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_pad_OBJECTS) $(gzip_put_pad_LDADD) $(LIBS) gzip_put_sub$(EXEEXT): $(gzip_put_sub_OBJECTS) $(gzip_put_sub_DEPENDENCIES) $(EXTRA_gzip_put_sub_DEPENDENCIES) @rm -f gzip_put_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_put_sub_OBJECTS) $(gzip_put_sub_LDADD) $(LIBS) gzip_seek$(EXEEXT): $(gzip_seek_OBJECTS) $(gzip_seek_DEPENDENCIES) $(EXTRA_gzip_seek_DEPENDENCIES) @rm -f gzip_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_seek_OBJECTS) $(gzip_seek_LDADD) $(LIBS) gzip_seek_far$(EXEEXT): $(gzip_seek_far_OBJECTS) $(gzip_seek_far_DEPENDENCIES) $(EXTRA_gzip_seek_far_DEPENDENCIES) @rm -f gzip_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_seek_far_OBJECTS) $(gzip_seek_far_LDADD) $(LIBS) gzip_seek_put$(EXEEXT): $(gzip_seek_put_OBJECTS) $(gzip_seek_put_DEPENDENCIES) $(EXTRA_gzip_seek_put_DEPENDENCIES) @rm -f gzip_seek_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_seek_put_OBJECTS) $(gzip_seek_put_LDADD) $(LIBS) gzip_sync$(EXEEXT): $(gzip_sync_OBJECTS) $(gzip_sync_DEPENDENCIES) $(EXTRA_gzip_sync_DEPENDENCIES) @rm -f gzip_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gzip_sync_OBJECTS) $(gzip_sync_LDADD) $(LIBS) header_complex$(EXEEXT): $(header_complex_OBJECTS) $(header_complex_DEPENDENCIES) $(EXTRA_header_complex_DEPENDENCIES) @rm -f header_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(header_complex_OBJECTS) $(header_complex_LDADD) $(LIBS) header_off64t$(EXEEXT): $(header_off64t_OBJECTS) $(header_off64t_DEPENDENCIES) $(EXTRA_header_off64t_DEPENDENCIES) @rm -f header_off64t$(EXEEXT) $(AM_V_CCLD)$(LINK) $(header_off64t_OBJECTS) $(header_off64t_LDADD) $(LIBS) hide$(EXEEXT): $(hide_OBJECTS) $(hide_DEPENDENCIES) $(EXTRA_hide_DEPENDENCIES) @rm -f hide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hide_OBJECTS) $(hide_LDADD) $(LIBS) hide_hidden$(EXEEXT): $(hide_hidden_OBJECTS) $(hide_hidden_DEPENDENCIES) $(EXTRA_hide_hidden_DEPENDENCIES) @rm -f hide_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hide_hidden_OBJECTS) $(hide_hidden_LDADD) $(LIBS) hide_unhide$(EXEEXT): $(hide_unhide_OBJECTS) $(hide_unhide_DEPENDENCIES) $(EXTRA_hide_unhide_DEPENDENCIES) @rm -f hide_unhide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hide_unhide_OBJECTS) $(hide_unhide_LDADD) $(LIBS) include_accmode$(EXEEXT): $(include_accmode_OBJECTS) $(include_accmode_DEPENDENCIES) $(EXTRA_include_accmode_DEPENDENCIES) @rm -f include_accmode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_accmode_OBJECTS) $(include_accmode_LDADD) $(LIBS) include_affix$(EXEEXT): $(include_affix_OBJECTS) $(include_affix_DEPENDENCIES) $(EXTRA_include_affix_DEPENDENCIES) @rm -f include_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_affix_OBJECTS) $(include_affix_LDADD) $(LIBS) include_auto$(EXEEXT): $(include_auto_OBJECTS) $(include_auto_DEPENDENCIES) $(EXTRA_include_auto_DEPENDENCIES) @rm -f include_auto$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_auto_OBJECTS) $(include_auto_LDADD) $(LIBS) include_cb$(EXEEXT): $(include_cb_OBJECTS) $(include_cb_DEPENDENCIES) $(EXTRA_include_cb_DEPENDENCIES) @rm -f include_cb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_cb_OBJECTS) $(include_cb_LDADD) $(LIBS) include_creat$(EXEEXT): $(include_creat_OBJECTS) $(include_creat_DEPENDENCIES) $(EXTRA_include_creat_DEPENDENCIES) @rm -f include_creat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_creat_OBJECTS) $(include_creat_LDADD) $(LIBS) include_ignore$(EXEEXT): $(include_ignore_OBJECTS) $(include_ignore_DEPENDENCIES) $(EXTRA_include_ignore_DEPENDENCIES) @rm -f include_ignore$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_ignore_OBJECTS) $(include_ignore_LDADD) $(LIBS) include_include$(EXEEXT): $(include_include_OBJECTS) $(include_include_DEPENDENCIES) $(EXTRA_include_include_DEPENDENCIES) @rm -f include_include$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_include_OBJECTS) $(include_include_LDADD) $(LIBS) include_index$(EXEEXT): $(include_index_OBJECTS) $(include_index_DEPENDENCIES) $(EXTRA_include_index_DEPENDENCIES) @rm -f include_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_index_OBJECTS) $(include_index_LDADD) $(LIBS) include_invalid$(EXEEXT): $(include_invalid_OBJECTS) $(include_invalid_DEPENDENCIES) $(EXTRA_include_invalid_DEPENDENCIES) @rm -f include_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_invalid_OBJECTS) $(include_invalid_LDADD) $(LIBS) include_nonexistent$(EXEEXT): $(include_nonexistent_OBJECTS) $(include_nonexistent_DEPENDENCIES) $(EXTRA_include_nonexistent_DEPENDENCIES) @rm -f include_nonexistent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_nonexistent_OBJECTS) $(include_nonexistent_LDADD) $(LIBS) include_pc$(EXEEXT): $(include_pc_OBJECTS) $(include_pc_DEPENDENCIES) $(EXTRA_include_pc_DEPENDENCIES) @rm -f include_pc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_pc_OBJECTS) $(include_pc_LDADD) $(LIBS) include_ref$(EXEEXT): $(include_ref_OBJECTS) $(include_ref_DEPENDENCIES) $(EXTRA_include_ref_DEPENDENCIES) @rm -f include_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_ref_OBJECTS) $(include_ref_LDADD) $(LIBS) include_sub$(EXEEXT): $(include_sub_OBJECTS) $(include_sub_DEPENDENCIES) $(EXTRA_include_sub_DEPENDENCIES) @rm -f include_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_sub_OBJECTS) $(include_sub_LDADD) $(LIBS) include_syntax$(EXEEXT): $(include_syntax_OBJECTS) $(include_syntax_DEPENDENCIES) $(EXTRA_include_syntax_DEPENDENCIES) @rm -f include_syntax$(EXEEXT) $(AM_V_CCLD)$(LINK) $(include_syntax_OBJECTS) $(include_syntax_LDADD) $(LIBS) index_domain$(EXEEXT): $(index_domain_OBJECTS) $(index_domain_DEPENDENCIES) $(EXTRA_index_domain_DEPENDENCIES) @rm -f index_domain$(EXEEXT) $(AM_V_CCLD)$(LINK) $(index_domain_OBJECTS) $(index_domain_LDADD) $(LIBS) index_index$(EXEEXT): $(index_index_OBJECTS) $(index_index_DEPENDENCIES) $(EXTRA_index_index_DEPENDENCIES) @rm -f index_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(index_index_OBJECTS) $(index_index_LDADD) $(LIBS) index_range$(EXEEXT): $(index_range_OBJECTS) $(index_range_DEPENDENCIES) $(EXTRA_index_range_DEPENDENCIES) @rm -f index_range$(EXEEXT) $(AM_V_CCLD)$(LINK) $(index_range_OBJECTS) $(index_range_LDADD) $(LIBS) index_s$(EXEEXT): $(index_s_OBJECTS) $(index_s_DEPENDENCIES) $(EXTRA_index_s_DEPENDENCIES) @rm -f index_s$(EXEEXT) $(AM_V_CCLD)$(LINK) $(index_s_OBJECTS) $(index_s_LDADD) $(LIBS) index_subset$(EXEEXT): $(index_subset_OBJECTS) $(index_subset_DEPENDENCIES) $(EXTRA_index_subset_DEPENDENCIES) @rm -f index_subset$(EXEEXT) $(AM_V_CCLD)$(LINK) $(index_subset_OBJECTS) $(index_subset_LDADD) $(LIBS) legacy_error$(EXEEXT): $(legacy_error_OBJECTS) $(legacy_error_DEPENDENCIES) $(EXTRA_legacy_error_DEPENDENCIES) @rm -f legacy_error$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_error_OBJECTS) $(legacy_error_LDADD) $(LIBS) legacy_estring$(EXEEXT): $(legacy_estring_OBJECTS) $(legacy_estring_DEPENDENCIES) $(EXTRA_legacy_estring_DEPENDENCIES) @rm -f legacy_estring$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_estring_OBJECTS) $(legacy_estring_LDADD) $(LIBS) legacy_format$(EXEEXT): $(legacy_format_OBJECTS) $(legacy_format_DEPENDENCIES) $(EXTRA_legacy_format_DEPENDENCIES) @rm -f legacy_format$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_format_OBJECTS) $(legacy_format_LDADD) $(LIBS) legacy_get$(EXEEXT): $(legacy_get_OBJECTS) $(legacy_get_DEPENDENCIES) $(EXTRA_legacy_get_DEPENDENCIES) @rm -f legacy_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_get_OBJECTS) $(legacy_get_LDADD) $(LIBS) legacy_get_put$(EXEEXT): $(legacy_get_put_OBJECTS) $(legacy_get_put_DEPENDENCIES) $(EXTRA_legacy_get_put_DEPENDENCIES) @rm -f legacy_get_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_get_put_OBJECTS) $(legacy_get_put_LDADD) $(LIBS) legacy_get_rofs$(EXEEXT): $(legacy_get_rofs_OBJECTS) $(legacy_get_rofs_DEPENDENCIES) $(EXTRA_legacy_get_rofs_DEPENDENCIES) @rm -f legacy_get_rofs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_get_rofs_OBJECTS) $(legacy_get_rofs_LDADD) $(LIBS) legacy_nframes$(EXEEXT): $(legacy_nframes_OBJECTS) $(legacy_nframes_DEPENDENCIES) $(EXTRA_legacy_nframes_DEPENDENCIES) @rm -f legacy_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_nframes_OBJECTS) $(legacy_nframes_LDADD) $(LIBS) legacy_nonexistent$(EXEEXT): $(legacy_nonexistent_OBJECTS) $(legacy_nonexistent_DEPENDENCIES) $(EXTRA_legacy_nonexistent_DEPENDENCIES) @rm -f legacy_nonexistent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_nonexistent_OBJECTS) $(legacy_nonexistent_LDADD) $(LIBS) legacy_put$(EXEEXT): $(legacy_put_OBJECTS) $(legacy_put_DEPENDENCIES) $(EXTRA_legacy_put_DEPENDENCIES) @rm -f legacy_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_put_OBJECTS) $(legacy_put_LDADD) $(LIBS) legacy_spf$(EXEEXT): $(legacy_spf_OBJECTS) $(legacy_spf_DEPENDENCIES) $(EXTRA_legacy_spf_DEPENDENCIES) @rm -f legacy_spf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(legacy_spf_OBJECTS) $(legacy_spf_LDADD) $(LIBS) lzma_get$(EXEEXT): $(lzma_get_OBJECTS) $(lzma_get_DEPENDENCIES) $(EXTRA_lzma_get_DEPENDENCIES) @rm -f lzma_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_get_OBJECTS) $(lzma_get_LDADD) $(LIBS) lzma_nframes$(EXEEXT): $(lzma_nframes_OBJECTS) $(lzma_nframes_DEPENDENCIES) $(EXTRA_lzma_nframes_DEPENDENCIES) @rm -f lzma_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_nframes_OBJECTS) $(lzma_nframes_LDADD) $(LIBS) lzma_put$(EXEEXT): $(lzma_put_OBJECTS) $(lzma_put_DEPENDENCIES) $(EXTRA_lzma_put_DEPENDENCIES) @rm -f lzma_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_put_OBJECTS) $(lzma_put_LDADD) $(LIBS) lzma_xz_add$(EXEEXT): $(lzma_xz_add_OBJECTS) $(lzma_xz_add_DEPENDENCIES) $(EXTRA_lzma_xz_add_DEPENDENCIES) @rm -f lzma_xz_add$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_add_OBJECTS) $(lzma_xz_add_LDADD) $(LIBS) lzma_xz_get$(EXEEXT): $(lzma_xz_get_OBJECTS) $(lzma_xz_get_DEPENDENCIES) $(EXTRA_lzma_xz_get_DEPENDENCIES) @rm -f lzma_xz_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_get_OBJECTS) $(lzma_xz_get_LDADD) $(LIBS) lzma_xz_get_far$(EXEEXT): $(lzma_xz_get_far_OBJECTS) $(lzma_xz_get_far_DEPENDENCIES) $(EXTRA_lzma_xz_get_far_DEPENDENCIES) @rm -f lzma_xz_get_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_get_far_OBJECTS) $(lzma_xz_get_far_LDADD) $(LIBS) lzma_xz_get_get$(EXEEXT): $(lzma_xz_get_get_OBJECTS) $(lzma_xz_get_get_DEPENDENCIES) $(EXTRA_lzma_xz_get_get_DEPENDENCIES) @rm -f lzma_xz_get_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_get_get_OBJECTS) $(lzma_xz_get_get_LDADD) $(LIBS) lzma_xz_get_get2$(EXEEXT): $(lzma_xz_get_get2_OBJECTS) $(lzma_xz_get_get2_DEPENDENCIES) $(EXTRA_lzma_xz_get_get2_DEPENDENCIES) @rm -f lzma_xz_get_get2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_get_get2_OBJECTS) $(lzma_xz_get_get2_LDADD) $(LIBS) lzma_xz_get_put$(EXEEXT): $(lzma_xz_get_put_OBJECTS) $(lzma_xz_get_put_DEPENDENCIES) $(EXTRA_lzma_xz_get_put_DEPENDENCIES) @rm -f lzma_xz_get_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_get_put_OBJECTS) $(lzma_xz_get_put_LDADD) $(LIBS) lzma_xz_move_to$(EXEEXT): $(lzma_xz_move_to_OBJECTS) $(lzma_xz_move_to_DEPENDENCIES) $(EXTRA_lzma_xz_move_to_DEPENDENCIES) @rm -f lzma_xz_move_to$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_move_to_OBJECTS) $(lzma_xz_move_to_LDADD) $(LIBS) lzma_xz_nframes$(EXEEXT): $(lzma_xz_nframes_OBJECTS) $(lzma_xz_nframes_DEPENDENCIES) $(EXTRA_lzma_xz_nframes_DEPENDENCIES) @rm -f lzma_xz_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_nframes_OBJECTS) $(lzma_xz_nframes_LDADD) $(LIBS) lzma_xz_put$(EXEEXT): $(lzma_xz_put_OBJECTS) $(lzma_xz_put_DEPENDENCIES) $(EXTRA_lzma_xz_put_DEPENDENCIES) @rm -f lzma_xz_put$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_put_OBJECTS) $(lzma_xz_put_LDADD) $(LIBS) lzma_xz_put_back$(EXEEXT): $(lzma_xz_put_back_OBJECTS) $(lzma_xz_put_back_DEPENDENCIES) $(EXTRA_lzma_xz_put_back_DEPENDENCIES) @rm -f lzma_xz_put_back$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_put_back_OBJECTS) $(lzma_xz_put_back_LDADD) $(LIBS) lzma_xz_put_endian$(EXEEXT): $(lzma_xz_put_endian_OBJECTS) $(lzma_xz_put_endian_DEPENDENCIES) $(EXTRA_lzma_xz_put_endian_DEPENDENCIES) @rm -f lzma_xz_put_endian$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_put_endian_OBJECTS) $(lzma_xz_put_endian_LDADD) $(LIBS) lzma_xz_put_get$(EXEEXT): $(lzma_xz_put_get_OBJECTS) $(lzma_xz_put_get_DEPENDENCIES) $(EXTRA_lzma_xz_put_get_DEPENDENCIES) @rm -f lzma_xz_put_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_put_get_OBJECTS) $(lzma_xz_put_get_LDADD) $(LIBS) lzma_xz_put_pad$(EXEEXT): $(lzma_xz_put_pad_OBJECTS) $(lzma_xz_put_pad_DEPENDENCIES) $(EXTRA_lzma_xz_put_pad_DEPENDENCIES) @rm -f lzma_xz_put_pad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_put_pad_OBJECTS) $(lzma_xz_put_pad_LDADD) $(LIBS) lzma_xz_seek$(EXEEXT): $(lzma_xz_seek_OBJECTS) $(lzma_xz_seek_DEPENDENCIES) $(EXTRA_lzma_xz_seek_DEPENDENCIES) @rm -f lzma_xz_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_seek_OBJECTS) $(lzma_xz_seek_LDADD) $(LIBS) lzma_xz_seek_far$(EXEEXT): $(lzma_xz_seek_far_OBJECTS) $(lzma_xz_seek_far_DEPENDENCIES) $(EXTRA_lzma_xz_seek_far_DEPENDENCIES) @rm -f lzma_xz_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_seek_far_OBJECTS) $(lzma_xz_seek_far_LDADD) $(LIBS) lzma_xz_sync$(EXEEXT): $(lzma_xz_sync_OBJECTS) $(lzma_xz_sync_DEPENDENCIES) $(EXTRA_lzma_xz_sync_DEPENDENCIES) @rm -f lzma_xz_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lzma_xz_sync_OBJECTS) $(lzma_xz_sync_LDADD) $(LIBS) madd$(EXEEXT): $(madd_OBJECTS) $(madd_DEPENDENCIES) $(EXTRA_madd_DEPENDENCIES) @rm -f madd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_OBJECTS) $(madd_LDADD) $(LIBS) madd_affix$(EXEEXT): $(madd_affix_OBJECTS) $(madd_affix_DEPENDENCIES) $(EXTRA_madd_affix_DEPENDENCIES) @rm -f madd_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_affix_OBJECTS) $(madd_affix_LDADD) $(LIBS) madd_alias$(EXEEXT): $(madd_alias_OBJECTS) $(madd_alias_DEPENDENCIES) $(EXTRA_madd_alias_DEPENDENCIES) @rm -f madd_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_alias_OBJECTS) $(madd_alias_LDADD) $(LIBS) madd_alias_affix$(EXEEXT): $(madd_alias_affix_OBJECTS) $(madd_alias_affix_DEPENDENCIES) $(EXTRA_madd_alias_affix_DEPENDENCIES) @rm -f madd_alias_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_alias_affix_OBJECTS) $(madd_alias_affix_LDADD) $(LIBS) madd_bit$(EXEEXT): $(madd_bit_OBJECTS) $(madd_bit_DEPENDENCIES) $(EXTRA_madd_bit_DEPENDENCIES) @rm -f madd_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_bit_OBJECTS) $(madd_bit_LDADD) $(LIBS) madd_bit_invalid$(EXEEXT): $(madd_bit_invalid_OBJECTS) $(madd_bit_invalid_DEPENDENCIES) $(EXTRA_madd_bit_invalid_DEPENDENCIES) @rm -f madd_bit_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_bit_invalid_OBJECTS) $(madd_bit_invalid_LDADD) $(LIBS) madd_carray$(EXEEXT): $(madd_carray_OBJECTS) $(madd_carray_DEPENDENCIES) $(EXTRA_madd_carray_DEPENDENCIES) @rm -f madd_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_carray_OBJECTS) $(madd_carray_LDADD) $(LIBS) madd_clincom$(EXEEXT): $(madd_clincom_OBJECTS) $(madd_clincom_DEPENDENCIES) $(EXTRA_madd_clincom_DEPENDENCIES) @rm -f madd_clincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_clincom_OBJECTS) $(madd_clincom_LDADD) $(LIBS) madd_const$(EXEEXT): $(madd_const_OBJECTS) $(madd_const_DEPENDENCIES) $(EXTRA_madd_const_DEPENDENCIES) @rm -f madd_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_const_OBJECTS) $(madd_const_LDADD) $(LIBS) madd_cpolynom$(EXEEXT): $(madd_cpolynom_OBJECTS) $(madd_cpolynom_DEPENDENCIES) $(EXTRA_madd_cpolynom_DEPENDENCIES) @rm -f madd_cpolynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_cpolynom_OBJECTS) $(madd_cpolynom_LDADD) $(LIBS) madd_crecip$(EXEEXT): $(madd_crecip_OBJECTS) $(madd_crecip_DEPENDENCIES) $(EXTRA_madd_crecip_DEPENDENCIES) @rm -f madd_crecip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_crecip_OBJECTS) $(madd_crecip_LDADD) $(LIBS) madd_crecip89$(EXEEXT): $(madd_crecip89_OBJECTS) $(madd_crecip89_DEPENDENCIES) $(EXTRA_madd_crecip89_DEPENDENCIES) @rm -f madd_crecip89$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_crecip89_OBJECTS) $(madd_crecip89_LDADD) $(LIBS) madd_divide$(EXEEXT): $(madd_divide_OBJECTS) $(madd_divide_DEPENDENCIES) $(EXTRA_madd_divide_DEPENDENCIES) @rm -f madd_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_divide_OBJECTS) $(madd_divide_LDADD) $(LIBS) madd_index$(EXEEXT): $(madd_index_OBJECTS) $(madd_index_DEPENDENCIES) $(EXTRA_madd_index_DEPENDENCIES) @rm -f madd_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_index_OBJECTS) $(madd_index_LDADD) $(LIBS) madd_lincom$(EXEEXT): $(madd_lincom_OBJECTS) $(madd_lincom_DEPENDENCIES) $(EXTRA_madd_lincom_DEPENDENCIES) @rm -f madd_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_lincom_OBJECTS) $(madd_lincom_LDADD) $(LIBS) madd_lincom_invalid$(EXEEXT): $(madd_lincom_invalid_OBJECTS) $(madd_lincom_invalid_DEPENDENCIES) $(EXTRA_madd_lincom_invalid_DEPENDENCIES) @rm -f madd_lincom_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_lincom_invalid_OBJECTS) $(madd_lincom_invalid_LDADD) $(LIBS) madd_linterp$(EXEEXT): $(madd_linterp_OBJECTS) $(madd_linterp_DEPENDENCIES) $(EXTRA_madd_linterp_DEPENDENCIES) @rm -f madd_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_linterp_OBJECTS) $(madd_linterp_LDADD) $(LIBS) madd_linterp_invalid$(EXEEXT): $(madd_linterp_invalid_OBJECTS) $(madd_linterp_invalid_DEPENDENCIES) $(EXTRA_madd_linterp_invalid_DEPENDENCIES) @rm -f madd_linterp_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_linterp_invalid_OBJECTS) $(madd_linterp_invalid_LDADD) $(LIBS) madd_mplex$(EXEEXT): $(madd_mplex_OBJECTS) $(madd_mplex_DEPENDENCIES) $(EXTRA_madd_mplex_DEPENDENCIES) @rm -f madd_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_mplex_OBJECTS) $(madd_mplex_LDADD) $(LIBS) madd_multiply$(EXEEXT): $(madd_multiply_OBJECTS) $(madd_multiply_DEPENDENCIES) $(EXTRA_madd_multiply_DEPENDENCIES) @rm -f madd_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_multiply_OBJECTS) $(madd_multiply_LDADD) $(LIBS) madd_multiply_invalid$(EXEEXT): $(madd_multiply_invalid_OBJECTS) $(madd_multiply_invalid_DEPENDENCIES) $(EXTRA_madd_multiply_invalid_DEPENDENCIES) @rm -f madd_multiply_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_multiply_invalid_OBJECTS) $(madd_multiply_invalid_LDADD) $(LIBS) madd_phase$(EXEEXT): $(madd_phase_OBJECTS) $(madd_phase_DEPENDENCIES) $(EXTRA_madd_phase_DEPENDENCIES) @rm -f madd_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_phase_OBJECTS) $(madd_phase_LDADD) $(LIBS) madd_phase_invalid$(EXEEXT): $(madd_phase_invalid_OBJECTS) $(madd_phase_invalid_DEPENDENCIES) $(EXTRA_madd_phase_invalid_DEPENDENCIES) @rm -f madd_phase_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_phase_invalid_OBJECTS) $(madd_phase_invalid_LDADD) $(LIBS) madd_polynom$(EXEEXT): $(madd_polynom_OBJECTS) $(madd_polynom_DEPENDENCIES) $(EXTRA_madd_polynom_DEPENDENCIES) @rm -f madd_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_polynom_OBJECTS) $(madd_polynom_LDADD) $(LIBS) madd_recip$(EXEEXT): $(madd_recip_OBJECTS) $(madd_recip_DEPENDENCIES) $(EXTRA_madd_recip_DEPENDENCIES) @rm -f madd_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_recip_OBJECTS) $(madd_recip_LDADD) $(LIBS) madd_sbit$(EXEEXT): $(madd_sbit_OBJECTS) $(madd_sbit_DEPENDENCIES) $(EXTRA_madd_sbit_DEPENDENCIES) @rm -f madd_sbit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_sbit_OBJECTS) $(madd_sbit_LDADD) $(LIBS) madd_spec$(EXEEXT): $(madd_spec_OBJECTS) $(madd_spec_DEPENDENCIES) $(EXTRA_madd_spec_DEPENDENCIES) @rm -f madd_spec$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_spec_OBJECTS) $(madd_spec_LDADD) $(LIBS) madd_spec_directive$(EXEEXT): $(madd_spec_directive_OBJECTS) $(madd_spec_directive_DEPENDENCIES) $(EXTRA_madd_spec_directive_DEPENDENCIES) @rm -f madd_spec_directive$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_spec_directive_OBJECTS) $(madd_spec_directive_LDADD) $(LIBS) madd_spec_invalid$(EXEEXT): $(madd_spec_invalid_OBJECTS) $(madd_spec_invalid_DEPENDENCIES) $(EXTRA_madd_spec_invalid_DEPENDENCIES) @rm -f madd_spec_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_spec_invalid_OBJECTS) $(madd_spec_invalid_LDADD) $(LIBS) madd_spec_resolv$(EXEEXT): $(madd_spec_resolv_OBJECTS) $(madd_spec_resolv_DEPENDENCIES) $(EXTRA_madd_spec_resolv_DEPENDENCIES) @rm -f madd_spec_resolv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_spec_resolv_OBJECTS) $(madd_spec_resolv_LDADD) $(LIBS) madd_string$(EXEEXT): $(madd_string_OBJECTS) $(madd_string_DEPENDENCIES) $(EXTRA_madd_string_DEPENDENCIES) @rm -f madd_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_string_OBJECTS) $(madd_string_LDADD) $(LIBS) madd_window$(EXEEXT): $(madd_window_OBJECTS) $(madd_window_DEPENDENCIES) $(EXTRA_madd_window_DEPENDENCIES) @rm -f madd_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(madd_window_OBJECTS) $(madd_window_LDADD) $(LIBS) move_affix$(EXEEXT): $(move_affix_OBJECTS) $(move_affix_DEPENDENCIES) $(EXTRA_move_affix_DEPENDENCIES) @rm -f move_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_affix_OBJECTS) $(move_affix_LDADD) $(LIBS) move_affix_dup$(EXEEXT): $(move_affix_dup_OBJECTS) $(move_affix_dup_DEPENDENCIES) $(EXTRA_move_affix_dup_DEPENDENCIES) @rm -f move_affix_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_affix_dup_OBJECTS) $(move_affix_dup_LDADD) $(LIBS) move_affix_meta$(EXEEXT): $(move_affix_meta_OBJECTS) $(move_affix_meta_DEPENDENCIES) $(EXTRA_move_affix_meta_DEPENDENCIES) @rm -f move_affix_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_affix_meta_OBJECTS) $(move_affix_meta_LDADD) $(LIBS) move_affix_updb$(EXEEXT): $(move_affix_updb_OBJECTS) $(move_affix_updb_DEPENDENCIES) $(EXTRA_move_affix_updb_DEPENDENCIES) @rm -f move_affix_updb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_affix_updb_OBJECTS) $(move_affix_updb_LDADD) $(LIBS) move_alias$(EXEEXT): $(move_alias_OBJECTS) $(move_alias_DEPENDENCIES) $(EXTRA_move_alias_DEPENDENCIES) @rm -f move_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_alias_OBJECTS) $(move_alias_LDADD) $(LIBS) move_data_enc_ar$(EXEEXT): $(move_data_enc_ar_OBJECTS) $(move_data_enc_ar_DEPENDENCIES) $(EXTRA_move_data_enc_ar_DEPENDENCIES) @rm -f move_data_enc_ar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_data_enc_ar_OBJECTS) $(move_data_enc_ar_LDADD) $(LIBS) move_data_enc_ra$(EXEEXT): $(move_data_enc_ra_OBJECTS) $(move_data_enc_ra_DEPENDENCIES) $(EXTRA_move_data_enc_ra_DEPENDENCIES) @rm -f move_data_enc_ra$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_data_enc_ra_OBJECTS) $(move_data_enc_ra_LDADD) $(LIBS) move_data_endian$(EXEEXT): $(move_data_endian_OBJECTS) $(move_data_endian_DEPENDENCIES) $(EXTRA_move_data_endian_DEPENDENCIES) @rm -f move_data_endian$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_data_endian_OBJECTS) $(move_data_endian_LDADD) $(LIBS) move_data_foffs$(EXEEXT): $(move_data_foffs_OBJECTS) $(move_data_foffs_DEPENDENCIES) $(EXTRA_move_data_foffs_DEPENDENCIES) @rm -f move_data_foffs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_data_foffs_OBJECTS) $(move_data_foffs_LDADD) $(LIBS) move_data_foffs_neg$(EXEEXT): $(move_data_foffs_neg_OBJECTS) $(move_data_foffs_neg_DEPENDENCIES) $(EXTRA_move_data_foffs_neg_DEPENDENCIES) @rm -f move_data_foffs_neg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_data_foffs_neg_OBJECTS) $(move_data_foffs_neg_LDADD) $(LIBS) move_data_nop$(EXEEXT): $(move_data_nop_OBJECTS) $(move_data_nop_DEPENDENCIES) $(EXTRA_move_data_nop_DEPENDENCIES) @rm -f move_data_nop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_data_nop_OBJECTS) $(move_data_nop_LDADD) $(LIBS) move_index$(EXEEXT): $(move_index_OBJECTS) $(move_index_DEPENDENCIES) $(EXTRA_move_index_DEPENDENCIES) @rm -f move_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_index_OBJECTS) $(move_index_LDADD) $(LIBS) move_meta$(EXEEXT): $(move_meta_OBJECTS) $(move_meta_DEPENDENCIES) $(EXTRA_move_meta_DEPENDENCIES) @rm -f move_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_meta_OBJECTS) $(move_meta_LDADD) $(LIBS) move_move$(EXEEXT): $(move_move_OBJECTS) $(move_move_DEPENDENCIES) $(EXTRA_move_move_DEPENDENCIES) @rm -f move_move$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_move_OBJECTS) $(move_move_LDADD) $(LIBS) move_protect$(EXEEXT): $(move_protect_OBJECTS) $(move_protect_DEPENDENCIES) $(EXTRA_move_protect_DEPENDENCIES) @rm -f move_protect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_protect_OBJECTS) $(move_protect_LDADD) $(LIBS) move_subdir$(EXEEXT): $(move_subdir_OBJECTS) $(move_subdir_DEPENDENCIES) $(EXTRA_move_subdir_DEPENDENCIES) @rm -f move_subdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_subdir_OBJECTS) $(move_subdir_LDADD) $(LIBS) name_affix$(EXEEXT): $(name_affix_OBJECTS) $(name_affix_DEPENDENCIES) $(EXTRA_name_affix_DEPENDENCIES) @rm -f name_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_affix_OBJECTS) $(name_affix_LDADD) $(LIBS) name_affix_bad$(EXEEXT): $(name_affix_bad_OBJECTS) $(name_affix_bad_DEPENDENCIES) $(EXTRA_name_affix_bad_DEPENDENCIES) @rm -f name_affix_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_affix_bad_OBJECTS) $(name_affix_bad_LDADD) $(LIBS) name_alias$(EXEEXT): $(name_alias_OBJECTS) $(name_alias_DEPENDENCIES) $(EXTRA_name_alias_DEPENDENCIES) @rm -f name_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_alias_OBJECTS) $(name_alias_LDADD) $(LIBS) name_dangle$(EXEEXT): $(name_dangle_OBJECTS) $(name_dangle_DEPENDENCIES) $(EXTRA_name_dangle_DEPENDENCIES) @rm -f name_dangle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_dangle_OBJECTS) $(name_dangle_LDADD) $(LIBS) name_dot5$(EXEEXT): $(name_dot5_OBJECTS) $(name_dot5_DEPENDENCIES) $(EXTRA_name_dot5_DEPENDENCIES) @rm -f name_dot5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_dot5_OBJECTS) $(name_dot5_LDADD) $(LIBS) name_dot5r$(EXEEXT): $(name_dot5r_OBJECTS) $(name_dot5r_DEPENDENCIES) $(EXTRA_name_dot5r_DEPENDENCIES) @rm -f name_dot5r$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_dot5r_OBJECTS) $(name_dot5r_LDADD) $(LIBS) name_dot9$(EXEEXT): $(name_dot9_OBJECTS) $(name_dot9_DEPENDENCIES) $(EXTRA_name_dot9_DEPENDENCIES) @rm -f name_dot9$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_dot9_OBJECTS) $(name_dot9_LDADD) $(LIBS) name_dup$(EXEEXT): $(name_dup_OBJECTS) $(name_dup_DEPENDENCIES) $(EXTRA_name_dup_DEPENDENCIES) @rm -f name_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_dup_OBJECTS) $(name_dup_LDADD) $(LIBS) name_meta$(EXEEXT): $(name_meta_OBJECTS) $(name_meta_DEPENDENCIES) $(EXTRA_name_meta_DEPENDENCIES) @rm -f name_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_meta_OBJECTS) $(name_meta_LDADD) $(LIBS) name_move$(EXEEXT): $(name_move_OBJECTS) $(name_move_DEPENDENCIES) $(EXTRA_name_move_DEPENDENCIES) @rm -f name_move$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_move_OBJECTS) $(name_move_LDADD) $(LIBS) name_move_alias$(EXEEXT): $(name_move_alias_OBJECTS) $(name_move_alias_DEPENDENCIES) $(EXTRA_name_move_alias_DEPENDENCIES) @rm -f name_move_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_move_alias_OBJECTS) $(name_move_alias_LDADD) $(LIBS) name_name$(EXEEXT): $(name_name_OBJECTS) $(name_name_DEPENDENCIES) $(EXTRA_name_name_DEPENDENCIES) @rm -f name_name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_name_OBJECTS) $(name_name_LDADD) $(LIBS) name_updb$(EXEEXT): $(name_updb_OBJECTS) $(name_updb_DEPENDENCIES) $(EXTRA_name_updb_DEPENDENCIES) @rm -f name_updb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_updb_OBJECTS) $(name_updb_LDADD) $(LIBS) name_updb_affix$(EXEEXT): $(name_updb_affix_OBJECTS) $(name_updb_affix_DEPENDENCIES) $(EXTRA_name_updb_affix_DEPENDENCIES) @rm -f name_updb_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_updb_affix_OBJECTS) $(name_updb_affix_LDADD) $(LIBS) name_updb_alias$(EXEEXT): $(name_updb_alias_OBJECTS) $(name_updb_alias_DEPENDENCIES) $(EXTRA_name_updb_alias_DEPENDENCIES) @rm -f name_updb_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_updb_alias_OBJECTS) $(name_updb_alias_LDADD) $(LIBS) name_updb_carray$(EXEEXT): $(name_updb_carray_OBJECTS) $(name_updb_carray_DEPENDENCIES) $(EXTRA_name_updb_carray_DEPENDENCIES) @rm -f name_updb_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_updb_carray_OBJECTS) $(name_updb_carray_LDADD) $(LIBS) name_updb_const$(EXEEXT): $(name_updb_const_OBJECTS) $(name_updb_const_DEPENDENCIES) $(EXTRA_name_updb_const_DEPENDENCIES) @rm -f name_updb_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_updb_const_OBJECTS) $(name_updb_const_LDADD) $(LIBS) name_updb_const_alias$(EXEEXT): $(name_updb_const_alias_OBJECTS) $(name_updb_const_alias_DEPENDENCIES) $(EXTRA_name_updb_const_alias_DEPENDENCIES) @rm -f name_updb_const_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(name_updb_const_alias_OBJECTS) $(name_updb_const_alias_LDADD) $(LIBS) native_bit$(EXEEXT): $(native_bit_OBJECTS) $(native_bit_DEPENDENCIES) $(EXTRA_native_bit_DEPENDENCIES) @rm -f native_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_bit_OBJECTS) $(native_bit_LDADD) $(LIBS) native_const$(EXEEXT): $(native_const_OBJECTS) $(native_const_DEPENDENCIES) $(EXTRA_native_const_DEPENDENCIES) @rm -f native_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_const_OBJECTS) $(native_const_LDADD) $(LIBS) native_index$(EXEEXT): $(native_index_OBJECTS) $(native_index_DEPENDENCIES) $(EXTRA_native_index_DEPENDENCIES) @rm -f native_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_index_OBJECTS) $(native_index_LDADD) $(LIBS) native_lincom$(EXEEXT): $(native_lincom_OBJECTS) $(native_lincom_DEPENDENCIES) $(EXTRA_native_lincom_DEPENDENCIES) @rm -f native_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_lincom_OBJECTS) $(native_lincom_LDADD) $(LIBS) native_lincom_cmpin$(EXEEXT): $(native_lincom_cmpin_OBJECTS) $(native_lincom_cmpin_DEPENDENCIES) $(EXTRA_native_lincom_cmpin_DEPENDENCIES) @rm -f native_lincom_cmpin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_lincom_cmpin_OBJECTS) $(native_lincom_cmpin_LDADD) $(LIBS) native_lincom_cmpscal$(EXEEXT): $(native_lincom_cmpscal_OBJECTS) $(native_lincom_cmpscal_DEPENDENCIES) $(EXTRA_native_lincom_cmpscal_DEPENDENCIES) @rm -f native_lincom_cmpscal$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_lincom_cmpscal_OBJECTS) $(native_lincom_cmpscal_LDADD) $(LIBS) native_linterp$(EXEEXT): $(native_linterp_OBJECTS) $(native_linterp_DEPENDENCIES) $(EXTRA_native_linterp_DEPENDENCIES) @rm -f native_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_linterp_OBJECTS) $(native_linterp_LDADD) $(LIBS) native_linterp_cmp$(EXEEXT): $(native_linterp_cmp_OBJECTS) $(native_linterp_cmp_DEPENDENCIES) $(EXTRA_native_linterp_cmp_DEPENDENCIES) @rm -f native_linterp_cmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_linterp_cmp_OBJECTS) $(native_linterp_cmp_LDADD) $(LIBS) native_mult$(EXEEXT): $(native_mult_OBJECTS) $(native_mult_DEPENDENCIES) $(EXTRA_native_mult_DEPENDENCIES) @rm -f native_mult$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_mult_OBJECTS) $(native_mult_LDADD) $(LIBS) native_mult1$(EXEEXT): $(native_mult1_OBJECTS) $(native_mult1_DEPENDENCIES) $(EXTRA_native_mult1_DEPENDENCIES) @rm -f native_mult1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_mult1_OBJECTS) $(native_mult1_LDADD) $(LIBS) native_mult2$(EXEEXT): $(native_mult2_OBJECTS) $(native_mult2_DEPENDENCIES) $(EXTRA_native_mult2_DEPENDENCIES) @rm -f native_mult2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_mult2_OBJECTS) $(native_mult2_LDADD) $(LIBS) native_phase$(EXEEXT): $(native_phase_OBJECTS) $(native_phase_DEPENDENCIES) $(EXTRA_native_phase_DEPENDENCIES) @rm -f native_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_phase_OBJECTS) $(native_phase_LDADD) $(LIBS) native_polynom$(EXEEXT): $(native_polynom_OBJECTS) $(native_polynom_DEPENDENCIES) $(EXTRA_native_polynom_DEPENDENCIES) @rm -f native_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_polynom_OBJECTS) $(native_polynom_LDADD) $(LIBS) native_polynom_cmpin$(EXEEXT): $(native_polynom_cmpin_OBJECTS) $(native_polynom_cmpin_DEPENDENCIES) $(EXTRA_native_polynom_cmpin_DEPENDENCIES) @rm -f native_polynom_cmpin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_polynom_cmpin_OBJECTS) $(native_polynom_cmpin_LDADD) $(LIBS) native_polynom_cmpscal$(EXEEXT): $(native_polynom_cmpscal_OBJECTS) $(native_polynom_cmpscal_DEPENDENCIES) $(EXTRA_native_polynom_cmpscal_DEPENDENCIES) @rm -f native_polynom_cmpscal$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_polynom_cmpscal_OBJECTS) $(native_polynom_cmpscal_LDADD) $(LIBS) native_raw$(EXEEXT): $(native_raw_OBJECTS) $(native_raw_DEPENDENCIES) $(EXTRA_native_raw_DEPENDENCIES) @rm -f native_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_raw_OBJECTS) $(native_raw_LDADD) $(LIBS) native_recip$(EXEEXT): $(native_recip_OBJECTS) $(native_recip_DEPENDENCIES) $(EXTRA_native_recip_DEPENDENCIES) @rm -f native_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_recip_OBJECTS) $(native_recip_LDADD) $(LIBS) native_recip_cmpin$(EXEEXT): $(native_recip_cmpin_OBJECTS) $(native_recip_cmpin_DEPENDENCIES) $(EXTRA_native_recip_cmpin_DEPENDENCIES) @rm -f native_recip_cmpin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_recip_cmpin_OBJECTS) $(native_recip_cmpin_LDADD) $(LIBS) native_recip_cmpscal$(EXEEXT): $(native_recip_cmpscal_OBJECTS) $(native_recip_cmpscal_DEPENDENCIES) $(EXTRA_native_recip_cmpscal_DEPENDENCIES) @rm -f native_recip_cmpscal$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_recip_cmpscal_OBJECTS) $(native_recip_cmpscal_LDADD) $(LIBS) native_sbit$(EXEEXT): $(native_sbit_OBJECTS) $(native_sbit_DEPENDENCIES) $(EXTRA_native_sbit_DEPENDENCIES) @rm -f native_sbit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_sbit_OBJECTS) $(native_sbit_LDADD) $(LIBS) native_string$(EXEEXT): $(native_string_OBJECTS) $(native_string_DEPENDENCIES) $(EXTRA_native_string_DEPENDENCIES) @rm -f native_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(native_string_OBJECTS) $(native_string_LDADD) $(LIBS) nentries_alias$(EXEEXT): $(nentries_alias_OBJECTS) $(nentries_alias_DEPENDENCIES) $(EXTRA_nentries_alias_DEPENDENCIES) @rm -f nentries_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nentries_alias_OBJECTS) $(nentries_alias_LDADD) $(LIBS) nentries_hidden$(EXEEXT): $(nentries_hidden_OBJECTS) $(nentries_hidden_DEPENDENCIES) $(EXTRA_nentries_hidden_DEPENDENCIES) @rm -f nentries_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nentries_hidden_OBJECTS) $(nentries_hidden_LDADD) $(LIBS) nentries_noalias$(EXEEXT): $(nentries_noalias_OBJECTS) $(nentries_noalias_DEPENDENCIES) $(EXTRA_nentries_noalias_DEPENDENCIES) @rm -f nentries_noalias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nentries_noalias_OBJECTS) $(nentries_noalias_LDADD) $(LIBS) nentries_scalar$(EXEEXT): $(nentries_scalar_OBJECTS) $(nentries_scalar_DEPENDENCIES) $(EXTRA_nentries_scalar_DEPENDENCIES) @rm -f nentries_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nentries_scalar_OBJECTS) $(nentries_scalar_LDADD) $(LIBS) nfields_hidden$(EXEEXT): $(nfields_hidden_OBJECTS) $(nfields_hidden_DEPENDENCIES) $(EXTRA_nfields_hidden_DEPENDENCIES) @rm -f nfields_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_hidden_OBJECTS) $(nfields_hidden_LDADD) $(LIBS) nfields_invalid$(EXEEXT): $(nfields_invalid_OBJECTS) $(nfields_invalid_DEPENDENCIES) $(EXTRA_nfields_invalid_DEPENDENCIES) @rm -f nfields_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_invalid_OBJECTS) $(nfields_invalid_LDADD) $(LIBS) nfields_nfields$(EXEEXT): $(nfields_nfields_OBJECTS) $(nfields_nfields_DEPENDENCIES) $(EXTRA_nfields_nfields_DEPENDENCIES) @rm -f nfields_nfields$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_nfields_OBJECTS) $(nfields_nfields_LDADD) $(LIBS) nfields_type$(EXEEXT): $(nfields_type_OBJECTS) $(nfields_type_DEPENDENCIES) $(EXTRA_nfields_type_DEPENDENCIES) @rm -f nfields_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_type_OBJECTS) $(nfields_type_LDADD) $(LIBS) nfields_type_hidden$(EXEEXT): $(nfields_type_hidden_OBJECTS) $(nfields_type_hidden_DEPENDENCIES) $(EXTRA_nfields_type_hidden_DEPENDENCIES) @rm -f nfields_type_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_type_hidden_OBJECTS) $(nfields_type_hidden_LDADD) $(LIBS) nfields_type_invalid$(EXEEXT): $(nfields_type_invalid_OBJECTS) $(nfields_type_invalid_DEPENDENCIES) $(EXTRA_nfields_type_invalid_DEPENDENCIES) @rm -f nfields_type_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_type_invalid_OBJECTS) $(nfields_type_invalid_LDADD) $(LIBS) nfields_vector$(EXEEXT): $(nfields_vector_OBJECTS) $(nfields_vector_DEPENDENCIES) $(EXTRA_nfields_vector_DEPENDENCIES) @rm -f nfields_vector$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_vector_OBJECTS) $(nfields_vector_LDADD) $(LIBS) nfields_vector_hidden$(EXEEXT): $(nfields_vector_hidden_OBJECTS) $(nfields_vector_hidden_DEPENDENCIES) $(EXTRA_nfields_vector_hidden_DEPENDENCIES) @rm -f nfields_vector_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_vector_hidden_OBJECTS) $(nfields_vector_hidden_LDADD) $(LIBS) nfields_vector_invalid$(EXEEXT): $(nfields_vector_invalid_OBJECTS) $(nfields_vector_invalid_DEPENDENCIES) $(EXTRA_nfields_vector_invalid_DEPENDENCIES) @rm -f nfields_vector_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nfields_vector_invalid_OBJECTS) $(nfields_vector_invalid_LDADD) $(LIBS) nframes64$(EXEEXT): $(nframes64_OBJECTS) $(nframes64_DEPENDENCIES) $(EXTRA_nframes64_DEPENDENCIES) @rm -f nframes64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nframes64_OBJECTS) $(nframes64_LDADD) $(LIBS) nframes_empty$(EXEEXT): $(nframes_empty_OBJECTS) $(nframes_empty_DEPENDENCIES) $(EXTRA_nframes_empty_DEPENDENCIES) @rm -f nframes_empty$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nframes_empty_OBJECTS) $(nframes_empty_LDADD) $(LIBS) nframes_invalid$(EXEEXT): $(nframes_invalid_OBJECTS) $(nframes_invalid_DEPENDENCIES) $(EXTRA_nframes_invalid_DEPENDENCIES) @rm -f nframes_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nframes_invalid_OBJECTS) $(nframes_invalid_LDADD) $(LIBS) nframes_nframes$(EXEEXT): $(nframes_nframes_OBJECTS) $(nframes_nframes_DEPENDENCIES) $(EXTRA_nframes_nframes_DEPENDENCIES) @rm -f nframes_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nframes_nframes_OBJECTS) $(nframes_nframes_LDADD) $(LIBS) nframes_off64$(EXEEXT): $(nframes_off64_OBJECTS) $(nframes_off64_DEPENDENCIES) $(EXTRA_nframes_off64_DEPENDENCIES) @rm -f nframes_off64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nframes_off64_OBJECTS) $(nframes_off64_LDADD) $(LIBS) nframes_spf$(EXEEXT): $(nframes_spf_OBJECTS) $(nframes_spf_DEPENDENCIES) $(EXTRA_nframes_spf_DEPENDENCIES) @rm -f nframes_spf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nframes_spf_OBJECTS) $(nframes_spf_LDADD) $(LIBS) nmeta$(EXEEXT): $(nmeta_OBJECTS) $(nmeta_DEPENDENCIES) $(EXTRA_nmeta_DEPENDENCIES) @rm -f nmeta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_OBJECTS) $(nmeta_LDADD) $(LIBS) nmeta_hidden$(EXEEXT): $(nmeta_hidden_OBJECTS) $(nmeta_hidden_DEPENDENCIES) $(EXTRA_nmeta_hidden_DEPENDENCIES) @rm -f nmeta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_hidden_OBJECTS) $(nmeta_hidden_LDADD) $(LIBS) nmeta_invalid$(EXEEXT): $(nmeta_invalid_OBJECTS) $(nmeta_invalid_DEPENDENCIES) $(EXTRA_nmeta_invalid_DEPENDENCIES) @rm -f nmeta_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_invalid_OBJECTS) $(nmeta_invalid_LDADD) $(LIBS) nmeta_parent$(EXEEXT): $(nmeta_parent_OBJECTS) $(nmeta_parent_DEPENDENCIES) $(EXTRA_nmeta_parent_DEPENDENCIES) @rm -f nmeta_parent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_parent_OBJECTS) $(nmeta_parent_LDADD) $(LIBS) nmeta_type$(EXEEXT): $(nmeta_type_OBJECTS) $(nmeta_type_DEPENDENCIES) $(EXTRA_nmeta_type_DEPENDENCIES) @rm -f nmeta_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_type_OBJECTS) $(nmeta_type_LDADD) $(LIBS) nmeta_type_hidden$(EXEEXT): $(nmeta_type_hidden_OBJECTS) $(nmeta_type_hidden_DEPENDENCIES) $(EXTRA_nmeta_type_hidden_DEPENDENCIES) @rm -f nmeta_type_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_type_hidden_OBJECTS) $(nmeta_type_hidden_LDADD) $(LIBS) nmeta_type_invalid$(EXEEXT): $(nmeta_type_invalid_OBJECTS) $(nmeta_type_invalid_DEPENDENCIES) $(EXTRA_nmeta_type_invalid_DEPENDENCIES) @rm -f nmeta_type_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_type_invalid_OBJECTS) $(nmeta_type_invalid_LDADD) $(LIBS) nmeta_type_parent$(EXEEXT): $(nmeta_type_parent_OBJECTS) $(nmeta_type_parent_DEPENDENCIES) $(EXTRA_nmeta_type_parent_DEPENDENCIES) @rm -f nmeta_type_parent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_type_parent_OBJECTS) $(nmeta_type_parent_LDADD) $(LIBS) nmeta_vectors$(EXEEXT): $(nmeta_vectors_OBJECTS) $(nmeta_vectors_DEPENDENCIES) $(EXTRA_nmeta_vectors_DEPENDENCIES) @rm -f nmeta_vectors$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_vectors_OBJECTS) $(nmeta_vectors_LDADD) $(LIBS) nmeta_vectors_del$(EXEEXT): $(nmeta_vectors_del_OBJECTS) $(nmeta_vectors_del_DEPENDENCIES) $(EXTRA_nmeta_vectors_del_DEPENDENCIES) @rm -f nmeta_vectors_del$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_vectors_del_OBJECTS) $(nmeta_vectors_del_LDADD) $(LIBS) nmeta_vectors_hidden$(EXEEXT): $(nmeta_vectors_hidden_OBJECTS) $(nmeta_vectors_hidden_DEPENDENCIES) $(EXTRA_nmeta_vectors_hidden_DEPENDENCIES) @rm -f nmeta_vectors_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_vectors_hidden_OBJECTS) $(nmeta_vectors_hidden_LDADD) $(LIBS) nmeta_vectors_invalid$(EXEEXT): $(nmeta_vectors_invalid_OBJECTS) $(nmeta_vectors_invalid_DEPENDENCIES) $(EXTRA_nmeta_vectors_invalid_DEPENDENCIES) @rm -f nmeta_vectors_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_vectors_invalid_OBJECTS) $(nmeta_vectors_invalid_LDADD) $(LIBS) nmeta_vectors_parent$(EXEEXT): $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_DEPENDENCIES) $(EXTRA_nmeta_vectors_parent_DEPENDENCIES) @rm -f nmeta_vectors_parent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nmeta_vectors_parent_OBJECTS) $(nmeta_vectors_parent_LDADD) $(LIBS) open_abs$(EXEEXT): $(open_abs_OBJECTS) $(open_abs_DEPENDENCIES) $(EXTRA_open_abs_DEPENDENCIES) @rm -f open_abs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_abs_OBJECTS) $(open_abs_LDADD) $(LIBS) open_cb_abort$(EXEEXT): $(open_cb_abort_OBJECTS) $(open_cb_abort_DEPENDENCIES) $(EXTRA_open_cb_abort_DEPENDENCIES) @rm -f open_cb_abort$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_cb_abort_OBJECTS) $(open_cb_abort_LDADD) $(LIBS) open_cb_cont$(EXEEXT): $(open_cb_cont_OBJECTS) $(open_cb_cont_DEPENDENCIES) $(EXTRA_open_cb_cont_DEPENDENCIES) @rm -f open_cb_cont$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_cb_cont_OBJECTS) $(open_cb_cont_LDADD) $(LIBS) open_cb_ignore$(EXEEXT): $(open_cb_ignore_OBJECTS) $(open_cb_ignore_DEPENDENCIES) $(EXTRA_open_cb_ignore_DEPENDENCIES) @rm -f open_cb_ignore$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_cb_ignore_OBJECTS) $(open_cb_ignore_LDADD) $(LIBS) open_cb_invalid$(EXEEXT): $(open_cb_invalid_OBJECTS) $(open_cb_invalid_DEPENDENCIES) $(EXTRA_open_cb_invalid_DEPENDENCIES) @rm -f open_cb_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_cb_invalid_OBJECTS) $(open_cb_invalid_LDADD) $(LIBS) open_cb_rescan$(EXEEXT): $(open_cb_rescan_OBJECTS) $(open_cb_rescan_DEPENDENCIES) $(EXTRA_open_cb_rescan_DEPENDENCIES) @rm -f open_cb_rescan$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_cb_rescan_OBJECTS) $(open_cb_rescan_LDADD) $(LIBS) open_cb_rescan_alloc$(EXEEXT): $(open_cb_rescan_alloc_OBJECTS) $(open_cb_rescan_alloc_DEPENDENCIES) $(EXTRA_open_cb_rescan_alloc_DEPENDENCIES) @rm -f open_cb_rescan_alloc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_cb_rescan_alloc_OBJECTS) $(open_cb_rescan_alloc_LDADD) $(LIBS) open_eaccess$(EXEEXT): $(open_eaccess_OBJECTS) $(open_eaccess_DEPENDENCIES) $(EXTRA_open_eaccess_DEPENDENCIES) @rm -f open_eaccess$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_eaccess_OBJECTS) $(open_eaccess_LDADD) $(LIBS) open_invalid$(EXEEXT): $(open_invalid_OBJECTS) $(open_invalid_DEPENDENCIES) $(EXTRA_open_invalid_DEPENDENCIES) @rm -f open_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_invalid_OBJECTS) $(open_invalid_LDADD) $(LIBS) open_nonexistent$(EXEEXT): $(open_nonexistent_OBJECTS) $(open_nonexistent_DEPENDENCIES) $(EXTRA_open_nonexistent_DEPENDENCIES) @rm -f open_nonexistent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_nonexistent_OBJECTS) $(open_nonexistent_LDADD) $(LIBS) open_notdirfile$(EXEEXT): $(open_notdirfile_OBJECTS) $(open_notdirfile_DEPENDENCIES) $(EXTRA_open_notdirfile_DEPENDENCIES) @rm -f open_notdirfile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_notdirfile_OBJECTS) $(open_notdirfile_LDADD) $(LIBS) open_open$(EXEEXT): $(open_open_OBJECTS) $(open_open_DEPENDENCIES) $(EXTRA_open_open_DEPENDENCIES) @rm -f open_open$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_open_OBJECTS) $(open_open_LDADD) $(LIBS) open_rofs$(EXEEXT): $(open_rofs_OBJECTS) $(open_rofs_DEPENDENCIES) $(EXTRA_open_rofs_DEPENDENCIES) @rm -f open_rofs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_rofs_OBJECTS) $(open_rofs_LDADD) $(LIBS) open_sym_al$(EXEEXT): $(open_sym_al_OBJECTS) $(open_sym_al_DEPENDENCIES) $(EXTRA_open_sym_al_DEPENDENCIES) @rm -f open_sym_al$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_al_OBJECTS) $(open_sym_al_LDADD) $(LIBS) open_sym_at$(EXEEXT): $(open_sym_at_OBJECTS) $(open_sym_at_DEPENDENCIES) $(EXTRA_open_sym_at_DEPENDENCIES) @rm -f open_sym_at$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_at_OBJECTS) $(open_sym_at_LDADD) $(LIBS) open_sym_c$(EXEEXT): $(open_sym_c_OBJECTS) $(open_sym_c_DEPENDENCIES) $(EXTRA_open_sym_c_DEPENDENCIES) @rm -f open_sym_c$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_c_OBJECTS) $(open_sym_c_LDADD) $(LIBS) open_sym_cl$(EXEEXT): $(open_sym_cl_OBJECTS) $(open_sym_cl_DEPENDENCIES) $(EXTRA_open_sym_cl_DEPENDENCIES) @rm -f open_sym_cl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_cl_OBJECTS) $(open_sym_cl_LDADD) $(LIBS) open_sym_ct$(EXEEXT): $(open_sym_ct_OBJECTS) $(open_sym_ct_DEPENDENCIES) $(EXTRA_open_sym_ct_DEPENDENCIES) @rm -f open_sym_ct$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_ct_OBJECTS) $(open_sym_ct_LDADD) $(LIBS) open_sym_d$(EXEEXT): $(open_sym_d_OBJECTS) $(open_sym_d_DEPENDENCIES) $(EXTRA_open_sym_d_DEPENDENCIES) @rm -f open_sym_d$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_d_OBJECTS) $(open_sym_d_LDADD) $(LIBS) open_sym_l$(EXEEXT): $(open_sym_l_OBJECTS) $(open_sym_l_DEPENDENCIES) $(EXTRA_open_sym_l_DEPENDENCIES) @rm -f open_sym_l$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_l_OBJECTS) $(open_sym_l_LDADD) $(LIBS) open_sym_p$(EXEEXT): $(open_sym_p_OBJECTS) $(open_sym_p_DEPENDENCIES) $(EXTRA_open_sym_p_DEPENDENCIES) @rm -f open_sym_p$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_p_OBJECTS) $(open_sym_p_LDADD) $(LIBS) open_sym_pl$(EXEEXT): $(open_sym_pl_OBJECTS) $(open_sym_pl_DEPENDENCIES) $(EXTRA_open_sym_pl_DEPENDENCIES) @rm -f open_sym_pl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_pl_OBJECTS) $(open_sym_pl_LDADD) $(LIBS) open_sym_pt$(EXEEXT): $(open_sym_pt_OBJECTS) $(open_sym_pt_DEPENDENCIES) $(EXTRA_open_sym_pt_DEPENDENCIES) @rm -f open_sym_pt$(EXEEXT) $(AM_V_CCLD)$(LINK) $(open_sym_pt_OBJECTS) $(open_sym_pt_LDADD) $(LIBS) parse_alias$(EXEEXT): $(parse_alias_OBJECTS) $(parse_alias_DEPENDENCIES) $(EXTRA_parse_alias_DEPENDENCIES) @rm -f parse_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_alias_OBJECTS) $(parse_alias_LDADD) $(LIBS) parse_alias_code$(EXEEXT): $(parse_alias_code_OBJECTS) $(parse_alias_code_DEPENDENCIES) $(EXTRA_parse_alias_code_DEPENDENCIES) @rm -f parse_alias_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_alias_code_OBJECTS) $(parse_alias_code_LDADD) $(LIBS) parse_alias_dup$(EXEEXT): $(parse_alias_dup_OBJECTS) $(parse_alias_dup_DEPENDENCIES) $(EXTRA_parse_alias_dup_DEPENDENCIES) @rm -f parse_alias_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_alias_dup_OBJECTS) $(parse_alias_dup_LDADD) $(LIBS) parse_alias_meta$(EXEEXT): $(parse_alias_meta_OBJECTS) $(parse_alias_meta_DEPENDENCIES) $(EXTRA_parse_alias_meta_DEPENDENCIES) @rm -f parse_alias_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_alias_meta_OBJECTS) $(parse_alias_meta_LDADD) $(LIBS) parse_alias_missing$(EXEEXT): $(parse_alias_missing_OBJECTS) $(parse_alias_missing_DEPENDENCIES) $(EXTRA_parse_alias_missing_DEPENDENCIES) @rm -f parse_alias_missing$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_alias_missing_OBJECTS) $(parse_alias_missing_LDADD) $(LIBS) parse_badline$(EXEEXT): $(parse_badline_OBJECTS) $(parse_badline_DEPENDENCIES) $(EXTRA_parse_badline_DEPENDENCIES) @rm -f parse_badline$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_badline_OBJECTS) $(parse_badline_LDADD) $(LIBS) parse_bit$(EXEEXT): $(parse_bit_OBJECTS) $(parse_bit_DEPENDENCIES) $(EXTRA_parse_bit_DEPENDENCIES) @rm -f parse_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit_OBJECTS) $(parse_bit_LDADD) $(LIBS) parse_bit4$(EXEEXT): $(parse_bit4_OBJECTS) $(parse_bit4_DEPENDENCIES) $(EXTRA_parse_bit4_DEPENDENCIES) @rm -f parse_bit4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit4_OBJECTS) $(parse_bit4_LDADD) $(LIBS) parse_bit_bitnum$(EXEEXT): $(parse_bit_bitnum_OBJECTS) $(parse_bit_bitnum_DEPENDENCIES) $(EXTRA_parse_bit_bitnum_DEPENDENCIES) @rm -f parse_bit_bitnum$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit_bitnum_OBJECTS) $(parse_bit_bitnum_LDADD) $(LIBS) parse_bit_bitsize$(EXEEXT): $(parse_bit_bitsize_OBJECTS) $(parse_bit_bitsize_DEPENDENCIES) $(EXTRA_parse_bit_bitsize_DEPENDENCIES) @rm -f parse_bit_bitsize$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit_bitsize_OBJECTS) $(parse_bit_bitsize_LDADD) $(LIBS) parse_bit_ncols$(EXEEXT): $(parse_bit_ncols_OBJECTS) $(parse_bit_ncols_DEPENDENCIES) $(EXTRA_parse_bit_ncols_DEPENDENCIES) @rm -f parse_bit_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit_ncols_OBJECTS) $(parse_bit_ncols_LDADD) $(LIBS) parse_bit_numbits$(EXEEXT): $(parse_bit_numbits_OBJECTS) $(parse_bit_numbits_DEPENDENCIES) $(EXTRA_parse_bit_numbits_DEPENDENCIES) @rm -f parse_bit_numbits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit_numbits_OBJECTS) $(parse_bit_numbits_LDADD) $(LIBS) parse_bit_scalar$(EXEEXT): $(parse_bit_scalar_OBJECTS) $(parse_bit_scalar_DEPENDENCIES) $(EXTRA_parse_bit_scalar_DEPENDENCIES) @rm -f parse_bit_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_bit_scalar_OBJECTS) $(parse_bit_scalar_LDADD) $(LIBS) parse_carray$(EXEEXT): $(parse_carray_OBJECTS) $(parse_carray_DEPENDENCIES) $(EXTRA_parse_carray_DEPENDENCIES) @rm -f parse_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_carray_OBJECTS) $(parse_carray_LDADD) $(LIBS) parse_carray_long$(EXEEXT): $(parse_carray_long_OBJECTS) $(parse_carray_long_DEPENDENCIES) $(EXTRA_parse_carray_long_DEPENDENCIES) @rm -f parse_carray_long$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_carray_long_OBJECTS) $(parse_carray_long_LDADD) $(LIBS) parse_const$(EXEEXT): $(parse_const_OBJECTS) $(parse_const_DEPENDENCIES) $(EXTRA_parse_const_DEPENDENCIES) @rm -f parse_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_const_OBJECTS) $(parse_const_LDADD) $(LIBS) parse_const_complex$(EXEEXT): $(parse_const_complex_OBJECTS) $(parse_const_complex_DEPENDENCIES) $(EXTRA_parse_const_complex_DEPENDENCIES) @rm -f parse_const_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_const_complex_OBJECTS) $(parse_const_complex_LDADD) $(LIBS) parse_const_ncols$(EXEEXT): $(parse_const_ncols_OBJECTS) $(parse_const_ncols_DEPENDENCIES) $(EXTRA_parse_const_ncols_DEPENDENCIES) @rm -f parse_const_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_const_ncols_OBJECTS) $(parse_const_ncols_LDADD) $(LIBS) parse_divide$(EXEEXT): $(parse_divide_OBJECTS) $(parse_divide_DEPENDENCIES) $(EXTRA_parse_divide_DEPENDENCIES) @rm -f parse_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_divide_OBJECTS) $(parse_divide_LDADD) $(LIBS) parse_double$(EXEEXT): $(parse_double_OBJECTS) $(parse_double_DEPENDENCIES) $(EXTRA_parse_double_DEPENDENCIES) @rm -f parse_double$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_double_OBJECTS) $(parse_double_LDADD) $(LIBS) parse_duplicate$(EXEEXT): $(parse_duplicate_OBJECTS) $(parse_duplicate_DEPENDENCIES) $(EXTRA_parse_duplicate_DEPENDENCIES) @rm -f parse_duplicate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_duplicate_OBJECTS) $(parse_duplicate_LDADD) $(LIBS) parse_duplicate_ignore$(EXEEXT): $(parse_duplicate_ignore_OBJECTS) $(parse_duplicate_ignore_DEPENDENCIES) $(EXTRA_parse_duplicate_ignore_DEPENDENCIES) @rm -f parse_duplicate_ignore$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_duplicate_ignore_OBJECTS) $(parse_duplicate_ignore_LDADD) $(LIBS) parse_endian_bad$(EXEEXT): $(parse_endian_bad_OBJECTS) $(parse_endian_bad_DEPENDENCIES) $(EXTRA_parse_endian_bad_DEPENDENCIES) @rm -f parse_endian_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_endian_bad_OBJECTS) $(parse_endian_bad_LDADD) $(LIBS) parse_endian_big$(EXEEXT): $(parse_endian_big_OBJECTS) $(parse_endian_big_DEPENDENCIES) $(EXTRA_parse_endian_big_DEPENDENCIES) @rm -f parse_endian_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_endian_big_OBJECTS) $(parse_endian_big_LDADD) $(LIBS) parse_endian_force$(EXEEXT): $(parse_endian_force_OBJECTS) $(parse_endian_force_DEPENDENCIES) $(EXTRA_parse_endian_force_DEPENDENCIES) @rm -f parse_endian_force$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_endian_force_OBJECTS) $(parse_endian_force_LDADD) $(LIBS) parse_endian_little$(EXEEXT): $(parse_endian_little_OBJECTS) $(parse_endian_little_DEPENDENCIES) $(EXTRA_parse_endian_little_DEPENDENCIES) @rm -f parse_endian_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_endian_little_OBJECTS) $(parse_endian_little_LDADD) $(LIBS) parse_endian_slash$(EXEEXT): $(parse_endian_slash_OBJECTS) $(parse_endian_slash_DEPENDENCIES) $(EXTRA_parse_endian_slash_DEPENDENCIES) @rm -f parse_endian_slash$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_endian_slash_OBJECTS) $(parse_endian_slash_LDADD) $(LIBS) parse_eol$(EXEEXT): $(parse_eol_OBJECTS) $(parse_eol_DEPENDENCIES) $(EXTRA_parse_eol_DEPENDENCIES) @rm -f parse_eol$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_eol_OBJECTS) $(parse_eol_LDADD) $(LIBS) parse_foffs$(EXEEXT): $(parse_foffs_OBJECTS) $(parse_foffs_DEPENDENCIES) $(EXTRA_parse_foffs_DEPENDENCIES) @rm -f parse_foffs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_foffs_OBJECTS) $(parse_foffs_LDADD) $(LIBS) parse_foffs_include$(EXEEXT): $(parse_foffs_include_OBJECTS) $(parse_foffs_include_DEPENDENCIES) $(EXTRA_parse_foffs_include_DEPENDENCIES) @rm -f parse_foffs_include$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_foffs_include_OBJECTS) $(parse_foffs_include_LDADD) $(LIBS) parse_foffs_slash$(EXEEXT): $(parse_foffs_slash_OBJECTS) $(parse_foffs_slash_DEPENDENCIES) $(EXTRA_parse_foffs_slash_DEPENDENCIES) @rm -f parse_foffs_slash$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_foffs_slash_OBJECTS) $(parse_foffs_slash_LDADD) $(LIBS) parse_hex$(EXEEXT): $(parse_hex_OBJECTS) $(parse_hex_DEPENDENCIES) $(EXTRA_parse_hex_DEPENDENCIES) @rm -f parse_hex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_hex_OBJECTS) $(parse_hex_LDADD) $(LIBS) parse_hidden$(EXEEXT): $(parse_hidden_OBJECTS) $(parse_hidden_DEPENDENCIES) $(EXTRA_parse_hidden_DEPENDENCIES) @rm -f parse_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_hidden_OBJECTS) $(parse_hidden_LDADD) $(LIBS) parse_hidden_field$(EXEEXT): $(parse_hidden_field_OBJECTS) $(parse_hidden_field_DEPENDENCIES) $(EXTRA_parse_hidden_field_DEPENDENCIES) @rm -f parse_hidden_field$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_hidden_field_OBJECTS) $(parse_hidden_field_LDADD) $(LIBS) parse_hidden_meta$(EXEEXT): $(parse_hidden_meta_OBJECTS) $(parse_hidden_meta_DEPENDENCIES) $(EXTRA_parse_hidden_meta_DEPENDENCIES) @rm -f parse_hidden_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_hidden_meta_OBJECTS) $(parse_hidden_meta_LDADD) $(LIBS) parse_include$(EXEEXT): $(parse_include_OBJECTS) $(parse_include_DEPENDENCIES) $(EXTRA_parse_include_DEPENDENCIES) @rm -f parse_include$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_OBJECTS) $(parse_include_LDADD) $(LIBS) parse_include_absolute$(EXEEXT): $(parse_include_absolute_OBJECTS) $(parse_include_absolute_DEPENDENCIES) $(EXTRA_parse_include_absolute_DEPENDENCIES) @rm -f parse_include_absolute$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_absolute_OBJECTS) $(parse_include_absolute_LDADD) $(LIBS) parse_include_absrel$(EXEEXT): $(parse_include_absrel_OBJECTS) $(parse_include_absrel_DEPENDENCIES) $(EXTRA_parse_include_absrel_DEPENDENCIES) @rm -f parse_include_absrel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_absrel_OBJECTS) $(parse_include_absrel_LDADD) $(LIBS) parse_include_affix_bad$(EXEEXT): $(parse_include_affix_bad_OBJECTS) $(parse_include_affix_bad_DEPENDENCIES) $(EXTRA_parse_include_affix_bad_DEPENDENCIES) @rm -f parse_include_affix_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_affix_bad_OBJECTS) $(parse_include_affix_bad_LDADD) $(LIBS) parse_include_affix_ref$(EXEEXT): $(parse_include_affix_ref_OBJECTS) $(parse_include_affix_ref_DEPENDENCIES) $(EXTRA_parse_include_affix_ref_DEPENDENCIES) @rm -f parse_include_affix_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_affix_ref_OBJECTS) $(parse_include_affix_ref_LDADD) $(LIBS) parse_include_dir$(EXEEXT): $(parse_include_dir_OBJECTS) $(parse_include_dir_DEPENDENCIES) $(EXTRA_parse_include_dir_DEPENDENCIES) @rm -f parse_include_dir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_dir_OBJECTS) $(parse_include_dir_LDADD) $(LIBS) parse_include_loop$(EXEEXT): $(parse_include_loop_OBJECTS) $(parse_include_loop_DEPENDENCIES) $(EXTRA_parse_include_loop_DEPENDENCIES) @rm -f parse_include_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_loop_OBJECTS) $(parse_include_loop_LDADD) $(LIBS) parse_include_nonexistent$(EXEEXT): $(parse_include_nonexistent_OBJECTS) $(parse_include_nonexistent_DEPENDENCIES) $(EXTRA_parse_include_nonexistent_DEPENDENCIES) @rm -f parse_include_nonexistent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_nonexistent_OBJECTS) $(parse_include_nonexistent_LDADD) $(LIBS) parse_include_prefix$(EXEEXT): $(parse_include_prefix_OBJECTS) $(parse_include_prefix_DEPENDENCIES) $(EXTRA_parse_include_prefix_DEPENDENCIES) @rm -f parse_include_prefix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_prefix_OBJECTS) $(parse_include_prefix_LDADD) $(LIBS) parse_include_prefix_dup$(EXEEXT): $(parse_include_prefix_dup_OBJECTS) $(parse_include_prefix_dup_DEPENDENCIES) $(EXTRA_parse_include_prefix_dup_DEPENDENCIES) @rm -f parse_include_prefix_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_prefix_dup_OBJECTS) $(parse_include_prefix_dup_LDADD) $(LIBS) parse_include_preprefix$(EXEEXT): $(parse_include_preprefix_OBJECTS) $(parse_include_preprefix_DEPENDENCIES) $(EXTRA_parse_include_preprefix_DEPENDENCIES) @rm -f parse_include_preprefix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_preprefix_OBJECTS) $(parse_include_preprefix_LDADD) $(LIBS) parse_include_ref$(EXEEXT): $(parse_include_ref_OBJECTS) $(parse_include_ref_DEPENDENCIES) $(EXTRA_parse_include_ref_DEPENDENCIES) @rm -f parse_include_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_ref_OBJECTS) $(parse_include_ref_LDADD) $(LIBS) parse_include_relabs$(EXEEXT): $(parse_include_relabs_OBJECTS) $(parse_include_relabs_DEPENDENCIES) $(EXTRA_parse_include_relabs_DEPENDENCIES) @rm -f parse_include_relabs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_relabs_OBJECTS) $(parse_include_relabs_LDADD) $(LIBS) parse_include_relrel$(EXEEXT): $(parse_include_relrel_OBJECTS) $(parse_include_relrel_DEPENDENCIES) $(EXTRA_parse_include_relrel_DEPENDENCIES) @rm -f parse_include_relrel$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_relrel_OBJECTS) $(parse_include_relrel_LDADD) $(LIBS) parse_include_slash$(EXEEXT): $(parse_include_slash_OBJECTS) $(parse_include_slash_DEPENDENCIES) $(EXTRA_parse_include_slash_DEPENDENCIES) @rm -f parse_include_slash$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_slash_OBJECTS) $(parse_include_slash_LDADD) $(LIBS) parse_include_suffix$(EXEEXT): $(parse_include_suffix_OBJECTS) $(parse_include_suffix_DEPENDENCIES) $(EXTRA_parse_include_suffix_DEPENDENCIES) @rm -f parse_include_suffix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_suffix_OBJECTS) $(parse_include_suffix_LDADD) $(LIBS) parse_include_sufsuffix$(EXEEXT): $(parse_include_sufsuffix_OBJECTS) $(parse_include_sufsuffix_DEPENDENCIES) $(EXTRA_parse_include_sufsuffix_DEPENDENCIES) @rm -f parse_include_sufsuffix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_include_sufsuffix_OBJECTS) $(parse_include_sufsuffix_LDADD) $(LIBS) parse_index$(EXEEXT): $(parse_index_OBJECTS) $(parse_index_DEPENDENCIES) $(EXTRA_parse_index_DEPENDENCIES) @rm -f parse_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_index_OBJECTS) $(parse_index_LDADD) $(LIBS) parse_lincom$(EXEEXT): $(parse_lincom_OBJECTS) $(parse_lincom_DEPENDENCIES) $(EXTRA_parse_lincom_DEPENDENCIES) @rm -f parse_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_OBJECTS) $(parse_lincom_LDADD) $(LIBS) parse_lincom_ncols1$(EXEEXT): $(parse_lincom_ncols1_OBJECTS) $(parse_lincom_ncols1_DEPENDENCIES) $(EXTRA_parse_lincom_ncols1_DEPENDENCIES) @rm -f parse_lincom_ncols1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_ncols1_OBJECTS) $(parse_lincom_ncols1_LDADD) $(LIBS) parse_lincom_ncols2$(EXEEXT): $(parse_lincom_ncols2_OBJECTS) $(parse_lincom_ncols2_DEPENDENCIES) $(EXTRA_parse_lincom_ncols2_DEPENDENCIES) @rm -f parse_lincom_ncols2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_ncols2_OBJECTS) $(parse_lincom_ncols2_LDADD) $(LIBS) parse_lincom_nfields$(EXEEXT): $(parse_lincom_nfields_OBJECTS) $(parse_lincom_nfields_DEPENDENCIES) $(EXTRA_parse_lincom_nfields_DEPENDENCIES) @rm -f parse_lincom_nfields$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_nfields_OBJECTS) $(parse_lincom_nfields_LDADD) $(LIBS) parse_lincom_nofields$(EXEEXT): $(parse_lincom_nofields_OBJECTS) $(parse_lincom_nofields_DEPENDENCIES) $(EXTRA_parse_lincom_nofields_DEPENDENCIES) @rm -f parse_lincom_nofields$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_nofields_OBJECTS) $(parse_lincom_nofields_LDADD) $(LIBS) parse_lincom_non$(EXEEXT): $(parse_lincom_non_OBJECTS) $(parse_lincom_non_DEPENDENCIES) $(EXTRA_parse_lincom_non_DEPENDENCIES) @rm -f parse_lincom_non$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_non_OBJECTS) $(parse_lincom_non_LDADD) $(LIBS) parse_lincom_non_ncols$(EXEEXT): $(parse_lincom_non_ncols_OBJECTS) $(parse_lincom_non_ncols_DEPENDENCIES) $(EXTRA_parse_lincom_non_ncols_DEPENDENCIES) @rm -f parse_lincom_non_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_non_ncols_OBJECTS) $(parse_lincom_non_ncols_LDADD) $(LIBS) parse_lincom_scalar$(EXEEXT): $(parse_lincom_scalar_OBJECTS) $(parse_lincom_scalar_DEPENDENCIES) $(EXTRA_parse_lincom_scalar_DEPENDENCIES) @rm -f parse_lincom_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_lincom_scalar_OBJECTS) $(parse_lincom_scalar_LDADD) $(LIBS) parse_linterp$(EXEEXT): $(parse_linterp_OBJECTS) $(parse_linterp_DEPENDENCIES) $(EXTRA_parse_linterp_DEPENDENCIES) @rm -f parse_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_linterp_OBJECTS) $(parse_linterp_LDADD) $(LIBS) parse_linterp_ncols$(EXEEXT): $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_DEPENDENCIES) $(EXTRA_parse_linterp_ncols_DEPENDENCIES) @rm -f parse_linterp_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_linterp_ncols_OBJECTS) $(parse_linterp_ncols_LDADD) $(LIBS) parse_literal_cmpbad$(EXEEXT): $(parse_literal_cmpbad_OBJECTS) $(parse_literal_cmpbad_DEPENDENCIES) $(EXTRA_parse_literal_cmpbad_DEPENDENCIES) @rm -f parse_literal_cmpbad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_cmpbad_OBJECTS) $(parse_literal_cmpbad_LDADD) $(LIBS) parse_literal_fltcmp$(EXEEXT): $(parse_literal_fltcmp_OBJECTS) $(parse_literal_fltcmp_DEPENDENCIES) $(EXTRA_parse_literal_fltcmp_DEPENDENCIES) @rm -f parse_literal_fltcmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_fltcmp_OBJECTS) $(parse_literal_fltcmp_LDADD) $(LIBS) parse_literal_fltcmp0$(EXEEXT): $(parse_literal_fltcmp0_OBJECTS) $(parse_literal_fltcmp0_DEPENDENCIES) $(EXTRA_parse_literal_fltcmp0_DEPENDENCIES) @rm -f parse_literal_fltcmp0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_fltcmp0_OBJECTS) $(parse_literal_fltcmp0_LDADD) $(LIBS) parse_literal_intcmp$(EXEEXT): $(parse_literal_intcmp_OBJECTS) $(parse_literal_intcmp_DEPENDENCIES) $(EXTRA_parse_literal_intcmp_DEPENDENCIES) @rm -f parse_literal_intcmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_intcmp_OBJECTS) $(parse_literal_intcmp_LDADD) $(LIBS) parse_literal_intcmp0$(EXEEXT): $(parse_literal_intcmp0_OBJECTS) $(parse_literal_intcmp0_DEPENDENCIES) $(EXTRA_parse_literal_intcmp0_DEPENDENCIES) @rm -f parse_literal_intcmp0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_intcmp0_OBJECTS) $(parse_literal_intcmp0_LDADD) $(LIBS) parse_literal_uintcmp$(EXEEXT): $(parse_literal_uintcmp_OBJECTS) $(parse_literal_uintcmp_DEPENDENCIES) $(EXTRA_parse_literal_uintcmp_DEPENDENCIES) @rm -f parse_literal_uintcmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_uintcmp_OBJECTS) $(parse_literal_uintcmp_LDADD) $(LIBS) parse_literal_uintcmp0$(EXEEXT): $(parse_literal_uintcmp0_OBJECTS) $(parse_literal_uintcmp0_DEPENDENCIES) $(EXTRA_parse_literal_uintcmp0_DEPENDENCIES) @rm -f parse_literal_uintcmp0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_literal_uintcmp0_OBJECTS) $(parse_literal_uintcmp0_LDADD) $(LIBS) parse_malias$(EXEEXT): $(parse_malias_OBJECTS) $(parse_malias_DEPENDENCIES) $(EXTRA_parse_malias_DEPENDENCIES) @rm -f parse_malias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_malias_OBJECTS) $(parse_malias_LDADD) $(LIBS) parse_malias_dup$(EXEEXT): $(parse_malias_dup_OBJECTS) $(parse_malias_dup_DEPENDENCIES) $(EXTRA_parse_malias_dup_DEPENDENCIES) @rm -f parse_malias_dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_malias_dup_OBJECTS) $(parse_malias_dup_LDADD) $(LIBS) parse_malias_meta$(EXEEXT): $(parse_malias_meta_OBJECTS) $(parse_malias_meta_DEPENDENCIES) $(EXTRA_parse_malias_meta_DEPENDENCIES) @rm -f parse_malias_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_malias_meta_OBJECTS) $(parse_malias_meta_LDADD) $(LIBS) parse_meta$(EXEEXT): $(parse_meta_OBJECTS) $(parse_meta_DEPENDENCIES) $(EXTRA_parse_meta_DEPENDENCIES) @rm -f parse_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_OBJECTS) $(parse_meta_LDADD) $(LIBS) parse_meta_affix$(EXEEXT): $(parse_meta_affix_OBJECTS) $(parse_meta_affix_DEPENDENCIES) $(EXTRA_parse_meta_affix_DEPENDENCIES) @rm -f parse_meta_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_affix_OBJECTS) $(parse_meta_affix_LDADD) $(LIBS) parse_meta_alias$(EXEEXT): $(parse_meta_alias_OBJECTS) $(parse_meta_alias_DEPENDENCIES) $(EXTRA_parse_meta_alias_DEPENDENCIES) @rm -f parse_meta_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_alias_OBJECTS) $(parse_meta_alias_LDADD) $(LIBS) parse_meta_frag$(EXEEXT): $(parse_meta_frag_OBJECTS) $(parse_meta_frag_DEPENDENCIES) $(EXTRA_parse_meta_frag_DEPENDENCIES) @rm -f parse_meta_frag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_frag_OBJECTS) $(parse_meta_frag_LDADD) $(LIBS) parse_meta_implicit$(EXEEXT): $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_DEPENDENCIES) $(EXTRA_parse_meta_implicit_DEPENDENCIES) @rm -f parse_meta_implicit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_implicit_OBJECTS) $(parse_meta_implicit_LDADD) $(LIBS) parse_meta_implicit2$(EXEEXT): $(parse_meta_implicit2_OBJECTS) $(parse_meta_implicit2_DEPENDENCIES) $(EXTRA_parse_meta_implicit2_DEPENDENCIES) @rm -f parse_meta_implicit2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_implicit2_OBJECTS) $(parse_meta_implicit2_LDADD) $(LIBS) parse_meta_implicit_affix$(EXEEXT): $(parse_meta_implicit_affix_OBJECTS) $(parse_meta_implicit_affix_DEPENDENCIES) $(EXTRA_parse_meta_implicit_affix_DEPENDENCIES) @rm -f parse_meta_implicit_affix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_implicit_affix_OBJECTS) $(parse_meta_implicit_affix_LDADD) $(LIBS) parse_meta_index$(EXEEXT): $(parse_meta_index_OBJECTS) $(parse_meta_index_DEPENDENCIES) $(EXTRA_parse_meta_index_DEPENDENCIES) @rm -f parse_meta_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_index_OBJECTS) $(parse_meta_index_LDADD) $(LIBS) parse_meta_index2$(EXEEXT): $(parse_meta_index2_OBJECTS) $(parse_meta_index2_DEPENDENCIES) $(EXTRA_parse_meta_index2_DEPENDENCIES) @rm -f parse_meta_index2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_index2_OBJECTS) $(parse_meta_index2_LDADD) $(LIBS) parse_meta_jump$(EXEEXT): $(parse_meta_jump_OBJECTS) $(parse_meta_jump_DEPENDENCIES) $(EXTRA_parse_meta_jump_DEPENDENCIES) @rm -f parse_meta_jump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_jump_OBJECTS) $(parse_meta_jump_LDADD) $(LIBS) parse_meta_malias$(EXEEXT): $(parse_meta_malias_OBJECTS) $(parse_meta_malias_DEPENDENCIES) $(EXTRA_parse_meta_malias_DEPENDENCIES) @rm -f parse_meta_malias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_malias_OBJECTS) $(parse_meta_malias_LDADD) $(LIBS) parse_meta_meta$(EXEEXT): $(parse_meta_meta_OBJECTS) $(parse_meta_meta_DEPENDENCIES) $(EXTRA_parse_meta_meta_DEPENDENCIES) @rm -f parse_meta_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_meta_OBJECTS) $(parse_meta_meta_LDADD) $(LIBS) parse_meta_parent$(EXEEXT): $(parse_meta_parent_OBJECTS) $(parse_meta_parent_DEPENDENCIES) $(EXTRA_parse_meta_parent_DEPENDENCIES) @rm -f parse_meta_parent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_parent_OBJECTS) $(parse_meta_parent_LDADD) $(LIBS) parse_meta_raw$(EXEEXT): $(parse_meta_raw_OBJECTS) $(parse_meta_raw_DEPENDENCIES) $(EXTRA_parse_meta_raw_DEPENDENCIES) @rm -f parse_meta_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_meta_raw_OBJECTS) $(parse_meta_raw_LDADD) $(LIBS) parse_mplex$(EXEEXT): $(parse_mplex_OBJECTS) $(parse_mplex_DEPENDENCIES) $(EXTRA_parse_mplex_DEPENDENCIES) @rm -f parse_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_mplex_OBJECTS) $(parse_mplex_LDADD) $(LIBS) parse_mplex_ncols$(EXEEXT): $(parse_mplex_ncols_OBJECTS) $(parse_mplex_ncols_DEPENDENCIES) $(EXTRA_parse_mplex_ncols_DEPENDENCIES) @rm -f parse_mplex_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_mplex_ncols_OBJECTS) $(parse_mplex_ncols_LDADD) $(LIBS) parse_mplex_nomax$(EXEEXT): $(parse_mplex_nomax_OBJECTS) $(parse_mplex_nomax_DEPENDENCIES) $(EXTRA_parse_mplex_nomax_DEPENDENCIES) @rm -f parse_mplex_nomax$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_mplex_nomax_OBJECTS) $(parse_mplex_nomax_LDADD) $(LIBS) parse_mplex_scalar$(EXEEXT): $(parse_mplex_scalar_OBJECTS) $(parse_mplex_scalar_DEPENDENCIES) $(EXTRA_parse_mplex_scalar_DEPENDENCIES) @rm -f parse_mplex_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_mplex_scalar_OBJECTS) $(parse_mplex_scalar_LDADD) $(LIBS) parse_multiply$(EXEEXT): $(parse_multiply_OBJECTS) $(parse_multiply_DEPENDENCIES) $(EXTRA_parse_multiply_DEPENDENCIES) @rm -f parse_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_multiply_OBJECTS) $(parse_multiply_LDADD) $(LIBS) parse_multiply_ncols$(EXEEXT): $(parse_multiply_ncols_OBJECTS) $(parse_multiply_ncols_DEPENDENCIES) $(EXTRA_parse_multiply_ncols_DEPENDENCIES) @rm -f parse_multiply_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_multiply_ncols_OBJECTS) $(parse_multiply_ncols_LDADD) $(LIBS) parse_name$(EXEEXT): $(parse_name_OBJECTS) $(parse_name_DEPENDENCIES) $(EXTRA_parse_name_DEPENDENCIES) @rm -f parse_name$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_name_OBJECTS) $(parse_name_LDADD) $(LIBS) parse_name_dot$(EXEEXT): $(parse_name_dot_OBJECTS) $(parse_name_dot_DEPENDENCIES) $(EXTRA_parse_name_dot_DEPENDENCIES) @rm -f parse_name_dot$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_name_dot_OBJECTS) $(parse_name_dot_LDADD) $(LIBS) parse_name_ext$(EXEEXT): $(parse_name_ext_OBJECTS) $(parse_name_ext_DEPENDENCIES) $(EXTRA_parse_name_ext_DEPENDENCIES) @rm -f parse_name_ext$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_name_ext_OBJECTS) $(parse_name_ext_LDADD) $(LIBS) parse_name_pedantic$(EXEEXT): $(parse_name_pedantic_OBJECTS) $(parse_name_pedantic_DEPENDENCIES) $(EXTRA_parse_name_pedantic_DEPENDENCIES) @rm -f parse_name_pedantic$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_name_pedantic_OBJECTS) $(parse_name_pedantic_LDADD) $(LIBS) parse_ncols$(EXEEXT): $(parse_ncols_OBJECTS) $(parse_ncols_DEPENDENCIES) $(EXTRA_parse_ncols_DEPENDENCIES) @rm -f parse_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_ncols_OBJECTS) $(parse_ncols_LDADD) $(LIBS) parse_octal_zero$(EXEEXT): $(parse_octal_zero_OBJECTS) $(parse_octal_zero_DEPENDENCIES) $(EXTRA_parse_octal_zero_DEPENDENCIES) @rm -f parse_octal_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_octal_zero_OBJECTS) $(parse_octal_zero_LDADD) $(LIBS) parse_phase$(EXEEXT): $(parse_phase_OBJECTS) $(parse_phase_DEPENDENCIES) $(EXTRA_parse_phase_DEPENDENCIES) @rm -f parse_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_phase_OBJECTS) $(parse_phase_LDADD) $(LIBS) parse_phase_ncols$(EXEEXT): $(parse_phase_ncols_OBJECTS) $(parse_phase_ncols_DEPENDENCIES) $(EXTRA_parse_phase_ncols_DEPENDENCIES) @rm -f parse_phase_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_phase_ncols_OBJECTS) $(parse_phase_ncols_LDADD) $(LIBS) parse_phase_scalar$(EXEEXT): $(parse_phase_scalar_OBJECTS) $(parse_phase_scalar_DEPENDENCIES) $(EXTRA_parse_phase_scalar_DEPENDENCIES) @rm -f parse_phase_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_phase_scalar_OBJECTS) $(parse_phase_scalar_LDADD) $(LIBS) parse_polynom$(EXEEXT): $(parse_polynom_OBJECTS) $(parse_polynom_DEPENDENCIES) $(EXTRA_parse_polynom_DEPENDENCIES) @rm -f parse_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_polynom_OBJECTS) $(parse_polynom_LDADD) $(LIBS) parse_polynom_ncols1$(EXEEXT): $(parse_polynom_ncols1_OBJECTS) $(parse_polynom_ncols1_DEPENDENCIES) $(EXTRA_parse_polynom_ncols1_DEPENDENCIES) @rm -f parse_polynom_ncols1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_polynom_ncols1_OBJECTS) $(parse_polynom_ncols1_LDADD) $(LIBS) parse_polynom_ncols2$(EXEEXT): $(parse_polynom_ncols2_OBJECTS) $(parse_polynom_ncols2_DEPENDENCIES) $(EXTRA_parse_polynom_ncols2_DEPENDENCIES) @rm -f parse_polynom_ncols2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_polynom_ncols2_OBJECTS) $(parse_polynom_ncols2_LDADD) $(LIBS) parse_polynom_scalar$(EXEEXT): $(parse_polynom_scalar_OBJECTS) $(parse_polynom_scalar_DEPENDENCIES) $(EXTRA_parse_polynom_scalar_DEPENDENCIES) @rm -f parse_polynom_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_polynom_scalar_OBJECTS) $(parse_polynom_scalar_LDADD) $(LIBS) parse_protect_all$(EXEEXT): $(parse_protect_all_OBJECTS) $(parse_protect_all_DEPENDENCIES) $(EXTRA_parse_protect_all_DEPENDENCIES) @rm -f parse_protect_all$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_protect_all_OBJECTS) $(parse_protect_all_LDADD) $(LIBS) parse_protect_bad$(EXEEXT): $(parse_protect_bad_OBJECTS) $(parse_protect_bad_DEPENDENCIES) $(EXTRA_parse_protect_bad_DEPENDENCIES) @rm -f parse_protect_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_protect_bad_OBJECTS) $(parse_protect_bad_LDADD) $(LIBS) parse_protect_data$(EXEEXT): $(parse_protect_data_OBJECTS) $(parse_protect_data_DEPENDENCIES) $(EXTRA_parse_protect_data_DEPENDENCIES) @rm -f parse_protect_data$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_protect_data_OBJECTS) $(parse_protect_data_LDADD) $(LIBS) parse_protect_format$(EXEEXT): $(parse_protect_format_OBJECTS) $(parse_protect_format_DEPENDENCIES) $(EXTRA_parse_protect_format_DEPENDENCIES) @rm -f parse_protect_format$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_protect_format_OBJECTS) $(parse_protect_format_LDADD) $(LIBS) parse_protect_none$(EXEEXT): $(parse_protect_none_OBJECTS) $(parse_protect_none_DEPENDENCIES) $(EXTRA_parse_protect_none_DEPENDENCIES) @rm -f parse_protect_none$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_protect_none_OBJECTS) $(parse_protect_none_LDADD) $(LIBS) parse_quote$(EXEEXT): $(parse_quote_OBJECTS) $(parse_quote_DEPENDENCIES) $(EXTRA_parse_quote_DEPENDENCIES) @rm -f parse_quote$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_quote_OBJECTS) $(parse_quote_LDADD) $(LIBS) parse_quote_mismatch$(EXEEXT): $(parse_quote_mismatch_OBJECTS) $(parse_quote_mismatch_DEPENDENCIES) $(EXTRA_parse_quote_mismatch_DEPENDENCIES) @rm -f parse_quote_mismatch$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_quote_mismatch_OBJECTS) $(parse_quote_mismatch_LDADD) $(LIBS) parse_raw$(EXEEXT): $(parse_raw_OBJECTS) $(parse_raw_DEPENDENCIES) $(EXTRA_parse_raw_DEPENDENCIES) @rm -f parse_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_OBJECTS) $(parse_raw_LDADD) $(LIBS) parse_raw_char$(EXEEXT): $(parse_raw_char_OBJECTS) $(parse_raw_char_DEPENDENCIES) $(EXTRA_parse_raw_char_DEPENDENCIES) @rm -f parse_raw_char$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_char_OBJECTS) $(parse_raw_char_LDADD) $(LIBS) parse_raw_char_bad$(EXEEXT): $(parse_raw_char_bad_OBJECTS) $(parse_raw_char_bad_DEPENDENCIES) $(EXTRA_parse_raw_char_bad_DEPENDENCIES) @rm -f parse_raw_char_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_char_bad_OBJECTS) $(parse_raw_char_bad_LDADD) $(LIBS) parse_raw_ncols$(EXEEXT): $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_DEPENDENCIES) $(EXTRA_parse_raw_ncols_DEPENDENCIES) @rm -f parse_raw_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_ncols_OBJECTS) $(parse_raw_ncols_LDADD) $(LIBS) parse_raw_scalar$(EXEEXT): $(parse_raw_scalar_OBJECTS) $(parse_raw_scalar_DEPENDENCIES) $(EXTRA_parse_raw_scalar_DEPENDENCIES) @rm -f parse_raw_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_scalar_OBJECTS) $(parse_raw_scalar_LDADD) $(LIBS) parse_raw_spf$(EXEEXT): $(parse_raw_spf_OBJECTS) $(parse_raw_spf_DEPENDENCIES) $(EXTRA_parse_raw_spf_DEPENDENCIES) @rm -f parse_raw_spf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_spf_OBJECTS) $(parse_raw_spf_LDADD) $(LIBS) parse_raw_type$(EXEEXT): $(parse_raw_type_OBJECTS) $(parse_raw_type_DEPENDENCIES) $(EXTRA_parse_raw_type_DEPENDENCIES) @rm -f parse_raw_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_raw_type_OBJECTS) $(parse_raw_type_LDADD) $(LIBS) parse_recip$(EXEEXT): $(parse_recip_OBJECTS) $(parse_recip_DEPENDENCIES) $(EXTRA_parse_recip_DEPENDENCIES) @rm -f parse_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_recip_OBJECTS) $(parse_recip_LDADD) $(LIBS) parse_ref$(EXEEXT): $(parse_ref_OBJECTS) $(parse_ref_DEPENDENCIES) $(EXTRA_parse_ref_DEPENDENCIES) @rm -f parse_ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_ref_OBJECTS) $(parse_ref_LDADD) $(LIBS) parse_ref_nonexistent$(EXEEXT): $(parse_ref_nonexistent_OBJECTS) $(parse_ref_nonexistent_DEPENDENCIES) $(EXTRA_parse_ref_nonexistent_DEPENDENCIES) @rm -f parse_ref_nonexistent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_ref_nonexistent_OBJECTS) $(parse_ref_nonexistent_LDADD) $(LIBS) parse_sbit$(EXEEXT): $(parse_sbit_OBJECTS) $(parse_sbit_DEPENDENCIES) $(EXTRA_parse_sbit_DEPENDENCIES) @rm -f parse_sbit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_sbit_OBJECTS) $(parse_sbit_LDADD) $(LIBS) parse_scalar1$(EXEEXT): $(parse_scalar1_OBJECTS) $(parse_scalar1_DEPENDENCIES) $(EXTRA_parse_scalar1_DEPENDENCIES) @rm -f parse_scalar1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_scalar1_OBJECTS) $(parse_scalar1_LDADD) $(LIBS) parse_scalar2$(EXEEXT): $(parse_scalar2_OBJECTS) $(parse_scalar2_DEPENDENCIES) $(EXTRA_parse_scalar2_DEPENDENCIES) @rm -f parse_scalar2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_scalar2_OBJECTS) $(parse_scalar2_LDADD) $(LIBS) parse_scalar_repr$(EXEEXT): $(parse_scalar_repr_OBJECTS) $(parse_scalar_repr_DEPENDENCIES) $(EXTRA_parse_scalar_repr_DEPENDENCIES) @rm -f parse_scalar_repr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_scalar_repr_OBJECTS) $(parse_scalar_repr_LDADD) $(LIBS) parse_sort$(EXEEXT): $(parse_sort_OBJECTS) $(parse_sort_DEPENDENCIES) $(EXTRA_parse_sort_DEPENDENCIES) @rm -f parse_sort$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_sort_OBJECTS) $(parse_sort_LDADD) $(LIBS) parse_string$(EXEEXT): $(parse_string_OBJECTS) $(parse_string_DEPENDENCIES) $(EXTRA_parse_string_DEPENDENCIES) @rm -f parse_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_string_OBJECTS) $(parse_string_LDADD) $(LIBS) parse_string_ncols$(EXEEXT): $(parse_string_ncols_OBJECTS) $(parse_string_ncols_DEPENDENCIES) $(EXTRA_parse_string_ncols_DEPENDENCIES) @rm -f parse_string_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_string_ncols_OBJECTS) $(parse_string_ncols_LDADD) $(LIBS) parse_string_null$(EXEEXT): $(parse_string_null_OBJECTS) $(parse_string_null_DEPENDENCIES) $(EXTRA_parse_string_null_DEPENDENCIES) @rm -f parse_string_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_string_null_OBJECTS) $(parse_string_null_LDADD) $(LIBS) parse_utf8$(EXEEXT): $(parse_utf8_OBJECTS) $(parse_utf8_DEPENDENCIES) $(EXTRA_parse_utf8_DEPENDENCIES) @rm -f parse_utf8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_utf8_OBJECTS) $(parse_utf8_LDADD) $(LIBS) parse_utf8_invalid$(EXEEXT): $(parse_utf8_invalid_OBJECTS) $(parse_utf8_invalid_DEPENDENCIES) $(EXTRA_parse_utf8_invalid_DEPENDENCIES) @rm -f parse_utf8_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_utf8_invalid_OBJECTS) $(parse_utf8_invalid_LDADD) $(LIBS) parse_utf8_zero$(EXEEXT): $(parse_utf8_zero_OBJECTS) $(parse_utf8_zero_DEPENDENCIES) $(EXTRA_parse_utf8_zero_DEPENDENCIES) @rm -f parse_utf8_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_utf8_zero_OBJECTS) $(parse_utf8_zero_LDADD) $(LIBS) parse_version$(EXEEXT): $(parse_version_OBJECTS) $(parse_version_DEPENDENCIES) $(EXTRA_parse_version_DEPENDENCIES) @rm -f parse_version$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_OBJECTS) $(parse_version_LDADD) $(LIBS) parse_version_89$(EXEEXT): $(parse_version_89_OBJECTS) $(parse_version_89_DEPENDENCIES) $(EXTRA_parse_version_89_DEPENDENCIES) @rm -f parse_version_89$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_89_OBJECTS) $(parse_version_89_LDADD) $(LIBS) parse_version_98$(EXEEXT): $(parse_version_98_OBJECTS) $(parse_version_98_DEPENDENCIES) $(EXTRA_parse_version_98_DEPENDENCIES) @rm -f parse_version_98$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_98_OBJECTS) $(parse_version_98_LDADD) $(LIBS) parse_version_include$(EXEEXT): $(parse_version_include_OBJECTS) $(parse_version_include_DEPENDENCIES) $(EXTRA_parse_version_include_DEPENDENCIES) @rm -f parse_version_include$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_include_OBJECTS) $(parse_version_include_LDADD) $(LIBS) parse_version_p8$(EXEEXT): $(parse_version_p8_OBJECTS) $(parse_version_p8_DEPENDENCIES) $(EXTRA_parse_version_p8_DEPENDENCIES) @rm -f parse_version_p8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_p8_OBJECTS) $(parse_version_p8_LDADD) $(LIBS) parse_version_p9$(EXEEXT): $(parse_version_p9_OBJECTS) $(parse_version_p9_DEPENDENCIES) $(EXTRA_parse_version_p9_DEPENDENCIES) @rm -f parse_version_p9$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_p9_OBJECTS) $(parse_version_p9_LDADD) $(LIBS) parse_version_permissive$(EXEEXT): $(parse_version_permissive_OBJECTS) $(parse_version_permissive_DEPENDENCIES) $(EXTRA_parse_version_permissive_DEPENDENCIES) @rm -f parse_version_permissive$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_permissive_OBJECTS) $(parse_version_permissive_LDADD) $(LIBS) parse_version_slash$(EXEEXT): $(parse_version_slash_OBJECTS) $(parse_version_slash_DEPENDENCIES) $(EXTRA_parse_version_slash_DEPENDENCIES) @rm -f parse_version_slash$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_version_slash_OBJECTS) $(parse_version_slash_LDADD) $(LIBS) parse_whitespace$(EXEEXT): $(parse_whitespace_OBJECTS) $(parse_whitespace_DEPENDENCIES) $(EXTRA_parse_whitespace_DEPENDENCIES) @rm -f parse_whitespace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_whitespace_OBJECTS) $(parse_whitespace_LDADD) $(LIBS) parse_window$(EXEEXT): $(parse_window_OBJECTS) $(parse_window_DEPENDENCIES) $(EXTRA_parse_window_DEPENDENCIES) @rm -f parse_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_window_OBJECTS) $(parse_window_LDADD) $(LIBS) parse_window_ncols$(EXEEXT): $(parse_window_ncols_OBJECTS) $(parse_window_ncols_DEPENDENCIES) $(EXTRA_parse_window_ncols_DEPENDENCIES) @rm -f parse_window_ncols$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_window_ncols_OBJECTS) $(parse_window_ncols_LDADD) $(LIBS) parse_window_op$(EXEEXT): $(parse_window_op_OBJECTS) $(parse_window_op_DEPENDENCIES) $(EXTRA_parse_window_op_DEPENDENCIES) @rm -f parse_window_op$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_window_op_OBJECTS) $(parse_window_op_LDADD) $(LIBS) parse_window_scalar$(EXEEXT): $(parse_window_scalar_OBJECTS) $(parse_window_scalar_DEPENDENCIES) $(EXTRA_parse_window_scalar_DEPENDENCIES) @rm -f parse_window_scalar$(EXEEXT) $(AM_V_CCLD)$(LINK) $(parse_window_scalar_OBJECTS) $(parse_window_scalar_LDADD) $(LIBS) protect_alter$(EXEEXT): $(protect_alter_OBJECTS) $(protect_alter_DEPENDENCIES) $(EXTRA_protect_alter_DEPENDENCIES) @rm -f protect_alter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(protect_alter_OBJECTS) $(protect_alter_LDADD) $(LIBS) protect_alter_all$(EXEEXT): $(protect_alter_all_OBJECTS) $(protect_alter_all_DEPENDENCIES) $(EXTRA_protect_alter_all_DEPENDENCIES) @rm -f protect_alter_all$(EXEEXT) $(AM_V_CCLD)$(LINK) $(protect_alter_all_OBJECTS) $(protect_alter_all_LDADD) $(LIBS) protect_get$(EXEEXT): $(protect_get_OBJECTS) $(protect_get_DEPENDENCIES) $(EXTRA_protect_get_DEPENDENCIES) @rm -f protect_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(protect_get_OBJECTS) $(protect_get_LDADD) $(LIBS) put64$(EXEEXT): $(put64_OBJECTS) $(put64_DEPENDENCIES) $(EXTRA_put64_DEPENDENCIES) @rm -f put64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put64_OBJECTS) $(put64_LDADD) $(LIBS) put_bad_code$(EXEEXT): $(put_bad_code_OBJECTS) $(put_bad_code_DEPENDENCIES) $(EXTRA_put_bad_code_DEPENDENCIES) @rm -f put_bad_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_bad_code_OBJECTS) $(put_bad_code_LDADD) $(LIBS) put_bit$(EXEEXT): $(put_bit_OBJECTS) $(put_bit_DEPENDENCIES) $(EXTRA_put_bit_DEPENDENCIES) @rm -f put_bit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_bit_OBJECTS) $(put_bit_LDADD) $(LIBS) put_bof$(EXEEXT): $(put_bof_OBJECTS) $(put_bof_DEPENDENCIES) $(EXTRA_put_bof_DEPENDENCIES) @rm -f put_bof$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_bof_OBJECTS) $(put_bof_LDADD) $(LIBS) put_carray$(EXEEXT): $(put_carray_OBJECTS) $(put_carray_DEPENDENCIES) $(EXTRA_put_carray_DEPENDENCIES) @rm -f put_carray$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_carray_OBJECTS) $(put_carray_LDADD) $(LIBS) put_carray_client$(EXEEXT): $(put_carray_client_OBJECTS) $(put_carray_client_DEPENDENCIES) $(EXTRA_put_carray_client_DEPENDENCIES) @rm -f put_carray_client$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_carray_client_OBJECTS) $(put_carray_client_LDADD) $(LIBS) put_carray_slice$(EXEEXT): $(put_carray_slice_OBJECTS) $(put_carray_slice_DEPENDENCIES) $(EXTRA_put_carray_slice_DEPENDENCIES) @rm -f put_carray_slice$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_carray_slice_OBJECTS) $(put_carray_slice_LDADD) $(LIBS) put_char$(EXEEXT): $(put_char_OBJECTS) $(put_char_DEPENDENCIES) $(EXTRA_put_char_DEPENDENCIES) @rm -f put_char$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_char_OBJECTS) $(put_char_LDADD) $(LIBS) put_clincom1$(EXEEXT): $(put_clincom1_OBJECTS) $(put_clincom1_DEPENDENCIES) $(EXTRA_put_clincom1_DEPENDENCIES) @rm -f put_clincom1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_clincom1_OBJECTS) $(put_clincom1_LDADD) $(LIBS) put_complex128$(EXEEXT): $(put_complex128_OBJECTS) $(put_complex128_DEPENDENCIES) $(EXTRA_put_complex128_DEPENDENCIES) @rm -f put_complex128$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_complex128_OBJECTS) $(put_complex128_LDADD) $(LIBS) put_complex64$(EXEEXT): $(put_complex64_OBJECTS) $(put_complex64_DEPENDENCIES) $(EXTRA_put_complex64_DEPENDENCIES) @rm -f put_complex64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_complex64_OBJECTS) $(put_complex64_LDADD) $(LIBS) put_const$(EXEEXT): $(put_const_OBJECTS) $(put_const_DEPENDENCIES) $(EXTRA_put_const_DEPENDENCIES) @rm -f put_const$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_const_OBJECTS) $(put_const_LDADD) $(LIBS) put_const_protect$(EXEEXT): $(put_const_protect_OBJECTS) $(put_const_protect_DEPENDENCIES) $(EXTRA_put_const_protect_DEPENDENCIES) @rm -f put_const_protect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_const_protect_OBJECTS) $(put_const_protect_LDADD) $(LIBS) put_cpolynom$(EXEEXT): $(put_cpolynom_OBJECTS) $(put_cpolynom_DEPENDENCIES) $(EXTRA_put_cpolynom_DEPENDENCIES) @rm -f put_cpolynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_cpolynom_OBJECTS) $(put_cpolynom_LDADD) $(LIBS) put_crecip$(EXEEXT): $(put_crecip_OBJECTS) $(put_crecip_DEPENDENCIES) $(EXTRA_put_crecip_DEPENDENCIES) @rm -f put_crecip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_crecip_OBJECTS) $(put_crecip_LDADD) $(LIBS) put_divide$(EXEEXT): $(put_divide_OBJECTS) $(put_divide_DEPENDENCIES) $(EXTRA_put_divide_DEPENDENCIES) @rm -f put_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_divide_OBJECTS) $(put_divide_LDADD) $(LIBS) put_endian16$(EXEEXT): $(put_endian16_OBJECTS) $(put_endian16_DEPENDENCIES) $(EXTRA_put_endian16_DEPENDENCIES) @rm -f put_endian16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian16_OBJECTS) $(put_endian16_LDADD) $(LIBS) put_endian32$(EXEEXT): $(put_endian32_OBJECTS) $(put_endian32_DEPENDENCIES) $(EXTRA_put_endian32_DEPENDENCIES) @rm -f put_endian32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian32_OBJECTS) $(put_endian32_LDADD) $(LIBS) put_endian64$(EXEEXT): $(put_endian64_OBJECTS) $(put_endian64_DEPENDENCIES) $(EXTRA_put_endian64_DEPENDENCIES) @rm -f put_endian64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian64_OBJECTS) $(put_endian64_LDADD) $(LIBS) put_endian8$(EXEEXT): $(put_endian8_OBJECTS) $(put_endian8_DEPENDENCIES) $(EXTRA_put_endian8_DEPENDENCIES) @rm -f put_endian8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian8_OBJECTS) $(put_endian8_LDADD) $(LIBS) put_endian_complex128_arm$(EXEEXT): $(put_endian_complex128_arm_OBJECTS) $(put_endian_complex128_arm_DEPENDENCIES) $(EXTRA_put_endian_complex128_arm_DEPENDENCIES) @rm -f put_endian_complex128_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_complex128_arm_OBJECTS) $(put_endian_complex128_arm_LDADD) $(LIBS) put_endian_complex128_big$(EXEEXT): $(put_endian_complex128_big_OBJECTS) $(put_endian_complex128_big_DEPENDENCIES) $(EXTRA_put_endian_complex128_big_DEPENDENCIES) @rm -f put_endian_complex128_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_complex128_big_OBJECTS) $(put_endian_complex128_big_LDADD) $(LIBS) put_endian_complex128_little$(EXEEXT): $(put_endian_complex128_little_OBJECTS) $(put_endian_complex128_little_DEPENDENCIES) $(EXTRA_put_endian_complex128_little_DEPENDENCIES) @rm -f put_endian_complex128_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_complex128_little_OBJECTS) $(put_endian_complex128_little_LDADD) $(LIBS) put_endian_complex64_arm$(EXEEXT): $(put_endian_complex64_arm_OBJECTS) $(put_endian_complex64_arm_DEPENDENCIES) $(EXTRA_put_endian_complex64_arm_DEPENDENCIES) @rm -f put_endian_complex64_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_complex64_arm_OBJECTS) $(put_endian_complex64_arm_LDADD) $(LIBS) put_endian_complex64_big$(EXEEXT): $(put_endian_complex64_big_OBJECTS) $(put_endian_complex64_big_DEPENDENCIES) $(EXTRA_put_endian_complex64_big_DEPENDENCIES) @rm -f put_endian_complex64_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_complex64_big_OBJECTS) $(put_endian_complex64_big_LDADD) $(LIBS) put_endian_complex64_little$(EXEEXT): $(put_endian_complex64_little_OBJECTS) $(put_endian_complex64_little_DEPENDENCIES) $(EXTRA_put_endian_complex64_little_DEPENDENCIES) @rm -f put_endian_complex64_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_complex64_little_OBJECTS) $(put_endian_complex64_little_LDADD) $(LIBS) put_endian_float32_arm$(EXEEXT): $(put_endian_float32_arm_OBJECTS) $(put_endian_float32_arm_DEPENDENCIES) $(EXTRA_put_endian_float32_arm_DEPENDENCIES) @rm -f put_endian_float32_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_float32_arm_OBJECTS) $(put_endian_float32_arm_LDADD) $(LIBS) put_endian_float32_big$(EXEEXT): $(put_endian_float32_big_OBJECTS) $(put_endian_float32_big_DEPENDENCIES) $(EXTRA_put_endian_float32_big_DEPENDENCIES) @rm -f put_endian_float32_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_float32_big_OBJECTS) $(put_endian_float32_big_LDADD) $(LIBS) put_endian_float32_little$(EXEEXT): $(put_endian_float32_little_OBJECTS) $(put_endian_float32_little_DEPENDENCIES) $(EXTRA_put_endian_float32_little_DEPENDENCIES) @rm -f put_endian_float32_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_float32_little_OBJECTS) $(put_endian_float32_little_LDADD) $(LIBS) put_endian_float64_arm$(EXEEXT): $(put_endian_float64_arm_OBJECTS) $(put_endian_float64_arm_DEPENDENCIES) $(EXTRA_put_endian_float64_arm_DEPENDENCIES) @rm -f put_endian_float64_arm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_float64_arm_OBJECTS) $(put_endian_float64_arm_LDADD) $(LIBS) put_endian_float64_big$(EXEEXT): $(put_endian_float64_big_OBJECTS) $(put_endian_float64_big_DEPENDENCIES) $(EXTRA_put_endian_float64_big_DEPENDENCIES) @rm -f put_endian_float64_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_float64_big_OBJECTS) $(put_endian_float64_big_LDADD) $(LIBS) put_endian_float64_little$(EXEEXT): $(put_endian_float64_little_OBJECTS) $(put_endian_float64_little_DEPENDENCIES) $(EXTRA_put_endian_float64_little_DEPENDENCIES) @rm -f put_endian_float64_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_endian_float64_little_OBJECTS) $(put_endian_float64_little_LDADD) $(LIBS) put_ff$(EXEEXT): $(put_ff_OBJECTS) $(put_ff_DEPENDENCIES) $(EXTRA_put_ff_DEPENDENCIES) @rm -f put_ff$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_ff_OBJECTS) $(put_ff_LDADD) $(LIBS) put_float32$(EXEEXT): $(put_float32_OBJECTS) $(put_float32_DEPENDENCIES) $(EXTRA_put_float32_DEPENDENCIES) @rm -f put_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_float32_OBJECTS) $(put_float32_LDADD) $(LIBS) put_float64$(EXEEXT): $(put_float64_OBJECTS) $(put_float64_DEPENDENCIES) $(EXTRA_put_float64_DEPENDENCIES) @rm -f put_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_float64_OBJECTS) $(put_float64_LDADD) $(LIBS) put_foffs$(EXEEXT): $(put_foffs_OBJECTS) $(put_foffs_DEPENDENCIES) $(EXTRA_put_foffs_DEPENDENCIES) @rm -f put_foffs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_foffs_OBJECTS) $(put_foffs_LDADD) $(LIBS) put_fs$(EXEEXT): $(put_fs_OBJECTS) $(put_fs_DEPENDENCIES) $(EXTRA_put_fs_DEPENDENCIES) @rm -f put_fs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_fs_OBJECTS) $(put_fs_LDADD) $(LIBS) put_here$(EXEEXT): $(put_here_OBJECTS) $(put_here_DEPENDENCIES) $(EXTRA_put_here_DEPENDENCIES) @rm -f put_here$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_here_OBJECTS) $(put_here_LDADD) $(LIBS) put_heres$(EXEEXT): $(put_heres_OBJECTS) $(put_heres_DEPENDENCIES) $(EXTRA_put_heres_DEPENDENCIES) @rm -f put_heres$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_heres_OBJECTS) $(put_heres_LDADD) $(LIBS) put_int16$(EXEEXT): $(put_int16_OBJECTS) $(put_int16_DEPENDENCIES) $(EXTRA_put_int16_DEPENDENCIES) @rm -f put_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_int16_OBJECTS) $(put_int16_LDADD) $(LIBS) put_int32$(EXEEXT): $(put_int32_OBJECTS) $(put_int32_DEPENDENCIES) $(EXTRA_put_int32_DEPENDENCIES) @rm -f put_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_int32_OBJECTS) $(put_int32_LDADD) $(LIBS) put_int64$(EXEEXT): $(put_int64_OBJECTS) $(put_int64_DEPENDENCIES) $(EXTRA_put_int64_DEPENDENCIES) @rm -f put_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_int64_OBJECTS) $(put_int64_LDADD) $(LIBS) put_int8$(EXEEXT): $(put_int8_OBJECTS) $(put_int8_DEPENDENCIES) $(EXTRA_put_int8_DEPENDENCIES) @rm -f put_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_int8_OBJECTS) $(put_int8_LDADD) $(LIBS) put_invalid$(EXEEXT): $(put_invalid_OBJECTS) $(put_invalid_DEPENDENCIES) $(EXTRA_put_invalid_DEPENDENCIES) @rm -f put_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_invalid_OBJECTS) $(put_invalid_LDADD) $(LIBS) put_lincom1$(EXEEXT): $(put_lincom1_OBJECTS) $(put_lincom1_DEPENDENCIES) $(EXTRA_put_lincom1_DEPENDENCIES) @rm -f put_lincom1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_lincom1_OBJECTS) $(put_lincom1_LDADD) $(LIBS) put_lincom2$(EXEEXT): $(put_lincom2_OBJECTS) $(put_lincom2_DEPENDENCIES) $(EXTRA_put_lincom2_DEPENDENCIES) @rm -f put_lincom2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_lincom2_OBJECTS) $(put_lincom2_LDADD) $(LIBS) put_lincom_noin$(EXEEXT): $(put_lincom_noin_OBJECTS) $(put_lincom_noin_DEPENDENCIES) $(EXTRA_put_lincom_noin_DEPENDENCIES) @rm -f put_lincom_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_lincom_noin_OBJECTS) $(put_lincom_noin_LDADD) $(LIBS) put_linterp$(EXEEXT): $(put_linterp_OBJECTS) $(put_linterp_DEPENDENCIES) $(EXTRA_put_linterp_DEPENDENCIES) @rm -f put_linterp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_linterp_OBJECTS) $(put_linterp_LDADD) $(LIBS) put_linterp_noin$(EXEEXT): $(put_linterp_noin_OBJECTS) $(put_linterp_noin_DEPENDENCIES) $(EXTRA_put_linterp_noin_DEPENDENCIES) @rm -f put_linterp_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_linterp_noin_OBJECTS) $(put_linterp_noin_LDADD) $(LIBS) put_linterp_nomono$(EXEEXT): $(put_linterp_nomono_OBJECTS) $(put_linterp_nomono_DEPENDENCIES) $(EXTRA_put_linterp_nomono_DEPENDENCIES) @rm -f put_linterp_nomono$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_linterp_nomono_OBJECTS) $(put_linterp_nomono_LDADD) $(LIBS) put_linterp_notab$(EXEEXT): $(put_linterp_notab_OBJECTS) $(put_linterp_notab_DEPENDENCIES) $(EXTRA_put_linterp_notab_DEPENDENCIES) @rm -f put_linterp_notab$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_linterp_notab_OBJECTS) $(put_linterp_notab_LDADD) $(LIBS) put_linterp_reverse$(EXEEXT): $(put_linterp_reverse_OBJECTS) $(put_linterp_reverse_DEPENDENCIES) $(EXTRA_put_linterp_reverse_DEPENDENCIES) @rm -f put_linterp_reverse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_linterp_reverse_OBJECTS) $(put_linterp_reverse_LDADD) $(LIBS) put_mplex$(EXEEXT): $(put_mplex_OBJECTS) $(put_mplex_DEPENDENCIES) $(EXTRA_put_mplex_DEPENDENCIES) @rm -f put_mplex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_mplex_OBJECTS) $(put_mplex_LDADD) $(LIBS) put_mplex_complex$(EXEEXT): $(put_mplex_complex_OBJECTS) $(put_mplex_complex_DEPENDENCIES) $(EXTRA_put_mplex_complex_DEPENDENCIES) @rm -f put_mplex_complex$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_mplex_complex_OBJECTS) $(put_mplex_complex_LDADD) $(LIBS) put_multiply$(EXEEXT): $(put_multiply_OBJECTS) $(put_multiply_DEPENDENCIES) $(EXTRA_put_multiply_DEPENDENCIES) @rm -f put_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_multiply_OBJECTS) $(put_multiply_LDADD) $(LIBS) put_nofile$(EXEEXT): $(put_nofile_OBJECTS) $(put_nofile_DEPENDENCIES) $(EXTRA_put_nofile_DEPENDENCIES) @rm -f put_nofile$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_nofile_OBJECTS) $(put_nofile_LDADD) $(LIBS) put_null$(EXEEXT): $(put_null_OBJECTS) $(put_null_DEPENDENCIES) $(EXTRA_put_null_DEPENDENCIES) @rm -f put_null$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_null_OBJECTS) $(put_null_LDADD) $(LIBS) put_off64$(EXEEXT): $(put_off64_OBJECTS) $(put_off64_DEPENDENCIES) $(EXTRA_put_off64_DEPENDENCIES) @rm -f put_off64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_off64_OBJECTS) $(put_off64_LDADD) $(LIBS) put_phase$(EXEEXT): $(put_phase_OBJECTS) $(put_phase_DEPENDENCIES) $(EXTRA_put_phase_DEPENDENCIES) @rm -f put_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_phase_OBJECTS) $(put_phase_LDADD) $(LIBS) put_phase_noin$(EXEEXT): $(put_phase_noin_OBJECTS) $(put_phase_noin_DEPENDENCIES) $(EXTRA_put_phase_noin_DEPENDENCIES) @rm -f put_phase_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_phase_noin_OBJECTS) $(put_phase_noin_LDADD) $(LIBS) put_polynom1$(EXEEXT): $(put_polynom1_OBJECTS) $(put_polynom1_DEPENDENCIES) $(EXTRA_put_polynom1_DEPENDENCIES) @rm -f put_polynom1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_polynom1_OBJECTS) $(put_polynom1_LDADD) $(LIBS) put_polynom2$(EXEEXT): $(put_polynom2_OBJECTS) $(put_polynom2_DEPENDENCIES) $(EXTRA_put_polynom2_DEPENDENCIES) @rm -f put_polynom2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_polynom2_OBJECTS) $(put_polynom2_LDADD) $(LIBS) put_polynom_noin$(EXEEXT): $(put_polynom_noin_OBJECTS) $(put_polynom_noin_DEPENDENCIES) $(EXTRA_put_polynom_noin_DEPENDENCIES) @rm -f put_polynom_noin$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_polynom_noin_OBJECTS) $(put_polynom_noin_LDADD) $(LIBS) put_protect$(EXEEXT): $(put_protect_OBJECTS) $(put_protect_DEPENDENCIES) $(EXTRA_put_protect_DEPENDENCIES) @rm -f put_protect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_protect_OBJECTS) $(put_protect_LDADD) $(LIBS) put_rdonly$(EXEEXT): $(put_rdonly_OBJECTS) $(put_rdonly_DEPENDENCIES) $(EXTRA_put_rdonly_DEPENDENCIES) @rm -f put_rdonly$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_rdonly_OBJECTS) $(put_rdonly_LDADD) $(LIBS) put_recip$(EXEEXT): $(put_recip_OBJECTS) $(put_recip_DEPENDENCIES) $(EXTRA_put_recip_DEPENDENCIES) @rm -f put_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_recip_OBJECTS) $(put_recip_LDADD) $(LIBS) put_recurse$(EXEEXT): $(put_recurse_OBJECTS) $(put_recurse_DEPENDENCIES) $(EXTRA_put_recurse_DEPENDENCIES) @rm -f put_recurse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_recurse_OBJECTS) $(put_recurse_LDADD) $(LIBS) put_repr$(EXEEXT): $(put_repr_OBJECTS) $(put_repr_DEPENDENCIES) $(EXTRA_put_repr_DEPENDENCIES) @rm -f put_repr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_repr_OBJECTS) $(put_repr_LDADD) $(LIBS) put_rofs$(EXEEXT): $(put_rofs_OBJECTS) $(put_rofs_DEPENDENCIES) $(EXTRA_put_rofs_DEPENDENCIES) @rm -f put_rofs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_rofs_OBJECTS) $(put_rofs_LDADD) $(LIBS) put_sbit$(EXEEXT): $(put_sbit_OBJECTS) $(put_sbit_DEPENDENCIES) $(EXTRA_put_sbit_DEPENDENCIES) @rm -f put_sbit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_sbit_OBJECTS) $(put_sbit_LDADD) $(LIBS) put_sf$(EXEEXT): $(put_sf_OBJECTS) $(put_sf_DEPENDENCIES) $(EXTRA_put_sf_DEPENDENCIES) @rm -f put_sf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_sf_OBJECTS) $(put_sf_LDADD) $(LIBS) put_ss$(EXEEXT): $(put_ss_OBJECTS) $(put_ss_DEPENDENCIES) $(EXTRA_put_ss_DEPENDENCIES) @rm -f put_ss$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_ss_OBJECTS) $(put_ss_LDADD) $(LIBS) put_string$(EXEEXT): $(put_string_OBJECTS) $(put_string_DEPENDENCIES) $(EXTRA_put_string_DEPENDENCIES) @rm -f put_string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_string_OBJECTS) $(put_string_LDADD) $(LIBS) put_string_protect$(EXEEXT): $(put_string_protect_OBJECTS) $(put_string_protect_DEPENDENCIES) $(EXTRA_put_string_protect_DEPENDENCIES) @rm -f put_string_protect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_string_protect_OBJECTS) $(put_string_protect_LDADD) $(LIBS) put_sub$(EXEEXT): $(put_sub_OBJECTS) $(put_sub_DEPENDENCIES) $(EXTRA_put_sub_DEPENDENCIES) @rm -f put_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_sub_OBJECTS) $(put_sub_LDADD) $(LIBS) put_type$(EXEEXT): $(put_type_OBJECTS) $(put_type_DEPENDENCIES) $(EXTRA_put_type_DEPENDENCIES) @rm -f put_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_type_OBJECTS) $(put_type_LDADD) $(LIBS) put_uint16$(EXEEXT): $(put_uint16_OBJECTS) $(put_uint16_DEPENDENCIES) $(EXTRA_put_uint16_DEPENDENCIES) @rm -f put_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_uint16_OBJECTS) $(put_uint16_LDADD) $(LIBS) put_uint32$(EXEEXT): $(put_uint32_OBJECTS) $(put_uint32_DEPENDENCIES) $(EXTRA_put_uint32_DEPENDENCIES) @rm -f put_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_uint32_OBJECTS) $(put_uint32_LDADD) $(LIBS) put_uint64$(EXEEXT): $(put_uint64_OBJECTS) $(put_uint64_DEPENDENCIES) $(EXTRA_put_uint64_DEPENDENCIES) @rm -f put_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_uint64_OBJECTS) $(put_uint64_LDADD) $(LIBS) put_window$(EXEEXT): $(put_window_OBJECTS) $(put_window_DEPENDENCIES) $(EXTRA_put_window_DEPENDENCIES) @rm -f put_window$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_window_OBJECTS) $(put_window_LDADD) $(LIBS) put_zero$(EXEEXT): $(put_zero_OBJECTS) $(put_zero_DEPENDENCIES) $(EXTRA_put_zero_DEPENDENCIES) @rm -f put_zero$(EXEEXT) $(AM_V_CCLD)$(LINK) $(put_zero_OBJECTS) $(put_zero_LDADD) $(LIBS) ref$(EXEEXT): $(ref_OBJECTS) $(ref_DEPENDENCIES) $(EXTRA_ref_DEPENDENCIES) @rm -f ref$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ref_OBJECTS) $(ref_LDADD) $(LIBS) ref_none$(EXEEXT): $(ref_none_OBJECTS) $(ref_none_DEPENDENCIES) $(EXTRA_ref_none_DEPENDENCIES) @rm -f ref_none$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ref_none_OBJECTS) $(ref_none_LDADD) $(LIBS) ref_two$(EXEEXT): $(ref_two_OBJECTS) $(ref_two_DEPENDENCIES) $(EXTRA_ref_two_DEPENDENCIES) @rm -f ref_two$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ref_two_OBJECTS) $(ref_two_LDADD) $(LIBS) repr_a$(EXEEXT): $(repr_a_OBJECTS) $(repr_a_DEPENDENCIES) $(EXTRA_repr_a_DEPENDENCIES) @rm -f repr_a$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_a_OBJECTS) $(repr_a_LDADD) $(LIBS) repr_bad$(EXEEXT): $(repr_bad_OBJECTS) $(repr_bad_DEPENDENCIES) $(EXTRA_repr_bad_DEPENDENCIES) @rm -f repr_bad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_bad_OBJECTS) $(repr_bad_LDADD) $(LIBS) repr_float32$(EXEEXT): $(repr_float32_OBJECTS) $(repr_float32_DEPENDENCIES) $(EXTRA_repr_float32_DEPENDENCIES) @rm -f repr_float32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_float32_OBJECTS) $(repr_float32_LDADD) $(LIBS) repr_float64$(EXEEXT): $(repr_float64_OBJECTS) $(repr_float64_DEPENDENCIES) $(EXTRA_repr_float64_DEPENDENCIES) @rm -f repr_float64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_float64_OBJECTS) $(repr_float64_LDADD) $(LIBS) repr_i$(EXEEXT): $(repr_i_OBJECTS) $(repr_i_DEPENDENCIES) $(EXTRA_repr_i_DEPENDENCIES) @rm -f repr_i$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_i_OBJECTS) $(repr_i_LDADD) $(LIBS) repr_int16$(EXEEXT): $(repr_int16_OBJECTS) $(repr_int16_DEPENDENCIES) $(EXTRA_repr_int16_DEPENDENCIES) @rm -f repr_int16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_int16_OBJECTS) $(repr_int16_LDADD) $(LIBS) repr_int32$(EXEEXT): $(repr_int32_OBJECTS) $(repr_int32_DEPENDENCIES) $(EXTRA_repr_int32_DEPENDENCIES) @rm -f repr_int32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_int32_OBJECTS) $(repr_int32_LDADD) $(LIBS) repr_int64$(EXEEXT): $(repr_int64_OBJECTS) $(repr_int64_DEPENDENCIES) $(EXTRA_repr_int64_DEPENDENCIES) @rm -f repr_int64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_int64_OBJECTS) $(repr_int64_LDADD) $(LIBS) repr_int8$(EXEEXT): $(repr_int8_OBJECTS) $(repr_int8_DEPENDENCIES) $(EXTRA_repr_int8_DEPENDENCIES) @rm -f repr_int8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_int8_OBJECTS) $(repr_int8_LDADD) $(LIBS) repr_m$(EXEEXT): $(repr_m_OBJECTS) $(repr_m_DEPENDENCIES) $(EXTRA_repr_m_DEPENDENCIES) @rm -f repr_m$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_m_OBJECTS) $(repr_m_LDADD) $(LIBS) repr_r$(EXEEXT): $(repr_r_OBJECTS) $(repr_r_DEPENDENCIES) $(EXTRA_repr_r_DEPENDENCIES) @rm -f repr_r$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_r_OBJECTS) $(repr_r_LDADD) $(LIBS) repr_real_a$(EXEEXT): $(repr_real_a_OBJECTS) $(repr_real_a_DEPENDENCIES) $(EXTRA_repr_real_a_DEPENDENCIES) @rm -f repr_real_a$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_real_a_OBJECTS) $(repr_real_a_LDADD) $(LIBS) repr_real_i$(EXEEXT): $(repr_real_i_OBJECTS) $(repr_real_i_DEPENDENCIES) $(EXTRA_repr_real_i_DEPENDENCIES) @rm -f repr_real_i$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_real_i_OBJECTS) $(repr_real_i_LDADD) $(LIBS) repr_real_m$(EXEEXT): $(repr_real_m_OBJECTS) $(repr_real_m_DEPENDENCIES) $(EXTRA_repr_real_m_DEPENDENCIES) @rm -f repr_real_m$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_real_m_OBJECTS) $(repr_real_m_LDADD) $(LIBS) repr_real_r$(EXEEXT): $(repr_real_r_OBJECTS) $(repr_real_r_DEPENDENCIES) $(EXTRA_repr_real_r_DEPENDENCIES) @rm -f repr_real_r$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_real_r_OBJECTS) $(repr_real_r_LDADD) $(LIBS) repr_uint16$(EXEEXT): $(repr_uint16_OBJECTS) $(repr_uint16_DEPENDENCIES) $(EXTRA_repr_uint16_DEPENDENCIES) @rm -f repr_uint16$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_uint16_OBJECTS) $(repr_uint16_LDADD) $(LIBS) repr_uint32$(EXEEXT): $(repr_uint32_OBJECTS) $(repr_uint32_DEPENDENCIES) $(EXTRA_repr_uint32_DEPENDENCIES) @rm -f repr_uint32$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_uint32_OBJECTS) $(repr_uint32_LDADD) $(LIBS) repr_uint64$(EXEEXT): $(repr_uint64_OBJECTS) $(repr_uint64_DEPENDENCIES) $(EXTRA_repr_uint64_DEPENDENCIES) @rm -f repr_uint64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_uint64_OBJECTS) $(repr_uint64_LDADD) $(LIBS) repr_uint8$(EXEEXT): $(repr_uint8_OBJECTS) $(repr_uint8_DEPENDENCIES) $(EXTRA_repr_uint8_DEPENDENCIES) @rm -f repr_uint8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(repr_uint8_OBJECTS) $(repr_uint8_LDADD) $(LIBS) seek64$(EXEEXT): $(seek64_OBJECTS) $(seek64_DEPENDENCIES) $(EXTRA_seek64_DEPENDENCIES) @rm -f seek64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek64_OBJECTS) $(seek64_LDADD) $(LIBS) seek_cur$(EXEEXT): $(seek_cur_OBJECTS) $(seek_cur_DEPENDENCIES) $(EXTRA_seek_cur_DEPENDENCIES) @rm -f seek_cur$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_cur_OBJECTS) $(seek_cur_LDADD) $(LIBS) seek_end$(EXEEXT): $(seek_end_OBJECTS) $(seek_end_DEPENDENCIES) $(EXTRA_seek_end_DEPENDENCIES) @rm -f seek_end$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_end_OBJECTS) $(seek_end_LDADD) $(LIBS) seek_far$(EXEEXT): $(seek_far_OBJECTS) $(seek_far_DEPENDENCIES) $(EXTRA_seek_far_DEPENDENCIES) @rm -f seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_far_OBJECTS) $(seek_far_LDADD) $(LIBS) seek_foffs$(EXEEXT): $(seek_foffs_OBJECTS) $(seek_foffs_DEPENDENCIES) $(EXTRA_seek_foffs_DEPENDENCIES) @rm -f seek_foffs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_foffs_OBJECTS) $(seek_foffs_LDADD) $(LIBS) seek_foffs2$(EXEEXT): $(seek_foffs2_OBJECTS) $(seek_foffs2_DEPENDENCIES) $(EXTRA_seek_foffs2_DEPENDENCIES) @rm -f seek_foffs2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_foffs2_OBJECTS) $(seek_foffs2_LDADD) $(LIBS) seek_index$(EXEEXT): $(seek_index_OBJECTS) $(seek_index_DEPENDENCIES) $(EXTRA_seek_index_DEPENDENCIES) @rm -f seek_index$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_index_OBJECTS) $(seek_index_LDADD) $(LIBS) seek_lincom$(EXEEXT): $(seek_lincom_OBJECTS) $(seek_lincom_DEPENDENCIES) $(EXTRA_seek_lincom_DEPENDENCIES) @rm -f seek_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_lincom_OBJECTS) $(seek_lincom_LDADD) $(LIBS) seek_mult$(EXEEXT): $(seek_mult_OBJECTS) $(seek_mult_DEPENDENCIES) $(EXTRA_seek_mult_DEPENDENCIES) @rm -f seek_mult$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_mult_OBJECTS) $(seek_mult_LDADD) $(LIBS) seek_neg$(EXEEXT): $(seek_neg_OBJECTS) $(seek_neg_DEPENDENCIES) $(EXTRA_seek_neg_DEPENDENCIES) @rm -f seek_neg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_neg_OBJECTS) $(seek_neg_LDADD) $(LIBS) seek_phase$(EXEEXT): $(seek_phase_OBJECTS) $(seek_phase_DEPENDENCIES) $(EXTRA_seek_phase_DEPENDENCIES) @rm -f seek_phase$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_phase_OBJECTS) $(seek_phase_LDADD) $(LIBS) seek_set$(EXEEXT): $(seek_set_OBJECTS) $(seek_set_DEPENDENCIES) $(EXTRA_seek_set_DEPENDENCIES) @rm -f seek_set$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_set_OBJECTS) $(seek_set_LDADD) $(LIBS) seek_sub$(EXEEXT): $(seek_sub_OBJECTS) $(seek_sub_DEPENDENCIES) $(EXTRA_seek_sub_DEPENDENCIES) @rm -f seek_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seek_sub_OBJECTS) $(seek_sub_LDADD) $(LIBS) sie_get_big$(EXEEXT): $(sie_get_big_OBJECTS) $(sie_get_big_DEPENDENCIES) $(EXTRA_sie_get_big_DEPENDENCIES) @rm -f sie_get_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_get_big_OBJECTS) $(sie_get_big_LDADD) $(LIBS) sie_get_little$(EXEEXT): $(sie_get_little_OBJECTS) $(sie_get_little_DEPENDENCIES) $(EXTRA_sie_get_little_DEPENDENCIES) @rm -f sie_get_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_get_little_OBJECTS) $(sie_get_little_LDADD) $(LIBS) sie_move_from$(EXEEXT): $(sie_move_from_OBJECTS) $(sie_move_from_DEPENDENCIES) $(EXTRA_sie_move_from_DEPENDENCIES) @rm -f sie_move_from$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_move_from_OBJECTS) $(sie_move_from_LDADD) $(LIBS) sie_move_to$(EXEEXT): $(sie_move_to_OBJECTS) $(sie_move_to_DEPENDENCIES) $(EXTRA_sie_move_to_DEPENDENCIES) @rm -f sie_move_to$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_move_to_OBJECTS) $(sie_move_to_LDADD) $(LIBS) sie_nframes_big$(EXEEXT): $(sie_nframes_big_OBJECTS) $(sie_nframes_big_DEPENDENCIES) $(EXTRA_sie_nframes_big_DEPENDENCIES) @rm -f sie_nframes_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_nframes_big_OBJECTS) $(sie_nframes_big_LDADD) $(LIBS) sie_nframes_little$(EXEEXT): $(sie_nframes_little_OBJECTS) $(sie_nframes_little_DEPENDENCIES) $(EXTRA_sie_nframes_little_DEPENDENCIES) @rm -f sie_nframes_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_nframes_little_OBJECTS) $(sie_nframes_little_LDADD) $(LIBS) sie_put_append$(EXEEXT): $(sie_put_append_OBJECTS) $(sie_put_append_DEPENDENCIES) $(EXTRA_sie_put_append_DEPENDENCIES) @rm -f sie_put_append$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_append_OBJECTS) $(sie_put_append_LDADD) $(LIBS) sie_put_append2$(EXEEXT): $(sie_put_append2_OBJECTS) $(sie_put_append2_DEPENDENCIES) $(EXTRA_sie_put_append2_DEPENDENCIES) @rm -f sie_put_append2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_append2_OBJECTS) $(sie_put_append2_LDADD) $(LIBS) sie_put_back$(EXEEXT): $(sie_put_back_OBJECTS) $(sie_put_back_DEPENDENCIES) $(EXTRA_sie_put_back_DEPENDENCIES) @rm -f sie_put_back$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_back_OBJECTS) $(sie_put_back_LDADD) $(LIBS) sie_put_big$(EXEEXT): $(sie_put_big_OBJECTS) $(sie_put_big_DEPENDENCIES) $(EXTRA_sie_put_big_DEPENDENCIES) @rm -f sie_put_big$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_big_OBJECTS) $(sie_put_big_LDADD) $(LIBS) sie_put_little$(EXEEXT): $(sie_put_little_OBJECTS) $(sie_put_little_DEPENDENCIES) $(EXTRA_sie_put_little_DEPENDENCIES) @rm -f sie_put_little$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_little_OBJECTS) $(sie_put_little_LDADD) $(LIBS) sie_put_many$(EXEEXT): $(sie_put_many_OBJECTS) $(sie_put_many_DEPENDENCIES) $(EXTRA_sie_put_many_DEPENDENCIES) @rm -f sie_put_many$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_many_OBJECTS) $(sie_put_many_LDADD) $(LIBS) sie_put_newo$(EXEEXT): $(sie_put_newo_OBJECTS) $(sie_put_newo_DEPENDENCIES) $(EXTRA_sie_put_newo_DEPENDENCIES) @rm -f sie_put_newo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_newo_OBJECTS) $(sie_put_newo_LDADD) $(LIBS) sie_put_newo0$(EXEEXT): $(sie_put_newo0_OBJECTS) $(sie_put_newo0_DEPENDENCIES) $(EXTRA_sie_put_newo0_DEPENDENCIES) @rm -f sie_put_newo0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_newo0_OBJECTS) $(sie_put_newo0_LDADD) $(LIBS) sie_put_pad$(EXEEXT): $(sie_put_pad_OBJECTS) $(sie_put_pad_DEPENDENCIES) $(EXTRA_sie_put_pad_DEPENDENCIES) @rm -f sie_put_pad$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_pad_OBJECTS) $(sie_put_pad_LDADD) $(LIBS) sie_put_pad0$(EXEEXT): $(sie_put_pad0_OBJECTS) $(sie_put_pad0_DEPENDENCIES) $(EXTRA_sie_put_pad0_DEPENDENCIES) @rm -f sie_put_pad0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_pad0_OBJECTS) $(sie_put_pad0_LDADD) $(LIBS) sie_put_trunc$(EXEEXT): $(sie_put_trunc_OBJECTS) $(sie_put_trunc_DEPENDENCIES) $(EXTRA_sie_put_trunc_DEPENDENCIES) @rm -f sie_put_trunc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_trunc_OBJECTS) $(sie_put_trunc_LDADD) $(LIBS) sie_put_trunc2$(EXEEXT): $(sie_put_trunc2_OBJECTS) $(sie_put_trunc2_DEPENDENCIES) $(EXTRA_sie_put_trunc2_DEPENDENCIES) @rm -f sie_put_trunc2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_trunc2_OBJECTS) $(sie_put_trunc2_LDADD) $(LIBS) sie_put_trunc_nf$(EXEEXT): $(sie_put_trunc_nf_OBJECTS) $(sie_put_trunc_nf_DEPENDENCIES) $(EXTRA_sie_put_trunc_nf_DEPENDENCIES) @rm -f sie_put_trunc_nf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_put_trunc_nf_OBJECTS) $(sie_put_trunc_nf_LDADD) $(LIBS) sie_seek$(EXEEXT): $(sie_seek_OBJECTS) $(sie_seek_DEPENDENCIES) $(EXTRA_sie_seek_DEPENDENCIES) @rm -f sie_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_seek_OBJECTS) $(sie_seek_LDADD) $(LIBS) sie_seek_far$(EXEEXT): $(sie_seek_far_OBJECTS) $(sie_seek_far_DEPENDENCIES) $(EXTRA_sie_seek_far_DEPENDENCIES) @rm -f sie_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_seek_far_OBJECTS) $(sie_seek_far_LDADD) $(LIBS) sie_sync$(EXEEXT): $(sie_sync_OBJECTS) $(sie_sync_DEPENDENCIES) $(EXTRA_sie_sync_DEPENDENCIES) @rm -f sie_sync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sie_sync_OBJECTS) $(sie_sync_LDADD) $(LIBS) slim_get$(EXEEXT): $(slim_get_OBJECTS) $(slim_get_DEPENDENCIES) $(EXTRA_slim_get_DEPENDENCIES) @rm -f slim_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(slim_get_OBJECTS) $(slim_get_LDADD) $(LIBS) slim_nframes$(EXEEXT): $(slim_nframes_OBJECTS) $(slim_nframes_DEPENDENCIES) $(EXTRA_slim_nframes_DEPENDENCIES) @rm -f slim_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(slim_nframes_OBJECTS) $(slim_nframes_LDADD) $(LIBS) slim_seek$(EXEEXT): $(slim_seek_OBJECTS) $(slim_seek_DEPENDENCIES) $(EXTRA_slim_seek_DEPENDENCIES) @rm -f slim_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(slim_seek_OBJECTS) $(slim_seek_LDADD) $(LIBS) slim_seek_far$(EXEEXT): $(slim_seek_far_OBJECTS) $(slim_seek_far_DEPENDENCIES) $(EXTRA_slim_seek_far_DEPENDENCIES) @rm -f slim_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(slim_seek_far_OBJECTS) $(slim_seek_far_LDADD) $(LIBS) spf_alias$(EXEEXT): $(spf_alias_OBJECTS) $(spf_alias_DEPENDENCIES) $(EXTRA_spf_alias_DEPENDENCIES) @rm -f spf_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_alias_OBJECTS) $(spf_alias_LDADD) $(LIBS) spf_alias_meta$(EXEEXT): $(spf_alias_meta_OBJECTS) $(spf_alias_meta_DEPENDENCIES) $(EXTRA_spf_alias_meta_DEPENDENCIES) @rm -f spf_alias_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_alias_meta_OBJECTS) $(spf_alias_meta_LDADD) $(LIBS) spf_alias_missing$(EXEEXT): $(spf_alias_missing_OBJECTS) $(spf_alias_missing_DEPENDENCIES) $(EXTRA_spf_alias_missing_DEPENDENCIES) @rm -f spf_alias_missing$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_alias_missing_OBJECTS) $(spf_alias_missing_LDADD) $(LIBS) spf_divide$(EXEEXT): $(spf_divide_OBJECTS) $(spf_divide_DEPENDENCIES) $(EXTRA_spf_divide_DEPENDENCIES) @rm -f spf_divide$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_divide_OBJECTS) $(spf_divide_LDADD) $(LIBS) spf_lincom$(EXEEXT): $(spf_lincom_OBJECTS) $(spf_lincom_DEPENDENCIES) $(EXTRA_spf_lincom_DEPENDENCIES) @rm -f spf_lincom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_lincom_OBJECTS) $(spf_lincom_LDADD) $(LIBS) spf_multiply$(EXEEXT): $(spf_multiply_OBJECTS) $(spf_multiply_DEPENDENCIES) $(EXTRA_spf_multiply_DEPENDENCIES) @rm -f spf_multiply$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_multiply_OBJECTS) $(spf_multiply_LDADD) $(LIBS) spf_polynom$(EXEEXT): $(spf_polynom_OBJECTS) $(spf_polynom_DEPENDENCIES) $(EXTRA_spf_polynom_DEPENDENCIES) @rm -f spf_polynom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_polynom_OBJECTS) $(spf_polynom_LDADD) $(LIBS) spf_raw$(EXEEXT): $(spf_raw_OBJECTS) $(spf_raw_DEPENDENCIES) $(EXTRA_spf_raw_DEPENDENCIES) @rm -f spf_raw$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_raw_OBJECTS) $(spf_raw_LDADD) $(LIBS) spf_recip$(EXEEXT): $(spf_recip_OBJECTS) $(spf_recip_DEPENDENCIES) $(EXTRA_spf_recip_DEPENDENCIES) @rm -f spf_recip$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_recip_OBJECTS) $(spf_recip_LDADD) $(LIBS) spf_recurse$(EXEEXT): $(spf_recurse_OBJECTS) $(spf_recurse_DEPENDENCIES) $(EXTRA_spf_recurse_DEPENDENCIES) @rm -f spf_recurse$(EXEEXT) $(AM_V_CCLD)$(LINK) $(spf_recurse_OBJECTS) $(spf_recurse_LDADD) $(LIBS) svlist$(EXEEXT): $(svlist_OBJECTS) $(svlist_DEPENDENCIES) $(EXTRA_svlist_DEPENDENCIES) @rm -f svlist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_OBJECTS) $(svlist_LDADD) $(LIBS) svlist0$(EXEEXT): $(svlist0_OBJECTS) $(svlist0_DEPENDENCIES) $(EXTRA_svlist0_DEPENDENCIES) @rm -f svlist0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist0_OBJECTS) $(svlist0_LDADD) $(LIBS) svlist2$(EXEEXT): $(svlist2_OBJECTS) $(svlist2_DEPENDENCIES) $(EXTRA_svlist2_DEPENDENCIES) @rm -f svlist2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist2_OBJECTS) $(svlist2_LDADD) $(LIBS) svlist_hidden$(EXEEXT): $(svlist_hidden_OBJECTS) $(svlist_hidden_DEPENDENCIES) $(EXTRA_svlist_hidden_DEPENDENCIES) @rm -f svlist_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_hidden_OBJECTS) $(svlist_hidden_LDADD) $(LIBS) svlist_invalid$(EXEEXT): $(svlist_invalid_OBJECTS) $(svlist_invalid_DEPENDENCIES) $(EXTRA_svlist_invalid_DEPENDENCIES) @rm -f svlist_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_invalid_OBJECTS) $(svlist_invalid_LDADD) $(LIBS) svlist_meta$(EXEEXT): $(svlist_meta_OBJECTS) $(svlist_meta_DEPENDENCIES) $(EXTRA_svlist_meta_DEPENDENCIES) @rm -f svlist_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_meta_OBJECTS) $(svlist_meta_LDADD) $(LIBS) svlist_meta0$(EXEEXT): $(svlist_meta0_OBJECTS) $(svlist_meta0_DEPENDENCIES) $(EXTRA_svlist_meta0_DEPENDENCIES) @rm -f svlist_meta0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_meta0_OBJECTS) $(svlist_meta0_LDADD) $(LIBS) svlist_meta_hidden$(EXEEXT): $(svlist_meta_hidden_OBJECTS) $(svlist_meta_hidden_DEPENDENCIES) $(EXTRA_svlist_meta_hidden_DEPENDENCIES) @rm -f svlist_meta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_meta_hidden_OBJECTS) $(svlist_meta_hidden_LDADD) $(LIBS) svlist_meta_invalid$(EXEEXT): $(svlist_meta_invalid_OBJECTS) $(svlist_meta_invalid_DEPENDENCIES) $(EXTRA_svlist_meta_invalid_DEPENDENCIES) @rm -f svlist_meta_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(svlist_meta_invalid_OBJECTS) $(svlist_meta_invalid_LDADD) $(LIBS) table$(EXEEXT): $(table_OBJECTS) $(table_DEPENDENCIES) $(EXTRA_table_DEPENDENCIES) @rm -f table$(EXEEXT) $(AM_V_CCLD)$(LINK) $(table_OBJECTS) $(table_LDADD) $(LIBS) table_code$(EXEEXT): $(table_code_OBJECTS) $(table_code_DEPENDENCIES) $(EXTRA_table_code_DEPENDENCIES) @rm -f table_code$(EXEEXT) $(AM_V_CCLD)$(LINK) $(table_code_OBJECTS) $(table_code_LDADD) $(LIBS) table_type$(EXEEXT): $(table_type_OBJECTS) $(table_type_DEPENDENCIES) $(EXTRA_table_type_DEPENDENCIES) @rm -f table_type$(EXEEXT) $(AM_V_CCLD)$(LINK) $(table_type_OBJECTS) $(table_type_LDADD) $(LIBS) tell$(EXEEXT): $(tell_OBJECTS) $(tell_DEPENDENCIES) $(EXTRA_tell_DEPENDENCIES) @rm -f tell$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tell_OBJECTS) $(tell_LDADD) $(LIBS) tell64$(EXEEXT): $(tell64_OBJECTS) $(tell64_DEPENDENCIES) $(EXTRA_tell64_DEPENDENCIES) @rm -f tell64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tell64_OBJECTS) $(tell64_LDADD) $(LIBS) tell_multidiv$(EXEEXT): $(tell_multidiv_OBJECTS) $(tell_multidiv_DEPENDENCIES) $(EXTRA_tell_multidiv_DEPENDENCIES) @rm -f tell_multidiv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tell_multidiv_OBJECTS) $(tell_multidiv_LDADD) $(LIBS) tell_sub$(EXEEXT): $(tell_sub_OBJECTS) $(tell_sub_DEPENDENCIES) $(EXTRA_tell_sub_DEPENDENCIES) @rm -f tell_sub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tell_sub_OBJECTS) $(tell_sub_LDADD) $(LIBS) tok_arg$(EXEEXT): $(tok_arg_OBJECTS) $(tok_arg_DEPENDENCIES) $(EXTRA_tok_arg_DEPENDENCIES) @rm -f tok_arg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tok_arg_OBJECTS) $(tok_arg_LDADD) $(LIBS) tok_escape$(EXEEXT): $(tok_escape_OBJECTS) $(tok_escape_DEPENDENCIES) $(EXTRA_tok_escape_DEPENDENCIES) @rm -f tok_escape$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tok_escape_OBJECTS) $(tok_escape_LDADD) $(LIBS) tok_quote$(EXEEXT): $(tok_quote_OBJECTS) $(tok_quote_DEPENDENCIES) $(EXTRA_tok_quote_DEPENDENCIES) @rm -f tok_quote$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tok_quote_OBJECTS) $(tok_quote_LDADD) $(LIBS) trunc$(EXEEXT): $(trunc_OBJECTS) $(trunc_DEPENDENCIES) $(EXTRA_trunc_DEPENDENCIES) @rm -f trunc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(trunc_OBJECTS) $(trunc_LDADD) $(LIBS) trunc_dir$(EXEEXT): $(trunc_dir_OBJECTS) $(trunc_dir_DEPENDENCIES) $(EXTRA_trunc_dir_DEPENDENCIES) @rm -f trunc_dir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(trunc_dir_OBJECTS) $(trunc_dir_LDADD) $(LIBS) trunc_rdonly$(EXEEXT): $(trunc_rdonly_OBJECTS) $(trunc_rdonly_DEPENDENCIES) $(EXTRA_trunc_rdonly_DEPENDENCIES) @rm -f trunc_rdonly$(EXEEXT) $(AM_V_CCLD)$(LINK) $(trunc_rdonly_OBJECTS) $(trunc_rdonly_LDADD) $(LIBS) trunc_rofs$(EXEEXT): $(trunc_rofs_OBJECTS) $(trunc_rofs_DEPENDENCIES) $(EXTRA_trunc_rofs_DEPENDENCIES) @rm -f trunc_rofs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(trunc_rofs_OBJECTS) $(trunc_rofs_LDADD) $(LIBS) trunc_truncsub$(EXEEXT): $(trunc_truncsub_OBJECTS) $(trunc_truncsub_DEPENDENCIES) $(EXTRA_trunc_truncsub_DEPENDENCIES) @rm -f trunc_truncsub$(EXEEXT) $(AM_V_CCLD)$(LINK) $(trunc_truncsub_OBJECTS) $(trunc_truncsub_LDADD) $(LIBS) unclude$(EXEEXT): $(unclude_OBJECTS) $(unclude_DEPENDENCIES) $(EXTRA_unclude_DEPENDENCIES) @rm -f unclude$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unclude_OBJECTS) $(unclude_LDADD) $(LIBS) unclude_del$(EXEEXT): $(unclude_del_OBJECTS) $(unclude_del_DEPENDENCIES) $(EXTRA_unclude_del_DEPENDENCIES) @rm -f unclude_del$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unclude_del_OBJECTS) $(unclude_del_LDADD) $(LIBS) unclude_move$(EXEEXT): $(unclude_move_OBJECTS) $(unclude_move_DEPENDENCIES) $(EXTRA_unclude_move_DEPENDENCIES) @rm -f unclude_move$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unclude_move_OBJECTS) $(unclude_move_LDADD) $(LIBS) unclude_open$(EXEEXT): $(unclude_open_OBJECTS) $(unclude_open_DEPENDENCIES) $(EXTRA_unclude_open_DEPENDENCIES) @rm -f unclude_open$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unclude_open_OBJECTS) $(unclude_open_LDADD) $(LIBS) version_0$(EXEEXT): $(version_0_OBJECTS) $(version_0_DEPENDENCIES) $(EXTRA_version_0_DEPENDENCIES) @rm -f version_0$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_0_OBJECTS) $(version_0_LDADD) $(LIBS) version_0_write$(EXEEXT): $(version_0_write_OBJECTS) $(version_0_write_DEPENDENCIES) $(EXTRA_version_0_write_DEPENDENCIES) @rm -f version_0_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_0_write_OBJECTS) $(version_0_write_LDADD) $(LIBS) version_1$(EXEEXT): $(version_1_OBJECTS) $(version_1_DEPENDENCIES) $(EXTRA_version_1_DEPENDENCIES) @rm -f version_1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_1_OBJECTS) $(version_1_LDADD) $(LIBS) version_1_write$(EXEEXT): $(version_1_write_OBJECTS) $(version_1_write_DEPENDENCIES) $(EXTRA_version_1_write_DEPENDENCIES) @rm -f version_1_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_1_write_OBJECTS) $(version_1_write_LDADD) $(LIBS) version_2$(EXEEXT): $(version_2_OBJECTS) $(version_2_DEPENDENCIES) $(EXTRA_version_2_DEPENDENCIES) @rm -f version_2$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_2_OBJECTS) $(version_2_LDADD) $(LIBS) version_2_write$(EXEEXT): $(version_2_write_OBJECTS) $(version_2_write_DEPENDENCIES) $(EXTRA_version_2_write_DEPENDENCIES) @rm -f version_2_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_2_write_OBJECTS) $(version_2_write_LDADD) $(LIBS) version_3$(EXEEXT): $(version_3_OBJECTS) $(version_3_DEPENDENCIES) $(EXTRA_version_3_DEPENDENCIES) @rm -f version_3$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_3_OBJECTS) $(version_3_LDADD) $(LIBS) version_3_write$(EXEEXT): $(version_3_write_OBJECTS) $(version_3_write_DEPENDENCIES) $(EXTRA_version_3_write_DEPENDENCIES) @rm -f version_3_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_3_write_OBJECTS) $(version_3_write_LDADD) $(LIBS) version_4$(EXEEXT): $(version_4_OBJECTS) $(version_4_DEPENDENCIES) $(EXTRA_version_4_DEPENDENCIES) @rm -f version_4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_4_OBJECTS) $(version_4_LDADD) $(LIBS) version_4_write$(EXEEXT): $(version_4_write_OBJECTS) $(version_4_write_DEPENDENCIES) $(EXTRA_version_4_write_DEPENDENCIES) @rm -f version_4_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_4_write_OBJECTS) $(version_4_write_LDADD) $(LIBS) version_5$(EXEEXT): $(version_5_OBJECTS) $(version_5_DEPENDENCIES) $(EXTRA_version_5_DEPENDENCIES) @rm -f version_5$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_5_OBJECTS) $(version_5_LDADD) $(LIBS) version_5_strict$(EXEEXT): $(version_5_strict_OBJECTS) $(version_5_strict_DEPENDENCIES) $(EXTRA_version_5_strict_DEPENDENCIES) @rm -f version_5_strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_5_strict_OBJECTS) $(version_5_strict_LDADD) $(LIBS) version_5_write$(EXEEXT): $(version_5_write_OBJECTS) $(version_5_write_DEPENDENCIES) $(EXTRA_version_5_write_DEPENDENCIES) @rm -f version_5_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_5_write_OBJECTS) $(version_5_write_LDADD) $(LIBS) version_6$(EXEEXT): $(version_6_OBJECTS) $(version_6_DEPENDENCIES) $(EXTRA_version_6_DEPENDENCIES) @rm -f version_6$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_6_OBJECTS) $(version_6_LDADD) $(LIBS) version_6_strict$(EXEEXT): $(version_6_strict_OBJECTS) $(version_6_strict_DEPENDENCIES) $(EXTRA_version_6_strict_DEPENDENCIES) @rm -f version_6_strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_6_strict_OBJECTS) $(version_6_strict_LDADD) $(LIBS) version_6_write$(EXEEXT): $(version_6_write_OBJECTS) $(version_6_write_DEPENDENCIES) $(EXTRA_version_6_write_DEPENDENCIES) @rm -f version_6_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_6_write_OBJECTS) $(version_6_write_LDADD) $(LIBS) version_7$(EXEEXT): $(version_7_OBJECTS) $(version_7_DEPENDENCIES) $(EXTRA_version_7_DEPENDENCIES) @rm -f version_7$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_7_OBJECTS) $(version_7_LDADD) $(LIBS) version_7_strict$(EXEEXT): $(version_7_strict_OBJECTS) $(version_7_strict_DEPENDENCIES) $(EXTRA_version_7_strict_DEPENDENCIES) @rm -f version_7_strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_7_strict_OBJECTS) $(version_7_strict_LDADD) $(LIBS) version_7_write$(EXEEXT): $(version_7_write_OBJECTS) $(version_7_write_DEPENDENCIES) $(EXTRA_version_7_write_DEPENDENCIES) @rm -f version_7_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_7_write_OBJECTS) $(version_7_write_LDADD) $(LIBS) version_8$(EXEEXT): $(version_8_OBJECTS) $(version_8_DEPENDENCIES) $(EXTRA_version_8_DEPENDENCIES) @rm -f version_8$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_8_OBJECTS) $(version_8_LDADD) $(LIBS) version_8_strict$(EXEEXT): $(version_8_strict_OBJECTS) $(version_8_strict_DEPENDENCIES) $(EXTRA_version_8_strict_DEPENDENCIES) @rm -f version_8_strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_8_strict_OBJECTS) $(version_8_strict_LDADD) $(LIBS) version_8_write$(EXEEXT): $(version_8_write_OBJECTS) $(version_8_write_DEPENDENCIES) $(EXTRA_version_8_write_DEPENDENCIES) @rm -f version_8_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_8_write_OBJECTS) $(version_8_write_LDADD) $(LIBS) version_9$(EXEEXT): $(version_9_OBJECTS) $(version_9_DEPENDENCIES) $(EXTRA_version_9_DEPENDENCIES) @rm -f version_9$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_9_OBJECTS) $(version_9_LDADD) $(LIBS) version_9_strict$(EXEEXT): $(version_9_strict_OBJECTS) $(version_9_strict_DEPENDENCIES) $(EXTRA_version_9_strict_DEPENDENCIES) @rm -f version_9_strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_9_strict_OBJECTS) $(version_9_strict_LDADD) $(LIBS) version_9_write$(EXEEXT): $(version_9_write_OBJECTS) $(version_9_write_DEPENDENCIES) $(EXTRA_version_9_write_DEPENDENCIES) @rm -f version_9_write$(EXEEXT) $(AM_V_CCLD)$(LINK) $(version_9_write_OBJECTS) $(version_9_write_LDADD) $(LIBS) vlist$(EXEEXT): $(vlist_OBJECTS) $(vlist_DEPENDENCIES) $(EXTRA_vlist_DEPENDENCIES) @rm -f vlist$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_OBJECTS) $(vlist_LDADD) $(LIBS) vlist_alias$(EXEEXT): $(vlist_alias_OBJECTS) $(vlist_alias_DEPENDENCIES) $(EXTRA_vlist_alias_DEPENDENCIES) @rm -f vlist_alias$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_alias_OBJECTS) $(vlist_alias_LDADD) $(LIBS) vlist_hidden$(EXEEXT): $(vlist_hidden_OBJECTS) $(vlist_hidden_DEPENDENCIES) $(EXTRA_vlist_hidden_DEPENDENCIES) @rm -f vlist_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_hidden_OBJECTS) $(vlist_hidden_LDADD) $(LIBS) vlist_invalid$(EXEEXT): $(vlist_invalid_OBJECTS) $(vlist_invalid_DEPENDENCIES) $(EXTRA_vlist_invalid_DEPENDENCIES) @rm -f vlist_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_invalid_OBJECTS) $(vlist_invalid_LDADD) $(LIBS) vlist_meta$(EXEEXT): $(vlist_meta_OBJECTS) $(vlist_meta_DEPENDENCIES) $(EXTRA_vlist_meta_DEPENDENCIES) @rm -f vlist_meta$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_meta_OBJECTS) $(vlist_meta_LDADD) $(LIBS) vlist_meta_hidden$(EXEEXT): $(vlist_meta_hidden_OBJECTS) $(vlist_meta_hidden_DEPENDENCIES) $(EXTRA_vlist_meta_hidden_DEPENDENCIES) @rm -f vlist_meta_hidden$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_meta_hidden_OBJECTS) $(vlist_meta_hidden_LDADD) $(LIBS) vlist_meta_invalid$(EXEEXT): $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_DEPENDENCIES) $(EXTRA_vlist_meta_invalid_DEPENDENCIES) @rm -f vlist_meta_invalid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vlist_meta_invalid_OBJECTS) $(vlist_meta_invalid_LDADD) $(LIBS) zzip_data$(EXEEXT): $(zzip_data_OBJECTS) $(zzip_data_DEPENDENCIES) $(EXTRA_zzip_data_DEPENDENCIES) @rm -f zzip_data$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzip_data_OBJECTS) $(zzip_data_LDADD) $(LIBS) zzip_get$(EXEEXT): $(zzip_get_OBJECTS) $(zzip_get_DEPENDENCIES) $(EXTRA_zzip_get_DEPENDENCIES) @rm -f zzip_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzip_get_OBJECTS) $(zzip_get_LDADD) $(LIBS) zzip_get_get$(EXEEXT): $(zzip_get_get_OBJECTS) $(zzip_get_get_DEPENDENCIES) $(EXTRA_zzip_get_get_DEPENDENCIES) @rm -f zzip_get_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzip_get_get_OBJECTS) $(zzip_get_get_LDADD) $(LIBS) zzip_nframes$(EXEEXT): $(zzip_nframes_OBJECTS) $(zzip_nframes_DEPENDENCIES) $(EXTRA_zzip_nframes_DEPENDENCIES) @rm -f zzip_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzip_nframes_OBJECTS) $(zzip_nframes_LDADD) $(LIBS) zzip_seek$(EXEEXT): $(zzip_seek_OBJECTS) $(zzip_seek_DEPENDENCIES) $(EXTRA_zzip_seek_DEPENDENCIES) @rm -f zzip_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzip_seek_OBJECTS) $(zzip_seek_LDADD) $(LIBS) zzip_seek_far$(EXEEXT): $(zzip_seek_far_OBJECTS) $(zzip_seek_far_DEPENDENCIES) $(EXTRA_zzip_seek_far_DEPENDENCIES) @rm -f zzip_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzip_seek_far_OBJECTS) $(zzip_seek_far_LDADD) $(LIBS) zzslim_get$(EXEEXT): $(zzslim_get_OBJECTS) $(zzslim_get_DEPENDENCIES) $(EXTRA_zzslim_get_DEPENDENCIES) @rm -f zzslim_get$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzslim_get_OBJECTS) $(zzslim_get_LDADD) $(LIBS) zzslim_nframes$(EXEEXT): $(zzslim_nframes_OBJECTS) $(zzslim_nframes_DEPENDENCIES) $(EXTRA_zzslim_nframes_DEPENDENCIES) @rm -f zzslim_nframes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzslim_nframes_OBJECTS) $(zzslim_nframes_LDADD) $(LIBS) zzslim_seek$(EXEEXT): $(zzslim_seek_OBJECTS) $(zzslim_seek_DEPENDENCIES) $(EXTRA_zzslim_seek_DEPENDENCIES) @rm -f zzslim_seek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzslim_seek_OBJECTS) $(zzslim_seek_LDADD) $(LIBS) zzslim_seek_far$(EXEEXT): $(zzslim_seek_far_OBJECTS) $(zzslim_seek_far_DEPENDENCIES) $(EXTRA_zzslim_seek_far_DEPENDENCIES) @rm -f zzslim_seek_far$(EXEEXT) $(AM_V_CCLD)$(LINK) $(zzslim_seek_far_OBJECTS) $(zzslim_seek_far_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_alias_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_alias_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_amb_code7.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_bit_bitnum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_bit_bitsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_bit_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_bit_numbits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_bit_scalars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_clincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_cpolynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_crecip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_crecip89.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_dangle_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_divide_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_dot5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_dot6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_duplicate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_format.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_lincom_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_lincom_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_lincom_nfields.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_linterp_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_meta_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_mplex_scalars.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_multiply_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_phase_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_polynom_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_protect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw_include.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw_spf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw_spf_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_raw_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_rdonly.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_resolv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_sbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_scalar_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_scalar_carray_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_sort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_spec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_spec_directive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_spec_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_spec_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_spec_resolv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_string_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_window_op.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_list_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_list_missing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_num.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_num_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_num_missing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_target.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_target_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias_target_missing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_bit_bitnum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_bit_numbits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_carray_len.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_carray_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_clincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_const_c2r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_const_r2c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_const_r2r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_cpolynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_cpolynom_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_crecip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_crecip89.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_crecip89_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_crecip_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_recode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_recode_recalc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar2a.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar2n.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar3c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_entry_scalar_amb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_lincom_23.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_lincom_32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_lincom_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_lincom_input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_lincom_offset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_lincom_slope.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_linterp_move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_mspec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_mspec_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_polynom_coeff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_polynom_input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_polynom_ord.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_raw_spf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_raw_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_recip_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_scalar_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_spec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_spec_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_spec_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_spec_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alter_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_get_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_get_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_get_here.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_get_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_put_here.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bof.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bof_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bof_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bof_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bof_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bof_phase_neg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_get_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_get_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_get_get2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_get_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_move_from.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_move_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_put_back.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_put_endian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_put_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_put_pad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_put_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close_close.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close_discard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex128_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex128_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex128_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex128_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex64_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex64_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex64_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_complex64_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float32_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_float64_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int16_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int32_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int64_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_int8_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint16_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint32_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint64_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convert_uint8_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat_excl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat_rdonly.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat_rdonly_exists.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array_free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array_meta0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array_meta_free.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_array_meta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_meta0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_meta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cvlist_meta_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_carray_deref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_const_deref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_const_force.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_data_enoent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_data_open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_del.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_derived.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_derived_after.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_derived_force.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_meta_force.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desync_flush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desync_path.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desync_reopen.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/desync_reopen_inv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dfes_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elist_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elist_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elist_noalias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/elist_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_alter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_alter_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_alter_open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_recode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_recode_open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encode_support.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian_alter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian_alter_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian_alter_sie.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian_move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_bad_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_bit_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_lincom_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_mplex_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_phase_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_polynom_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_raw_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_raw_scalar_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_raw_scalar_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_scalar_repr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_type_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry_window_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eof.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eof_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eof_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eof_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eof_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eof_phase_neg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_num.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_short.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_verbose.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error_verbose_prefix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_get_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_get_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_get_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_get_get2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_get_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_put_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_put_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_put_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_put_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_put_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_meta2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_meta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_meta_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_type_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_type_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_type_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_type_meta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flist_type_meta_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_amb_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_bad_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_flush.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_hex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_lincom1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_mult.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_raw_close.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_spec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foffs_alter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foffs_alter_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foffs_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foffs_move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_affix_alter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_affix_alter2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_affix_alter_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_affix_alter_nop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_affix_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_index_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_name_oor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_num.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment_parent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_bad_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_carray_c2r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_carray_len.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_carray_slice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_char.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_clincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_const_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_const_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_const_repr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_cpolynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_cpolynom1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_cpolynom_int.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_dim.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_divide_ccin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_divide_crin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_divide_crinr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_divide_rcin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_divide_s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_complex128_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_complex128_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_complex128_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_complex64_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_complex64_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_complex64_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_float32_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_float32_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_float32_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_float64_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_float64_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_endian_float64_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_ff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_foffs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_foffs2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_fs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_here.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_here_foffs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_heres.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_index_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom2s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom3s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom_mdt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom_non.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_lincom_spf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp_abs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp_empty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp_notab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_linterp_sort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_bof.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_lb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_lball.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_nolb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mplex_saved.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply_ccin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply_crin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply_crinr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply_rcin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_multiply_s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_neg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_none.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_nonexistent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_off64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_phase_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_polynom_cmpin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_polynom_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_recip_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_recurse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_rofs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_sbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_sf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_ss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_clr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_ge.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_gt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_le.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_lt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_ne.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_window_set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_zero_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_zero_float.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global_flags.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global_ref_empty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/global_ref_set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_del.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_get_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_get_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_get_get2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_get_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_move_from.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_move_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_back.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_endian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_off.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_pad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_put_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_seek_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/header_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/header_off64t.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hide_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hide_unhide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_accmode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_auto.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_cb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_creat.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_ignore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_include.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_nonexistent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_pc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include_syntax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_domain.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_range.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_s.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index_subset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_error.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_estring.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_format.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_get_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_get_rofs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_nonexistent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy_spf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_add.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_get_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_get_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_get_get2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_get_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_move_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_put.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_put_back.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_put_endian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_put_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_put_pad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma_xz_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_alias_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_bit_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_clincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_cpolynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_crecip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_crecip89.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_lincom_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_linterp_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_multiply_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_phase_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_sbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_spec.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_spec_directive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_spec_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_spec_resolv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madd_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_affix_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_affix_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_affix_updb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_data_enc_ar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_data_enc_ra.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_data_endian.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_data_foffs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_data_foffs_neg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_data_nop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_protect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_subdir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_affix_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_dangle.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_dot5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_dot5r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_dot9.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_move_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_updb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_updb_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_updb_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_updb_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_updb_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name_updb_const_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_lincom_cmpin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_lincom_cmpscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_linterp_cmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_mult.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_mult1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_mult2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_polynom_cmpin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_polynom_cmpscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_recip_cmpin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_recip_cmpscal.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_sbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nentries_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nentries_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nentries_noalias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nentries_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_nfields.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_type_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_type_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_vector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_vector_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields_vector_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes_empty.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes_off64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes_spf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_parent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_type_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_type_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_type_parent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_vectors.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_vectors_del.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_vectors_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_vectors_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nmeta_vectors_parent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_abs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_cb_abort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_cb_cont.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_cb_ignore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_cb_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_cb_rescan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_cb_rescan_alloc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_eaccess.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_nonexistent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_notdirfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_rofs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_al.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_at.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_c.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_cl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_ct.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_d.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_l.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_p.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_pl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open_sym_pt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_alias_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_alias_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_alias_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_alias_missing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_badline.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit_bitnum.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit_bitsize.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit_numbits.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_bit_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_carray_long.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_const_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_const_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_double.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_duplicate.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_duplicate_ignore.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_endian_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_endian_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_endian_force.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_endian_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_endian_slash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_eol.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_foffs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_foffs_include.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_foffs_slash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_hex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_hidden_field.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_hidden_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_absolute.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_absrel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_affix_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_affix_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_loop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_nonexistent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_prefix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_prefix_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_preprefix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_relabs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_relrel.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_slash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_suffix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_include_sufsuffix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_ncols1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_ncols2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_nfields.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_nofields.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_non.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_non_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_lincom_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_linterp_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_cmpbad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_fltcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_fltcmp0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_intcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_intcmp0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_uintcmp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_literal_uintcmp0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_malias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_malias_dup.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_malias_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_frag.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_implicit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_implicit2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_implicit_affix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_index2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_jump.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_malias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_parent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_meta_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_mplex_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_mplex_nomax.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_mplex_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_multiply_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_name.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_name_dot.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_name_ext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_name_pedantic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_octal_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_phase_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_phase_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_polynom_ncols1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_polynom_ncols2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_polynom_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_protect_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_protect_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_protect_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_protect_format.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_protect_none.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_quote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_quote_mismatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw_char.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw_char_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw_spf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_raw_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_ref_nonexistent.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_sbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_scalar1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_scalar2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_scalar_repr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_sort.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_string_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_string_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_utf8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_utf8_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_utf8_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_89.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_98.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_include.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_p8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_p9.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_permissive.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_version_slash.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_whitespace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_window_ncols.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_window_op.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_window_scalar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protect_alter.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protect_alter_all.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protect_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_bad_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_bit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_bof.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_carray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_carray_client.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_carray_slice.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_char.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_clincom1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_complex128.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_complex64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_const.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_const_protect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_cpolynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_crecip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_complex128_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_complex128_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_complex128_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_complex64_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_complex64_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_complex64_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_float32_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_float32_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_float32_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_float64_arm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_float64_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_endian_float64_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_ff.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_foffs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_fs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_here.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_heres.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_lincom1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_lincom2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_lincom_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_linterp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_linterp_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_linterp_nomono.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_linterp_notab.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_linterp_reverse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_mplex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_mplex_complex.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_nofile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_null.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_off64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_phase_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_polynom1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_polynom2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_polynom_noin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_protect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_rdonly.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_recurse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_repr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_rofs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_sbit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_sf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_ss.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_string_protect.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_window.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/put_zero.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ref.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ref_none.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ref_two.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_a.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_bad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_float32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_float64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_i.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_int16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_int32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_int64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_int8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_m.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_real_a.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_real_i.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_real_m.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_real_r.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_uint16.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_uint32.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_uint64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/repr_uint8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_cur.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_end.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_foffs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_foffs2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_index.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_mult.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_neg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_phase.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_set.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seek_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_get_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_get_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_move_from.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_move_to.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_nframes_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_nframes_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_append.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_append2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_back.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_big.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_little.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_many.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_newo.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_newo0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_pad.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_pad0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_trunc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_trunc2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_put_trunc_nf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie_sync.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slim_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slim_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slim_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slim_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_alias_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_alias_missing.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_divide.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_lincom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_multiply.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_polynom.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_raw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_recip.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf_recurse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist_meta0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist_meta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/svlist_meta_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_code.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/table_type.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tell.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tell64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tell_multidiv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tell_sub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tok_arg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tok_escape.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tok_quote.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trunc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trunc_dir.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trunc_rdonly.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trunc_rofs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trunc_truncsub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unclude.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unclude_del.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unclude_move.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unclude_open.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_0.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_0_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_1.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_1_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_2.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_2_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_3_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_4.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_4_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_5.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_5_strict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_5_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_6.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_6_strict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_6_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_7.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_7_strict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_7_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_8.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_8_strict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_8_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_9.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_9_strict.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version_9_write.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist_alias.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist_meta.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist_meta_hidden.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vlist_meta_invalid.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip_data.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip_get_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip_seek_far.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzslim_get.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzslim_nframes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzslim_seek.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzslim_seek_far.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 -o $@ $< .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 -o $@ `$(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: $(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" 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 check-TESTS: $(TESTS) @failed=0; all=0; xfail=0; xpass=0; skip=0; \ srcdir=$(srcdir); export srcdir; \ list=' $(TESTS) '; \ $(am__tty_colors); \ if test -n "$$list"; then \ for tst in $$list; do \ if test -f ./$$tst; then dir=./; \ elif test -f $$tst; then dir=; \ else dir="$(srcdir)/"; fi; \ if $(TESTS_ENVIRONMENT) $${dir}$$tst $(AM_TESTS_FD_REDIRECT); then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xpass=`expr $$xpass + 1`; \ failed=`expr $$failed + 1`; \ col=$$red; res=XPASS; \ ;; \ *) \ col=$$grn; res=PASS; \ ;; \ esac; \ elif test $$? -ne 77; then \ all=`expr $$all + 1`; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$tst[\ \ ]*) \ xfail=`expr $$xfail + 1`; \ col=$$lgn; res=XFAIL; \ ;; \ *) \ failed=`expr $$failed + 1`; \ col=$$red; res=FAIL; \ ;; \ esac; \ else \ skip=`expr $$skip + 1`; \ col=$$blu; res=SKIP; \ fi; \ echo "$${col}$$res$${std}: $$tst"; \ done; \ if test "$$all" -eq 1; then \ tests="test"; \ All=""; \ else \ tests="tests"; \ All="All "; \ fi; \ if test "$$failed" -eq 0; then \ if test "$$xfail" -eq 0; then \ banner="$$All$$all $$tests passed"; \ else \ if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \ banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \ fi; \ else \ if test "$$xpass" -eq 0; then \ banner="$$failed of $$all $$tests failed"; \ else \ if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \ banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \ fi; \ fi; \ dashes="$$banner"; \ skipped=""; \ if test "$$skip" -ne 0; then \ if test "$$skip" -eq 1; then \ skipped="($$skip test was not run)"; \ else \ skipped="($$skip tests were not run)"; \ fi; \ test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$skipped"; \ fi; \ report=""; \ if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ report="Please report to $(PACKAGE_BUGREPORT)"; \ test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ dashes="$$report"; \ fi; \ dashes=`echo "$$dashes" | sed s/./=/g`; \ if test "$$failed" -eq 0; then \ col="$$grn"; \ else \ col="$$red"; \ fi; \ echo "$${col}$$dashes$${std}"; \ echo "$${col}$$banner$${std}"; \ test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \ test -z "$$report" || echo "$${col}$$report$${std}"; \ echo "$${col}$$dashes$${std}"; \ test "$$failed" -eq 0; \ else :; fi 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-local 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-checkPROGRAMS clean-generic clean-libtool clean-local \ 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 TAGS all all-am check check-TESTS check-am \ check-local clean clean-checkPROGRAMS clean-generic \ clean-libtool clean-local cscopelist-am ctags ctags-am \ 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 tags-am uninstall uninstall-am # fast tests .PHONY: fastcheck fastcheck: touch $(TESTS) ${MAKE} check # valgrind valgrind.log: $(TESTS) rm -f $@; \ for x in $^; do ( \ echo $$x:; \ sed -e 's/exec "/exec valgrind --leak-check=full --track-origins=yes --track-fds=yes --suppressions=valgrind.suppressions "/' $$x | sh; \ echo $$x = $$? ); done &> $@; # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dir getdata-clean-dir: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dir rm -rf *~ # 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: libgetdata-0.9.0/test/gzip_put_nframes.c0000640000175000017500000000352012614323564020503 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" uint32_t d[100]; int main(void) { #ifndef USE_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.gz"; int i, e1, e2, r = 0; size_t n1, n2; off_t nf1, nf2; DIRFILE *D; for (i = 0; i < 100; ++i) d[i] = i; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_CREAT | GD_EXCL | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT32, 1, 0); n1 = gd_putdata(D, "data", 0, 0, 0, 100, GD_UINT32, d); CHECKU(n1, 100); e1 = gd_error(D); CHECKI(e1, GD_E_OK); nf1 = gd_nframes(D); CHECKU(nf1, 100); gd_close(D); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n2 = gd_putdata(D, "data", 0, 100, 0, 100, GD_UINT32, d); CHECKU(n2, 100); e2 = gd_error(D); CHECKI(e2, GD_E_OK); nf2 = gd_nframes(D); CHECKU(nf2, 200); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/put_endian_float64_big.c0000640000175000017500000000414012614323564021434 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write big-endian FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\nENDIAN big\n"; unsigned int i; const double c = 1.5; unsigned char x[sizeof(double)] = { 0x3F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; unsigned char u[sizeof(double)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * sizeof(double), SEEK_SET); read(fd, u, sizeof(double)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < sizeof(double); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/entry_recip.c0000640000175000017500000000350512614323564017455 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read POLYNOM entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RECIP in 2\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_RECIP_ENTRY); CHECKX(E.flags, GD_EN_CALC); CHECKI(E.EN(recip,dividend), 2); CHECKS(E.in_fields[0], "in"); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/put_type.c0000640000175000017500000000323612614323564017004 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write an invalid type */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UNKNOWN, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_TYPE); return r; } libgetdata-0.9.0/test/add_cpolynom.c0000640000175000017500000000426012614323564017601 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a complex POLYNOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int r = 0; int error, j; gd_entry_t e; DIRFILE *D; #ifdef GD_NO_C99_API const double a[8] = {1, 29.03, 0.3, 12.34, 0.5, 99.55, 1.8, 45.32}; #else const double complex a[4] = {1 + _Complex_I * 29.03, 0.3 + _Complex_I * 12.34, 0.5 + _Complex_I * 99.55, 1.8 + _Complex_I * 45.32}; #endif rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_cpolynom(D, "new", 3, "in", a, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_POLYNOM_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(polynom,poly_ord), 3); CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); for (j = 0; j < 4; ++j) { #ifdef GD_NO_C99_API CHECKCi(j,e.EN(polynom,ca)[j], a + 2 * j); #else CHECKCi(j,e.EN(polynom,ca)[j], a[j]); #endif } gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/parse_hidden_meta.c0000640000175000017500000000273512614323564020571 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n" "data/meta CONST UINT8 1\n" "/HIDDEN data/meta\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/name_updb_carray.c0000640000175000017500000000365112614323564020427 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "phase PHASE INDEX data<3>\n" "data CARRAY UINT8 8 9 10 11 12\n" "lincom LINCOM INDEX data data<1>\n"; int fd, e1, e2, e3, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_rename(D, "data", "zata", GD_REN_UPDB); e1 = gd_error(D); CHECKI(e1, 0); gd_entry(D, "phase", &E); e2 = gd_error(D); CHECKI(e2, 0); CHECKS(E.scalar[0], "zata"); CHECKI(E.scalar_ind[0], 3); gd_free_entry_strings(&E); gd_entry(D, "lincom", &E); e3 = gd_error(D); CHECKI(e3, 0); CHECKS(E.scalar[0], "zata"); CHECKS(E.scalar[GD_MAX_LINCOM], "zata"); CHECKI(E.scalar_ind[0], 0); CHECKI(E.scalar_ind[GD_MAX_LINCOM], 1); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_utf8_invalid.c0000640000175000017500000000300112614323564020707 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING \\u654321\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error,GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/del_const_force.c0000640000175000017500000000343212614323564020261 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 13\n" "raw RAW UINT8 data\n"; int fd, ret, error1, error2, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", GD_DEL_FORCE); error1 = gd_error(D); spf = gd_spf(D, "raw"); error2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error1, GD_E_OK); CHECKI(error2, GD_E_BAD_SCALAR); CHECKU(spf, 0); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/get_const.c0000640000175000017500000000324612614323564017121 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read constant */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT64 8.3\n"; double c; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_constant(D, "const", GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKF(c, 8.3); return r; } libgetdata-0.9.0/test/name_affix.c0000640000175000017500000000363012614323564017226 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 8\n"; int fd, r1, r2, e1, e2, e3, r = 0; gd_entype_t type; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); r1 = gd_rename(D, "AdataZ", "BdataY", 0); e1 = gd_error(D); CHECKI(r1, -1); CHECKI(e1, GD_E_BAD_CODE); r2 = gd_rename(D, "AdataZ", "AzataZ", 0); e2 = gd_error(D); CHECKI(r2, 0); CHECKI(e2, 0); type = gd_entry_type(D, "AzataZ"); e3 = gd_error(D); CHECKI(type, GD_RAW_ENTRY); CHECKI(e3, 0); gd_discard(D); unlink(format); unlink(format1); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_polynom_input.c0000640000175000017500000000424112614323564021233 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "polynom POLYNOM data 1 2 1\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_polynom(D, "polynom", 0, "phase", NULL); error = gd_error(D); n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) { const int x = i + 41; CHECKIi(i,c[i], x * x + 2 * x + 1); } unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/parse_meta_affix.c0000640000175000017500000000324712614323564020432 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "parent RAW UINT8 1\n" "META parent child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/parse_version_p8.c0000640000175000017500000000332612614323564020421 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test version leakage */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/ar"; const char *format_data = "/INCLUDE format1\n" "r.d RECIP a b EQ 1.\n"; const char *format1_data = "/VERSION 8\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_utf8_zero.c0000640000175000017500000000277412614323564020260 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING \\u0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error,GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_include_sufsuffix.c0000640000175000017500000000375212614323564022055 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "INCLUDE format1 pre post\n"; const char *format1_data = "INCLUDE format2 \"\" POST\n"; const char *format2_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf, spf1, spf2; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDONLY); spf = gd_spf(D, "data"); spf1 = gd_spf(D, "predatapost"); spf2 = gd_spf(D, "predataPOSTpost"); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 0); CHECKU(spf1, 0); CHECKU(spf2, 11); return r; } libgetdata-0.9.0/test/add_window.c0000640000175000017500000000327112614323564017251 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; gd_triplet_t threshold; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); threshold.r = 3.4; gd_add_window(D, "new", "in", "check", GD_WINDOP_GE, threshold, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_WINDOW_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKS(e.in_fields[1], "check"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(window,windop), GD_WINDOP_GE); CHECKF(e.EN(window,threshold.r), 3.4); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/get_polynom_noin.c0000640000175000017500000000322312614323564020506 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read POLYNOM */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM data 2 3\n"; unsigned char c = 0; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/parse_quote.c0000640000175000017500000000304512614323564017460 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "\"da ta\" RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/flac_put_little.c0000640000175000017500000000554312614323564020310 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_flac = "dirfile/data.flac"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; #ifdef USE_FLAC char command[4096]; uint16_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, unlink_flac, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 0x0101 * i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_FLAC D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_flac, &buf); #ifdef USE_FLAC CHECKI(e1, GD_E_OK); CHECKI(n, 8); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(stat_data, -1); #endif #ifdef USE_FLAC snprintf(command, 4096, "%s --silent --decode --delete-input-file " "--force-raw-format --sign=signed --endian=little %s --output-name=%s", FLAC, data_flac, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof d)) { if (i < 40 || i > 48) { CHECKXi(i, d, 0); } else CHECKXi(i, d, (i - 40) * 0x0101); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_flac = unlink(data_flac); CHECKI(unlink_flac, -1); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_FLAC CHECKI(unlink_data, 0); #else CHECKI(unlink_data, -1); #endif return r; #endif } libgetdata-0.9.0/test/native_linterp_cmp.c0000640000175000017500000000333412614323564021014 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data table\n" "data RAW UINT8 11\n"; const char *table_data = "0 0;1\n1 1;1\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, table_data, strlen(table_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "linterp"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(table); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/hide_hidden.c0000640000175000017500000000311012614323564017346 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n" "hata RAW UINT8 8\n" "/HIDDEN hata\n"; int fd, h1, h2, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); h1 = gd_hidden(D, "data"); e1 = gd_error(D); h2 = gd_hidden(D, "hata"); e2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(h1, 0); CHECKI(e2, GD_E_OK); CHECKI(h2, 1); return r; } libgetdata-0.9.0/test/parse_version.c0000640000175000017500000000307712614323564020015 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "VERSION 999999\nBADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/convert_int8_int32.c0000640000175000017500000000374312614323564020577 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; int32_t c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/alter_entry_scalar_amb.c0000640000175000017500000000335212614323564021626 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 7\nphase PHASE INDEX c\n"; int fd, ret, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_entry(D, "phase", &E); free(E.scalar[0]); E.scalar[0] = "2"; ret = gd_alter_entry(D, "phase", &E, 0); error = gd_error(D); CHECKI(ret, -1); CHECKI(error, GD_E_BAD_CODE); E.scalar[0] = NULL; gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/seek64.c0000640000175000017500000000373112614323564016234 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #define _LARGEFILE64_SOURCE 1 #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off64_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek64(D, "data", 6, 0, GD_SEEK_SET); e1 = gd_error(D); n = gd_tell64(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(m, 48); CHECKI(n, 48); return r; } libgetdata-0.9.0/test/get_multiply_noin.c0000640000175000017500000000363112614323564020673 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read MULTIPLY */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data data\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/nframes_nframes.c0000640000175000017500000000350312614323564020276 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 1\n"; int fd, error, r = 0; const size_t len = strlen(data); off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, (off_t)len / 2); return r; } libgetdata-0.9.0/test/vlist.c0000640000175000017500000000412712614323564016274 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "data3 RAW UINT8 1\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_vector_list(D); error = gd_error(D); CHECKI(error,0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { if (strcmp(field_list[i], "data1") == 0) continue; else if (strcmp(field_list[i], "data2") == 0) continue; else if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "INDEX") == 0) continue; r = 1; } CHECKI(i,4); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/hide_unhide.c0000640000175000017500000000303112614323564017371 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n/HIDDEN data\n"; int fd, n, h, m, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_nfields(D); h = gd_unhide(D, "data"); error = gd_error(D); m = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 1); CHECKI(h, 0); CHECKI(m, 2); return r; } libgetdata-0.9.0/test/legacy_put.c0000640000175000017500000000404212614323564017263 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 via the legacy interface*/ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, error, r = 0; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); n = PutData(filedir, "data", 5, 0, 1, 0, 'c', c, &error); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); return r; #endif } libgetdata-0.9.0/test/lzma_xz_put_endian.c0000640000175000017500000000535612614323564021032 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n" #ifdef WORDS_BIGENDIAN "ENDIAN little\n"; #else "ENDIAN big\n"; #endif uint16_t c[8]; #ifdef USE_LZMA char command[4096]; uint16_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint16_t)(0x102 * i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_LZMA D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_xz, &buf); #ifdef USE_LZMA if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(stat_data, -1); #endif #ifdef USE_LZMA /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint16_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, 0x201 * (i - 40)); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(n, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/convert_int8_int64.c0000640000175000017500000000374312614323564020604 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; int64_t c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/entry_polynom.c0000640000175000017500000000363612614323564020055 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read POLYNOM entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data POLYNOM in 1 2 3 4 5\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_POLYNOM_ENTRY); CHECKX(E.flags, GD_EN_CALC); CHECKI(E.EN(polynom,poly_ord), 4); CHECKS(E.in_fields[0], "in"); for (fd = 0; fd < 4; ++fd) CHECKFi(fd,E.EN(polynom,a)[fd], fd + 1.); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/nentries_alias.c0000640000175000017500000000324312614323564020131 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "/ALIAS data2 data1\n" "/ALIAS data3 data4\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nentries(D, NULL, GD_ALIAS_ENTRIES, 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 2); return r; } libgetdata-0.9.0/test/parse_const_complex.c0000640000175000017500000000357112614323564021204 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST COMPLEX128 1;2\n"; int fd, e1, e2, r = 0; #ifdef GD_NO_C99_API double c[2]; const double v[2] = {1, 2}; #else complex double c; #endif DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); e1 = gd_error(D); #ifdef GD_NO_C99_API gd_get_constant(D, "const", GD_COMPLEX128, c); #else gd_get_constant(D, "const", GD_COMPLEX128, &c); #endif e2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1,GD_E_OK); CHECKI(e2,GD_E_OK); #ifdef GD_NO_C99_API CHECKC(c,v); #else CHECKC(c,1 + _Complex_I * 2); #endif return r; } libgetdata-0.9.0/test/convert_uint32_uint16.c0000640000175000017500000000377112614323564021231 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; uint16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_uint16_uint8.c0000640000175000017500000000377712614323564021162 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/alter_entry_recode.c0000640000175000017500000000447012614323564021005 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; uint16_t d; int fd, i, ret, error, r = 0; off_t n; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); E.EN(raw,data_type) = GD_UINT16; E.EN(raw,spf) = 11; ret = gd_alter_entry(D, "data", &E, 1); error = gd_error(D); n = gd_nframes(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKXi(i, d, i * 8 / 11); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 32); CHECKI(ret, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/madd_crecip89.c0000640000175000017500000000362212614323564017545 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define GD_C89_API #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; double div[2] = {3.2, 3.1}; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_crecip(D, "new", "meta", "in1", div); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_RECIP_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKF(e.EN(recip,cdividend)[0], div[0]); CHECKF(e.EN(recip,cdividend)[1], div[1]); CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/put_linterp_nomono.c0000640000175000017500000000402012614323564021055 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write LINTERP */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n"; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; FILE *t; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); t = fopen(table, "wt"); for (i = 0; i < 10; ++i) fprintf(t, "%i %i\n", i * 6, (i - 5) * (i - 5)); fclose(t); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(table); unlink(data); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error, GD_E_DOMAIN); return r; } libgetdata-0.9.0/test/convert_uint8_int64.c0000640000175000017500000000376112614323564020771 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; int64_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/put_invalid.c0000640000175000017500000000261512614323564017451 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Writing data to an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; char c[8]; int error, r = 0; DIRFILE *D; size_t n; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); CHECKI(n,0); CHECKI(error,GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/sie_put_little.c0000640000175000017500000000500712614323564020156 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write little-endian SIE data */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; const uint8_t data_out[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; uint8_t check[4 * 9]; DIRFILE *D; int fd, i, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); read(fd, check, 4 * 9); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 16); for (i = 0; i < 4 * 9; ++i) CHECKIi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/add_spec.c0000640000175000017500000000340112614323564016667 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "data RAW UINT8 2", 0); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); if (unlink(data)) r = 1; unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/dfes_linterp.c0000640000175000017500000000312012614323564017601 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a LINTERP entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data LINTERP in table\n"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/get_endian_complex128_big.c0000640000175000017500000002170012614323564022027 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read big-endian COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\nENDIAN big\n"; #ifdef GD_NO_C99_API double u[20]; double v[20][2]; #else double complex u[10]; double complex v[20]; #endif const unsigned char data_data[64 * 16] = { 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1e, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x26, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x31, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x39, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x43, 0x38, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x4c, 0xd5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x9f, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x37, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x40, 0x68, 0x53, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x40, 0x72, 0x3e, 0xde, 0x40, 0x00, 0x00, 0x00, 0x40, 0x7b, 0x5e, 0x4d, 0x60, 0x00, 0x00, 0x00, 0x40, 0x84, 0x86, 0xba, 0x08, 0x00, 0x00, 0x00, 0x40, 0x8e, 0xca, 0x17, 0x0c, 0x00, 0x00, 0x00, 0x40, 0x97, 0x17, 0x91, 0x49, 0x00, 0x00, 0x00, 0x40, 0xa1, 0x51, 0xac, 0xf6, 0xc0, 0x00, 0x00, 0x40, 0xa9, 0xfa, 0x83, 0x72, 0x20, 0x00, 0x00, 0x40, 0xb3, 0x7b, 0xe2, 0x95, 0x98, 0x00, 0x00, 0x40, 0xbd, 0x39, 0xd3, 0xe0, 0x64, 0x00, 0x00, 0x40, 0xc5, 0xeb, 0x5e, 0xe8, 0x4b, 0x00, 0x00, 0x40, 0xd0, 0x70, 0x87, 0x2e, 0x38, 0x40, 0x00, 0x40, 0xd8, 0xa8, 0xca, 0xc5, 0x54, 0x60, 0x00, 0x40, 0xe2, 0x7e, 0x98, 0x13, 0xff, 0x48, 0x00, 0x40, 0xeb, 0xbd, 0xe4, 0x1d, 0xfe, 0xec, 0x00, 0x40, 0xf4, 0xce, 0x6b, 0x16, 0x7f, 0x31, 0x00, 0x40, 0xff, 0x35, 0xa0, 0xa1, 0xbe, 0xc9, 0x80, 0x41, 0x07, 0x68, 0x38, 0x79, 0x4f, 0x17, 0x20, 0x41, 0x11, 0x8e, 0x2a, 0x5a, 0xfb, 0x51, 0x58, 0x41, 0x1a, 0x55, 0x3f, 0x88, 0x78, 0xfa, 0x04, 0x41, 0x23, 0xbf, 0xef, 0xa6, 0x5a, 0xbb, 0x83, 0x41, 0x2d, 0x9f, 0xe7, 0x79, 0x88, 0x19, 0x44, 0x41, 0x36, 0x37, 0xed, 0x9b, 0x26, 0x12, 0xf3, 0x41, 0x40, 0xa9, 0xf2, 0x34, 0x5c, 0x8e, 0x36, 0x41, 0x48, 0xfe, 0xeb, 0x4e, 0x8a, 0xd5, 0x51, 0x41, 0x52, 0xbf, 0x30, 0x7a, 0xe8, 0x1f, 0xfd, 0x41, 0x5c, 0x1e, 0xc8, 0xb8, 0x5c, 0x2f, 0xfc, 0x41, 0x65, 0x17, 0x16, 0x8a, 0x45, 0x23, 0xfd, 0x41, 0x6f, 0xa2, 0xa1, 0xcf, 0x67, 0xb5, 0xfc, 0x41, 0x77, 0xb9, 0xf9, 0x5b, 0x8d, 0xc8, 0x7d, 0x41, 0x81, 0xcb, 0x7b, 0x04, 0xaa, 0x56, 0x5e, 0x41, 0x8a, 0xb1, 0x38, 0x86, 0xff, 0x81, 0x8d, 0x41, 0x94, 0x04, 0xea, 0x65, 0x3f, 0xa1, 0x2a, 0x41, 0x9e, 0x07, 0x5f, 0x97, 0xdf, 0x71, 0xbf, 0x41, 0xa6, 0x85, 0x87, 0xb1, 0xe7, 0x95, 0x4f, 0x41, 0xb0, 0xe4, 0x25, 0xc5, 0x6d, 0xaf, 0xfb, 0x41, 0xb9, 0x56, 0x38, 0xa8, 0x24, 0x87, 0xf8, 0x41, 0xc3, 0x00, 0xaa, 0x7e, 0x1b, 0x65, 0xfa, 0x41, 0xcc, 0x80, 0xff, 0xbd, 0x29, 0x18, 0xf7, 0x41, 0xd5, 0x60, 0xbf, 0xcd, 0xde, 0xd2, 0xb9, 0x41, 0xe0, 0x08, 0x8f, 0xda, 0x67, 0x1e, 0x0b, 0x41, 0xe8, 0x0c, 0xd7, 0xc7, 0x9a, 0xad, 0x10, 0x41, 0xf2, 0x09, 0xa1, 0xd5, 0xb4, 0x01, 0xcc, 0x41, 0xfb, 0x0e, 0x72, 0xc0, 0x8e, 0x02, 0xb2, 0x42, 0x04, 0x4a, 0xd6, 0x10, 0x6a, 0x82, 0x06, 0x42, 0x0e, 0x70, 0x41, 0x18, 0x9f, 0xc3, 0x09, 0x42, 0x16, 0xd4, 0x30, 0xd2, 0x77, 0xd2, 0x47, 0x42, 0x21, 0x1f, 0x24, 0x9d, 0xd9, 0xdd, 0xb5, 0x42, 0x29, 0xae, 0xb6, 0xec, 0xc6, 0xcc, 0x90, 0x42, 0x33, 0x43, 0x09, 0x31, 0x95, 0x19, 0x6c, 0x42, 0x3c, 0xe4, 0x8d, 0xca, 0x5f, 0xa6, 0x22, 0x42, 0x45, 0xab, 0x6a, 0x57, 0xc7, 0xbc, 0x9a, 0x42, 0x50, 0x40, 0x8f, 0xc1, 0xd5, 0xcd, 0x74, 0x42, 0x58, 0x60, 0xd7, 0xa2, 0xc0, 0xb4, 0x2e, 0x42, 0x62, 0x48, 0xa1, 0xba, 0x10, 0x87, 0x22, 0x42, 0x6b, 0x6c, 0xf2, 0x97, 0x18, 0xca, 0xb3, 0x42, 0x74, 0x91, 0xb5, 0xf1, 0x52, 0x98, 0x06, 0x42, 0x7e, 0xda, 0x90, 0xe9, 0xfb, 0xe4, 0x09, 0x42, 0x87, 0x23, 0xec, 0xaf, 0x7c, 0xeb, 0x07, 0x42, 0x91, 0x5a, 0xf1, 0x83, 0x9d, 0xb0, 0x45, 0x42, 0x9a, 0x08, 0x6a, 0x45, 0x6c, 0x88, 0x68, 0x42, 0xa3, 0x86, 0x4f, 0xb4, 0x11, 0x66, 0x4e, 0x42, 0xad, 0x49, 0x77, 0x8e, 0x1a, 0x19, 0x75, 0x42, 0xb5, 0xf7, 0x19, 0xaa, 0x93, 0x93, 0x18, 0x42, 0xc0, 0x79, 0x53, 0x3f, 0xee, 0xae, 0x52, 0x42, 0xc8, 0xb5, 0xfc, 0xdf, 0xe6, 0x05, 0x7b, 0x42, 0xd2, 0x88, 0x7d, 0xa7, 0xec, 0x84, 0x1c, 0x42, 0xdb, 0xcc, 0xbc, 0x7b, 0xe2, 0xc6, 0x2a, 0x42, 0xe4, 0xd9, 0x8d, 0x5c, 0xea, 0x14, 0xa0, 0x42, 0xef, 0x46, 0x54, 0x0b, 0x5f, 0x1e, 0xf0, 0x42, 0xf7, 0x74, 0xbf, 0x08, 0x87, 0x57, 0x34, 0x43, 0x01, 0x97, 0x8f, 0x46, 0x65, 0x81, 0x67, 0x43, 0x0a, 0x63, 0x56, 0xe9, 0x98, 0x42, 0x1a, 0x43, 0x13, 0xca, 0x81, 0x2f, 0x32, 0x31, 0x94, 0x43, 0x1d, 0xaf, 0xc1, 0xc6, 0xcb, 0x4a, 0x5e, 0x43, 0x26, 0x43, 0xd1, 0x55, 0x18, 0x77, 0xc6, 0x43, 0x30, 0xb2, 0xdc, 0xff, 0xd2, 0x59, 0xd4, 0x43, 0x39, 0x0c, 0x4b, 0x7f, 0xbb, 0x86, 0xbe, 0x43, 0x42, 0xc9, 0x38, 0x9f, 0xcc, 0xa5, 0x0e, 0x43, 0x4c, 0x2d, 0xd4, 0xef, 0xb2, 0xf7, 0x95, 0x43, 0x55, 0x22, 0x5f, 0xb3, 0xc6, 0x39, 0xb0, 0x43, 0x5f, 0xb3, 0x8f, 0x8d, 0xa9, 0x56, 0x88, 0x43, 0x67, 0xc6, 0xab, 0xaa, 0x3f, 0x00, 0xe6, 0x43, 0x71, 0xd5, 0x00, 0xbf, 0xaf, 0x40, 0xac, 0x43, 0x7a, 0xbf, 0x81, 0x1f, 0x86, 0xe1, 0x02, 0x43, 0x84, 0x0f, 0xa0, 0xd7, 0xa5, 0x28, 0xc2, 0x43, 0x8e, 0x17, 0x71, 0x43, 0x77, 0xbd, 0x23, 0x43, 0x96, 0x91, 0x94, 0xf2, 0x99, 0xcd, 0xda, 0x43, 0xa0, 0xed, 0x2f, 0xb5, 0xf3, 0x5a, 0x64, 0x43, 0xa9, 0x63, 0xc7, 0x90, 0xed, 0x07, 0x96, 0x43, 0xb3, 0x0a, 0xd5, 0xac, 0xb1, 0xc5, 0xb0, 0x43, 0xbc, 0x90, 0x40, 0x83, 0x0a, 0xa8, 0x88, 0x43, 0xc5, 0x6c, 0x30, 0x62, 0x47, 0xfe, 0x66, 0x43, 0xd0, 0x11, 0x24, 0x49, 0xb5, 0xfe, 0xcc, 0x43, 0xd8, 0x19, 0xb6, 0x6e, 0x90, 0xfe, 0x32, 0x43, 0xe2, 0x13, 0x48, 0xd2, 0xec, 0xbe, 0xa6, 0x43, 0xeb, 0x1c, 0xed, 0x3c, 0x63, 0x1d, 0xf9, 0x43, 0xf4, 0x55, 0xb1, 0xed, 0x4a, 0x56, 0x7b, 0x43, 0xfe, 0x80, 0x8a, 0xe3, 0xef, 0x81, 0xb8, 0x44, 0x06, 0xe0, 0x68, 0x2a, 0xf3, 0xa1, 0x4a, 0x44, 0x11, 0x28, 0x4e, 0x20, 0x36, 0xb8, 0xf8, 0x44, 0x19, 0xbc, 0x75, 0x30, 0x52, 0x15, 0x74, 0x44, 0x23, 0x4d, 0x57, 0xe4, 0x3d, 0x90, 0x17, 0x44, 0x2c, 0xf4, 0x03, 0xd6, 0x5c, 0x58, 0x22, 0x44, 0x35, 0xb7, 0x02, 0xe0, 0xc5, 0x42, 0x1a, 0x44, 0x40, 0x49, 0x42, 0x28, 0x93, 0xf1, 0x94, 0x44, 0x48, 0x6d, 0xe3, 0x3c, 0xdd, 0xea, 0x5e, 0x44, 0x52, 0x52, 0x6a, 0x6d, 0xa6, 0x6f, 0xc6, 0x44, 0x5b, 0x7b, 0x9f, 0xa4, 0x79, 0xa7, 0xa9, 0x44, 0x64, 0x9c, 0xb7, 0xbb, 0x5b, 0x3d, 0xbf, 0x44, 0x6e, 0xeb, 0x13, 0x99, 0x08, 0xdc, 0x9e, 0x44, 0x77, 0x30, 0x4e, 0xb2, 0xc6, 0xa5, 0x76, 0x44, 0x81, 0x64, 0x3b, 0x06, 0x14, 0xfc, 0x18, 0x44, 0x8a, 0x16, 0x58, 0x89, 0x1f, 0x7a, 0x24, 0x44, 0x93, 0x90, 0xc2, 0x66, 0xd7, 0x9b, 0x9b, 0x44, 0x9d, 0x59, 0x23, 0x9a, 0x43, 0x69, 0x68 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); #ifdef GD_NO_C99_API v[0][0] = 1.5; v[0][1] = 2.25; for (i = 1; i < 20; ++i) { v[i][0] = v[i - 1][0] * 2.25; v[i][1] = v[i - 1][1] * 2.25; } #else v[0] = 1.5 + _Complex_I * 2.25; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 2.25; #endif fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * 16 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) #ifdef GD_NO_C99_API CHECKCi(i, u + 2 * i, v[i + 5]); #else CHECKCi(i, u[i], v[i + 5]); #endif return r; } libgetdata-0.9.0/test/get_mplex_s.c0000640000175000017500000000370012614323564017435 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 1 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mplex", 0, 0, 0, 256, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 128); return r; } libgetdata-0.9.0/test/open_cb_invalid.c0000640000175000017500000000345112614323564020245 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include static int saw_callback = 0; int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_) { saw_callback++; return -1; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n" "BADDIRECTIVE BADTYPE\n" "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(saw_callback, 1); CHECKI(error, GD_E_CALLBACK); return r; } libgetdata-0.9.0/test/put_uint16.c0000640000175000017500000000423312614323564017147 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint16_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint16_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint16_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_nonexistent.c0000640000175000017500000000323712614323564020351 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n"; unsigned char c[8]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_UNKNOWN_ENCODING); return r; } libgetdata-0.9.0/test/entry_linterp.c0000640000175000017500000000346112614323564020031 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read LINTERP entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data LINTERP in1 ../tablefile\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_LINTERP_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.EN(linterp,table), "../tablefile"); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/nmeta_invalid.c0000640000175000017500000000257012614323564017745 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nmfields(D, "raw1"); error = gd_error(D); gd_discard(D); CHECKU(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/add_lincom_affix.c0000640000175000017500000000461712614323564020405 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINCOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; int e1, e2, e3, r = 0; DIRFILE *D; const char *in_fields[2] = {"in1", "in2"}; const char *Ain_fieldsZ[2] = {"Ain1Z", "Ain2Z"}; const double m[2] = {1, 0.3}; const double b[2] = {5, 0.9}; gd_entry_t e; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_include_affix(D, "format1", 0, "A", "Z", GD_CREAT); gd_add_lincom(D, "new", 2, Ain_fieldsZ, m, b, 1); e1 = gd_error(D); gd_add_lincom(D, "AnewZ", 2, in_fields, m, b, 1); e2 = gd_error(D); gd_add_lincom(D, "AnewZ", 2, Ain_fieldsZ, m, b, 1); e3 = gd_error(D); /* check */ gd_entry(D, "AnewZ", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 1); CHECKI(e.EN(lincom,n_fields), 2); CHECKS(e.in_fields[0], "Ain1Z"); CHECKS(e.in_fields[1], "Ain2Z"); CHECKF(e.EN(lincom,m)[0], m[0]); CHECKF(e.EN(lincom,m)[1], m[1]); CHECKF(e.EN(lincom,b)[0], b[0]); CHECKF(e.EN(lincom,b)[1], b[1]); CHECKX(e.flags, GD_EN_CALC); gd_free_entry_strings(&e); } gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_BAD_CODE); CHECKI(e2, GD_E_BAD_CODE); CHECKI(e3, GD_E_OK); return r; } libgetdata-0.9.0/test/parse_include_preprefix.c0000640000175000017500000000372612614323564022040 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "INCLUDE format1 pre\n"; const char *format1_data = "INCLUDE format2 PRE\n"; const char *format2_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf, spf1, spf2; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDONLY); spf = gd_spf(D, "data"); spf1 = gd_spf(D, "predata"); spf2 = gd_spf(D, "prePREdata"); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 0); CHECKU(spf1, 0); CHECKU(spf2, 11); return r; } libgetdata-0.9.0/test/slim_seek_far.c0000640000175000017500000000375712614323564017746 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_SLIM || !defined USE_SLIM return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *slimdata = "dirfile/data.slm"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) { perror("command"); r = 1; } D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(n,256); error = gd_error(D); CHECKI(error,0); gd_discard(D); unlink(slimdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/seek_neg.c0000640000175000017500000000353212614323564016712 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, r = 0; off_t m; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); m = gd_seek(D, "data", -3, 0, GD_SEEK_CUR); e1 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_RANGE); CHECKI(m, -1); return r; } libgetdata-0.9.0/test/flac_seek.c0000640000175000017500000000436212614323564017050 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* encode */ snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; #ifdef USE_FLAC D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_LITTLE_ENDIAN); #else D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN); #endif n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); error = gd_error(D); #ifdef USE_FLAC CHECKI(error, 0); CHECKI(n, 40); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, -1); #endif gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/convert_uint64_complex64.c0000640000175000017500000000431012614323564021717 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/alter_const_r2c.c0000640000175000017500000000334612614323564020220 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT64 8.3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; double d; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_const(D, "const", GD_COMPLEX128); error = gd_error(D); n = gd_get_constant(D, "const", GD_FLOAT64, &d); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKF(d, 8.3); return r; } libgetdata-0.9.0/test/alter_spec_polynom.c0000640000175000017500000000360312614323564021027 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM a 3 5 7 9\n"; int fd, i, ret, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "polynom POLYNOM b 1 2 3\n", 0); error = gd_error(D); gd_entry(D, "polynom", &E); CHECKI(E.field_type, GD_POLYNOM_ENTRY); CHECKS(E.in_fields[0], "b"); CHECKI(E.EN(polynom,poly_ord), 2); for (i = 0; i < 3; ++i) CHECKFi(i, E.EN(polynom,a)[i], i + 1); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(ret, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/alter_crecip_zero.c0000640000175000017500000000414612614323564020627 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div RECIP data 230.\n"; int32_t data_data[256]; double c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_crecip(D, "div", "phase", 0); error = gd_error(D); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 230. / (i + 41.)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/put_int32.c0000640000175000017500000000416712614323564016766 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 40 + i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT32, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int32_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int32_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/lzma_xz_put_back.c0000640000175000017500000000511412614323564020464 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if ! (defined TEST_LZMA) || ! (defined USE_LZMA) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_xz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/elist_scalar.c0000640000175000017500000000354012614323564017576 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CONST UINT8 1\n" "data2 RAW UINT8 1\n" "data3 STRING UINT8\n"; int fd, i, error, r = 0; const char **entry_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); entry_list = gd_entry_list(D, NULL, GD_SCALAR_ENTRIES, 0); error = gd_error(D); CHECKI(error, 0); CHECKPN(entry_list); for (i = 0; ; ++i) { if (entry_list[i] == NULL) break; if (strcmp(entry_list[i], "data1") == 0) continue; else if (strcmp(entry_list[i], "data3") == 0) continue; fprintf(stderr, "entry_list[%i] = \"%s\"\n", i, entry_list[i]); r = 1; } CHECKI(i, 2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/fragment_affix_dup.c0000640000175000017500000000360312614323564020761 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "CdataD CONST UINT8 1\nINCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 11\n"; char *prefix; char *suffix; int fd, ret, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_alter_affixes(D, 1, "C", "D"); e1 = gd_error(D); gd_fragment_affixes(D, 1, &prefix, &suffix); e2 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKS(prefix,"A"); CHECKS(suffix,"Z"); CHECKI(ret,-1); CHECKI(e1,GD_E_DUPLICATE); CHECKI(e2,0); free(prefix); free(suffix); return r; } libgetdata-0.9.0/test/lzma_xz_add.c0000640000175000017500000000365612614323564017435 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.xz"; gd_entry_t e; int e1, e2, e3, unlink_data, r = 0; DIRFILE *D; rmdirfile(); #ifdef USE_LZMA D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_LZMA_ENCODED); #else D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_LZMA_ENCODED); #endif gd_add_raw(D, "data", GD_UINT8, 2, 0); e1 = gd_error(D); /* check */ e2 = gd_entry(D, "data", &e); #ifdef USE_LZMA CHECKI(e2, 0); if (e2 == 0) { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } #else CHECKI(e2, -1); #endif e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); #ifdef USE_LZMA CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); #endif unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/add_bit_invalid.c0000640000175000017500000000251712614323564020230 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_bit(D, "new", "input", 1, 1, 0); error = gd_error(D); gd_discard(D); CHECKI(error,GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/index_subset.c0000640000175000017500000000437012614323564017627 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include #define F(x) sqrt(((x) + 600.) / 500.) /* inverse of F(x) via linear interpolation between x and x+1 */ #define G(x,y) (x + ((y - F(x)) / (F(x+1) - F(x)))) int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double d[1000], f1, f2, f3; int i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 1000; ++i) d[i] = F(i); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, d, 1000 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); f1 = gd_framenum_subset(D, "data", 1.09, 100, 800); f2 = gd_framenum_subset(D, "data", 1.49, 100, 800); f3 = gd_framenum_subset(D, "data", 1.79, 100, 800); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKF(f1, G( 100, 1.09)); /* = -10.3339841573191 */ CHECKF(f2, G( 510, 1.49)); /* = 510.050010695549 */ CHECKF(f3, G( 798, 1.79)); /* = 995.067417578234 */ return r; } libgetdata-0.9.0/test/flush_spec.c0000640000175000017500000000443612614323564017271 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *apath = "dirfile/a"; const char *jpath = "dirfile/j"; const char *spec[] = { "a RAW UINT8 1\n", "c CONST UINT64 1\n", "d CONST UINT64 2\n", "e LINCOM 2 a c 1 h 3 d\n", "f LINTERP a /lut/table\n", "g MULTIPLY e f\n", "h BIT a 2 d\n", "i PHASE h c\n", "j RAW UINT16 d\n", "k PHASE h 3\n", "l SBIT a d 2\n", "m POLYNOM a 1 c 2 d\n", "n STRING a\\ b\\ c\\ \\x01\\ ÿ\n", "o DIVIDE j k\n", "p RECIP e d\n", "q WINDOW i m EQ c\n", "r CARRAY FLOAT64 1.2 3.4 5.6 7.8\n", NULL }; int error, i = 0, r = 0; FILE *stream; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC | GD_VERBOSE); for (i = 0; spec[i] != NULL; ++i) gd_add_spec(D, spec[i], 0); error = gd_error(D); gd_discard(D); stream = fopen(format, "rt"); i = 0; while (!feof(stream)) { char line[GD_MAX_LINE_LENGTH]; if (fgets(line, GD_MAX_LINE_LENGTH, stream) == NULL) break; if (line[0] == '/' || line[0] == '#' || line[0] < ' ') continue; if (strcmp(line, spec[i]) != 0) { fprintf(stderr, "%s <=> %s", spec[i], line); error = 1; } ++i; } fclose(stream); unlink(apath); unlink(jpath); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/convert_float32_complex128.c0000640000175000017500000000432012614323564022122 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/convert_float64_uint64.c0000640000175000017500000000376712614323564021374 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; uint64_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_lincom_non.c0000640000175000017500000000305512614323564020457 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM in1 1 0 in2 1 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/put_sf.c0000640000175000017500000000420712614323564016432 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 0, 40, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/bzip_put_endian.c0000640000175000017500000000536212614323564020307 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n" #ifdef WORDS_BIGENDIAN "ENDIAN little\n"; #else "ENDIAN big\n"; #endif uint16_t c[8]; #ifdef USE_BZIP2 char command[4096]; uint16_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint16_t)(0x102 * i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_bz2, &buf); #ifdef USE_BZIP2 if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(stat_data, -1); #endif #ifdef USE_BZIP2 /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint16_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, 0x201 * (i - 40)); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(n, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/convert_uint64_int16.c0000640000175000017500000000376612614323564021055 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/alter_entry_scalar3.c0000640000175000017500000000357712614323564021103 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in c1 3\nc1 CONST INT64 3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); free(E.scalar[0]); E.scalar[0] = NULL; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); gd_free_entry_strings(&E); n = gd_entry(D, "data", &E); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,0); CHECKI(ret,0); CHECKI(E.EN(bit,bitnum), 3); CHECKP(E.scalar[0]); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_uint64_int32.c0000640000175000017500000000376612614323564021053 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_meta_implicit_affix.c0000640000175000017500000000324212614323564022317 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "parent RAW UINT8 1\n" "parent/child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/foffs_alter.c0000640000175000017500000000376312614323564017432 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test frameoffset */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n"; unsigned char data_data[256]; int fd, ret, error, r = 0; off_t fo, nf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_frameoffset(D, 16, 0, 0); error = gd_error(D); fo = gd_frameoffset(D, 0); nf = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(fo, 16); CHECKI(nf, 48); return r; } libgetdata-0.9.0/test/flac_put_complex128.c0000640000175000017500000000402712614323564020711 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define GD_C89_API #include "test.h" int main(void) { #if !defined USE_FLAC || !defined TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.flac"; double c[16]; double d[26]; off_t nf; int r = 0, i, e1, e2, e3; size_t n1, n2; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 16; ++i) c[i] = 1.234 * i; D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN | GD_VERBOSE | GD_CREAT | GD_EXCL); gd_add_spec(D, "data RAW COMPLEX128 1", 0); n1 = gd_putdata(D, "data", 5, 0, 8, 0, GD_COMPLEX128, c); CHECKI(n1, 8); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nf = gd_nframes(D); CHECKU(nf, 13); n2 = gd_getdata(D, "data", 0, 0, 0, 13, GD_COMPLEX128, d); CHECKI(n2, 13); e3 = gd_error(D); CHECKI(e3, GD_E_OK); for (i = 0; i < 26; ++i) { if (i < 10) CHECKFi(i, d[i], 0); else CHECKFi(i, d[i], 1.234 * (i - 10)); } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/lzma_xz_get_far.c0000640000175000017500000000416012614323564020303 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; #ifdef USE_LZMA D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(error, 0); #else CHECKI(error, GD_E_UNSUPPORTED); #endif CHECKI(n, 0); return r; #endif } libgetdata-0.9.0/test/version_6_strict.c0000640000175000017500000000531212614323564020432 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Check Standards Version 6 strictness */ #include "test.h" #include #include #include #include #include #include #include int cb(gd_parser_data_t *pdata, void *ll) { ((int*)ll)[pdata->linenum - 1] = 1; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 6\n" "X 4) { CHECKIi(i,ll[i],0); } } CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i],40 + i); CHECKI(m,0); return r; } libgetdata-0.9.0/test/add_format.c0000640000175000017500000000265612614323564017240 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; gd_entry_t E; E.field = "new"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 21; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add(D, &E); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,1); CHECKI(error, GD_E_BAD_INDEX); return r; } libgetdata-0.9.0/test/sie_put_many.c0000640000175000017500000000344712614323564017633 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; uint8_t c[60], d[60]; DIRFILE *D; int i, n1, n2, n3, e1, e2, e3, r = 0; rmdirfile(); for (i = 0; i < 60; ++i) c[i] = i; D = gd_open(filedir, GD_RDWR | GD_SIE_ENCODED | GD_CREAT | GD_LITTLE_ENDIAN | GD_VERBOSE); n1 = gd_add_raw(D, "data", GD_UINT8, 20, 0); e1 = gd_error(D); CHECKI(n1, 0); CHECKI(e1, 0); n2 = gd_putdata(D, "data", 0, 10, 0, 60, GD_UINT8, c); e2 = gd_error(D); CHECKI(n2, 60); CHECKI(e2, 0); gd_close(D); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n3 = gd_getdata(D, "data", 0, 10, 0, 60, GD_UINT8, d); e3 = gd_error(D); CHECKI(n3, 60); CHECKI(e3, 0); for (i = 0; i < 60; ++i) CHECKIi(i, c[i], d[i]); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_meta_alias.c0000640000175000017500000000400512614323564020035 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int e1, e2, e3, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_CONST_ENTRY; E.fragment_index = 0; E.EN(scalar,const_type) = GD_UINT8; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); e1 = gd_error(D); gd_add_alias(D, "alias", "data", 0); e2 = gd_error(D); E.field = "alias/data"; gd_add(D, &E); e3 = gd_error(D); /* check */ gd_entry(D, "data/data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(e3, GD_E_OK); return r; } libgetdata-0.9.0/test/error_error.c0000640000175000017500000000235112614323564017472 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #define DIRFILENAME "a non-existant dirfile" int main(void) { char *string; int error, r = 0; DIRFILE *D = gd_open(DIRFILENAME, 0); string = gd_error_string(D, NULL, 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_IO); CHECKSS(string, DIRFILENAME); free(string); return r; } libgetdata-0.9.0/test/ref.c0000640000175000017500000000413212614323564015703 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "REFERENCE data2\n" ; const char *data1 = "dirfile/data1"; const char *data2 = "dirfile/data2"; uint8_t data_data[4] = { 0, 1, 2, 3 }; int fd, error, error2, r = 0; DIRFILE *D; off_t nf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 4); close(fd); fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error,0); nf = gd_nframes(D); error2 = gd_error(D); CHECKI(error2,0); CHECKI(nf,3); gd_discard(D); unlink(format); unlink(data1); unlink(data2); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int16_float64.c0000640000175000017500000000401712614323564021171 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/include_affix.c0000640000175000017500000000332712614323564017734 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "#\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include_affix(D, "format1", 0, "A", "Z", 0); error = gd_error(D); spf = gd_spf(D, "AdataZ"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(spf, 11); return r; } libgetdata-0.9.0/test/get_affix.c0000640000175000017500000000422412614323564017065 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "INCLUDE format1 A Z\n"; const char *format1_data = "phase PHASE data -2\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "AphaseZ", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKI(c, 3); return r; } libgetdata-0.9.0/test/parse_window_ncols.c0000640000175000017500000000303712614323564021031 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data WINDOW in1 XOR 0x10\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/sie_put_pad0.c0000640000175000017500000000474512614323564017515 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; #define NREC 4 const uint8_t data_out[] = { 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34 }; uint8_t check[(1 + NREC) * 9]; DIRFILE *D; int fd, i, n, error, r = 0; ssize_t l; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 2 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 16); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); l = read(fd, check, (1 + NREC) * 9); close(fd); CHECKI(l, NREC * 9); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < NREC * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/parse_multiply.c0000640000175000017500000000304512614323564020202 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MULTIPLY in1 in2\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/madd_linterp_invalid.c0000640000175000017500000000253012614323564021277 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_madd_linterp(D, "new", "meta", "in", "table"); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_raw_char.c0000640000175000017500000000303412614323564020107 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW c 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/bzip_get_get2.c0000640000175000017500000000443412614323564017660 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_BZIP2 || !defined TEST_BZIP2 return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *bz2data = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, error1, n2, error2, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1); error1 = gd_error(D); n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2); error2 = gd_error(D); gd_discard(D); unlink(bz2data); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(error2, 0); CHECKI(n1, 8); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKUi(i,c1[i], i); CHECKUi(i,c2[i], i); } return r; #endif } libgetdata-0.9.0/test/zzip_data.c0000640000175000017500000000445412614323564017123 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_ZZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *testzip = "dirfile/test.zip"; const char *format_data = "data RAW UINT16 8\n" "/ENCODING zzip test\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; #ifdef USE_ZZIP int i; #endif DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ chdir(filedir); snprintf(command, 4096, "%s test data > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(data); #ifdef USE_ZZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(testzip); unlink(format); rmdir(filedir); #ifdef USE_ZZIP CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/version_6_write.c0000640000175000017500000000342512614323564020257 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 6\n" "b\\ c CONST UINT8 8\n" "\"a \\#r\" RAW UINT8 b\\ c\n" "/META \"a \\#r\" \\x64\\c\\157 PHASE \"a \\#r\" 0\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; unsigned int s; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 6); q = gd_rewrite_fragment(D, 0); CHECKI(e,6); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_CURRENT); s = gd_spf(D, "a #r/dco"); CHECKI(c,6); CHECKU(s,8); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/spf_recurse.c0000640000175000017500000000331012614323564017444 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempting to resove a recursively defined field should fail cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in1 RAW UINT8 11\n" "lincom LINCOM 2 lincom 1 0 in1 1 0\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); spf = gd_spf(D, "lincom"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(spf,0); CHECKI(error,GD_E_RECURSE_LEVEL); return r; } libgetdata-0.9.0/test/legacy_nonexistent.c0000640000175000017500000000234512614323564021035 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else int error, r = 0; size_t n = GetNFrames("no such dirfile", &error, NULL); CHECKI(n,0); CHECKI(error, GD_E_IO); return r; #endif } libgetdata-0.9.0/test/parse_include_absolute.c0000640000175000017500000000405712614323564021650 0ustar alastairalastair/* Copyright (C) 2011-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #if defined GD_NO_GETCWD return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data1 = "INCLUDE "; const char *format_data2 = "/dirfile/format1\n"; const char *format1_data = "data RAW UINT8 11\n"; int cwd_size = 2048; char *ptr, *cwd = NULL; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); gdtest_getcwd(ptr, cwd, cwd_size); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); gd_pathwrite(fd, cwd); write(fd, format_data2, strlen(format_data2)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 11); free(cwd); return r; #endif } libgetdata-0.9.0/test/parse_raw_scalar.c0000640000175000017500000000307012614323564020437 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST INT8 1\ndata RAW UINT8 const\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/entry_invalid.c0000640000175000017500000000247612614323564020007 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read entry from an invalid DIRFILE */ #include "test.h" #include #include #include #include #include #include int main(void) { DIRFILE *D = gd_open("not a dirfile", GD_RDONLY); gd_entry_t E; int error, r = 0; int n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); CHECKI(n, -1); return r; } libgetdata-0.9.0/test/get_sbit.c0000640000175000017500000000405412614323564016732 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read SBIT */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "bit SBIT data 7 4\ndata RAW UINT16 1\n"; int16_t c[10]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = 0x0101 * (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "bit", 5, 0, 10, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (fd = 0; fd < 10; ++fd) CHECKIi(fd, c[fd], fd * 2 - ((fd > 6) ? 22 : 6)); return r; } libgetdata-0.9.0/test/convert_int64_float64.c0000640000175000017500000000400712614323564021173 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/alter_entry_scalar4.c0000640000175000017500000000363612614323564021100 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in 3 c1\nc1 CONST INT64 3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); free(E.scalar[1]); E.scalar[1] = NULL; E.EN(bit,numbits) = 11; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); gd_free_entry_strings(&E); n = gd_entry(D, "data", &E); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKI(E.EN(bit,numbits), 11); CHECKP(E.scalar[1]); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/gzip_put_endian.c0000640000175000017500000000560712614323564020316 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n" #ifdef WORDS_BIGENDIAN "ENDIAN little\n"; #else "ENDIAN big\n"; #endif uint16_t c[8]; #ifdef USE_GZIP char command[4096]; uint16_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint16_t)(0x102 * i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_gz, &buf); #ifdef USE_GZIP if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(stat_data, -1); #endif #ifdef USE_GZIP /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint16_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, 0x201 * (i - 40)); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(n, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/alter_crecip89_null.c0000640000175000017500000000420312614323564020775 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define GD_C89_API #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div RECIP data 230.\n"; int32_t data_data[256]; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_crecip(D, "div", "phase", NULL); error = gd_error(D); n = gd_entry(D, "div", &E); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,0); CHECKI(ret,0); CHECKX(E.flags, GD_EN_CALC); CHECKF(E.EN(recip,dividend), 230.); CHECKS(E.in_fields[0], "phase"); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/entry_type.c0000640000175000017500000000317112614323564017333 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read entry type */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, error, r = 0; gd_entype_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry_type(D, "data"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, GD_RAW_ENTRY); return r; } libgetdata-0.9.0/test/cvlist_meta_invalid.c0000640000175000017500000000260512614323564021152 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const void *fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_mconstants(D, "parent", GD_UINT8); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/native_const.c0000640000175000017500000000273712614323564017634 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "const"); error = gd_error(D); CHECKU(type, GD_UINT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_crecip89.c0000640000175000017500000000352712614323564017374 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define GD_C89_API #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; double dividend[2] = {33.3, 44.4}; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_crecip(D, "new", "in", dividend, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RECIP_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKF(e.EN(recip,cdividend)[0], dividend[0]); CHECKF(e.EN(recip,cdividend)[1], dividend[1]); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/sie_put_back.c0000640000175000017500000000526712614323564017571 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; const uint8_t data_out[] = { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; uint8_t check[6 * 9]; DIRFILE *D; int fd, i, n1, n2, e1, e2, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n1 = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n1, 16); CHECKI(e1, 0); n2 = gd_putdata(D, "data", 0, 0, 2, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(n2, 16); CHECKI(e2, 0); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); read(fd, check, 6 * 9); close(fd); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < 6 * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/index_index.c0000640000175000017500000000446712614323564017440 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Frameindex look-up */ #include "test.h" #include #include #include #include #include #include #include #include #define F(x) sqrt(((x) + 600.) / 500.) /* inverse of F(x) via linear interpolation between x and x+1 */ #define G(x,y) (x + ((y - F(x)) / (F(x+1) - F(x)))) int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double d[1000], f1, f2, f3, f4; int i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 1000; ++i) d[i] = F(i); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, d, 1000 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); f1 = gd_framenum(D, "data", 1.09); f2 = gd_framenum(D, "data", 1.49); f3 = gd_framenum(D, "data", 1.79); f4 = gd_framenum(D, "data", F(128)); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKF(f1, G( 0, 1.09)); /* = -5.96730894763915 */ CHECKF(f2, G( 510, 1.49)); /* = 510.050010695549 */ CHECKF(f3, G( 998, 1.79)); /* = 1002.04807025292 */ CHECKF(f4, 128.); /* exact */ return r; } libgetdata-0.9.0/test/convert_float32_float64.c0000640000175000017500000000401612614323564021501 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/get_here.c0000640000175000017500000000404312614323564016712 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, m, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", 5, 0, GD_SEEK_SET); n = gd_getdata(D, "data", GD_HERE, 0, 0, 8, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(m, 40); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/madd_sbit.c0000640000175000017500000000345612614323564017065 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a BIT field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_sbit(D, "new", "meta", "input", 1, 1); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_SBIT_ENTRY); CHECKS(e.in_fields[0], "input"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(bit,bitnum), 1); CHECKI(e.EN(bit,numbits), 1); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/madd.c0000640000175000017500000000357212614323564016043 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, ge_error, n, r = 0; gd_entry_t e; DIRFILE *D; gd_entry_t E; memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); E.field_type = GD_CONST_ENTRY; E.EN(scalar,const_type) = GD_UINT8; gd_madd(D, &E, "data"); error = gd_error(D); /* check */ n = gd_nfields(D); gd_entry(D, "data/data", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 2); return r; } libgetdata-0.9.0/test/add_resolv.c0000640000175000017500000000307312614323564017254 0ustar alastairalastair/* Copyright (C) 2011, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, i, r = 0; unsigned int n; DIRFILE *D; const char *target; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_alias(D, "alias", "data", 0); gd_add_raw(D, "data", GD_UINT8, 1, 0); error = gd_error(D); /* check */ target = gd_alias_target(D, "alias"); CHECKS(target, "data"); i = gd_fragment_index(D, "alias"); n = gd_naliases(D, "alias"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(i, 0); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/include_accmode.c0000640000175000017500000000274212614323564020232 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); close(fd); D = gd_open(filedir, GD_RDONLY); gd_include(D, "format1", 0, GD_CREAT); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_ACCMODE); return r; } libgetdata-0.9.0/test/parse_ref_nonexistent.c0000640000175000017500000000303412614323564021533 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "REFERENCE data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_BAD_REFERENCE); return r; } libgetdata-0.9.0/test/put_const_protect.c0000640000175000017500000000330012614323564020701 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 8\nPROTECT all\n"; uint8_t d = 3; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_put_constant(D, "data", GD_UINT8, &d); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_PROTECTED); CHECKI(n, -1); return r; } libgetdata-0.9.0/test/get_divide_crinr.c0000640000175000017500000000403112614323564020425 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data phase\n" "phase PHASE data.r 1\n" "data RAW COMPLEX128 1\n"; double c[8]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i, c[i], (5. + i) / (6. + i)); return r; } libgetdata-0.9.0/test/del_meta_force.c0000640000175000017500000000354112614323564020062 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n" "META data e STRING 1\n" "META data q STRING 2\n" "META data a STRING 3\n" "META data b STRING 4\n" "META data z STRING 5\n" "META data l STRING 6\n" "s STRING e\n"; int fd, ret, error, nf, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", GD_DEL_META); error = gd_error(D); nf = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(nf, 2); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/creat_excl.c0000640000175000017500000000273012614323564017242 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Exclusively creating an existing dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_EXISTS); return r; } libgetdata-0.9.0/test/tok_quote.c0000640000175000017500000000352112614323564017142 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *spec = "string STRING \"value\""; int e1, e2, e3, e4, e5, r = 0; char *tok1, *tok2, *tok3, *tok4; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1,GD_E_OK); tok1 = gd_strtok(D, spec); e2 = gd_error(D); CHECKI(e2,GD_E_OK); CHECKS(tok1,"string"); free(tok1); tok2 = gd_strtok(D, NULL); e3 = gd_error(D); CHECKI(e3,GD_E_OK); CHECKS(tok2,"STRING"); free(tok2); tok3 = gd_strtok(D, NULL); e4 = gd_error(D); CHECKI(e4,GD_E_OK); CHECKS(tok3,"value"); free(tok3); tok4 = gd_strtok(D, NULL); e5 = gd_error(D); CHECKI(e5,GD_E_OK); CHECKP(tok4); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/name_alias.c0000640000175000017500000000724512614323564017230 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *zata = "dirfile/zata"; const char *format_data = "early PHASE cata 0\n" "earlya PHASE data 0\n" "/ALIAS aata cata\n" "/ALIAS bata data\n" "late PHASE cata 0\n" "latea PHASE data 0\n" "cata RAW UINT8 8\n" "/ALIAS data cata\n" "eata RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e0, e1, e2, e3, e4, e5, e6, e7, unlink_data, unlink_zata, r = 0; const char **fl; #define NFIELDS 10 const char *field_list[NFIELDS] = { "INDEX", "aata", "bata", "cata", "early", "earlya", "eata", "late", "latea", "zata" }; char *s1, *s2, *s3, *s4; const char *s5, *s6; unsigned nf, i; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); gd_validate(D, "early"); gd_validate(D, "earlya"); ret = gd_rename(D, "data", "zata", 0); e0 = gd_error(D); CHECKI(ret, 0); CHECKI(e0, 0); gd_spf(D, "early"); e1 = gd_error(D); CHECKI(e1, 0); gd_spf(D, "late"); e2 = gd_error(D); CHECKI(e2, 0); gd_spf(D, "earlya"); e3 = gd_error(D); CHECKI(e3, GD_E_BAD_CODE); gd_spf(D, "latea"); e4 = gd_error(D); CHECKI(e4, GD_E_BAD_CODE); nf = gd_nfields(D); CHECKU(nf, NFIELDS); if (nf > NFIELDS) nf = NFIELDS; fl = gd_field_list(D); for (i = 0; i < nf; ++i) CHECKSi(i, fl[i], field_list[i]); gd_entry(D, "early", &E); s1 = E.in_fields[0]; CHECKS(s1, "cata"); gd_free_entry_strings(&E); gd_entry(D, "earlya", &E); s2 = E.in_fields[0]; CHECKS(s2, "data"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s3 = E.in_fields[0]; CHECKS(s3, "cata"); gd_free_entry_strings(&E); gd_entry(D, "latea", &E); s4 = E.in_fields[0]; CHECKS(s4, "data"); gd_free_entry_strings(&E); gd_entry(D, "aata", &E); e5 = gd_error(D); s5 = gd_alias_target(D, "aata"); CHECKI(e5, 0); CHECKS(s5, "cata"); gd_free_entry_strings(&E); gd_entry(D, "bata", &E); e6 = gd_error(D); s6 = gd_alias_target(D, "bata"); CHECKS(s6, "zata"); CHECKI(e6, 0); gd_free_entry_strings(&E); e7 = gd_close(D); CHECKI(e7, 0); unlink_data = unlink(data); unlink_zata = unlink(zata); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); CHECKI(unlink_zata, -1); return r; } libgetdata-0.9.0/test/cvlist_array_meta_hidden.c0000640000175000017500000000375512614323564022164 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CARRAY UINT8 1\n" "parent/data1 CARRAY UINT8 1 2 3 4 5\n" "parent/data2 CARRAY UINT8 2 4 6 8 10 12\n" "/HIDDEN parent/data2\n" "parent/data3 CARRAY UINT8 3 6 9 12 15 18 21\n" "META parent data4 LINTERP UINT8 1\n"; int fd, r = 0; size_t i, error; struct uint8_carrays { size_t n; uint8_t *d; } *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 2; ++fd) { CHECKUi(fd,field_list[fd].n, (size_t)(5 + 2 * fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 1000 + i,field_list[fd].d[i], (2 * fd + 1) * (i + 1)); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flac_get_get2.c0000640000175000017500000000461112614323564017616 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_FLAC || !defined TEST_FLAC return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, error1, n2, error2, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1); error1 = gd_error(D); n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2); error2 = gd_error(D); gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(error2, 0); CHECKI(n1, 8); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKUi(i,c1[i], i); CHECKUi(i,c2[i], i); } return r; #endif } libgetdata-0.9.0/test/cvlist_array_free.c0000640000175000017500000000455312614323564020641 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CARRAY UINT8 1 2 3 4 5\n" "data2 CARRAY UINT8 2 4 6 8 10 12\n" "data4 RAW UINT8 1\n"; int fd, e1, e2, r = 0; size_t i; struct uint8_carrays { size_t n; uint8_t *d; } *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8); e1 = gd_error(D); CHECKI(e1, 0); if (!r) for (fd = 0; fd < 2; ++fd) { CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1)); } gd_add_spec(D, "data3 CARRAY UINT8 3 6 9 12 15 18 21", 0); field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8); e2 = gd_error(D); CHECKI(e2, 0); if (!r) for (fd = 0; fd < 3; ++fd) { CHECKUi(fd * 2000,field_list[fd].n, (size_t)(5 + fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 3000 + i,field_list[fd].d[i], (fd + 1) * (i + 1)); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_float32_uint8.c0000640000175000017500000000377012614323564021277 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; uint8_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/add_lincom_nfields.c0000640000175000017500000000307612614323564020732 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINCOM field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; const char *in_fields[2] = {"in1", "in2"}; const double m[2] = {1, 0.3}; const double b[2] = {0, 0.9}; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_lincom(D, "new", 0, in_fields, m, b, 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/close_close.c0000640000175000017500000000263512614323564017427 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Closing a dirfile should succeed cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_close(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/flush_sync.c0000640000175000017500000000412012614323564017301 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); gd_sync(D, "data"); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); return 1; } CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flush_hex.c0000640000175000017500000000300212614323564017107 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, r = 0; const char *in = "\xF\x1E\x2D\x3C\x4B\x5A\x69\x78\x87\x96\xA5\xB4\xC3\xD2\xE1\xF0"; char s[1000]; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC | GD_VERBOSE); gd_add_string(D, "STRING", in, 0); e1 = gd_error(D); CHECKI(e1, 0); gd_close(D); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_get_string(D, "STRING", 1000, s); e2 = gd_error(D); CHECKI(e2, 0); CHECKS(s, in); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flist_type_meta.c0000640000175000017500000000443512614323564020325 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent STRING UINT8 1\n" "META parent data1 STRING UINT8 1\n" "META parent data2 STRING UINT8 1\n" "META parent data3 STRING UINT8 1\n" "META parent data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { CHECKIi(i,strlen(field_list[i]), 5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i, 3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_3.c0000640000175000017500000000503112614323564017035 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 3 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/RAW"; const char *data = "dirfile/ENDIAN"; const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n"; const char *format_data1 = "m MULTIPLY ENDIAN ENDIAN\na&b RAW c 8\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "m", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],(40 + i) * (40 + i)); /* Version 3 is forwards compatible with version 4 */ CHECKI(v,4); CHECKI(l,4); CHECKI(e,3); return r; } libgetdata-0.9.0/test/convert_float64_int16.c0000640000175000017500000000376412614323564021201 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_int64.c0000640000175000017500000000412512614323564016734 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t c[8]; int64_t data_data[64]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = fd * (0x0200000000000001) * (2 * (fd % 2) - 1); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (0x5000000000000028 + i * 0x0200000000000001) * (2 * (i % 2) - 1)); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_raw_spf.c0000640000175000017500000000427012614323564017762 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; uint8_t d; int fd, i, ret, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_raw(D, "data", GD_NULL, 11, 1); error = gd_error(D); n = gd_nframes(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint8_t))) { CHECKX(d, i * 8 / 11); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 32); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/get_window_lt.c0000640000175000017500000000401412614323564017773 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data LT 44\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i < 4) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/parse_literal_cmpbad.c0000640000175000017500000000303012614323564021257 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST COMPLEX128 1;a\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error, GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_duplicate_ignore.c0000640000175000017500000000310312614323564021633 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\ndata RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_IGNORE_DUPS | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/parse_version_permissive.c0000640000175000017500000000313012614323564022251 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "VERSION 999999\nBADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_PERMISSIVE | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/desync_flush.c0000640000175000017500000000302612614323564017616 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, n1, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e1 = gd_error(D); /* ensure mtime ticks over */ sleep(1); gd_rewrite_fragment(D, 0); n1 = gd_desync(D, 0); e2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n1, 0); return r; } libgetdata-0.9.0/test/lzma_xz_put_get.c0000640000175000017500000000421012614323564020337 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.xz"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d[8]; int fd, i, m, n, e1, e2, e3, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_LZMA D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); for (i = 0; i < m; ++i) CHECKIi(i, d[i], c[i]); e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(n, 8); CHECKI(m, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(e2, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(m, 0); #endif return r; #endif } libgetdata-0.9.0/test/get_complex64.c0000640000175000017500000000455112614323564017614 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 8\n"; #ifdef GD_NO_C99_API float c[16]; float data_data[256]; #else float complex c[8]; float complex data_data[128]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) { #ifdef GD_NO_C99_API data_data[2 * fd] = data_data[2 * fd + 1] = 1.5 * fd; #else data_data[fd] = (float complex)(1.5 * (1 + _Complex_I) * fd); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API const float v[2] = {1.5 * (40 + i), 1.5 * (40 + i)}; CHECKCi(i, c + 2 * i, v); #else CHECKCi(i, c[i], 1.5 * (1 + _Complex_I) * (40 + i)); #endif } return r; } libgetdata-0.9.0/test/alter_const_r2r.c0000640000175000017500000000334312614323564020234 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT32 8.3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; double d; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_const(D, "const", GD_FLOAT64); error = gd_error(D); n = gd_get_constant(D, "const", GD_FLOAT64, &d); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKF(d, 8.3); return r; } libgetdata-0.9.0/test/open_cb_rescan.c0000640000175000017500000000352312614323564020072 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include static int saw_callback = 0; int callback(gd_parser_data_t *pdata, void *extra gd_unused_) { if (saw_callback) return GD_SYNTAX_ABORT; saw_callback = 1; strcpy(pdata->line, "/REFERENCE data\n"); return GD_SYNTAX_RESCAN; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(saw_callback, 1); CHECKI(error, GD_E_BAD_REFERENCE); return r; } libgetdata-0.9.0/test/parse_phase.c0000640000175000017500000000304012614323564017416 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data PHASE in1 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/lzma_xz_get_put.c0000640000175000017500000001155012614323564020344 0ustar alastairalastair/* Copyright (C) 2014, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; const unsigned char xzdata[300] = { 0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04, 0xe6, 0xd6, 0xb4, 0x46, 0x02, 0x00, 0x21, 0x01, 0x16, 0x00, 0x00, 0x00, 0x74, 0x2f, 0xe5, 0xa3, 0xe0, 0x00, 0xff, 0x00, 0xea, 0x5d, 0x00, 0x00, 0x00, 0x52, 0x50, 0x0a, 0x84, 0xf9, 0x9b, 0xb2, 0x80, 0x21, 0xa9, 0x69, 0xd6, 0x27, 0xe0, 0x3e, 0x06, 0x5a, 0x5f, 0x04, 0x8d, 0x53, 0xd4, 0x04, 0xba, 0x39, 0x57, 0x05, 0x09, 0xc1, 0x55, 0x24, 0xde, 0x9d, 0xb8, 0x71, 0x59, 0x31, 0x60, 0xa1, 0x9f, 0xf9, 0x6f, 0x49, 0x73, 0xf2, 0xc8, 0xea, 0x8c, 0xba, 0x1a, 0x8b, 0x29, 0x69, 0x21, 0x80, 0xfe, 0x33, 0x83, 0x66, 0xaf, 0x46, 0x6d, 0xec, 0x9e, 0x89, 0x8a, 0x0b, 0x83, 0xf0, 0x3c, 0x0e, 0x89, 0x8e, 0x3f, 0xed, 0x5f, 0xe7, 0x9e, 0x90, 0xd9, 0x1c, 0xff, 0x32, 0xf4, 0xb2, 0xe0, 0x39, 0x51, 0xb2, 0xd2, 0x14, 0x15, 0xb4, 0xc5, 0x71, 0xba, 0xdb, 0x06, 0xe3, 0x79, 0x9a, 0x9f, 0xbb, 0x38, 0xc1, 0xb0, 0x00, 0xac, 0x93, 0x0b, 0xaa, 0x06, 0x19, 0x03, 0x12, 0x08, 0x15, 0x5b, 0x9b, 0xc8, 0x48, 0xf0, 0x32, 0x2e, 0xfe, 0x2d, 0xa0, 0x87, 0xc8, 0xf0, 0xa4, 0xe0, 0xd2, 0x51, 0xeb, 0x8d, 0x67, 0x56, 0x92, 0xb2, 0x4d, 0x84, 0xc5, 0xf1, 0x86, 0x31, 0xdf, 0x6a, 0x62, 0x5b, 0xc2, 0x79, 0x2d, 0xd9, 0xf7, 0x3c, 0x73, 0xba, 0x74, 0x74, 0x07, 0xd8, 0x3c, 0xa9, 0x56, 0x22, 0x24, 0xa1, 0x66, 0xf8, 0x5a, 0x84, 0x5f, 0x30, 0x67, 0xd2, 0xf6, 0x4b, 0x49, 0x2e, 0x7f, 0x20, 0xeb, 0xdb, 0xf8, 0x10, 0x0e, 0x94, 0x78, 0x77, 0xc7, 0x3f, 0x6b, 0xef, 0xb4, 0xcd, 0x95, 0xe2, 0x6f, 0xf6, 0x44, 0x6e, 0x06, 0xcf, 0x0b, 0x82, 0x1a, 0xcb, 0xdb, 0x7a, 0xf0, 0x57, 0x8d, 0x98, 0xff, 0x90, 0xc0, 0x3e, 0xe6, 0xc1, 0x12, 0x41, 0x75, 0xee, 0x03, 0x28, 0x96, 0xeb, 0x09, 0x37, 0x0e, 0x1e, 0x00, 0x00, 0x00, 0xb0, 0x3a, 0xdb, 0x65, 0x2f, 0x4b, 0x41, 0x72, 0x00, 0x01, 0x86, 0x02, 0x80, 0x02, 0x00, 0x00, 0x2d, 0x12, 0xa1, 0x9f, 0xb1, 0xc4, 0x67, 0xfb, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x59, 0x5a }; uint8_t c[8], d[8]; #ifdef USE_LZMA char command[4096]; #endif int fd, i, m, n, e1, e2, e3, unlink_data, unlink_dataxz, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) d[i] = (uint8_t)(80 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_xz, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, xzdata, 300); close(fd); #ifdef USE_LZMA D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); e3 = gd_close(D); CHECKI(e3, 0); #ifdef USE_LZMA /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { r = 1; } else { uint8_t b; fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &b, sizeof(uint8_t))) { if (i < 40 || i >= 48) { CHECKIi(i, b, i); } else CHECKIi(i, b, i + 40); i++; } CHECKI(i, 256); close(fd); } } for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 40 + i); #endif unlink_data = unlink(data); unlink_dataxz = unlink(data_xz); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(unlink_data, 0); CHECKI(unlink_dataxz, -1); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(n, 8); CHECKI(m, 8); #else CHECKI(unlink_data, -1); CHECKI(unlink_dataxz, 0); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(e2, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(m, 0); #endif return r; #endif } libgetdata-0.9.0/test/gzip_put_sub.c0000640000175000017500000000605412614323564017646 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #if ! (defined TEST_GZIP) || ! (defined USE_GZIP) return 77; #else const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data_gz = "dirfile/sub/data.gz"; const char *data = "dirfile/sub/data"; const char *format_data = "/INCLUDE sub/format1\n"; const char *format1_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_gz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/seek_phase.c0000640000175000017500000000347312614323564017245 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "phase PHASE data 4\n" "/ENCODING none\n" "data RAW UINT8 8\n"; int fd, e0, e1, e2, r = 0; off_t m, n1, n2; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "phase", 6, 0, GD_SEEK_SET | GD_SEEK_WRITE); e0 = gd_error(D); n1 = gd_tell(D, "phase"); e1 = gd_error(D); n2 = gd_tell(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e0, 0); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(m, 48); CHECKI(n1, 48); CHECKI(n2, 44); return r; } libgetdata-0.9.0/test/get_window.c0000640000175000017500000000401512614323564017275 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data EQ 44\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i == 4) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/add_polynom_scalar.c0000640000175000017500000000417012614323564020763 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_POLYNOM_ENTRY; E.fragment_index = 0; E.EN(polynom,poly_ord) = 3; E.in_fields[0] = "INDEX"; E.scalar[0] = "A"; E.scalar[1] = "B"; E.scalar[2] = "C"; E.scalar[3] = "D"; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "A CONST INT64 1", 0); gd_add_spec(D, "B CONST INT64 2", 0); gd_add_spec(D, "C CONST INT64 3", 0); gd_add_spec(D, "D CONST INT64 4", 0); gd_add(D, &E); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_POLYNOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(polynom,poly_ord), 3); CHECKF(e.EN(polynom,a)[0], 1); CHECKF(e.EN(polynom,a)[1], 2); CHECKF(e.EN(polynom,a)[2], 3); CHECKF(e.EN(polynom,a)[3], 4); CHECKS(e.scalar[0], "A"); CHECKS(e.scalar[1], "B"); CHECKS(e.scalar[2], "C"); CHECKS(e.scalar[3], "D"); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/native_recip_cmpin.c0000640000175000017500000000277612614323564021001 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "recip RECIP data 1\n" "data RAW COMPLEX128 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "recip"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_raw_spf.c0000640000175000017500000000302712614323564017764 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/add_linterp.c0000640000175000017500000000331412614323564017415 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINTERP field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_linterp(D, "new", "in", "table", 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINTERP_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKS(e.EN(linterp,table), "table"); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/get_linterp.c0000640000175000017500000000422412614323564017445 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINTERP */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[64]; int fd, i, n, error, r = 0; DIRFILE *D; FILE *t; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); t = fopen(table, "wt"); for (i = 0; i < 2 * GD_LUT_CHUNK; ++i) fprintf(t, "%i %i\n", i * 6, i * 12); fclose(t); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(table); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 10); return r; } libgetdata-0.9.0/test/ascii_put.c0000640000175000017500000000414612614323564017114 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; int d, n, e1, e2; int fd, i, r = 0; struct stat buf; FILE* stream; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_TEXT_ENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1,0); CHECKI(n,8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) return 1; stream = fopen(data, "r"); i = 0; for (;;) { fscanf(stream, "%i", &d); if (feof(stream)) break; if (i < 40 || i > 48) { CHECKI(d, 0); } else CHECKI(d, i); i++; } fclose(stream); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/sie_get_big.c0000640000175000017500000000404212614323564017367 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read big-endian SIE data */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN big\n"; unsigned char c[16]; const uint8_t data_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32 }; DIRFILE *D; int fd, i, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 16); for (i = 0; i < 16; ++i) CHECKXi(i,c[i], (i <= 8) ? 0x22 : 0x32); return r; } libgetdata-0.9.0/test/get_endian_float64_little.c0000640000175000017500000002112712614323564022143 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\nENDIAN little\n"; double u[10]; double v[20]; const unsigned char data_data[128 * 8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x39, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0xd5, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x9f, 0x55, 0x40, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x37, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x53, 0x68, 0x40, 0x00, 0x00, 0x00, 0x40, 0xde, 0x3e, 0x72, 0x40, 0x00, 0x00, 0x00, 0x60, 0x4d, 0x5e, 0x7b, 0x40, 0x00, 0x00, 0x00, 0x08, 0xba, 0x86, 0x84, 0x40, 0x00, 0x00, 0x00, 0x0c, 0x17, 0xca, 0x8e, 0x40, 0x00, 0x00, 0x00, 0x49, 0x91, 0x17, 0x97, 0x40, 0x00, 0x00, 0xc0, 0xf6, 0xac, 0x51, 0xa1, 0x40, 0x00, 0x00, 0x20, 0x72, 0x83, 0xfa, 0xa9, 0x40, 0x00, 0x00, 0x98, 0x95, 0xe2, 0x7b, 0xb3, 0x40, 0x00, 0x00, 0x64, 0xe0, 0xd3, 0x39, 0xbd, 0x40, 0x00, 0x00, 0x4b, 0xe8, 0x5e, 0xeb, 0xc5, 0x40, 0x00, 0x40, 0x38, 0x2e, 0x87, 0x70, 0xd0, 0x40, 0x00, 0x60, 0x54, 0xc5, 0xca, 0xa8, 0xd8, 0x40, 0x00, 0x48, 0xff, 0x13, 0x98, 0x7e, 0xe2, 0x40, 0x00, 0xec, 0xfe, 0x1d, 0xe4, 0xbd, 0xeb, 0x40, 0x00, 0x31, 0x7f, 0x16, 0x6b, 0xce, 0xf4, 0x40, 0x80, 0xc9, 0xbe, 0xa1, 0xa0, 0x35, 0xff, 0x40, 0x20, 0x17, 0x4f, 0x79, 0x38, 0x68, 0x07, 0x41, 0x58, 0x51, 0xfb, 0x5a, 0x2a, 0x8e, 0x11, 0x41, 0x04, 0xfa, 0x78, 0x88, 0x3f, 0x55, 0x1a, 0x41, 0x83, 0xbb, 0x5a, 0xa6, 0xef, 0xbf, 0x23, 0x41, 0x44, 0x19, 0x88, 0x79, 0xe7, 0x9f, 0x2d, 0x41, 0xf3, 0x12, 0x26, 0x9b, 0xed, 0x37, 0x36, 0x41, 0x36, 0x8e, 0x5c, 0x34, 0xf2, 0xa9, 0x40, 0x41, 0x51, 0xd5, 0x8a, 0x4e, 0xeb, 0xfe, 0x48, 0x41, 0xfd, 0x1f, 0xe8, 0x7a, 0x30, 0xbf, 0x52, 0x41, 0xfc, 0x2f, 0x5c, 0xb8, 0xc8, 0x1e, 0x5c, 0x41, 0xfd, 0x23, 0x45, 0x8a, 0x16, 0x17, 0x65, 0x41, 0xfc, 0xb5, 0x67, 0xcf, 0xa1, 0xa2, 0x6f, 0x41, 0x7d, 0xc8, 0x8d, 0x5b, 0xf9, 0xb9, 0x77, 0x41, 0x5e, 0x56, 0xaa, 0x04, 0x7b, 0xcb, 0x81, 0x41, 0x8d, 0x81, 0xff, 0x86, 0x38, 0xb1, 0x8a, 0x41, 0x2a, 0xa1, 0x3f, 0x65, 0xea, 0x04, 0x94, 0x41, 0xbf, 0x71, 0xdf, 0x97, 0x5f, 0x07, 0x9e, 0x41, 0x4f, 0x95, 0xe7, 0xb1, 0x87, 0x85, 0xa6, 0x41, 0xfb, 0xaf, 0x6d, 0xc5, 0x25, 0xe4, 0xb0, 0x41, 0xf8, 0x87, 0x24, 0xa8, 0x38, 0x56, 0xb9, 0x41, 0xfa, 0x65, 0x1b, 0x7e, 0xaa, 0x00, 0xc3, 0x41, 0xf7, 0x18, 0x29, 0xbd, 0xff, 0x80, 0xcc, 0x41, 0xb9, 0xd2, 0xde, 0xcd, 0xbf, 0x60, 0xd5, 0x41, 0x0b, 0x1e, 0x67, 0xda, 0x8f, 0x08, 0xe0, 0x41, 0x10, 0xad, 0x9a, 0xc7, 0xd7, 0x0c, 0xe8, 0x41, 0xcc, 0x01, 0xb4, 0xd5, 0xa1, 0x09, 0xf2, 0x41, 0xb2, 0x02, 0x8e, 0xc0, 0x72, 0x0e, 0xfb, 0x41, 0x06, 0x82, 0x6a, 0x10, 0xd6, 0x4a, 0x04, 0x42, 0x09, 0xc3, 0x9f, 0x18, 0x41, 0x70, 0x0e, 0x42, 0x47, 0xd2, 0x77, 0xd2, 0x30, 0xd4, 0x16, 0x42, 0xb5, 0xdd, 0xd9, 0x9d, 0x24, 0x1f, 0x21, 0x42, 0x90, 0xcc, 0xc6, 0xec, 0xb6, 0xae, 0x29, 0x42, 0x6c, 0x19, 0x95, 0x31, 0x09, 0x43, 0x33, 0x42, 0x22, 0xa6, 0x5f, 0xca, 0x8d, 0xe4, 0x3c, 0x42, 0x9a, 0xbc, 0xc7, 0x57, 0x6a, 0xab, 0x45, 0x42, 0x74, 0xcd, 0xd5, 0xc1, 0x8f, 0x40, 0x50, 0x42, 0x2e, 0xb4, 0xc0, 0xa2, 0xd7, 0x60, 0x58, 0x42, 0x22, 0x87, 0x10, 0xba, 0xa1, 0x48, 0x62, 0x42, 0xb3, 0xca, 0x18, 0x97, 0xf2, 0x6c, 0x6b, 0x42, 0x06, 0x98, 0x52, 0xf1, 0xb5, 0x91, 0x74, 0x42, 0x09, 0xe4, 0xfb, 0xe9, 0x90, 0xda, 0x7e, 0x42, 0x07, 0xeb, 0x7c, 0xaf, 0xec, 0x23, 0x87, 0x42, 0x45, 0xb0, 0x9d, 0x83, 0xf1, 0x5a, 0x91, 0x42, 0x68, 0x88, 0x6c, 0x45, 0x6a, 0x08, 0x9a, 0x42, 0x4e, 0x66, 0x11, 0xb4, 0x4f, 0x86, 0xa3, 0x42, 0x75, 0x19, 0x1a, 0x8e, 0x77, 0x49, 0xad, 0x42, 0x18, 0x93, 0x93, 0xaa, 0x19, 0xf7, 0xb5, 0x42, 0x52, 0xae, 0xee, 0x3f, 0x53, 0x79, 0xc0, 0x42, 0x7b, 0x05, 0xe6, 0xdf, 0xfc, 0xb5, 0xc8, 0x42, 0x1c, 0x84, 0xec, 0xa7, 0x7d, 0x88, 0xd2, 0x42, 0x2a, 0xc6, 0xe2, 0x7b, 0xbc, 0xcc, 0xdb, 0x42, 0xa0, 0x14, 0xea, 0x5c, 0x8d, 0xd9, 0xe4, 0x42, 0xf0, 0x1e, 0x5f, 0x0b, 0x54, 0x46, 0xef, 0x42, 0x34, 0x57, 0x87, 0x08, 0xbf, 0x74, 0xf7, 0x42, 0x67, 0x81, 0x65, 0x46, 0x8f, 0x97, 0x01, 0x43, 0x1a, 0x42, 0x98, 0xe9, 0x56, 0x63, 0x0a, 0x43, 0x94, 0x31, 0x32, 0x2f, 0x81, 0xca, 0x13, 0x43, 0x5e, 0x4a, 0xcb, 0xc6, 0xc1, 0xaf, 0x1d, 0x43, 0xc6, 0x77, 0x18, 0x55, 0xd1, 0x43, 0x26, 0x43, 0xd4, 0x59, 0xd2, 0xff, 0xdc, 0xb2, 0x30, 0x43, 0xbe, 0x86, 0xbb, 0x7f, 0x4b, 0x0c, 0x39, 0x43, 0x0e, 0xa5, 0xcc, 0x9f, 0x38, 0xc9, 0x42, 0x43, 0x95, 0xf7, 0xb2, 0xef, 0xd4, 0x2d, 0x4c, 0x43, 0xb0, 0x39, 0xc6, 0xb3, 0x5f, 0x22, 0x55, 0x43, 0x88, 0x56, 0xa9, 0x8d, 0x8f, 0xb3, 0x5f, 0x43, 0xe6, 0x00, 0x3f, 0xaa, 0xab, 0xc6, 0x67, 0x43, 0xac, 0x40, 0xaf, 0xbf, 0x00, 0xd5, 0x71, 0x43, 0x02, 0xe1, 0x86, 0x1f, 0x81, 0xbf, 0x7a, 0x43, 0xc2, 0x28, 0xa5, 0xd7, 0xa0, 0x0f, 0x84, 0x43, 0x23, 0xbd, 0x77, 0x43, 0x71, 0x17, 0x8e, 0x43, 0xda, 0xcd, 0x99, 0xf2, 0x94, 0x91, 0x96, 0x43, 0x64, 0x5a, 0xf3, 0xb5, 0x2f, 0xed, 0xa0, 0x43, 0x96, 0x07, 0xed, 0x90, 0xc7, 0x63, 0xa9, 0x43, 0xb0, 0xc5, 0xb1, 0xac, 0xd5, 0x0a, 0xb3, 0x43, 0x88, 0xa8, 0x0a, 0x83, 0x40, 0x90, 0xbc, 0x43, 0x66, 0xfe, 0x47, 0x62, 0x30, 0x6c, 0xc5, 0x43, 0xcc, 0xfe, 0xb5, 0x49, 0x24, 0x11, 0xd0, 0x43, 0x32, 0xfe, 0x90, 0x6e, 0xb6, 0x19, 0xd8, 0x43, 0xa6, 0xbe, 0xec, 0xd2, 0x48, 0x13, 0xe2, 0x43, 0xf9, 0x1d, 0x63, 0x3c, 0xed, 0x1c, 0xeb, 0x43, 0x7b, 0x56, 0x4a, 0xed, 0xb1, 0x55, 0xf4, 0x43, 0xb8, 0x81, 0xef, 0xe3, 0x8a, 0x80, 0xfe, 0x43, 0x4a, 0xa1, 0xf3, 0x2a, 0x68, 0xe0, 0x06, 0x44, 0xf8, 0xb8, 0x36, 0x20, 0x4e, 0x28, 0x11, 0x44, 0x74, 0x15, 0x52, 0x30, 0x75, 0xbc, 0x19, 0x44, 0x17, 0x90, 0x3d, 0xe4, 0x57, 0x4d, 0x23, 0x44, 0x22, 0x58, 0x5c, 0xd6, 0x03, 0xf4, 0x2c, 0x44, 0x1a, 0x42, 0xc5, 0xe0, 0x02, 0xb7, 0x35, 0x44, 0x94, 0xf1, 0x93, 0x28, 0x42, 0x49, 0x40, 0x44, 0x5e, 0xea, 0xdd, 0x3c, 0xe3, 0x6d, 0x48, 0x44, 0xc6, 0x6f, 0xa6, 0x6d, 0x6a, 0x52, 0x52, 0x44, 0xa9, 0xa7, 0x79, 0xa4, 0x9f, 0x7b, 0x5b, 0x44, 0xbf, 0x3d, 0x5b, 0xbb, 0xb7, 0x9c, 0x64, 0x44, 0x9e, 0xdc, 0x08, 0x99, 0x13, 0xeb, 0x6e, 0x44, 0x76, 0xa5, 0xc6, 0xb2, 0x4e, 0x30, 0x77, 0x44, 0x18, 0xfc, 0x14, 0x06, 0x3b, 0x64, 0x81, 0x44, 0x24, 0x7a, 0x1f, 0x89, 0x58, 0x16, 0x8a, 0x44, 0x9b, 0x9b, 0xd7, 0x66, 0xc2, 0x90, 0x93, 0x44, 0x68, 0x69, 0x43, 0x9a, 0x23, 0x59, 0x9d, 0x44 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); v[0] = 1.5; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 1.5; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) CHECKFi(i, u[i], v[i + 5]); return r; } libgetdata-0.9.0/test/del_carray.c0000640000175000017500000000322712614323564017240 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CARRAY UINT8 1 2 3 4\n" "raw RAW UINT8 data<2>\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DELETE); CHECKI(ret, -1); return r; } libgetdata-0.9.0/test/get_mplex_saved.c0000640000175000017500000000437212614323564020303 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 0 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8], d[8]; unsigned char data_data[256]; int fd, n1, n2, i, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c); e1 = gd_error(D); n2 = gd_getdata(D, "mplex", 6, 0, 1, 0, GD_UINT8, &d); e2 = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n1, 8); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKIi(i, c[i], 39 + 3 * ((i + 1) / 3)); CHECKIi(i, d[i], 48 + 3 * (i / 3)); } return r; } libgetdata-0.9.0/test/name_dangle.c0000640000175000017500000000651012614323564017363 0ustar alastairalastair/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *zata = "dirfile/zata"; const char *format_data = "early MULTIPLY data data\n" "/ALIAS earlya data\n" "late PHASE data 0\n" "/ALIAS latea data\n" "cata RAW UINT8 8\n" "data RAW UINT8 8\n" "eata RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e1, e2, e3, e4, e5, e6, unlink_data, unlink_zata, r = 0; const char **fl; #define NFIELDS 6 const char *field_list[NFIELDS] = { "INDEX", "cata", "early", "eata", "late", "zata" }; char *s1, *s4; const char *s3, *s6; unsigned nf, i; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); /* force-resolve the early entries */ gd_validate(D, "early"); gd_validate(D, "earlya"); ret = gd_rename(D, "data", "zata", GD_REN_DANGLE); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, 0); gd_spf(D, "early"); e2 = gd_error(D); CHECKI(e2, GD_E_BAD_CODE); gd_spf(D, "late"); e3 = gd_error(D); CHECKI(e3, GD_E_BAD_CODE); nf = gd_nfields(D); CHECKI(nf, NFIELDS); if (nf > NFIELDS) nf = NFIELDS; fl = gd_field_list(D); for (i = 0; i < nf; ++i) CHECKSi(i, fl[i], field_list[i]); gd_entry(D, "early", &E); s1 = E.in_fields[0]; CHECKS(s1, "data"); gd_free_entry_strings(&E); gd_entry(D, "earlya", &E); e4 = gd_error(D); s3 = gd_alias_target(D, "earlya"); CHECKI(e4, GD_E_BAD_CODE); CHECKS(s3, "data"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s4 = E.in_fields[0]; CHECKS(s4, "data"); gd_free_entry_strings(&E); gd_entry(D, "latea", &E); e5 = gd_error(D); s6 = gd_alias_target(D, "earlya"); CHECKI(e5, GD_E_BAD_CODE); CHECKS(s6, "data"); gd_free_entry_strings(&E); e6 = gd_close(D); CHECKI(e6, 0); unlink_data = unlink(data); unlink_zata = unlink(zata); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); CHECKI(unlink_zata, -1); return r; } libgetdata-0.9.0/test/open_sym_cl.c0000640000175000017500000000300712614323564017436 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile/link"; const char *format = "dirfile/format"; const char *targ = "./"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ symlink(targ, filedir); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; #endif } libgetdata-0.9.0/test/add_mplex.c0000640000175000017500000000315112614323564017064 0ustar alastairalastair/* Copyright (C) 2012-2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_mplex(D, "new", "in", "count", 3, 4, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_MPLEX_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKS(e.in_fields[1], "count"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(mplex,count_val), 3); CHECKI(e.EN(mplex,period), 4); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/name_updb_affix.c0000640000175000017500000000470712614323564020246 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT8 8\n" "AphaseZ PHASE data 0\n" "AphaseZ/meta CONST UINT8 3\n" "/INCLUDE format1 A Z\n"; const char *format1_data = "bit BIT phase phase/meta 1\n"; int fd, r1, r2, r3, e1, e2, e3, e4, e5, e6, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_validate(D, "AbitZ"); e1 = gd_error(D); CHECKI(e1, 0); gd_entry(D, "AbitZ", &E); e2 = gd_error(D); CHECKI(e2, 0); CHECKSi(1, E.in_fields[0], "AphaseZ"); CHECKSi(1, E.scalar[0], "AphaseZ/meta"); gd_free_entry_strings(&E); r1 = gd_rename(D, "AphaseZ", "zata", GD_REN_UPDB); e3 = gd_error(D); CHECKI(r1, -1); CHECKI(e3, GD_E_BAD_CODE); r2 = gd_rename(D, "AphaseZ", "zata", GD_REN_UPDB | GD_REN_FORCE); e4 = gd_error(D); CHECKI(r2, 0); CHECKI(e4, 0); gd_validate(D, "AbitZ"); e5 = gd_error(D); CHECKI(e5, GD_E_BAD_SCALAR); gd_entry(D, "AbitZ", &E); e6 = gd_error(D); CHECKI(e6, 0); CHECKSi(2, E.in_fields[0], "AphaseZ"); CHECKSi(2, E.scalar[0], "AphaseZ/meta"); gd_free_entry_strings(&E); r3 = gd_close(D); CHECKI(r3, 0); unlink(format); unlink(format1); rmdir(filedir); return r; } libgetdata-0.9.0/test/svlist_hidden.c0000640000175000017500000000375612614323564020001 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 STRING valu1\n" "data2 STRING valu2\n" "/HIDDEN data2\n" "data3 STRING valu3\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_strings(D); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i,len,5); CHECKIi(i,field_list[i][0], 'v'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 'l'); CHECKIi(i,field_list[i][3], 'u'); if (field_list[i][4] != '1' && field_list[i][4] != '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i,2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_raw.c0000640000175000017500000000304012614323564017107 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/del_alias.c0000640000175000017500000000356112614323564017051 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n" "/ALIAS alias data\n"; int fd, ret, error1, error2, error3, r = 0; gd_entype_t t1, t2; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); t1 = gd_entry_type(D, "alias"); error1 = gd_error(D); CHECKI(error1, GD_E_OK); CHECKU(t1, GD_RAW_ENTRY); ret = gd_delete(D, "alias", 0); error2 = gd_error(D); CHECKI(error2, GD_E_OK); CHECKI(ret, 0); t2 = gd_entry_type(D, "alias"); error3 = gd_error(D); CHECKU(t2, GD_NO_ENTRY); CHECKI(error3, GD_E_BAD_CODE); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_window_ne.c0000640000175000017500000000401512614323564017757 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data NE 44\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i != 4) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/convert_int16_complex64.c0000640000175000017500000000431412614323564021533 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/get_endian_complex64_big.c0000640000175000017500000001336712614323564021760 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read big-endian COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 1\nENDIAN big\n"; #ifdef GD_NO_C99_API float u[20]; float v[20][2]; #else float complex u[10]; float complex v[20]; #endif const unsigned char data_data[64 * 8] = { 0x3F, 0xC0, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x40, 0x58, 0x00, 0x00, 0x40, 0xA2, 0x00, 0x00, 0x40, 0xF3, 0x00, 0x00, 0x41, 0x36, 0x40, 0x00, 0x41, 0x88, 0xB0, 0x00, 0x41, 0xCD, 0x08, 0x00, 0x42, 0x19, 0xC6, 0x00, 0x42, 0x66, 0xA9, 0x00, 0x42, 0xAC, 0xFE, 0xC0, 0x43, 0x01, 0xBF, 0x10, 0x43, 0x42, 0x9E, 0x98, 0x43, 0x91, 0xF6, 0xF2, 0x43, 0xDA, 0xF2, 0x6B, 0x44, 0x24, 0x35, 0xD0, 0x44, 0x76, 0x50, 0xB8, 0x44, 0xB8, 0xBC, 0x8A, 0x45, 0x0A, 0x8D, 0x68, 0x45, 0x4F, 0xD4, 0x1C, 0x45, 0x9B, 0xDF, 0x15, 0x45, 0xE9, 0xCE, 0xA0, 0x46, 0x2F, 0x5A, 0xF8, 0x46, 0x83, 0x84, 0x3A, 0x46, 0xC5, 0x46, 0x57, 0x47, 0x13, 0xF4, 0xC1, 0x47, 0x5D, 0xEF, 0x22, 0x47, 0xA6, 0x73, 0x5A, 0x47, 0xF9, 0xAD, 0x07, 0x48, 0x3B, 0x41, 0xC5, 0x48, 0x8C, 0x71, 0x54, 0x48, 0xD2, 0xA9, 0xFE, 0x49, 0x1D, 0xFF, 0x7E, 0x49, 0x6C, 0xFF, 0x3D, 0x49, 0xB1, 0xBF, 0x6E, 0x4A, 0x05, 0x4F, 0x92, 0x4A, 0x47, 0xF7, 0x5B, 0x4A, 0x95, 0xF9, 0x84, 0x4A, 0xE0, 0xF6, 0x46, 0x4B, 0x28, 0xB8, 0xB4, 0x4B, 0x7D, 0x15, 0x0E, 0x4B, 0xBD, 0xCF, 0xCA, 0x4C, 0x0E, 0x5B, 0xD8, 0x4C, 0x55, 0x89, 0xC4, 0x4C, 0xA0, 0x27, 0x53, 0x4C, 0xF0, 0x3A, 0xFC, 0x4D, 0x34, 0x2C, 0x3D, 0x4D, 0x87, 0x21, 0x2E, 0x4D, 0xCA, 0xB1, 0xC5, 0x4E, 0x18, 0x05, 0x54, 0x4E, 0x64, 0x07, 0xFE, 0x4E, 0xAB, 0x05, 0xFE, 0x4F, 0x00, 0x44, 0x7E, 0x4F, 0x40, 0x66, 0xBD, 0x4F, 0x90, 0x4D, 0x0E, 0x4F, 0xD8, 0x73, 0x95, 0x50, 0x22, 0x56, 0xB0, 0x50, 0x73, 0x82, 0x08, 0x50, 0xB6, 0xA1, 0x86, 0x51, 0x08, 0xF9, 0x24, 0x51, 0x4D, 0x75, 0xB6, 0x51, 0x9A, 0x18, 0x48, 0x51, 0xE7, 0x24, 0x6C, 0x52, 0x2D, 0x5B, 0x51, 0x52, 0x82, 0x04, 0x7D, 0x52, 0xC3, 0x06, 0xBC, 0x53, 0x12, 0x45, 0x0D, 0x53, 0x5B, 0x67, 0x94, 0x53, 0xA4, 0x8D, 0xAF, 0x53, 0xF6, 0xD4, 0x86, 0x54, 0x39, 0x1F, 0x64, 0x54, 0x8A, 0xD7, 0x8B, 0x54, 0xD0, 0x43, 0x50, 0x55, 0x1C, 0x32, 0x7C, 0x55, 0x6A, 0x4B, 0xBA, 0x55, 0xAF, 0xB8, 0xCC, 0x56, 0x03, 0xCA, 0x99, 0x56, 0x45, 0xAF, 0xE6, 0x56, 0x94, 0x43, 0xEC, 0x56, 0xDE, 0x65, 0xE2, 0x57, 0x26, 0xCC, 0x6A, 0x57, 0x7A, 0x32, 0x9F, 0x57, 0xBB, 0xA5, 0xF7, 0x58, 0x0C, 0xBC, 0x79, 0x58, 0x53, 0x1A, 0xB6, 0x58, 0x9E, 0x54, 0x08, 0x58, 0xED, 0x7E, 0x0C, 0x59, 0x32, 0x1E, 0x89, 0x59, 0x85, 0x96, 0xE7, 0x59, 0xC8, 0x62, 0x5A, 0x5A, 0x16, 0x49, 0xC4, 0x5A, 0x61, 0x6E, 0xA6, 0x5A, 0xA9, 0x12, 0xFC, 0x5A, 0xFD, 0x9C, 0x7A, 0x5B, 0x3E, 0x35, 0x5C, 0x5B, 0x8E, 0xA8, 0x05, 0x5B, 0xD5, 0xFC, 0x08, 0x5C, 0x20, 0x7D, 0x06, 0x5C, 0x70, 0xBB, 0x89, 0x5C, 0xB4, 0x8C, 0xA7, 0x5D, 0x07, 0x69, 0x7D, 0x5D, 0x4B, 0x1E, 0x3C, 0x5D, 0x98, 0x56, 0xAD, 0x5D, 0xE4, 0x82, 0x04, 0x5E, 0x2B, 0x61, 0x83, 0x5E, 0x80, 0x89, 0x22, 0x5E, 0xC0, 0xCD, 0xB3, 0x5F, 0x10, 0x9A, 0x46, 0x5F, 0x58, 0xE7, 0x69, 0x5F, 0xA2, 0xAD, 0x8F, 0x5F, 0xF4, 0x04, 0x56, 0x60, 0x37, 0x03, 0x40, 0x60, 0x89, 0x42, 0x70, 0x60, 0xCD, 0xE3, 0xA8, 0x61, 0x1A, 0x6A, 0xBE, 0x61, 0x67, 0xA0, 0x1D, 0x61, 0xAD, 0xB8, 0x16, 0x62, 0x02, 0x4A, 0x10, 0x62, 0x43, 0x6F, 0x18, 0x62, 0x92, 0x93, 0x52, 0x62, 0xDB, 0xDC, 0xFB, 0x63, 0x24, 0xE5, 0xBC, 0x63, 0x77, 0x58, 0x9A, 0x63, 0xB9, 0x82, 0x74, 0x64, 0x0B, 0x21, 0xD7, 0x64, 0x50, 0xB2, 0xC2, 0x64, 0x9C, 0x86, 0x12, 0x64, 0xEA, 0xC9, 0x1B }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); #ifdef GD_NO_C99_API v[0][0] = 1.5; v[0][1] = 2.25; for (i = 1; i < 20; ++i) { v[i][0] = v[i - 1][0] * 2.25; v[i][1] = v[i - 1][1] * 2.25; } #else v[0] = 1.5 + _Complex_I * 2.25; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 2.25; #endif fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * 8 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) #ifdef GD_NO_C99_API CHECKCi(i, u + 2 * i, v[i + 5]); #else CHECKCi(i, u[i], v[i + 5]); #endif return r; } libgetdata-0.9.0/test/put_char.c0000640000175000017500000000344612614323564016743 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 c/ an old-style type character should fail cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, (gd_type_t)'c', c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_TYPE); return r; } libgetdata-0.9.0/test/seek_mult.c0000640000175000017500000000366112614323564017125 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "mult MULTIPLY cata data\n" "/ENCODING none\n" "cata RAW UINT8 8\n" "data RAW UINT8 8\n"; int fd, e0, e1, e2, e3, r = 0; off_t m, n1, n2, n3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "mult", 6, 0, GD_SEEK_SET | GD_SEEK_WRITE); e0 = gd_error(D); n1 = gd_tell(D, "mult"); e1 = gd_error(D); n2 = gd_tell(D, "cata"); e2 = gd_error(D); n3 = gd_tell(D, "data"); e3 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e0, 0); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(e3, 0); CHECKI(m, 48); CHECKI(n1, 48); CHECKI(n2, 48); CHECKI(n3, 48); return r; } libgetdata-0.9.0/test/open_notdirfile.c0000640000175000017500000000246312614323564020314 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Opening an non-dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); D = gd_open(filedir, GD_RDONLY); rmdir(filedir); error = gd_error(D); CHECKI(error, GD_E_IO); gd_discard(D); return r; } libgetdata-0.9.0/test/get_multiply_s.c0000640000175000017500000000363112614323564020172 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data phase\n" "phase PHASE data 128\n" "data RAW UINT8 1\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mult", 0, 0, 1000, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 128); return r; } libgetdata-0.9.0/test/native_raw.c0000640000175000017500000000272412614323564017273 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "data"); error = gd_error(D); CHECKU(type, GD_UINT8); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/foffs_get.c0000640000175000017500000000356012614323564017075 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test frameoffset */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n"; unsigned char data_data[256]; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_frameoffset(D, 0); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n, 13); return r; } libgetdata-0.9.0/test/flist_type_invalid.c0000640000175000017500000000261312614323564021021 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_field_list_by_type(D, GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_meta_alias.c0000640000175000017500000000314012614323564020416 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "/ALIAS alias parent\n" "META alias child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/alter_entry_scalar3c.c0000640000175000017500000000357612614323564021245 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in c1 3\nc1 CONST INT64 3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); memset(&E, 0, sizeof(E)); E.field_type = GD_BIT_ENTRY; E.EN(bit,bitnum) = -1; E.EN(bit,numbits) = 3; E.in_fields[0] = "in"; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); n = gd_entry(D, "data", &E); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,0); CHECKI(ret,0); CHECKI(E.EN(bit,bitnum), 3); CHECKP(E.scalar[0]); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/ascii_put_here.c0000640000175000017500000000434012614323564020113 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; int d, n1, n2, e1, e2, e3; int fd, i, r = 0; struct stat buf; FILE* stream; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_TEXT_ENCODED | GD_VERBOSE); n1 = gd_seek(D, "data", 5, 0, GD_SEEK_SET | GD_SEEK_WRITE); e1 = gd_error(D); CHECKI(e1,0); CHECKI(n1,40); n2 = gd_putdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2,0); CHECKI(n2,8); e3 = gd_close(D); CHECKI(e3, 0); if (stat(data, &buf)) return 1; stream = fopen(data, "r"); i = 0; for (;;) { fscanf(stream, "%i", &d); if (feof(stream)) break; if (i < 40 || i > 48) { CHECKI(d, 0); } else CHECKI(d, i); i++; } fclose(stream); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_ss.c0000640000175000017500000000373312614323564016421 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 0, 40, 0, 8, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_complex64_int64.c0000640000175000017500000000362212614323564021537 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX64 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST INT64 0\n"; int64_t c = 0; #ifdef GD_NO_C99_API float d[] = {8, 0}; #else float complex d = 8; #endif int fd, n1, n2, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); #ifdef GD_NO_C99_API n1 = gd_put_constant(D, "data", GD_COMPLEX64, d); #else n1 = gd_put_constant(D, "data", GD_COMPLEX64, &d); #endif n2 = gd_get_constant(D, "data", GD_INT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKI(c, 8); return r; } libgetdata-0.9.0/test/madd_bit.c0000640000175000017500000000345512614323564016701 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a BIT field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int ge_error, error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_bit(D, "new", "meta", "input", 1, 1); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_BIT_ENTRY); CHECKS(e.in_fields[0], "input"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(bit,bitnum), 1); CHECKI(e.EN(bit,numbits), 1); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/bzip_put_get.c0000640000175000017500000000421612614323564017625 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.bz2"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d[8]; int fd, i, m, n, e1, e2, e3, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); for (i = 0; i < m; ++i) CHECKIi(i, d[i], c[i]); e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(n, 8); CHECKI(m, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(e2, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(m, 0); #endif return r; #endif } libgetdata-0.9.0/test/alter_cpolynom.c0000640000175000017500000000505512614323564020163 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n" "polynom POLYNOM data 1 2 1\n"; int32_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; const double a[] = {2, 1, 1, 2, 1, 3}; #else double complex c[8]; const double complex a[] = {2 + _Complex_I * 1, 1 + _Complex_I * 2, 1 + _Complex_I * 3}; #endif int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_cpolynom(D, "polynom", 0, NULL, a); error = gd_error(D); n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, c); gd_discard(D); for (i = 0; i < 8; ++i) { int x = i + 40; #ifdef GD_NO_C99_API const double v[2] = {2 + x + x * x, 1 + 2 * x + 3 * x * x}; CHECKCi(i,c + 2 * i, v); #else const double complex v = (2 + _Complex_I * 1) + (1 + _Complex_I * 2) * x + (1 + _Complex_I * 3) * x * x; CHECKCi(i,c[i], v); #endif } unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/add_window_op.c0000640000175000017500000000276312614323564017754 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a WINDOW field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_triplet_t threshold; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); threshold.r = 3.4; gd_add_window(D, "new", "in", "check", (gd_windop_t)-1, threshold, 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/repr_int32.c0000640000175000017500000000424412614323564017122 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i],40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flist.c0000640000175000017500000000424112614323564016251 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "data3 RAW UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_field_list(D); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; ; ++i) { if (field_list[i] == NULL) break; if (strcmp(field_list[i], "data1") == 0) continue; else if (strcmp(field_list[i], "data2") == 0) continue; else if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "INDEX") == 0) continue; fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } CHECKI(i, 4); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flist_type_meta_hidden.c0000640000175000017500000000414012614323564021631 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent STRING UINT8 1\n" "META parent data1 STRING UINT8 1\n" "META parent data2 STRING UINT8 1\n" "/HIDDEN parent/data2\n" "META parent data3 STRING UINT8 1\n" "META parent data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { CHECKIi(i,strlen(field_list[i]), 5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] != '1' && field_list[i][4] != '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i, 2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alias_num_missing.c0000640000175000017500000000300512614323564020626 0ustar alastairalastair/* Copyright (C) 2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS e f\n" "/ALIAS a b\n" "/ALIAS b d\n" "/ALIAS c d\n" "/ALIAS d f\n"; int fd, e, r = 0; unsigned n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_naliases(D, "a"); e = gd_error(D); CHECKI(e, GD_E_BAD_CODE); CHECKU(n, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_complex128_uint64.c0000640000175000017500000000363312614323564022007 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT64 0\n"; uint64_t c = 0; #ifdef GD_NO_C99_API double d[] = {8, 0}; #else double complex d = 8; #endif int fd, n1, n2, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); #ifdef GD_NO_C99_API n1 = gd_put_constant(D, "data", GD_COMPLEX128, d); #else n1 = gd_put_constant(D, "data", GD_COMPLEX128, &d); #endif n2 = gd_get_constant(D, "data", GD_UINT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKU(c, 8); return r; } libgetdata-0.9.0/test/spf_raw.c0000640000175000017500000000322212614323564016567 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the samples-per-frame of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 11\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/put_rdonly.c0000640000175000017500000000340012614323564017323 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; int fd, n, e1, e2, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,0); CHECKI(e1,GD_E_ACCMODE); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, -1); return r; } libgetdata-0.9.0/test/get_fs.c0000640000175000017500000000373412614323564016405 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 8, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_meta_meta.c0000640000175000017500000000276712614323564020271 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent child CONST UINT8 1\n" "META parent/child grandchild CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/slim_seek.c0000640000175000017500000000375412614323564017113 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_SLIM || !defined USE_SLIM return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *slimdata = "dirfile/data.slm"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) { perror("command"); r = 1; } D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); CHECKI(n,40); error = gd_error(D); CHECKI(error,0); gd_discard(D); unlink(slimdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/sie_nframes_little.c0000640000175000017500000000357212614323564021006 0ustar alastairalastair/* Copyright (C) 2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian SIE data */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 1\n/ENCODING sie\n/ENDIAN little\n"; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; DIRFILE *D; off_t n; int fd, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 9 * 3 * sizeof(uint8_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes(D); error = gd_error(D); gd_discard(D); CHECKI(error, 0); CHECKI(n, 0x31); return r; } libgetdata-0.9.0/test/gzip_nframes.c0000640000175000017500000000441712614323564017621 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; #ifdef USE_GZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/convert_uint8_uint64.c0000640000175000017500000000402412614323564021147 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint64_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/entry_phase_scalar.c0000640000175000017500000000353512614323564021003 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read PHASE entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "shift CONST UINT8 3\ndata PHASE in1 shift\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_PHASE_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.scalar[0], "shift"); CHECKI(E.EN(phase,shift), 3); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/get_window_ge.c0000640000175000017500000000401512614323564017750 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data GE 44\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i >= 4) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/open_cb_rescan_alloc.c0000640000175000017500000000346612614323564021252 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include static int saw_callback = 0; int callback(gd_parser_data_t *pdata, void *extra gd_unused_) { if (saw_callback) return GD_SYNTAX_ABORT; saw_callback = 1; pdata->line = strdup("/REFERENCE data\n"); return GD_SYNTAX_RESCAN; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(saw_callback, 1); CHECKI(error, GD_E_BAD_REFERENCE); return r; } libgetdata-0.9.0/test/sie_nframes_big.c0000640000175000017500000000356712614323564020256 0ustar alastairalastair/* Copyright (C) 2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian SIE data */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 1\n/ENCODING sie\n/ENDIAN big\n"; const uint8_t data_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32 }; DIRFILE *D; off_t n; int fd, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 9 * 3 * sizeof(uint8_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes(D); error = gd_error(D); gd_discard(D); CHECKI(error, 0); CHECKI(n, 0x31); return r; } libgetdata-0.9.0/test/convert_uint64_int8.c0000640000175000017500000000376312614323564020773 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/put_const.c0000640000175000017500000000330312614323564017144 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val = 0; int e1, e2, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_const(D, "data", GD_UINT8, GD_UINT8, &val, 0); val = 23; gd_put_constant(D, "data", GD_UINT8, &val); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); /* check */ val = 0; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_get_constant(D, "data", GD_UINT8, &val); gd_discard(D); unlink(format); rmdir(filedir); CHECKU(val, 23); return r; } libgetdata-0.9.0/test/put_endian16.c0000640000175000017500000000427312614323564017432 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT16 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint16_t c = 0x201, d = 0; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT16 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); lseek(fd, 5 * sizeof(uint16_t), SEEK_SET); read(fd, &d, sizeof(uint16_t)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,1); CHECKX(d,0x102); return r; } libgetdata-0.9.0/test/del_carray_deref.c0000640000175000017500000000334512614323564020406 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CARRAY UINT8 13 14 15 16 17\n" "raw RAW UINT8 data<2>\n"; int fd, ret, error, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", GD_DEL_DEREF); error = gd_error(D); spf = gd_spf(D, "raw"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKU(spf, 15); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/parse_include_dir.c0000640000175000017500000000312712614323564020605 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format_data = "INCLUDE sub\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(subdir); rmdir(filedir); CHECKI(error, GD_E_IO); return r; } libgetdata-0.9.0/test/convert_float32_uint32.c0000640000175000017500000000377312614323564021357 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; uint32_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/gzip_put_pad.c0000640000175000017500000000521712614323564017621 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if ! (defined TEST_GZIP) || ! (defined USE_GZIP) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); gd_close(D); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n2 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_gz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/nmeta_vectors_parent.c0000640000175000017500000000410412614323564021350 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); nfields = gd_nmvectors(D, "raw9"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKU(nfields, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/alter_mspec_affix.c0000640000175000017500000000417312614323564020607 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 8\nMETA data phase PHASE data 1\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_malter_spec(D, "phase PHASE data 2", "AdataZ", 0); error = gd_error(D); n = gd_getdata(D, "AdataZ/phase", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i + 42); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/put_endian8.c0000640000175000017500000000426212614323564017351 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint8_t c = 0x21, d = 0; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT8 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); lseek(fd, 5 * sizeof(uint8_t), SEEK_SET); read(fd, &d, sizeof(uint8_t)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKX(d,0x21); CHECKI(n,1); CHECKI(error,0); return r; } libgetdata-0.9.0/test/alias_list_missing.c0000640000175000017500000000300212614323564020777 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS e f\n" "/ALIAS a b\n" "/ALIAS b d\n" "/ALIAS c d\n" "/ALIAS d f\n"; int fd, e, r = 0; DIRFILE *D; const char **al; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); al = gd_aliases(D, "a"); e = gd_error(D); CHECKI(e, GD_E_BAD_CODE); CHECKP(al); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/move_data_nop.c0000640000175000017500000000436312614323564017750 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1\ndata RAW UINT8 11"; const char *format1_data = "#\n"; unsigned char data_data[256]; int fd, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); ret = gd_move(D, "data", 1, GD_REN_DATA); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); unlink(format1); unlink(format); unlink(data); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/gzip_move_to.c0000640000175000017500000000542012614323564017631 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data_raw = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n"; uint8_t data_in[256]; DIRFILE *D; #ifdef USE_GZIP uint8_t d; char command[4096]; int i; #endif int fd, e1, e2, unlink_raw, r = 0; struct stat buf; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_in[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_in, 256); close(fd); #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR); #endif gd_alter_encoding(D, GD_GZIP_ENCODED, 0, 1); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); #ifdef USE_GZIP if (stat(data_gz, &buf)) { perror("stat"); r = 1; } CHECKI(stat(data_raw, &buf), -1); #else if (stat(data_raw, &buf)) { perror("stat"); r = 1; } CHECKI(stat(data_gz, &buf), -1); #endif #ifdef USE_GZIP /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data_gz); if (gd_system(command)) { fprintf(stderr, "command failed: %s\n", command); r = 1; } else { fd = open(data_raw, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, i); i++; } CHECKI(i, 256); close(fd); } } #endif unlink_raw = unlink(data_raw); unlink(format); rmdir(filedir); CHECKI(unlink_raw, 0); #ifdef USE_GZIP CHECKI(e1, GD_E_OK); #else CHECKI(e1, GD_E_UNSUPPORTED); #endif return r; } libgetdata-0.9.0/test/put_sub.c0000640000175000017500000000473512614323564016621 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data = "dirfile/sub/data"; const char *format_data = "/INCLUDE sub/format1\n"; const char *format1_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; DIRFILE *D; struct stat buf; for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else CHECKI(buf.st_size, 48 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); if (fd < 0) { perror("open"); r = 1; } else { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } unlink(data); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_carray_long.c0000640000175000017500000000322012614323564020616 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "c CARRAY UINT8 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/del_ref.c0000640000175000017500000000413212614323564016527 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n" "cata RAW UINT8 8\n" "/REFERENCE data\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, ret, e1, e2, r = 0; const char *ref1, *ref2; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); ref1 = gd_reference(D, NULL); CHECKS(ref1, "data"); ret = gd_delete(D, "data", 0); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); ref2 = gd_reference(D, NULL); CHECKS(ref2, "cata"); e2 = gd_discard(D); CHECKI(e2, 0); fd = unlink(data); unlink(format); rmdir(filedir); CHECKI(fd, 0); return r; } libgetdata-0.9.0/test/encode_alter_all.c0000640000175000017500000000423412614323564020406 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT16 8\n" "/ENCODING none\n" "/INCLUDE format1\n"; const char *format1_data = "data1 RAW UINT8 8\n/ENCODING sie\n"; int fd, ret, error, r = 0; unsigned long e0, e1, e2, e3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e0 = gd_encoding(D, 0); e1 = gd_encoding(D, 1); ret = gd_alter_encoding(D, GD_TEXT_ENCODED, GD_ALL_FRAGMENTS, 0); error = gd_error(D); e2 = gd_encoding(D, 0); e3 = gd_encoding(D, 1); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKU(e0, GD_UNENCODED); CHECKU(e1, GD_SIE_ENCODED); CHECKU(e2, GD_TEXT_ENCODED); CHECKU(e3, GD_TEXT_ENCODED); return r; } libgetdata-0.9.0/test/nfields_nfields.c0000640000175000017500000000407312614323564020263 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nfields(D); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 8); return r; } libgetdata-0.9.0/test/parse_meta_frag.c0000640000175000017500000000342312614323564020250 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "parent RAW UINT8 1\nINCLUDE format1\n"; const char *format1_data = "parent/child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error, GD_E_FORMAT); gd_discard(D); unlink(format); unlink(format1); rmdir(filedir); return r; } libgetdata-0.9.0/test/slim_nframes.c0000640000175000017500000000445512614323564017616 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_SLIM return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *slimdata = "dirfile/data.slm"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) { perror("command"); r = 1; } #ifdef USE_SLIM D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(slimdata); unlink(format); rmdir(filedir); #ifdef USE_SLIM CHECKI(error, 0); CHECKI(n,256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/repr_int16.c0000640000175000017500000000430012614323564017115 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n,8); for (i = 0; i < 8; ++i) if (c[i] != 40 + i) CHECKIi(i,c[i], 40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_lincom_23.c0000640000175000017500000000440012614323564020101 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 2 data 1 0 data 1 0\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; const char *in_fields[3] = {"data", "phase", "data"}; const double m[3] = {1, 2, 3}; const double b[3] = {3, 0, 1}; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_lincom(D, "lincom", 3, in_fields, m, b); error = gd_error(D); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (40 + i) * 6 + 6); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/alter_spec.c0000640000175000017500000000426712614323564017261 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; uint8_t d; int fd, i, ret, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "data RAW UINT8 11", 1); error = gd_error(D); n = gd_nframes(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint8_t))) { CHECKX(d, i * 8 / 11); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,32); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/sie_sync.c0000640000175000017500000000405512614323564016747 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; DIRFILE *D; int fd, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); n = gd_flush(D, "data"); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flac_get_far.c0000640000175000017500000000420712614323564017526 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); #ifdef USE_FLAC CHECKI(error, 0); #else CHECKI(error, GD_E_UNSUPPORTED); #endif CHECKI(n, 0); return r; #endif } libgetdata-0.9.0/test/entry_lincom.c0000640000175000017500000000414512614323564017635 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read LINCOM entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data LINCOM 3 in1 1 2 in2 3 4 in3 5 6\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_LINCOM_ENTRY); CHECKX(E.flags, GD_EN_CALC); CHECKI(E.EN(lincom,n_fields), 3); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); CHECKS(E.in_fields[2], "in3"); CHECKF(E.EN(lincom,m)[0], 1.); CHECKF(E.EN(lincom,b)[0], 2.); CHECKF(E.EN(lincom,m)[1], 3.); CHECKF(E.EN(lincom,b)[1], 4.); CHECKF(E.EN(lincom,m)[2], 5.); CHECKF(E.EN(lincom,b)[2], 6.); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/get_carray_len.c0000640000175000017500000000323112614323564020104 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read constant */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n"; int fd, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_array_len(D, "carray"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 7); return r; } libgetdata-0.9.0/test/flush_raw_close.c0000640000175000017500000000412212614323564020305 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); gd_raw_close(D, "data"); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_bit_scalar.c0000640000175000017500000000306712614323564020432 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST INT32 3\ndata BIT in1 const\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/lzma_xz_sync.c0000640000175000017500000000455312614323564017656 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_LZMA || !defined USE_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n, e1, e2, stat_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); n = gd_flush(D, "data"); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n, 0); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_xz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/parse_literal_intcmp0.c0000640000175000017500000000276312614323564021417 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data PHASE in1 1;0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_include_prefix_dup.c0000640000175000017500000000317212614323564022174 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 pre\npredata RAW UINT8 1\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, e, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); e = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(e, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_linterp.c0000640000175000017500000000304412614323564017777 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data LINTERP in1 lut\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/add_phase.c0000640000175000017500000000327012614323564017041 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a PHASE field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_PHASE_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(phase,shift), 3); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/put_foffs.c0000640000175000017500000000422512614323564017125 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 2\n"; uint8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 32 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 24 || i >= 32) { CHECKUi(i,d,0); } else CHECKUi(i,d,i+16); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_fs.c0000640000175000017500000000420212614323564016425 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 0, 8, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flist_invalid.c0000640000175000017500000000256212614323564017763 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_field_list(D); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_literal_fltcmp0.c0000640000175000017500000000303612614323564021404 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT64 1;0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error, GD_E_OK); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/madd_const.c0000640000175000017500000000356512614323564017253 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a CONST field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val = 3; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_const(D, "new", "data", GD_UINT8, GD_UINT8, &val); error = gd_error(D); /* check */ gd_entry(D, "new/data", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_get_constant(D, "new/data", GD_UINT8, &val); CHECKU(val, 3); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_int32_float64.c0000640000175000017500000000400712614323564021166 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/bzip_sync.c0000640000175000017500000000455212614323564017135 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_BZIP2 || !defined USE_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n, e1, e2, stat_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); n = gd_flush(D, "data"); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n, 0); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_bz2, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/protect_get.c0000640000175000017500000000356612614323564017460 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test protection */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nPROTECT format\n"; unsigned char data_data[256]; int fd, p, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); p = gd_protection(D, 0); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(p, GD_PROTECT_FORMAT); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/convert_int64_int8.c0000640000175000017500000000375712614323564020611 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_string.c0000640000175000017500000000321512614323564017275 0ustar alastairalastair/* Copyright (C) 2014, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING String\\ data\n"; int fd, n, error, r = 0; char s[1000]; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_string(D, "string", 1000, s); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 12); CHECKS(s, "String data"); return r; } libgetdata-0.9.0/test/parse_phase_scalar.c0000640000175000017500000000307112614323564020747 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST INT32 1\ndata PHASE in1 const\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/add_protect.c0000640000175000017500000000342712614323564017425 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nPROTECT all\n"; int fd, error, n, r = 0; DIRFILE *D; gd_entry_t E; E.field = "data2"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_add(D, &E); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 2); CHECKI(error, GD_E_PROTECTED); return r; } libgetdata-0.9.0/test/file_type.c0000640000175000017500000000360412614323564017112 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to get RAW filename */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data CONST UINT8 8\n"; unsigned char data_data[256]; int fd, error, r = 0; const char *path; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); path = gd_raw_filename(D, "data"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_FIELD_TYPE); CHECKP(path); return r; } libgetdata-0.9.0/test/tell_sub.c0000640000175000017500000000420512614323564016741 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data = "dirfile/sub/data"; const char *format_data = "/INCLUDE sub/format1\n"; const char *format1_data = "data RAW UINT8 8\nFRAMEOFFSET 6\n"; unsigned char data_data[256]; int fd, e1, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_tell(D, "data"); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 48); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_carray_len.c0000640000175000017500000000362412614323564020442 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY FLOAT32 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n"; int fd, i, ret, error, n, r = 0; size_t z; DIRFILE *D; double d[5]; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_carray(D, "carray", GD_NULL, 5); error = gd_error(D); z = gd_array_len(D, "carray"); n = gd_get_carray(D, "carray", GD_FLOAT64, &d); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKU(z, 5); for (i = 0; i < 5; ++i) CHECKFi(i, d[i], 8.3 - i * 1.1); return r; } libgetdata-0.9.0/test/bzip_get_get.c0000640000175000017500000000456612614323564017604 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_BZIP2 || !defined TEST_BZIP2 return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, e1, e2, n2, e3, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1); CHECKI(n1, 8); e1 = gd_error(D); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2); e3 = gd_error(D); CHECKI(e3, 0); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKIi(i,c1[i], 40 + i); CHECKIi(i,c2[i], 40 + i); } gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/seek_sub.c0000640000175000017500000000434112614323564016731 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data = "dirfile/sub/data"; const char *format_data = "/INCLUDE sub/format1\n"; const char *format1_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", 6, 0, GD_SEEK_SET); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(m, 48); n = gd_tell(D, "data"); e2 = gd_error(D); CHECKI(e2, 0); CHECKI(n, 48); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(subdir); rmdir(filedir); return r; } libgetdata-0.9.0/test/tok_arg.c0000640000175000017500000000267512614323564016567 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, r = 0; char *tok; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL); e1 = gd_error(D); tok = gd_strtok(D, NULL); e2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1,GD_E_OK); CHECKI(e2,GD_E_ARGUMENT); CHECKP(tok); return r; } libgetdata-0.9.0/test/ref_none.c0000640000175000017500000000410412614323564016721 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" ; const char *data1 = "dirfile/data1"; const char *data2 = "dirfile/data2"; uint8_t data_data[4] = { 0, 1, 2, 3 }; int fd, error, error2, r = 0; DIRFILE *D; off_t nf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 4); close(fd); fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error, 0); nf = gd_nframes(D); error2 = gd_error(D); CHECKI(error2, 0); CHECKI(nf,4); gd_discard(D); unlink(format); unlink(data1); unlink(data2); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint16_uint64.c0000640000175000017500000000401412614323564021225 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; uint64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/flac_put_big.c0000640000175000017500000000552412614323564017553 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_flac = "dirfile/data.flac"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; #ifdef USE_FLAC char command[4096]; uint16_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, unlink_flac, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 0x0101 * i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_FLAC D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_BIG_ENDIAN | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_BIG_ENDIAN); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_flac, &buf); #ifdef USE_FLAC CHECKI(e1, GD_E_OK); CHECKI(n, 8); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(stat_data, -1); #endif #ifdef USE_FLAC snprintf(command, 4096, "%s --silent --decode --delete-input-file " "--force-raw-format --sign=signed --endian=big %s --output-name=%s", FLAC, data_flac, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof d)) { if (i < 40 || i > 48) { CHECKXi(i, d, 0); } else CHECKXi(i, d, (i - 40) * 0x0101); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_flac = unlink(data_flac); CHECKI(unlink_flac, -1); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_FLAC CHECKI(unlink_data, 0); #else CHECKI(unlink_data, -1); #endif return r; #endif } libgetdata-0.9.0/test/table_type.c0000640000175000017500000000313112614323564017255 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 8\n"; int fd, error, r = 0; const char *path; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); path = gd_linterp_tablename(D, "data"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_FIELD_TYPE); CHECKP(path); return r; } libgetdata-0.9.0/test/madd_alias_affix.c0000640000175000017500000000425612614323564020371 0ustar alastairalastair/* Copyright (C) 2012, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format"; const char *data = "dirfile/data"; const char *target1, *target2; int e1, e2, e3, e4, e5, i, r = 0; unsigned int n; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_include_affix(D, "format1", 0, "A", "Z", GD_CREAT); gd_add_raw(D, "AdataZ", GD_UINT8, 1, 1); gd_madd_alias(D, "data", "AaliasZ", "AdataZ"); e1 = gd_error(D); gd_madd_alias(D, "AdataZ", "alias", "AdataZ"); e2 = gd_error(D); gd_madd_alias(D, "AdataZ", "AaliasZ", "data"); e3 = gd_error(D); gd_madd_alias(D, "AdataZ", "AaliasZ", "AdataZ"); e4 = gd_error(D); gd_add_alias(D, "AdataZ/alias2", "AdataZ", 1); e5 = gd_error(D); /* check */ target1 = gd_alias_target(D, "AdataZ/AaliasZ"); CHECKS(target1, "AdataZ"); target2 = gd_alias_target(D, "AdataZ/alias2"); CHECKS(target2, "AdataZ"); i = gd_fragment_index(D, "AdataZ/AaliasZ"); n = gd_naliases(D, "AdataZ/AaliasZ"); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(e1, GD_E_BAD_CODE); CHECKI(e2, GD_E_OK); CHECKI(e3, GD_E_BAD_CODE); CHECKI(e4, GD_E_OK); CHECKI(e5, GD_E_OK); CHECKI(i, 1); CHECKU(n, 4); return r; } libgetdata-0.9.0/test/parse_bit_bitnum.c0000640000175000017500000000302612614323564020456 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1 -1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/elist_hidden.c0000640000175000017500000000400412614323564017560 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "/HIDDEN data2\n" "data3 RAW UINT8 1\n"; int fd, i, error, r = 0; const char **entry_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); entry_list = gd_entry_list(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_HIDDEN); error = gd_error(D); CHECKI(error, 0); CHECKPN(entry_list); for (i = 0; ; ++i) { if (entry_list[i] == NULL) break; if (strcmp(entry_list[i], "data1") == 0) continue; else if (strcmp(entry_list[i], "data2") == 0) continue; else if (strcmp(entry_list[i], "data3") == 0) continue; else if (strcmp(entry_list[i], "INDEX") == 0) continue; fprintf(stderr, "entry_list[%i] = \"%s\"\n", i, entry_list[i]); r = 1; } CHECKI(i, 4); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int8_complex64.c0000640000175000017500000000426612614323564021462 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/del_data_enoent.c0000640000175000017500000000314712614323564020241 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n/ENCODING none\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_delete(D, "data", GD_DEL_DATA); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/parse_protect_all.c0000640000175000017500000000303312614323564020630 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "PROTECT all\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/name_updb_alias.c0000640000175000017500000000523112614323564020233 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "early PHASE cata 0\n" "earlya PHASE data 0\n" "/ALIAS aata cata\n" "/ALIAS bata data\n" "late PHASE cata 0\n" "latea PHASE data 0\n" "cata RAW UINT8 8\n" "/ALIAS data cata\n"; int fd, e0, e1, e2, e3, e4, e5, e6, r = 0; const char *s1, *s2, *s3, *s4, *s5, *s6; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_validate(D, "early"); gd_validate(D, "earlya"); gd_rename(D, "data", "zata", GD_REN_UPDB); e0 = gd_error(D); CHECKI(e0,0); gd_spf(D, "early"); e1 = gd_error(D); CHECKI(e1,0); gd_spf(D, "earlya"); e2 = gd_error(D); CHECKI(e2,0); gd_spf(D, "late"); e3 = gd_error(D); CHECKI(e3,0); gd_spf(D, "latea"); e4 = gd_error(D); CHECKI(e4,0); gd_entry(D, "early", &E); s1 = E.in_fields[0]; CHECKS(s1, "cata"); gd_free_entry_strings(&E); gd_entry(D, "earlya", &E); s2 = E.in_fields[0]; CHECKS(s2, "zata"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s3 = E.in_fields[0]; CHECKS(s3, "cata"); gd_free_entry_strings(&E); gd_entry(D, "latea", &E); s4 = E.in_fields[0]; CHECKS(s4, "zata"); gd_free_entry_strings(&E); gd_entry(D, "aata", &E); e5 = gd_error(D); s5 = gd_alias_target(D, "aata"); CHECKI(e5,0); CHECKS(s5, "cata"); gd_free_entry_strings(&E); gd_entry(D, "bata", &E); e6 = gd_error(D); s6 = gd_alias_target(D, "bata"); CHECKI(e6,0); CHECKS(s6, "zata"); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_2.c0000640000175000017500000000442712614323564017044 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 2 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/INCLUDE"; const char *format_data = "INCLUDE RAW c 8\n" "a&b RAW c 8\n" "m MULTIPLY INCLUDE INCLUDE\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "m", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],(40 + i) * (40 + i)); CHECKI(v,2); CHECKI(l,2); CHECKI(e,2); return r; } libgetdata-0.9.0/test/name_affix_bad.c0000640000175000017500000000325312614323564020035 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 8\n"; int fd, ret, e1, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_rename(D, "AdataZ", "zata", 0); e1 = gd_error(D); gd_discard(D); unlink(format); unlink(format1); rmdir(filedir); CHECKI(e1,GD_E_BAD_CODE); CHECKI(ret,-1); return r; } libgetdata-0.9.0/test/put_endian_complex64_arm.c0000640000175000017500000000446612614323564022027 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write arm-endian COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 1\nENDIAN little arm\n"; unsigned int i; #ifdef GD_NO_C99_API const float c[] = {1.5, 2.25}; #else const float complex c = 1.5 + _Complex_I * 2.25; #endif unsigned char x[2 * sizeof(float)] = { 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40 }; unsigned char u[2 * sizeof(float)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); #else n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, &c); #endif error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * 2 * sizeof(float), SEEK_SET); read(fd, u, 2 * sizeof(float)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < 2 * sizeof(float); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/parse_name_dot.c0000640000175000017500000000304012614323564020104 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "d.ta RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/vlist_meta_hidden.c0000640000175000017500000000412712614323564020615 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent data1 LINTERP UINT8 1\n" "META parent data2 LINTERP UINT8 1\n" "/HIDDEN parent/data2\n" "META parent data3 LINTERP UINT8 1\n" "META parent data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_mvector_list(D, "parent"); error = gd_error(D); CHECKI(error,0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i,len,5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] != '1' && field_list[i][4] != '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i,2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_endian_complex64_little.c0000640000175000017500000001337512614323564022513 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 1\nENDIAN little\n"; #ifdef GD_NO_C99_API float u[20]; float v[20][2]; #else float complex u[10]; float complex v[20]; #endif const unsigned char data_data[64 * 8] = { 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x58, 0x40, 0x00, 0x00, 0xA2, 0x40, 0x00, 0x00, 0xF3, 0x40, 0x00, 0x40, 0x36, 0x41, 0x00, 0xB0, 0x88, 0x41, 0x00, 0x08, 0xCD, 0x41, 0x00, 0xC6, 0x19, 0x42, 0x00, 0xA9, 0x66, 0x42, 0xC0, 0xFE, 0xAC, 0x42, 0x10, 0xBF, 0x01, 0x43, 0x98, 0x9E, 0x42, 0x43, 0xF2, 0xF6, 0x91, 0x43, 0x6B, 0xF2, 0xDA, 0x43, 0xD0, 0x35, 0x24, 0x44, 0xB8, 0x50, 0x76, 0x44, 0x8A, 0xBC, 0xB8, 0x44, 0x68, 0x8D, 0x0A, 0x45, 0x1C, 0xD4, 0x4F, 0x45, 0x15, 0xDF, 0x9B, 0x45, 0xA0, 0xCE, 0xE9, 0x45, 0xF8, 0x5A, 0x2F, 0x46, 0x3A, 0x84, 0x83, 0x46, 0x57, 0x46, 0xC5, 0x46, 0xC1, 0xF4, 0x13, 0x47, 0x22, 0xEF, 0x5D, 0x47, 0x5A, 0x73, 0xA6, 0x47, 0x07, 0xAD, 0xF9, 0x47, 0xC5, 0x41, 0x3B, 0x48, 0x54, 0x71, 0x8C, 0x48, 0xFE, 0xA9, 0xD2, 0x48, 0x7E, 0xFF, 0x1D, 0x49, 0x3D, 0xFF, 0x6C, 0x49, 0x6E, 0xBF, 0xB1, 0x49, 0x92, 0x4F, 0x05, 0x4A, 0x5B, 0xF7, 0x47, 0x4A, 0x84, 0xF9, 0x95, 0x4A, 0x46, 0xF6, 0xE0, 0x4A, 0xB4, 0xB8, 0x28, 0x4B, 0x0E, 0x15, 0x7D, 0x4B, 0xCA, 0xCF, 0xBD, 0x4B, 0xD8, 0x5B, 0x0E, 0x4C, 0xC4, 0x89, 0x55, 0x4C, 0x53, 0x27, 0xA0, 0x4C, 0xFC, 0x3A, 0xF0, 0x4C, 0x3D, 0x2C, 0x34, 0x4D, 0x2E, 0x21, 0x87, 0x4D, 0xC5, 0xB1, 0xCA, 0x4D, 0x54, 0x05, 0x18, 0x4E, 0xFE, 0x07, 0x64, 0x4E, 0xFE, 0x05, 0xAB, 0x4E, 0x7E, 0x44, 0x00, 0x4F, 0xBD, 0x66, 0x40, 0x4F, 0x0E, 0x4D, 0x90, 0x4F, 0x95, 0x73, 0xD8, 0x4F, 0xB0, 0x56, 0x22, 0x50, 0x08, 0x82, 0x73, 0x50, 0x86, 0xA1, 0xB6, 0x50, 0x24, 0xF9, 0x08, 0x51, 0xB6, 0x75, 0x4D, 0x51, 0x48, 0x18, 0x9A, 0x51, 0x6C, 0x24, 0xE7, 0x51, 0x51, 0x5B, 0x2D, 0x52, 0x7D, 0x04, 0x82, 0x52, 0xBC, 0x06, 0xC3, 0x52, 0x0D, 0x45, 0x12, 0x53, 0x94, 0x67, 0x5B, 0x53, 0xAF, 0x8D, 0xA4, 0x53, 0x86, 0xD4, 0xF6, 0x53, 0x64, 0x1F, 0x39, 0x54, 0x8B, 0xD7, 0x8A, 0x54, 0x50, 0x43, 0xD0, 0x54, 0x7C, 0x32, 0x1C, 0x55, 0xBA, 0x4B, 0x6A, 0x55, 0xCC, 0xB8, 0xAF, 0x55, 0x99, 0xCA, 0x03, 0x56, 0xE6, 0xAF, 0x45, 0x56, 0xEC, 0x43, 0x94, 0x56, 0xE2, 0x65, 0xDE, 0x56, 0x6A, 0xCC, 0x26, 0x57, 0x9F, 0x32, 0x7A, 0x57, 0xF7, 0xA5, 0xBB, 0x57, 0x79, 0xBC, 0x0C, 0x58, 0xB6, 0x1A, 0x53, 0x58, 0x08, 0x54, 0x9E, 0x58, 0x0C, 0x7E, 0xED, 0x58, 0x89, 0x1E, 0x32, 0x59, 0xE7, 0x96, 0x85, 0x59, 0x5A, 0x62, 0xC8, 0x59, 0xC4, 0x49, 0x16, 0x5A, 0xA6, 0x6E, 0x61, 0x5A, 0xFC, 0x12, 0xA9, 0x5A, 0x7A, 0x9C, 0xFD, 0x5A, 0x5C, 0x35, 0x3E, 0x5B, 0x05, 0xA8, 0x8E, 0x5B, 0x08, 0xFC, 0xD5, 0x5B, 0x06, 0x7D, 0x20, 0x5C, 0x89, 0xBB, 0x70, 0x5C, 0xA7, 0x8C, 0xB4, 0x5C, 0x7D, 0x69, 0x07, 0x5D, 0x3C, 0x1E, 0x4B, 0x5D, 0xAD, 0x56, 0x98, 0x5D, 0x04, 0x82, 0xE4, 0x5D, 0x83, 0x61, 0x2B, 0x5E, 0x22, 0x89, 0x80, 0x5E, 0xB3, 0xCD, 0xC0, 0x5E, 0x46, 0x9A, 0x10, 0x5F, 0x69, 0xE7, 0x58, 0x5F, 0x8F, 0xAD, 0xA2, 0x5F, 0x56, 0x04, 0xF4, 0x5F, 0x40, 0x03, 0x37, 0x60, 0x70, 0x42, 0x89, 0x60, 0xA8, 0xE3, 0xCD, 0x60, 0xBE, 0x6A, 0x1A, 0x61, 0x1D, 0xA0, 0x67, 0x61, 0x16, 0xB8, 0xAD, 0x61, 0x10, 0x4A, 0x02, 0x62, 0x18, 0x6F, 0x43, 0x62, 0x52, 0x93, 0x92, 0x62, 0xFB, 0xDC, 0xDB, 0x62, 0xBC, 0xE5, 0x24, 0x63, 0x9A, 0x58, 0x77, 0x63, 0x74, 0x82, 0xB9, 0x63, 0xD7, 0x21, 0x0B, 0x64, 0xC2, 0xB2, 0x50, 0x64, 0x12, 0x86, 0x9C, 0x64, 0x1B, 0xC9, 0xEA, 0x64 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); #ifdef GD_NO_C99_API v[0][0] = 1.5; v[0][1] = 2.25; for (i = 1; i < 20; ++i) { v[i][0] = v[i - 1][0] * 2.25; v[i][1] = v[i - 1][1] * 2.25; } #else v[0] = 1.5 + _Complex_I * 2.25; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 2.25; #endif fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * 8 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) #ifdef GD_NO_C99_API CHECKCi(i, u + 2 * i, v[i + 5]); #else CHECKCi(i, u[i], v[i + 5]); #endif return r; } libgetdata-0.9.0/test/add_raw_invalid.c0000640000175000017500000000251512614323564020241 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_raw(D, "data", GD_UINT8, 2, 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/put_endian64.c0000640000175000017500000000432512614323564017433 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT64 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint64_t c = 0x0203000000040001, d = 0; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT64 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT64, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); lseek(fd, 5 * sizeof(uint64_t), SEEK_SET); read(fd, &d, sizeof(uint64_t)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKX(d,0x0100040000000302); CHECKI(n,1); CHECKI(error,0); return r; } libgetdata-0.9.0/test/cvlist_array0.c0000640000175000017500000000323012614323564017707 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data4 RAW UINT8 1\n"; int fd, error, r = 0; gd_carray_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (gd_carray_t*)gd_carrays(D, GD_UINT8); error = gd_error(D); CHECKI(error, 0); CHECKU(field_list[0].n, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_raw_spf.c0000640000175000017500000000270312614323564017402 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_raw(D, "new", GD_UINT8, 0, 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,1); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/move_data_foffs.c0000640000175000017500000000466412614323564020263 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test move */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1\ndata RAW UINT8 11"; const char *format1_data = "FRAMEOFFSET 1\n"; uint8_t d, data_data[256]; int fd, i, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); ret = gd_move(D, "data", 1, GD_REN_DATA); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKUi(i,d,i + 11); i++; } close(fd); unlink(format1); unlink(format); unlink(data); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_uint64_float64.c0000640000175000017500000000401212614323564021354 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_divide.c0000640000175000017500000000304312614323564017565 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data DIVIDE in1 in2\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/convert_int16_int64.c0000640000175000017500000000377212614323564020665 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_linterp_noin.c0000640000175000017500000000353512614323564020474 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINTERP */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\n"; unsigned char c = 0; int fd, i, n, error, r = 0; DIRFILE *D; FILE *t; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); t = fopen(table, "wt"); for (i = 0; i < 10; ++i) fprintf(t, "%i %i\n", i * 6, i * 12); fclose(t); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(table); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/get_bad_code.c0000640000175000017500000000324112614323564017506 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read a non-existant field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "#\n"; unsigned char c = 0; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "no-such-field", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/legacy_spf.c0000640000175000017500000000317712614323564017253 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the samples-per-frame of a field via the legacy API should * succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skip */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 11\n"; int fd, error, r = 0; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); spf = GetSamplesPerFrame(filedir, "data", &error); unlink(format); rmdir(filedir); CHECKU(spf, 11); return r; #endif } libgetdata-0.9.0/test/put_phase.c0000640000175000017500000000426312614323564017124 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write PHASE */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "phase PHASE data -2\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "phase", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 46 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 38 || i > 46) { CHECKIi(i,d,0); } else CHECKIi(i,d,i + 2); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_6.c0000640000175000017500000000446412614323564017051 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 6 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/a#r"; const char *format_data = "/VERSION 6\na\\#r RAW UINT8 8\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "a#r", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); /* Version 6 is forward compatible with versions 7 and 8 */ CHECKI(v,6); CHECKI(l,GD_DIRFILE_STANDARDS_VERSION); CHECKI(e,6); return r; } libgetdata-0.9.0/test/gzip_get_far.c0000640000175000017500000000416612614323564017576 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; #ifdef USE_GZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(error, 0); #else CHECKI(error, GD_E_UNSUPPORTED); #endif CHECKI(n, 0); return r; #endif } libgetdata-0.9.0/test/convert_uint32_int8.c0000640000175000017500000000376312614323564020766 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/put_endian_complex128_big.c0000640000175000017500000000455612614323564022072 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write big-endian COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\nENDIAN big\n"; unsigned int i; #ifdef GD_NO_C99_API const double c[] = {1.5, 2.25}; #else const double complex c = 1.5 + _Complex_I * 2.25; #endif unsigned char x[2 * sizeof(double)] = { 0x3F, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; unsigned char u[2 * sizeof(double)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); #else n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c); #endif error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * 2 * sizeof(double), SEEK_SET); read(fd, u, 2 * sizeof(double)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < 2 * sizeof(double); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/put_nofile.c0000640000175000017500000000454612614323564017304 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_RESOURCE_H #include #endif #define GD_RLIM 20 int main(void) { #if ! defined HAVE_SETRLIMIT return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_fmt = "dirfile/ent%04i"; struct rlimit rlim = { GD_RLIM, GD_RLIM }; int i, e1, e2, e3, r = 0; const uint8_t data[8] = {1,2,3,4,5,6,7,8}; char name[16]; if (setrlimit(RLIMIT_NOFILE, &rlim)) { perror("setrlimit"); return 77; } DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_CREAT | GD_UNENCODED | GD_RDWR); /* now add a bunch of files */ for (i = 0; i < GD_RLIM; ++i) { sprintf(name, "ent%04i", i); gd_add_raw(D, name, GD_UINT8, 1, 0); e1 = gd_error(D); CHECKIi(i,e1,GD_E_OK); } gd_flush(D, NULL); /* now try writing; this will pile up file descriptors */ for (i = 0; i < GD_RLIM; ++i) { sprintf(name, "ent%04i", i); gd_putdata(D, name, 0, 0, 0, 8, GD_UINT8, data); e2 = gd_error(D); if (e2 == GD_E_RAW_IO) { /* closing everything and try again -- should work now */ gd_raw_close(D, NULL); gd_putdata(D, name, 0, 0, 0, 8, GD_UINT8, data); e3 = gd_error(D); CHECKIi(i,e3,GD_E_OK); } else { CHECKIi(i,e2,GD_E_OK); } } gd_discard(D); for (i = 0; i < GD_RLIM; ++i) { sprintf(name, data_fmt, i); unlink(name); } unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/convert_complex64_uint64.c0000640000175000017500000000362612614323564021730 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX64 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT64 0\n"; uint64_t c = 0; #ifdef GD_NO_C99_API float d[] = {8, 0}; #else float complex d = 8; #endif int fd, error, n1, n2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); #ifdef GD_NO_C99_API n1 = gd_put_constant(D, "data", GD_COMPLEX64, d); #else n1 = gd_put_constant(D, "data", GD_COMPLEX64, &d); #endif n2 = gd_get_constant(D, "data", GD_UINT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKU(c, 8); return r; } libgetdata-0.9.0/test/add_raw_include.c0000640000175000017500000000360212614323564020234 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; gd_entry_t e; int frag, error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_UNENCODED | GD_VERBOSE); frag = gd_include(D, "format1", 0, GD_CREAT); gd_add_raw(D, "data", GD_UINT8, 2, frag); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 1); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); if (unlink(data)) r = 1; unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/ascii_get_sub.c0000640000175000017500000000426712614323564017740 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data = "dirfile/sub/data.txt"; const char *format1_data = "data RAW UINT8 8\n"; const char *format_data = "/INCLUDE sub/format1\n"; unsigned char c[8]; int fd, i, n, error, r = 0; DIRFILE *D; FILE* stream; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(subdir); rmdir(filedir); return r; } libgetdata-0.9.0/test/nentries_noalias.c0000640000175000017500000000373312614323564020472 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/ALIAS raw0 raw1\n" "/ALIAS raw1/const2 raw1/const\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nentries(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_NOALIAS); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 8); return r; } libgetdata-0.9.0/test/name_name.c0000640000175000017500000000660712614323564017060 0ustar alastairalastair/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *zata = "dirfile/zata"; const char *format_data = "early MULTIPLY data data\n" "/ALIAS earlya data\n" "late PHASE data 0\n" "/ALIAS latea data\n" "cata RAW UINT8 8\n" "data RAW UINT8 8\n" "eata RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e1, e2, e3, e4, e5, e6, unlink_data, unlink_zata, r = 0; const char **fl; #define NFIELDS 8 const char *field_list[NFIELDS] = { "INDEX", "cata", "early", "earlya", "eata", "late", "latea", "zata" }; char *s1, *s2, *s5; const char *s3, *s4, *s6; unsigned nf, i; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); /* force-resolve the early entries */ gd_validate(D, "early"); gd_validate(D, "earlya"); ret = gd_rename(D, "data", "zata", 0); e1 = gd_error(D); CHECKI(ret,0); CHECKI(e1,0); gd_spf(D, "early"); e2 = gd_error(D); CHECKI(e2,GD_E_BAD_CODE); gd_spf(D, "late"); e3 = gd_error(D); CHECKI(e3,GD_E_BAD_CODE); nf = gd_nfields(D); CHECKI(nf, NFIELDS); if (nf > NFIELDS) nf = NFIELDS; fl = gd_field_list(D); for (i = 0; i < nf; ++i) CHECKSi(i, fl[i], field_list[i]); gd_entry(D, "early", &E); s1 = E.in_fields[0]; CHECKS(s1, "data"); gd_free_entry_strings(&E); gd_entry(D, "earlya", &E); e4 = gd_error(D); s2 = E.field; s3 = gd_alias_target(D, "earlya"); CHECKI(e4,0); CHECKS(s2, "zata"); CHECKS(s3, "zata"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s4 = E.in_fields[0]; CHECKS(s4, "data"); gd_free_entry_strings(&E); gd_entry(D, "latea", &E); e5 = gd_error(D); s5 = E.field; s6 = gd_alias_target(D, "earlya"); CHECKI(e5,0); CHECKS(s5, "zata"); CHECKS(s6, "zata"); gd_free_entry_strings(&E); e6 = gd_close(D); CHECKI(e6, 0); unlink_data = unlink(data); unlink_zata = unlink(zata); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); CHECKI(unlink_zata, -1); return r; } libgetdata-0.9.0/test/parse_bit4.c0000640000175000017500000000304012614323564017160 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1 3 4\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/version_9_strict.c0000640000175000017500000000647012614323564020443 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int cb(gd_parser_data_t *pdata, void *ll) { ((int*)ll)[pdata->linenum - 1] = 1; return GD_SYNTAX_IGNORE; } #define NLINES 18 int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 8\n" /* 0 */ "/INCLUDE format1\n" /* 1 */ "w WINDOW INDEX INDEX SET 0x1\n"; /* 2 */ const char *format1_data = "\n\n\n" "/VERSION 9\n" /* 3 */ "/INCLUDE format2 A Z\n" /* 4 */ "/INCLUDE format2 A.Z\n" /* 5 */ "Xr RAW COMPLEX128 0xA\n" /* 6 */ "Xy POLYNOM INDEX 8 055 0xAE 2\n" /* 7 */ "ar WINDOW AdZ INDEX SET 0x1\n" /* 8 */ "AINDEXZ PHASE INDEX 0\n" /* 9 */ "/HIDDEN Xy\n"; /* 10 */ const char *format2_data = "\n\n\n" "\n\n\n\n\n\n\n\n" "c RAW UINT8 1\n" /* 11 */ "/HIDDEN c\n" /* 12 */ "/REFERENCE c\n" /* 13 */ "/VERSION 8\n" /* 14 */ "d PHASE INDEX 0\n" /* 15 */ "d/c CONST FLOAT64 1\n" /* 16 */ "/META d d CONST FLOAT64 1\n"; /* 17 */ uint16_t c[8]; int ll[NLINES]; unsigned char data_data[256]; int fd, i, n, v, error, r = 0; DIRFILE *D; memset(c, 0, 16); memset(ll, 0, NLINES * sizeof(int)); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_cbopen(filedir, GD_RDONLY | GD_PEDANTIC, cb, ll); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); CHECKI(v,GD_DIRFILE_STANDARDS_VERSION); n = gd_getdata(D, "ar", 4, 0, 8, 0, GD_UINT16, c); gd_discard(D); unlink(data); unlink(format); unlink(format1); unlink(format2); rmdir(filedir); CHECKI(error,0); for (i = 0; i < NLINES; ++i) { if (i == 2 || i == 5) { CHECKIi(i,ll[i], 1); } else { CHECKIi(i,ll[i],0); } } CHECKI(n,8); for (i = 0; i < n; ++i) CHECKUi(i,c[i], (i & 1) ? 4 + i : 0); return r; } libgetdata-0.9.0/test/get_lincom2s.c0000640000175000017500000000364312614323564017522 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM data 1 0 phase 1 0\n" "phase PHASE data 128\n" "data RAW UINT8 1\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 0, 0, 1000, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 128); return r; } libgetdata-0.9.0/test/add_spec_resolv.c0000640000175000017500000000307312614323564020266 0ustar alastairalastair/* Copyright (C) 2011, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, i, r = 0; unsigned int n; DIRFILE *D; const char *target; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_alias(D, "alias", "data", 0); gd_add_spec(D, "data RAW UINT8 1", 0); error = gd_error(D); /* check */ target = gd_alias_target(D, "alias"); CHECKS(target, "data"); i = gd_fragment_index(D, "alias"); n = gd_naliases(D, "alias"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(i, 0); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/del_meta.c0000640000175000017500000000347412614323564016711 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n" "META data e CONST UINT8 1\n" "META data q CONST UINT8 2\n" "META data a CONST UINT8 3\n" "META data b CONST UINT8 4\n" "META data z CONST UINT8 5\n" "META data l CONST UINT8 6\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DELETE); CHECKI(ret, -1); return r; } libgetdata-0.9.0/test/elist_alias.c0000640000175000017500000000375412614323564017431 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "/ALIAS data2 data1\n" "/ALIAS data3 data4\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_entry_list(D, NULL, GD_ALIAS_ENTRIES, 0); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; ; ++i) { if (field_list[i] == NULL) break; if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "data2") == 0) continue; fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } CHECKI(i, 2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint8_float64.c0000640000175000017500000000400612614323564021275 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; double c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/open_sym_ct.c0000640000175000017500000000301612614323564017446 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile/link/"; const char *format = "dirfile/format"; const char *targ = "."; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ symlink(targ, "dirfile/link"); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; #endif } libgetdata-0.9.0/test/repr_uint64.c0000640000175000017500000000424712614323564017317 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif uint64_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_index.c0000640000175000017500000000303012614323564017424 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "INDEX RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/version_8_strict.c0000640000175000017500000000474212614323564020442 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int cb(gd_parser_data_t *pdata, void *ll) { ((int*)ll)[pdata->linenum - 1] = 1; return GD_SYNTAX_IGNORE; } #define NLINES 13 int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 8\n" "X #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM data 1 0 data 1 0 phase 1 0\n" "phase PHASE data 128\n" "data RAW UINT8 1\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 0, 0, 1000, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 128); return r; } libgetdata-0.9.0/test/bzip_put_sub.c0000640000175000017500000000562212614323564017641 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if ! (defined TEST_BZIP2) || ! (defined USE_BZIP2) return 77; #else const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data_bz2 = "dirfile/sub/data.bz2"; const char *data = "dirfile/sub/data"; const char *format_data = "/INCLUDE sub/format1\n"; const char *format1_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_bz2, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/parse_version_89.c0000640000175000017500000000335012614323564020327 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test version leakage */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 8\n" "/INCLUDE format1\n" "r WINDOW a b EQ 1.\n"; const char *format1_data = "/VERSION 9\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/name_move.c0000640000175000017500000000435512614323564017104 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *zata = "dirfile/zata"; const char *format_data = "cata RAW UINT8 8\ndata RAW UINT8 8\n" "eata RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e1, e2, unlink_data, unlink_zata, r = 0; const char **fl; #define NFIELDS 4 const char *field_list[NFIELDS] = { "INDEX", "cata", "eata", "zata" }; unsigned i, nf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_rename(D, "data", "zata", GD_REN_DATA); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(ret, 0); nf = gd_nfields(D); CHECKI(nf, NFIELDS); if (nf > NFIELDS) nf = NFIELDS; fl = gd_field_list(D); for (i = 0; i < nf; ++i) CHECKSi(i, fl[i], field_list[i]); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); unlink_zata = unlink(zata); unlink(format); rmdir(filedir); CHECKI(unlink_data, -1); CHECKI(unlink_zata, 0); return r; } libgetdata-0.9.0/test/svlist2.c0000640000175000017500000000433612614323564016543 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 STRING valu1\n" "data2 STRING valu2\n" "data3 STRING valu3\n" "data4 CONST UINT8 1\n"; int fd, z, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); for (z = 0; z < 2; ++z) { field_list = gd_strings(D); error = gd_error(D); CHECKIi(z, error, 0); CHECKPNi(z, field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i * 2 + z,len,5); CHECKIi(i * 2 + z,field_list[i][0], 'v'); CHECKIi(i * 2 + z,field_list[i][1], 'a'); CHECKIi(i * 2 + z,field_list[i][2], 'l'); CHECKIi(i * 2 + z,field_list[i][3], 'u'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i@%i] = \"%s\"\n", i, z, field_list[i]); r = 1; } } CHECKIi(z, i,3); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flush_string.c0000640000175000017500000000306112614323564017636 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #define S "a\"b\\c#d e\tf\ng" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e0, r = 0; char s[100] = {0}; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC | GD_VERBOSE); gd_add_string(D, "s", S, 0); e0 = gd_close(D); CHECKI(e0, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_get_string(D, "s", 100, s); e1 = gd_error(D); CHECKI(e1, GD_E_OK); gd_discard(D); CHECKS(s, S); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alias_target_alias.c0000640000175000017500000000274512614323564020747 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS alias target\n/ALIAS target next\n"; int fd, e, r = 0; DIRFILE *D; const char *t; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); t = gd_alias_target(D, "alias"); CHECKS(t, "target"); e = gd_error(D); CHECKI(e, GD_E_OK); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_8.c0000640000175000017500000000447012614323564017050 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 8 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 8\n" "ar RAW UINT8 8\n" "FRAMEOFFSET DIVIDE ar ar\n" "r RECIP ar 1.\n"; double c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "r", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],1. / (40 + i)); CHECKI(v,8); CHECKI(l,GD_DIRFILE_STANDARDS_VERSION); CHECKI(e,8); return r; } libgetdata-0.9.0/test/lzma_xz_get_get.c0000640000175000017500000000454112614323564020315 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_LZMA || !defined TEST_LZMA return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, e1, e2, n2, e3, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1); CHECKI(n1, 8); e1 = gd_error(D); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2); e3 = gd_error(D); CHECKI(e3, 0); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKIi(i,c1[i], 40 + i); CHECKIi(i,c2[i], 40 + i); } gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/parse_const.c0000640000175000017500000000304312614323564017447 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/global_ref_empty.c0000640000175000017500000000322712614323564020445 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Global metadata check */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 1\n"; int fd, error, r = 0; const char *ref; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); ref = gd_reference(D, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKP(ref); return r; } libgetdata-0.9.0/test/put_endian32.c0000640000175000017500000000430312614323564017422 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT32 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint32_t c = 0x2000001, d = 0; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT32 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT32, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); lseek(fd, 5 * sizeof(uint32_t), SEEK_SET); read(fd, &d, sizeof(uint32_t)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,1); CHECKX(d,0x1000002); return r; } libgetdata-0.9.0/test/get_invalid.c0000640000175000017500000000260412614323564017416 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; char c[8]; int error, r = 0; size_t n; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); CHECKI(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_bit_bitsize.c0000640000175000017500000000303012614323564020624 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1 63 2\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/name_updb_const_alias.c0000640000175000017500000000401012614323564021433 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "early RAW UINT8 c\n" "late RAW UINT8 c\n" "/ALIAS b c\n" "e CONST UINT8 2\n" "/ALIAS c e\n"; int fd, e1, e2, e3, e4, r = 0; const char *s1, *s2, *s3; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_validate(D, "early"); gd_rename(D, "c", "d", GD_REN_UPDB); e1 = gd_error(D); CHECKI(e1,0); gd_spf(D, "early"); e2 = gd_error(D); CHECKI(e2,0); gd_spf(D, "late"); e3 = gd_error(D); CHECKI(e3,0); gd_entry(D, "early", &E); s1 = E.scalar[0]; CHECKS(s1, "d"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s2 = E.scalar[0]; CHECKS(s2, "d"); gd_free_entry_strings(&E); gd_entry(D, "b", &E); e4 = gd_error(D); s3 = gd_alias_target(D, "b"); CHECKI(e4,0); CHECKS(s3, "d"); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/sie_put_newo0.c0000640000175000017500000000421712614323564017713 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; uint8_t check[9]; uint8_t c[6], d[16]; DIRFILE *D; int fd, i, j, n1, n2, n3, e1, e2, e3, r = 0; rmdirfile(); for (i = 0; i < 6; ++i) c[i] = i; D = gd_open(filedir, GD_RDWR | GD_SIE_ENCODED | GD_CREAT | GD_LITTLE_ENDIAN | GD_VERBOSE); n1 = gd_add_raw(D, "data", GD_UINT8, 20, 0); e1 = gd_error(D); CHECKI(n1, 0); CHECKI(e1, 0); n2 = gd_putdata(D, "data", 0, 10, 0, 6, GD_UINT8, c); e2 = gd_error(D); CHECKI(n2, 6); CHECKI(e2, 0); gd_close(D); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n3 = gd_getdata(D, "data", 0, 0, 0, 16, GD_UINT8, d); e3 = gd_error(D); CHECKI(n3, 16); CHECKI(e3, 0); for (i = 0; i < 16; ++i) if (i < 10) CHECKIi(i, d[i], 0); else CHECKIi(i, d[i], c[i - 10]); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); j = 0; while (read(fd, check, 9) == 9) { CHECKIi(j * 10 + 0, check[0], 10 + j); for (i = 1; i < 8; ++i) CHECKIi(j * 10 + i, check[i], 0); CHECKIi(j * 10 + 8, check[8], j); j++; } CHECKI(j, 6); close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_window_le.c0000640000175000017500000000401512614323564017755 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data LE 44\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i <= 4) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/dfes_divide.c0000640000175000017500000000302712614323564017376 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data DIVIDE e b\n"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/put_complex64.c0000640000175000017500000000516712614323564017651 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 8\n"; #ifdef GD_NO_C99_API float c[8][2], d[2]; const float zero[] = {0, 0}; #else float complex c[8], d; const float complex zero = 0; #endif struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API c[i][0] = 40 + i; c[i][1] = i; #else c[i] = 40 + i * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); e1 = gd_error(D); CHECKI(e1,0); CHECKI(n,8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * 2 * sizeof(float)); fd = open(data, O_RDONLY | O_BINARY); i = 0; #ifdef GD_NO_C99_API while (read(fd, d, 2 * sizeof(float))) #else while (read(fd, &d, sizeof(float complex))) #endif { if (i < 40 || i > 48) { CHECKCi(i,d,zero); } else { #ifdef GD_NO_C99_API float v[] = {i, i - 40}; #else float complex v = i + _Complex_I * (i - 40); #endif CHECKCi(i,d,v); } i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint16_float64.c0000640000175000017500000000402412614323564021354 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_version_p9.c0000640000175000017500000000334012614323564020416 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test version leakage */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/ar"; const char *format_data = "/INCLUDE format1\n" "r.d WINDOW a b EQ 1.\n"; const char *format1_data = "/VERSION 9\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/trunc_rofs.c0000640000175000017500000000340212614323564017312 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Truncating a read-only dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); close(open(data, O_CREAT | O_EXCL | O_WRONLY, 0666)); chmod(filedir, 0555); /* ensure filesystem honours read-onlyness */ if (!unlink(data) || errno != EACCES) { unlink(format); rmdir(filedir); return 77; } D = gd_open(filedir, GD_RDWR | GD_TRUNC); error = gd_error(D); gd_discard(D); chmod(filedir, 0777); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_TRUNC); return r; } libgetdata-0.9.0/test/madd_clincom.c0000640000175000017500000000462312614323564017545 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINCOM field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; const char *in_fields[2] = {"in1", "in2"}; #ifdef GD_NO_C99_API const double m[2][2] = {{1, 3.3}, {0.3, 18.3}}; const double b[2][2] = {{2, 3.8}, {2.1, 9.8}}; #else const double complex m[2] = {1 + _Complex_I * 3.3, 0.3 + _Complex_I * 18.3}; const double complex b[2] = {2 + _Complex_I * 3.8, 2.1 + _Complex_I * 9.8}; #endif DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); #ifdef GD_NO_C99_API gd_madd_clincom(D, "new", "meta", 2, in_fields, (double*)m, (double*)b); #else gd_madd_clincom(D, "new", "meta", 2, in_fields, m, b); #endif error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields), 2); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKC(e.EN(lincom,cm)[0], m[0]); CHECKC(e.EN(lincom,cm)[1], m[1]); CHECKC(e.EN(lincom,cb)[0], b[0]); CHECKC(e.EN(lincom,cb)[1], b[1]); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/entry_type_alias.c0000640000175000017500000000277212614323564020512 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n" "/ALIAS alias data\n"; int fd, error, r = 0; gd_entype_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry_type(D, "alias"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, GD_RAW_ENTRY); return r; } libgetdata-0.9.0/test/convert_int64_uint16.c0000640000175000017500000000376412614323564021053 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; uint16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_int16_float32.c0000640000175000017500000000401712614323564021164 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/native_lincom.c0000640000175000017500000000277312614323564017767 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM data 1 0\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "lincom"); error = gd_error(D); CHECKU(type, GD_FLOAT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/open_rofs.c0000640000175000017500000000357412614323564017132 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Truncating a read-only dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "/INCLUDE format1\n"; int error, fd, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0444); write(fd, format_data, strlen(format_data)); close(fd); close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0444)); chmod(filedir, 0555); /* ensure filesystem honours read-onlyness */ if (!unlink(format1) || errno != EACCES) { unlink(format); rmdir(filedir); return 77; } D = gd_open(filedir, GD_RDWR | GD_VERBOSE); error = gd_error(D); gd_discard(D); chmod(filedir, 0777); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/put_clincom1.c0000640000175000017500000000503712614323564017531 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 1 data 1;1 0;-1\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, q, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (q = 0; q < 8; ++q) c[q] = (int8_t)(39 + q * 2); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n,8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); q = 0; while (read(fd, &d, sizeof(int8_t))) { if (q < 40 || q > 48) { CHECKIi(q,d,0); } else { /* if: * L = (1+i) D - i * then: * D = (L + i) * (1 / (1+i)) * = (L + i) * ((1-i) / 2) * = [ (L + 1) + (1 - L) i ] / 2 * so: * Re(D) = (L + 1) / 2 * and, if: * L = 39 + 2 (q - 40), * then: * Re(D) = (40 + 2(q-40)) / 2 = 20 + q - 40 = q - 20 */ CHECKIi(q,d,q - 20); } q++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/bzip_put_back.c0000640000175000017500000000511312614323564017743 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if ! (defined TEST_BZIP2) || ! (defined USE_BZIP2) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_bz2, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/alter_entry_lincom.c0000640000175000017500000000424712614323564021027 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM a 1 2\n"; int fd, ret, error, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "lincom", &E); E.EN(lincom,n_fields) = 2; E.EN(lincom,m[0]) = 3; E.EN(lincom,b[0]) = 4; E.EN(lincom,m[1]) = 5; E.EN(lincom,b[1]) = 6; E.in_fields[1] = "b"; ret = gd_alter_entry(D, "lincom", &E, 0); error = gd_error(D); E.in_fields[1] = NULL; gd_free_entry_strings(&E); memset(&E, 0, sizeof(E)); gd_entry(D, "lincom", &E); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKS(E.in_fields[0], "a"); CHECKS(E.in_fields[1], "b"); CHECKI(E.EN(lincom,n_fields), 2); CHECKF(E.EN(lincom,m[0]), 3); CHECKF(E.EN(lincom,b[0]), 4); CHECKF(E.EN(lincom,m[1]), 5); CHECKF(E.EN(lincom,b[1]), 6); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/put_recurse.c0000640000175000017500000000335212614323564017472 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempting to resove a recursively defined field should fail cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in1 RAW UINT8 11\n" "lincom LINCOM 1 lincom 1 0\n"; unsigned char c[8]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_RECURSE_LEVEL); return r; } libgetdata-0.9.0/test/get_polynom_cmpin.c0000640000175000017500000000434412614323564020656 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3 2 1\n" "data RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, fd, n, error, r = 0; DIRFILE *D; memset(c, 0, sizeof(double) * 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { data_data[2 * fd] = (double)fd; data_data[2 * fd + 1] = fd / 256.; } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "polynom", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { const double a = 5. + i; /* Re(data) */ const double b = a / 256.; /* Im(data) */ CHECKFi(i, c[i * 2], 3 + 2 * a + a * a - b * b); CHECKFi(i, c[i * 2 + 1], 2 * b + 2 * a * b); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_float32_uint16.c0000640000175000017500000000377312614323564021361 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; uint16_t c[8], i; int fd, error, n, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_carray.c0000640000175000017500000000336112614323564017252 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read constant */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n"; double c[7]; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_carray(D, "carray", GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); for (i = 0; i < 7; ++i) CHECKFi(i, c[i], 8.3 - i * 1.1); return r; } libgetdata-0.9.0/test/move_affix.c0000640000175000017500000000411512614323564017253 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "INCLUDE format1 A B\n" "INCLUDE format2 C D\n"; const char *format1_data = "data RAW UINT8 11\n"; const char *format2_data = "#\n"; int fd, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "AdataB", 2, 0); error = gd_error(D); ge_ret = gd_entry(D, "CdataD", &E); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 2); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_uint32_float32.c0000640000175000017500000000401112614323564021341 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_name_ext.c0000640000175000017500000000306212614323564020122 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data.txt RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); return r; } libgetdata-0.9.0/test/bzip_add.c0000640000175000017500000000366512614323564016715 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.bz2"; gd_entry_t e; int e1, e2, e3, unlink_data, r = 0; DIRFILE *D; rmdirfile(); #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_BZIP2_ENCODED); #else D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_BZIP2_ENCODED); #endif gd_add_raw(D, "data", GD_UINT8, 2, 0); e1 = gd_error(D); /* check */ e2 = gd_entry(D, "data", &e); #ifdef USE_BZIP2 CHECKI(e2, 0); if (e2 == 0) { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } #else CHECKI(e2, -1); #endif e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); #ifdef USE_BZIP2 CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); #endif unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/alter_mspec.c0000640000175000017500000000414212614323564017426 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nMETA data phase PHASE data 1\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_malter_spec(D, "phase PHASE data 2", "data", 0); error = gd_error(D); n = gd_getdata(D, "data/phase", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i + 42); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/convert_uint16_complex128.c0000640000175000017500000000433012614323564021777 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/entry_mplex.c0000640000175000017500000000327512614323564017504 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MPLEX in1 in2 1 2\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_MPLEX_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); CHECKI(E.EN(mplex,count_val), 1); CHECKI(E.EN(mplex,period), 2); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_int32_int16.c0000640000175000017500000000376212614323564020657 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_meta_index.c0000640000175000017500000000306212614323564020437 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "META INDEX child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/parse_foffs_include.c0000640000175000017500000000532012614323564021127 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "FRAMEOFFSET 1\nINCLUDE format1\nINCLUDE format2"; const char *data1 = "dirfile/data1"; const char *format1 = "dirfile/format1"; const char *format1_data = "data1 RAW UINT8 1\n"; const char *data2 = "dirfile/data2"; const char *format2 = "dirfile/format2"; const char *format2_data = "data2 RAW UINT8 1\nFRAMEOFFSET 2"; int fd, error, error2, error3, r = 0; uint8_t data_data[4] = { 0, 1, 2, 3 }; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 4); close(fd); fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 4); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error, 0); gd_getdata(D, "data1", 3, 0, 1, 0, GD_UINT8, data_data); error2 = gd_error(D); CHECKI(error2, 0); CHECKU(data_data[0], 2); gd_getdata(D, "data2", 3, 0, 1, 0, GD_UINT8, data_data); error3 = gd_error(D); CHECKI(error3, 0); CHECKU(data_data[0], 1); gd_discard(D); unlink(format); unlink(format1); unlink(format2); unlink(data1); unlink(data2); rmdir(filedir); return r; } libgetdata-0.9.0/test/eof_lincom.c0000640000175000017500000000421012614323564017236 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *data2 = "dirfile/data2"; const char *format_data = "data RAW UINT16 1\n" "data2 RAW UINT8 1\n" "lincom LINCOM 2 data2 1. 0. data 1. 0.\n" "lincom2 LINCOM 2 data 1. 0. data2 1. 0.\n"; int fd, error, error2, r = 0; const size_t len = strlen(data); off_t n, m; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_eof(D, "lincom"); error = gd_error(D); m = gd_eof(D, "lincom"); error2 = gd_error(D); gd_discard(D); unlink(data2); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, (int)len / 2); CHECKI(error2, 0); CHECKI(m, (int)len / 2); return r; } libgetdata-0.9.0/test/parse_include_relabs.c0000640000175000017500000000457012614323564021302 0ustar alastairalastair/* Copyright (C) 2011-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #if defined GD_NO_GETCWD return 77; #else const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *format2 = "dirfile/sub/format2"; const char *format_data = "INCLUDE sub/format1\n"; const char *format1_data1 = "INCLUDE "; const char *format1_data2 = "/dirfile/sub/format2\n"; const char *format2_data = "data RAW UINT8 11\n"; int cwd_size = 2048; char *ptr, *cwd = NULL; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); gdtest_getcwd(ptr, cwd, cwd_size); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data1, strlen(format1_data1)); gd_pathwrite(fd, cwd); write(fd, format1_data2, strlen(format1_data2)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); CHECKU(spf, 11); free(cwd); return r; #endif } libgetdata-0.9.0/test/spf_alias_meta.c0000640000175000017500000000301112614323564020071 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 11\n" "data/sub PHASE data 0\n" "/ALIAS alias data\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "alias/sub"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/eof.c0000640000175000017500000000341512614323564015703 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 1\n"; int fd, error, r = 0; off_t n; const size_t len = strlen(data); DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_eof(D, "data"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI((int)n, (int)len / 2); return r; } libgetdata-0.9.0/test/add_amb_code7.c0000640000175000017500000000272612614323564017566 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, r = 0; DIRFILE *D; gd_entry_t E; memset(&E, 0, sizeof(E)); E.field = "pathological"; E.field_type = GD_PHASE_ENTRY; E.in_fields[0] = "INDEX"; /* this is a valid field code, sadly */ E.scalar[0] = "1"; E.scalar_ind[0] = -1; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC); gd_dirfile_standards(D, 7); gd_add(D, &E); e1 = gd_error(D); CHECKI(e1, GD_E_BAD_CODE); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/include_ignore.c0000640000175000017500000000405012614323564020114 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data1 RAW UINT8 1\n"; const char *format1_data = "data RAW UINT8 11\nREFERENCE data\n"; int fd, error1, error2, r = 0; const char *reference; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include(D, "format1", 0, GD_IGNORE_REFS | GD_VERBOSE); error1 = gd_error(D); reference = gd_reference(D, NULL); CHECKS(reference, "data1"); CHECKI(error1, 0); error2 = gd_error(D); spf = gd_spf(D, "data"); CHECKI(error2, 0); CHECKU(spf, 11); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_alias_affix.c0000640000175000017500000000354512614323564020214 0ustar alastairalastair/* Copyright (C) 2012, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format"; const char *data = "dirfile/data"; const char *target; int e1, e2, e3, i, r = 0; unsigned int n; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_include_affix(D, "format1", 0, "A", "Z", GD_CREAT); gd_add_raw(D, "AdataZ", GD_UINT8, 1, 1); gd_add_alias(D, "alias", "AdataZ", 1); e1 = gd_error(D); gd_add_alias(D, "AaliasZ", "data", 1); e2 = gd_error(D); gd_add_alias(D, "AaliasZ", "AdataZ", 1); e3 = gd_error(D); /* check */ target = gd_alias_target(D, "AaliasZ"); CHECKS(target, "AdataZ"); i = gd_fragment_index(D, "AaliasZ"); n = gd_naliases(D, "AaliasZ"); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(e1, GD_E_BAD_CODE); CHECKI(e2, GD_E_BAD_CODE); CHECKI(e3, GD_E_OK); CHECKI(i, 1); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/native_polynom_cmpin.c0000640000175000017500000000300612614323564021357 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM data 1 0\n" "data RAW COMPLEX128 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "polynom"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/madd_spec_invalid.c0000640000175000017500000000252412614323564020557 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_madd_spec(D, "data RAW UINT8 2", "INDEX"); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/flac_get_get.c0000640000175000017500000000470512614323564017540 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_FLAC || !defined TEST_FLAC return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, e1, e2, n2, e3, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1); CHECKI(n1, 8); e1 = gd_error(D); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2); e3 = gd_error(D); CHECKI(e3, 0); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKIi(i,c1[i], 40 + i); CHECKIi(i,c2[i], 40 + i); } gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/include_pc.c0000640000175000017500000000403212614323564017233 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int saw_callback = 0; int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_) { saw_callback++; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data PAW UINT8 1\n"; const char *format1_data = "data ROW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_cbopen(filedir, GD_RDWR, callback, NULL); gd_parser_callback(D, NULL, NULL); gd_include(D, "format1", 0, 0); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, GD_E_FORMAT); CHECKI(saw_callback, 1); return r; } libgetdata-0.9.0/test/global_flags.c0000640000175000017500000000436512614323564017553 0ustar alastairalastair/* Copyright (C) :e2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int i, r = 0; int n[7], e[7]; const int v[7] = { 0 | GD_PRETTY_PRINT, GD_VERBOSE | GD_PRETTY_PRINT, GD_VERBOSE | 0, 0 | GD_PRETTY_PRINT, GD_VERBOSE | 0, 0 | GD_PRETTY_PRINT, GD_VERBOSE | 0 }; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_PRETTY_PRINT); n[0] = gd_flags(D, 0, 0); e[0] = gd_error(D); n[1] = gd_flags(D, GD_VERBOSE, 0); e[1] = gd_error(D); n[2] = gd_flags(D, 0, GD_PRETTY_PRINT); e[2] = gd_error(D); n[3] = gd_flags(D, GD_VERBOSE | GD_PRETTY_PRINT, GD_VERBOSE | GD_PRETTY_PRINT); e[3] = gd_error(D); n[4] = gd_flags(D, GD_VERBOSE, GD_PRETTY_PRINT); e[4] = gd_error(D); n[5] = gd_flags(D, GD_VERBOSE | GD_PRETTY_PRINT, GD_VERBOSE); e[5] = gd_error(D); n[6] = gd_flags(D, GD_VERBOSE, GD_VERBOSE | GD_PRETTY_PRINT); e[6] = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); for (i = 0; i < 7; ++i) { CHECKIi(i, e[i], 0); CHECKXi(i, n[i], v[i]); } return r; } libgetdata-0.9.0/test/put_string_protect.c0000640000175000017500000000323112614323564021064 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data STRING UINT8\nPROTECT all\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_put_string(D, "data", "some string"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error, GD_E_PROTECTED); return r; } libgetdata-0.9.0/test/add_bit_bitsize.c0000640000175000017500000000271012614323564020246 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a BIT field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_bit(D, "new", "input", 1, 99, 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/parse_eol.c0000640000175000017500000000304412614323564017101 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\\\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/add_string.c0000640000175000017500000000335112614323564017247 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; char val[1000]; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_string(D, "data", "A string.", 0); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_STRING_ENTRY); CHECKI(e.fragment_index, 0); gd_get_string(D, "data", 1000, val); CHECKS(val, "A string."); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/parse_scalar1.c0000640000175000017500000000302712614323564017651 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 9\ndata RAW UINT8 scalar<3>\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error,GD_E_OK); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_sf.c0000640000175000017500000000373312614323564016404 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 0, 40, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_include_loop.c0000640000175000017500000000302112614323564020771 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "INCLUDE format\n"; int fd, e, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); e = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e, GD_E_RECURSE_LEVEL); return r; } libgetdata-0.9.0/test/flush_flush.c0000640000175000017500000000413112614323564017450 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); gd_flush(D, "data"); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_polynom.c0000640000175000017500000000277612614323564020206 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM data 1 0\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "polynom"); error = gd_error(D); CHECKU(type, GD_FLOAT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/bzip_get_far.c0000640000175000017500000000417112614323564017565 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *bz2data = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 1000, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(bz2data); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(error, 0); #else CHECKI(error, GD_E_UNSUPPORTED); #endif CHECKI(n, 0); return r; #endif } libgetdata-0.9.0/test/parse_polynom_scalar.c0000640000175000017500000000311712614323564021345 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT64 3.2\n" "polynom POLYNOM in const 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/put_linterp_noin.c0000640000175000017500000000367612614323564020533 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write LINTERP */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\n"; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; FILE *t; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); t = fopen(table, "wt"); for (i = 0; i < 10; ++i) fprintf(t, "%i %i\n", i * 6, i * 3); fclose(t); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(table); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/add_multiply_invalid.c0000640000175000017500000000252212614323564021325 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_multiply(D, "new", "in1", "in2", 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/bof_bit.c0000640000175000017500000000341312614323564016534 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 2\n" "bit BIT data 1\n" "/FRAMEOFFSET 35\n"; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, strlen(data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_bof(D, "bit"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 70); return r; } libgetdata-0.9.0/test/cvlist_meta_hidden.c0000640000175000017500000000337612614323564020765 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CONST UINT8 1\n" "META parent data1 CONST UINT8 1\n" "META parent data2 CONST UINT8 2\n" "/HIDDEN parent/data2\n" "META parent data3 CONST UINT8 3\n" "META parent data4 LINTERP UINT8 1\n"; int fd, error, r = 0; uint8_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (uint8_t *)gd_mconstants(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 2; ++fd) CHECKUi(fd,field_list[fd], 2 * fd + 1); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/foffs_move.c0000640000175000017500000000376312614323564017271 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test frameoffset */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n"; unsigned char data_data[256]; int fd, ret, error, r = 0; off_t fo, nf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_frameoffset(D, 16, 0, 1); error = gd_error(D); fo = gd_frameoffset(D, 0); nf = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(fo, 16); CHECKI(nf, 45); return r; } libgetdata-0.9.0/test/add_const.c0000640000175000017500000000344212614323564017070 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a CONST field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val = 3; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_const(D, "data", GD_UINT8, GD_UINT8, &val, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_get_constant(D, "data", GD_UINT8, &val); CHECKI(val, 3); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/alias_list.c0000640000175000017500000000345012614323564017255 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS e f\n" "/ALIAS a b\n" "/ALIAS b d\n" "/ALIAS c d\n" "/ALIAS d f\n" "f CONST UINT8 1\n"; int fd, e, i = 0, r = 0; int x[256]; DIRFILE *D; const char **al; rmdirfile(); mkdir(filedir, 0777); memset(x, 0, 256 * sizeof(int)); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); al = gd_aliases(D, "f"); e = gd_error(D); CHECKI(e, GD_E_OK); CHECKPN(al); if (!r) for (i = 0; al[i]; ++i) { CHECKUi(i, al[i][1], 0); x[(int)(al[i][0])]++; } CHECKI(i, 6); for (i = 0; i < 256; ++i) CHECKIi(i, x[i], (i >= 'a' && i <= 'f') ? 1 : 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_window.c0000640000175000017500000000305012614323564017626 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data WINDOW in1 in2 EQ 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/bzip_seek.c0000640000175000017500000000374612614323564017114 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_BZIP2 || !defined TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *bzip2data = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; int fd, n, error, r = 0; char command[4096]; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); error = gd_error(D); CHECKI(n, 40); CHECKI(error, 0); gd_discard(D); unlink(bzip2data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/put_uint64.c0000640000175000017500000000423212614323564017151 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t c[8], d, i; struct stat buf; int fd, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 40 + i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint64_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint64_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_phase.c0000640000175000017500000000371012614323564017067 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read PHASE */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "phase PHASE data -2\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "phase", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKI(c, 3); return r; } libgetdata-0.9.0/test/zzslim_nframes.c0000640000175000017500000000504112614323564020172 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #if !defined(TEST_ZZIP) || !defined(TEST_SLIM) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *dataslm = "dirfile/data.slm"; const char *rawzip = "dirfile/raw.zip"; const char *format_data = "data RAW UINT16 1\n/ENCODING zzslim\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress, twice */ snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) return 1; chdir(filedir); snprintf(command, 4096, "%s raw data.slm > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(dataslm); unlink(data); #ifdef USE_ZZSLIM D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(rawzip); unlink(format); rmdir(filedir); #ifdef USE_ZZSLIM CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/cvlist_array_meta0.c0000640000175000017500000000336512614323564020726 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CARRAY UINT8 1\n" "META parent data4 LINTERP UINT8 1\n"; int fd, r = 0; size_t error; gd_carray_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (gd_carray_t *)gd_mcarrays(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); CHECKI(field_list[0].n, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_crecip89.c0000640000175000017500000000433512614323564017751 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #define GD_C89_API #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div RECIP data 230.\n"; int32_t data_data[256]; int fd, ret, error, n, r = 0; DIRFILE *D; double div[2] = {1093., 3290.}; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_crecip(D, "div", "phase", div); error = gd_error(D); n = gd_entry(D, "div", &E); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,0); CHECKI(ret,0); CHECKF(E.EN(recip,cdividend)[0], div[0]); CHECKF(E.EN(recip,cdividend)[1], div[1]); CHECKS(E.in_fields[0], "phase"); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/version_0_write.c0000640000175000017500000000337512614323564020255 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "FRAMEOFFSET RAW c 8\na&b RAW c 8"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 0); q = gd_rewrite_fragment(D, 0); CHECKI(e,0); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_CURRENT); CHECKI(c,0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/madd_linterp.c0000640000175000017500000000343512614323564017576 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINTERP field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_linterp(D, "new", "meta", "in", "table"); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_LINTERP_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKS(e.EN(linterp,table), "table"); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/get_lincom_non.c0000640000175000017500000000370412614323564020125 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM data 2 3 data 1 0\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 18); return r; } libgetdata-0.9.0/test/seek_foffs.c0000640000175000017500000000370312614323564017244 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 5\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", 6, 0, GD_SEEK_SET); e1 = gd_error(D); n = gd_tell(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(m, 48); CHECKI(n, 48); return r; } libgetdata-0.9.0/test/get_endian32.c0000640000175000017500000000440312614323564017372 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint32_t c = 0; uint32_t data_data[128]; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT32 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); for (fd = 0; fd < 128; ++fd) data_data[fd] = fd * (0x020201); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKX(c, 0x50a0a00); return r; } libgetdata-0.9.0/test/open_abs.c0000640000175000017500000000272212614323564016720 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; char path[4096]; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); getcwd(path, 4096); strcat(path, "/"); strcat(path, filedir); D = gd_open(path, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/add_raw_sub.c0000640000175000017500000000436712614323564017413 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *data = "dirfile/sub/data"; const char *format_data = "/INCLUDE sub/format1\n"; const char *format1_data = "#\n"; gd_entry_t e; int error, fd, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE | GD_UNENCODED); gd_add_raw(D, "data", GD_UINT8, 2, 1); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 1); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); if (unlink(data)) { perror("unlink"); r = 1; } unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/flist0.c0000640000175000017500000000304412614323564016331 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_field_list_by_type(D, GD_RAW_ENTRY); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); CHECKP(field_list[0]); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/gzip_get_get2.c0000640000175000017500000000474612614323564017673 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #if !defined USE_GZIP || !defined TEST_GZIP return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, error1, n2, error2, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1); error1 = gd_error(D); n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2); error2 = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(error2, 0); CHECKI(n1, 8); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKUi(i,c1[i], i); CHECKUi(i,c2[i], i); } return r; #endif } libgetdata-0.9.0/test/del_derived_force.c0000640000175000017500000000322012614323564020550 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nlincom LINCOM 1 data 1 0\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", GD_DEL_FORCE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/version_7_strict.c0000640000175000017500000000472312614323564020440 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Check Standards Version 6 strictness */ #include "test.h" #include #include #include #include #include #include #include int cb(gd_parser_data_t *pdata, void *ll) { ((int*)ll)[pdata->linenum - 1] = 1; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 7\n" "X 2) { CHECKIi(i,ll[i],0); } } CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 +i); return r; } libgetdata-0.9.0/test/add_linterp_invalid.c0000640000175000017500000000252212614323564021123 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_linterp(D, "new", "in", "table", 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/put_endian_float64_arm.c0000640000175000017500000000414712614323564021461 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write arm-endian FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\nENDIAN little arm\n"; unsigned int i; const double c = 1.5; unsigned char x[sizeof(double)] = { 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0x00 }; unsigned char u[sizeof(double)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * sizeof(double), SEEK_SET); read(fd, u, sizeof(double)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < sizeof(double); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/file_code.c0000640000175000017500000000357412614323564017051 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to get RAW filename */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, error, r = 0; const char *path; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); path = gd_raw_filename(D, "bata"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_CODE); CHECKP(path); return r; } libgetdata-0.9.0/test/alter_entry_hidden.c0000640000175000017500000000354212614323564020776 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, error, r = 0; off_t n; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); E.flags = GD_EN_HIDDEN; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); n = gd_nfields(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKI(ret, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/parse_include_slash.c0000640000175000017500000000342412614323564021141 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "/INCLUDE format1\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf,11); return r; } libgetdata-0.9.0/test/native_index.c0000640000175000017500000000244512614323564017611 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); type = gd_native_type(D, "INDEX"); error = gd_error(D); CHECKU(type, GD_UINT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int8_float32.c0000640000175000017500000000376712614323564021120 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; float c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/sie_seek_far.c0000640000175000017500000000362012614323564017547 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; DIRFILE *D; int fd, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(n, 4000); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/repr_uint8.c0000640000175000017500000000424512614323564017233 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif uint8_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_string.c0000640000175000017500000000272712614323564020013 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING value\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "string"); error = gd_error(D); CHECKU(type, GD_NULL); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_zero_complex.c0000640000175000017500000000375512614323564020506 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "/FRAMEOFFSET 100\ndata RAW COMPLEX128 8\n"; double c[16]; double data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 16 * sizeof(double)); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd / 256.; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 16; ++i) CHECKFi(i, c[i], 0); return r; } libgetdata-0.9.0/test/alter_mplex.c0000640000175000017500000000424312614323564017446 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "count RAW UINT8 8\n" "data RAW UINT8 8\n" "mplex MPLEX data count 1 3\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_mplex(D, "mplex", NULL, NULL, 2, -1); error = gd_error(D); n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 38 + 3 * ((i + 2) / 3)); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/put_mplex.c0000640000175000017500000000431212614323564017144 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 1 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8], d[8]; unsigned char data_data[256]; int i, n, m, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); for (i = 0; i < 256; ++i) data_data[i] = (unsigned char)i; i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256); close(i); for (i = 0; i < 256; ++i) data_data[i] %= 3; i = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256); close(i); for (i = 0; i < 8; ++i) d[i] = 80 + i; D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &d); error = gd_error(D); m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(m, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], ((i % 3) == 0) ? 80 + i : 40 + i); return r; } libgetdata-0.9.0/test/add_divide.c0000640000175000017500000000325212614323564017205 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_divide(D, "new", "in1", "in2", 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_DIVIDE_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/madd_lincom_invalid.c0000640000175000017500000000271112614323564021104 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char *in_fields[2] = {"in1", "in2"}; const double m[2] = {1, 0.3}; const double b[2] = {0, 0.9}; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_madd_lincom(D, "new", "meta", 2, in_fields, m, b); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/sie_put_trunc2.c0000640000175000017500000000453312614323564020101 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[0x32]; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; #define NREC 2 const uint8_t data_out[] = { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x29 }; uint8_t check[(NREC + 1) * 9]; DIRFILE *D; int fd, i, n, error, r = 0; ssize_t l; memset(c, 0x29, 0x32); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 0, 2, 0, 0x32, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 0x32); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); l = read(fd, check, (NREC + 1) * 9); close(fd); CHECKI(l, NREC * 9); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < NREC * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/repr_real_m.c0000640000175000017500000000403112614323564017414 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read modulus representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double c[8]; double data_data[100]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) data_data[i] = sin(i * 3.14159265358979323846 / 5.); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 100 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.m", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],fabs(data_data[5 + i])); return r; } libgetdata-0.9.0/test/get_null.c0000640000175000017500000000360512614323564016744 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read returning GD_NULL */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); return r; } libgetdata-0.9.0/test/version_5_write.c0000640000175000017500000000346612614323564020263 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 5\n" "/ENDIAN big\n" "a.r RAW UINT8 8\n" "ENCODING PHASE a.r 0\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 5); q = gd_rewrite_fragment(D, 0); CHECKI(e,5); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_CURRENT); CHECKI(c,5); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/desync.c0000640000175000017500000000332312614323564016415 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, e3, n1, n2, fd, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); e1 = gd_error(D); n1 = gd_desync(D, 0); e2 = gd_error(D); /* ensure mtime ticks over */ sleep(1); /* modify the format file */ fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666); write(fd, "#\n", 2); close(fd); n2 = gd_desync(D, 0); e3 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(e3, 0); CHECKI(n1, 0); CHECKI(n2, 1); return r; } libgetdata-0.9.0/test/repr_real_a.c0000640000175000017500000000406312614323564017405 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read argument representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double c[8]; double data_data[100]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) data_data[i] = sin(i * 3.14159265358979323846 / 5.); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 100 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.a", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],(data_data[i] > 0) ? 3.14159265358979323846 : 0); return r; } libgetdata-0.9.0/test/endian_get.c0000640000175000017500000000513512614323564017230 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test endianness */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format3 = "dirfile/format3"; const char *format_data = "ENDIAN little\nINCLUDE format1\n"; const char *format_data1 = "ENDIAN big\nINCLUDE format2\n"; const char *format_data2 = "ENDIAN big arm\nINCLUDE format3\n"; const char *format_data3 = "ENDIAN little arm\n"; int fd, error, r = 0; unsigned long n, m, l, k; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data2, strlen(format_data2)); close(fd); fd = open(format3, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data3, strlen(format_data3)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_endianness(D, 0); m = gd_endianness(D, 1); l = gd_endianness(D, 2); k = gd_endianness(D, 3); error = gd_error(D); gd_discard(D); unlink(format); unlink(format1); unlink(format2); unlink(format3); rmdir(filedir); CHECKI(error, 0); CHECKX(n, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN); CHECKX(m, GD_BIG_ENDIAN | GD_NOT_ARM_ENDIAN); CHECKX(l, GD_BIG_ENDIAN | GD_ARM_ENDIAN); CHECKX(k, GD_LITTLE_ENDIAN | GD_ARM_ENDIAN); return r; } libgetdata-0.9.0/test/convert_complex128_int64.c0000640000175000017500000000362712614323564021625 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST INT64 0\n"; int64_t c = 0; #ifdef GD_NO_C99_API double d[] = {8, 0}; #else double complex d = 8; #endif int fd, n1, n2, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); #ifdef GD_NO_C99_API n1 = gd_put_constant(D, "data", GD_COMPLEX128, d); #else n1 = gd_put_constant(D, "data", GD_COMPLEX128, &d); #endif n2 = gd_get_constant(D, "data", GD_INT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKI(c, 8); return r; } libgetdata-0.9.0/test/legacy_error.c0000640000175000017500000000242412614323564017606 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #define DIRFILENAME "a non-existant dirfile" int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else char string[1000]; int error, n, r = 0; n = GetData(DIRFILENAME, "data", 5, 0, 1, 0, 'n', NULL, &error); GetDataErrorString(string, 1000); CHECKI(n, 0); CHECKI(error, GD_E_IO); CHECKSS(string, DIRFILENAME); return r; #endif } libgetdata-0.9.0/test/open_invalid.c0000640000175000017500000000232612614323564017601 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { int e1, e2, r = 0; DIRFILE *D; D = gd_invalid_dirfile(); e1 = gd_error(D); CHECKI(e1, 0); gd_nframes(D); e2 = gd_error(D); CHECKI(e2, GD_E_BAD_DIRFILE); gd_discard(D); return r; } libgetdata-0.9.0/test/parse_string_null.c0000640000175000017500000000304212614323564020660 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING \"\"\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/alias_num.c0000640000175000017500000000305012614323564017075 0ustar alastairalastair/* Copyright (C) 2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS e f\n" "/ALIAS a b\n" "/ALIAS b d\n" "/ALIAS c d\n" "/ALIAS d f\n" "f CONST UINT8 1\n"; int fd, e, r = 0; unsigned int n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_naliases(D, "f"); e = gd_error(D); CHECKI(e, GD_E_OK); CHECKU(n, 6); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/nfields_type_hidden.c0000640000175000017500000000364212614323564021134 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "/HIDDEN string\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nfields_by_type(D, GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 1); return r; } libgetdata-0.9.0/test/version_0.c0000640000175000017500000000436012614323564017036 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 0 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/FRAMEOFFSET"; const char *format_data = "FRAMEOFFSET RAW c 8\na&b RAW c 8"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "FRAMEOFFSET", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); CHECKI(v,0); CHECKI(l,0); CHECKI(e,0); return r; } libgetdata-0.9.0/test/put_int16.c0000640000175000017500000000420212614323564016756 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int16_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT16, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int16_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int16_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/madd_recip.c0000640000175000017500000000343212614323564017220 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_recip(D, "new", "meta", "in1", 3.2); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_RECIP_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKF(e.EN(recip,dividend), 3.2); CHECKX(e.flags, GD_EN_CALC); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/legacy_nframes.c0000640000175000017500000000343412614323564020112 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames via the legacy API should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 1\n"; int fd, error, r = 0; const size_t len = strlen(data); size_t n; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); n = GetNFrames(filedir, &error, NULL); unlink(data); unlink(format); rmdir(filedir); CHECKU(n,len); return r; #endif } libgetdata-0.9.0/test/header_off64t.c0000640000175000017500000000312412614323564017547 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Does GetData respect _FILE_OFFSET_BITS? This test isn't very interesting * on a 64-bit system. */ #define _FILE_OFFSET_BITS 64 #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/FRAMEOFFSET 0x123456789\n"; int fd, error, r = 0; uint64_t fo; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); fo = gd_frameoffset(D, 0); CHECKI(fo, 0x123456789); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_multiply_crin.c0000640000175000017500000000416412614323564020665 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read MULTIPLY */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data INDEX\ndata RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { const double a = 5 + i; const double b = a / 256.; CHECKFi(i, c[i * 2], a * a); CHECKFi(i, c[i * 2 + 1], a * b); } return r; } libgetdata-0.9.0/test/repr_float64.c0000640000175000017500000000427312614323564017444 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/flist2.c0000640000175000017500000000425112614323564016334 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "data3 RAW UINT8 1\n"; int fd, i, z, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); for (z = 0; z < 2; ++z) { field_list = gd_field_list(D); error = gd_error(D); CHECKIi(z, error, 0); CHECKPNi(z, field_list); for (i = 0; ; ++i) { if (field_list[i] == NULL) break; if (strcmp(field_list[i], "data1") == 0) continue; else if (strcmp(field_list[i], "data2") == 0) continue; else if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "INDEX") == 0) continue; fprintf(stderr, "field_list[%i@%i] = \"%s\"\n", i, z, field_list[i]); r = 1; } CHECKIi(z, i, 4); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_literal_fltcmp.c0000640000175000017500000000302512614323564021322 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT64 1;1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error, GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/elist_noalias.c0000640000175000017500000000401312614323564017753 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "data3 RAW UINT8 1\n" "/ALIAS data4 data32\n"; int fd, i, error, r = 0; const char **entry_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); entry_list = gd_entry_list(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_NOALIAS); error = gd_error(D); CHECKI(error, 0); CHECKPN(entry_list); for (i = 0; ; ++i) { if (entry_list[i] == NULL) break; if (strcmp(entry_list[i], "data1") == 0) continue; else if (strcmp(entry_list[i], "data2") == 0) continue; else if (strcmp(entry_list[i], "data3") == 0) continue; else if (strcmp(entry_list[i], "INDEX") == 0) continue; fprintf(stderr, "entry_list[%i] = \"%s\"\n", i, entry_list[i]); r = 1; } CHECKI(i, 4); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_lincom1.c0000640000175000017500000000424712614323564017370 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 1 data 0.5 3.0\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d, (i - 3) * 2); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_window.c0000640000175000017500000000356012614323564017663 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read WINDOW entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data WINDOW in1 in2 NE 0\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_WINDOW_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); CHECKI(E.EN(window,windop), GD_WINDOP_NE); CHECKI(E.EN(window,threshold.i), 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/add_rdonly.c0000640000175000017500000000343612614323564017254 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field to a read-only dirfile*/ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, error, n, r = 0; DIRFILE *D; gd_entry_t E; E.field = "new"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); gd_add(D, &E); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 2); CHECKI(error, GD_E_ACCMODE); return r; } libgetdata-0.9.0/test/parse_alias_code.c0000640000175000017500000000264312614323564020411 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n/ALIAS ra.ta data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_alias_meta.c0000640000175000017500000000272512614323564020426 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n" "data/cata CONST UINT8 1\n" "/ALIAS data/eata data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); return r; } libgetdata-0.9.0/test/name_dup.c0000640000175000017500000000271712614323564016726 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nzata RAW UINT8 1\n"; int fd, ret, e1, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_rename(D, "data", "zata", 0); e1 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1,GD_E_DUPLICATE); CHECKI(ret,-1); return r; } libgetdata-0.9.0/test/get_type.c0000640000175000017500000000364212614323564016754 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UNKNOWN, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_TYPE); return r; } libgetdata-0.9.0/test/get_rofs.c0000640000175000017500000000433112614323564016740 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Should be able to read from a R/O dirfile */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int i, fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); chmod(data, 0555); /* ensure filesystem honours read-onlyness */ if ((fd = open(data, O_RDWR)) >= 0 || errno != EACCES) { if (fd >= 0) close(fd); unlink(format); unlink(data); rmdir(filedir); return 77; } D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/nfields_vector_hidden.c0000640000175000017500000000364612614323564021461 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "carray CARRAY UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nvectors(D); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 4); return r; } libgetdata-0.9.0/test/parse_multiply_ncols.c0000640000175000017500000000303012614323564021372 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MULTIPLY in1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/add_raw.c0000640000175000017500000000343412614323564016534 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; gd_entry_t e; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT8, 2, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); if (unlink(data)) { perror("unlink"); r = 1; } unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_uint16_int8.c0000640000175000017500000000377412614323564020772 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_uint32_int32.c0000640000175000017500000000376612614323564021046 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/madd_index.c0000640000175000017500000000361712614323564017232 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, ge_error, n, r = 0; gd_entry_t e; DIRFILE *D; gd_entry_t E; memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); E.field_type = GD_CONST_ENTRY; E.EN(scalar,const_type) = GD_UINT8; E.fragment_index = 99; gd_madd(D, &E, "data"); error = gd_error(D); /* check */ n = gd_nfields(D); gd_entry(D, "data/data", &e); ge_error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(ge_error, 0); CHECKI(n, 2); if (!r) { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } return r; } libgetdata-0.9.0/test/madd_window.c0000640000175000017500000000374612614323564017435 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a WINDOW field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; gd_triplet_t thresh; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); thresh.r = 0.1; gd_add_window(D, "new", "in", "check", GD_WINDOP_GT, thresh, 0); thresh.u = 0x1F000; gd_madd_window(D, "new", "meta", "in", "check", GD_WINDOP_CLR, thresh); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_WINDOW_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKS(e.in_fields[1], "check"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(window,windop), GD_WINDOP_CLR); CHECKI(e.EN(window,threshold.u), 0x1F000); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/madd_multiply.c0000640000175000017500000000343012614323564017773 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a MULTIPLY field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_multiply(D, "new", "meta", "in1", "in2"); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_MULTIPLY_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/lzma_xz_get.c0000640000175000017500000000436512614323564017462 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8] = {0, 0, 0, 0, 0, 0, 0, 0}; char command[4096]; uint16_t data_data[256]; #ifdef USE_LZMA int i; #endif int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; #ifdef USE_LZMA D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKXi(i,c[i],40 + i); #else CHECKI(error,GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/convert_uint16_complex64.c0000640000175000017500000000432212614323564021717 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/parse_window_scalar.c0000640000175000017500000000307512614323564021162 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST INT32 1\ndata WINDOW a b LT const\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/madd_lincom.c0000640000175000017500000000415412614323564017401 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINCOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; const char *in_fields[2] = {"in1", "in2"}; const double m[2] = {1, 0.3}; const double b[2] = {0, 0.9}; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_lincom(D, "new", "meta", 2, in_fields, m, b); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields), 2); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKF(e.EN(lincom,m)[0], m[0]); CHECKF(e.EN(lincom,m)[1], m[1]); CHECKF(e.EN(lincom,b)[0], b[0]); CHECKF(e.EN(lincom,b)[1], b[1]); CHECKX(e.flags, GD_EN_CALC); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/put_endian_complex64_little.c0000640000175000017500000000446512614323564022544 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write little-endian COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 1\nENDIAN little\n"; unsigned int i; #ifdef GD_NO_C99_API const float c[] = {1.5, 2.25}; #else const float complex c = 1.5 + _Complex_I * 2.25; #endif unsigned char x[2 * sizeof(float)] = { 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40 }; unsigned char u[2 * sizeof(float)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); #else n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, &c); #endif error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * 2 * sizeof(float), SEEK_SET); read(fd, u, 2 * sizeof(float)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < 2 * sizeof(float); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/move_data_foffs_neg.c0000640000175000017500000000471512614323564021111 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1\n" "data RAW UINT8 11\n" "/FRAMEOFFSET 1\n"; const char *format1_data = "FRAMEOFFSET 0\n"; uint8_t d, data_data[256]; int fd, i, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); ret = gd_move(D, "data", 1, GD_REN_DATA); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKUi(i,d, (i < 11) ? 0 : i - 11); i++; } close(fd); unlink(format1); unlink(format); unlink(data); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/get_here_foffs.c0000640000175000017500000000443612614323564020103 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Check GD_HERE and FRAMEOFFSET */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "FRAMEOFFSET 2\ndata RAW UINT8 8\n"; unsigned char c[8], d[8]; unsigned char data_data[256]; int fd, i, j, k, l, m, n, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 0, 4, GD_SEEK_SET); m = gd_getdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); l = gd_tell(D, "data"); k = gd_getdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); j = gd_tell(D, "data"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n, 4); CHECKI(m, 8); CHECKI(l, 12); CHECKI(k, 8); CHECKI(j, 20); for (i = 0; i < 8; ++i) { CHECKUi(i, c[i], 0); CHECKUi(i, d[i], (i < 4) ? 0 : i - 4); } return r; } libgetdata-0.9.0/test/version_5.c0000640000175000017500000000452012614323564017041 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 5 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/a.r"; const char *format_data = "/VERSION 5\n" #ifdef WORDS_BIGENDIAN "/ENDIAN little\n" #else "/ENDIAN big\n" #endif "a.r RAW UINT8 8\n" "ENCODING PHASE a.r 0\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "a.r", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); CHECKI(v,5); CHECKI(l,5); CHECKI(e,5); return r; } libgetdata-0.9.0/test/zzip_get.c0000640000175000017500000000441512614323564016766 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_ZZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *rawzip = "dirfile/raw.zip"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; #ifdef USE_ZZIP int i; #endif DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ chdir(filedir); snprintf(command, 4096, "%s raw data > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(data); #ifdef USE_ZZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(rawzip); unlink(format); rmdir(filedir); #ifdef USE_ZZIP CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); #else CHECKI(error, GD_E_UNKNOWN_ENCODING); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/parse_string_ncols.c0000640000175000017500000000302412614323564021024 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/put_lincom2.c0000640000175000017500000000360612614323564017367 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 2 data 0.5 3.0 data 1.0 2.0\ndata RAW INT8 8\n"; int8_t c[8]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,0); CHECKI(e1,GD_E_BAD_FIELD_TYPE); e2 = gd_close(D); CHECKI(e2, 0); if (!stat(data, &buf)) { perror("stat"); r = 1; } unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/desync_path.c0000640000175000017500000000412312614323564017430 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile"; const char *dira = "dirfile/a"; const char *dirb = "dirfile/b"; const char *link = "dirfile/link"; const char *formata = "dirfile/a/format"; const char *formatb = "dirfile/b/format"; int e1, e2, e3, n1, n2, n3, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(dira, 0777); mkdir(dirb, 0777); symlink("a", link); close(open(formata, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* ensure mtime ticks over */ sleep(1); close(open(formatb, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(link, GD_RDONLY | GD_VERBOSE); n1 = gd_desync(D, 0); e1 = gd_error(D); /* change symlink */ unlink(link); symlink("b", link); n2 = gd_desync(D, 0); e2 = gd_error(D); n3 = gd_desync(D, GD_DESYNC_PATHCHECK); e3 = gd_error(D); gd_discard(D); unlink(formata); unlink(formatb); unlink(link); rmdir(dira); rmdir(dirb); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(e3, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKI(n3, 1); return r; #endif } libgetdata-0.9.0/test/encode_recode.c0000640000175000017500000000440012614323564017703 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *txtdata = "dirfile/data.txt"; const char *format_data = "data RAW UINT16 8\nENCODING none\n"; uint16_t data_data[128]; uint16_t c[8]; int fd, i, ret, e1, e2, n, unlink_txtdata, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 0x201 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 1); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, 0); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKXi(i,c[i], (40 + i) * 0x201); e2 = gd_close(D); CHECKI(e2, 0); unlink_txtdata = unlink(txtdata); unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_txtdata, 0); CHECKI(unlink_data, -1); return r; } libgetdata-0.9.0/test/put_protect.c0000640000175000017500000000337612614323564017510 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nPROTECT all\n"; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error, GD_E_PROTECTED); return r; } libgetdata-0.9.0/test/get_cpolynom1.c0000640000175000017500000000403012614323564017704 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3;2 2;4\ndata RAW UINT8 1\n"; double c[16]; unsigned char data_data[256]; int i, fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "polynom", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { CHECKFi(i, c[i * 2], 3 + 2 * (5 + i)); CHECKFi(i, c[i * 2 + 1], 2 + 4 * (5 + i)); } return r; } libgetdata-0.9.0/test/include_auto.c0000640000175000017500000000376712614323564017617 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "#\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, error1, error2, r = 0; const char *reference; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include(D, "format1", 0, GD_VERBOSE); error1 = gd_error(D); CHECKI(error1, 0); reference = gd_reference(D, NULL); CHECKS(reference, "data"); error2 = gd_error(D); spf = gd_spf(D, "data"); CHECKI(error2, 0); CHECKU(spf, 11); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/seek_cur.c0000640000175000017500000000373612614323564016740 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_seek(D, "data", 6, 0, GD_SEEK_SET); m = gd_seek(D, "data", -3, 0, GD_SEEK_CUR); e1 = gd_error(D); n = gd_tell(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(m, 24); CHECKI(n, 24); return r; } libgetdata-0.9.0/test/flac_nframes.c0000640000175000017500000000446612614323564017561 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; #ifdef USE_FLAC D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); #ifdef USE_FLAC CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/get_uint64.c0000640000175000017500000000406412614323564017123 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t c[8]; uint64_t data_data[128]; int fd, i, n, error, r = 0; unsigned j; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (j = 0; j < 128; ++j) data_data[j] = j * (0x0200000000000001U); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],0x5000000000000028U + i * 0x0200000000000001U); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/madd_spec_directive.c0000640000175000017500000000300112614323564021076 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, m, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_madd_spec(D, "META INDEX RAW UINT8 2", "INDEX"); error = gd_error(D); /* check */ n = gd_nfields(D); m = gd_nmfields(D, "INDEX"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(m, 0); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_polynom_ncols2.c0000640000175000017500000000306412614323564021301 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM in 1 2 3 4 5 6 7 8 9\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/convert_int8_uint8.c0000640000175000017500000000374312614323564020707 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; uint8_t c[8], i; int8_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/version_8_write.c0000640000175000017500000000347312614323564020264 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 8\n" "ar RAW UINT8 8\n" "FRAMEOFFSET DIVIDE ar ar\n" "r RECIP ar 1.\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 8); q = gd_rewrite_fragment(D, 0); CHECKI(e,8); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_CURRENT); CHECKI(c,8); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_bit_numbits.c0000640000175000017500000000302712614323564020642 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1 1 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/put_window.c0000640000175000017500000000357112614323564017334 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data EQ 3\ndata RAW INT8 8\n"; int8_t c[8]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "window", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,0); CHECKI(e1,GD_E_BAD_FIELD_TYPE); e2 = gd_close(D); CHECKI(e2, 0); if (!stat(data, &buf)) { perror("stat"); r = 1; } unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int16_int8.c0000640000175000017500000000376712614323564020607 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_float64_uint16.c0000640000175000017500000000376612614323564021370 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; uint16_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/flist_meta_hidden.c0000640000175000017500000000404512614323564020574 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent data1 LINTERP UINT8 1\n" "META parent data2 LINTERP UINT8 1\n" "/HIDDEN parent/data2\n" "META parent data3 LINTERP UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_mfield_list(D, "parent"); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i] != NULL; ++i) { CHECKIi(i,strlen(field_list[i]), 5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] != '1' && field_list[i][4] != '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i, 2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/lzma_xz_nframes.c0000640000175000017500000000440612614323564020332 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retrieving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; DIRFILE *D; size_t n; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; #ifdef USE_LZMA D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(error,0); CHECKI(n,256); #else CHECKI(error,GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/table_code.c0000640000175000017500000000313412614323564017211 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "linterp LINTERP INDEX table\n"; int fd, error, r = 0; const char *path; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); path = gd_linterp_tablename(D, "bata"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_CODE); CHECKP(path); return r; } libgetdata-0.9.0/test/entry_phase.c0000640000175000017500000000342112614323564017450 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read PHASE entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data PHASE in1 3\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_PHASE_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKI(E.EN(phase,shift), 3); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/repr_r.c0000640000175000017500000000441412614323564016423 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read argument representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\n"; double c[8]; #ifdef GD_NO_C99_API double data_data[100][2]; #else double complex data_data[100]; #endif int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) { #ifdef GD_NO_C99_API const double v = i * 3.14159265358979323846 / 5.; data_data[i][0] = cos(v); data_data[i][1] = sin(v); #else data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.); #endif } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 200 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.r", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],creal(data_data[5 + i])); return r; } libgetdata-0.9.0/test/bof_phase_neg.c0000640000175000017500000000461012614323564017707 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT16 5\n" "phase PHASE data 3\n" "/FRAMEOFFSET 35\n" "mult MULTIPLY phase2 phase\n" "mult2 MULTIPLY phase phase2\n" "INCLUDE format1\n"; const char *format1_data = "data2 RAW UINT8 3\n" "FRAMEOFFSET 43\n" "phase2 PHASE data2 1000\n"; int fd, error1, error2, error3, error4, r = 0; off_t bof_phase, bof_phase2, bof_mult, bof_mult2; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); bof_phase = gd_bof(D, "phase"); error1 = gd_error(D); bof_phase2 = gd_bof(D, "phase2"); error2 = gd_error(D); bof_mult = gd_bof(D, "mult"); error3 = gd_error(D); bof_mult2 = gd_bof(D, "mult2"); error4 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(bof_phase, 172); CHECKI(error2, 0); CHECKI(bof_phase2, 0); CHECKI(error3, 0); CHECKI(bof_mult, 103); /* = floor(172 * 3 / 5) */ CHECKI(error4, 0); CHECKI(bof_mult2, 172); return r; } libgetdata-0.9.0/test/parse_include_absrel.c0000640000175000017500000000442712614323564021303 0ustar alastairalastair/* Copyright (C) 2011-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #if defined GD_NO_GETCWD return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data1 = "INCLUDE "; const char *format_data2 = "/dirfile/format1\n"; const char *format1_data = "INCLUDE format2\n"; const char *format2_data = "data RAW UINT8 11\n"; int cwd_size = 2048; char *ptr, *cwd = NULL; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); gdtest_getcwd(ptr, cwd, cwd_size); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); gd_pathwrite(fd, cwd); write(fd, format_data2, strlen(format_data2)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 11); free(cwd); return r; #endif } libgetdata-0.9.0/test/convert_complex64_complex128.c0000640000175000017500000000455412614323564022502 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX64 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 8\n"; #ifdef GD_NO_C99_API float data_data[512]; double c[16]; #else float complex data_data[256]; double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[2 * fd] = data_data[2 * fd + 1] = (float)fd; #else data_data[fd] = (float complex)fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 40 + i}; CHECKCi(i,c + 2 * i, v); #else CHECKCi(i,c[i], (40 + i) * (1 + _Complex_I)); #endif } return r; } libgetdata-0.9.0/test/alter_entry_affix.c0000640000175000017500000000413412614323564020636 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 A\n"; const char *format1_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, error, r = 0; off_t n; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "Adata", &E); E.EN(raw,data_type) = GD_UINT16; E.EN(raw,spf) = 11; ret = gd_alter_entry(D, "Adata", &E, 0); error = gd_error(D); n = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 11); CHECKI(ret, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/get_endian_float64_big.c0000640000175000017500000002112112614323564021401 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read big-endian FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\nENDIAN big\n"; double u[10]; double v[20]; const unsigned char data_data[128 * 8] = { 0x3f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1e, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x26, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x31, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x39, 0xa1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x43, 0x38, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x40, 0x4c, 0xd5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x40, 0x55, 0x9f, 0xd8, 0x00, 0x00, 0x00, 0x00, 0x40, 0x60, 0x37, 0xe2, 0x00, 0x00, 0x00, 0x00, 0x40, 0x68, 0x53, 0xd3, 0x00, 0x00, 0x00, 0x00, 0x40, 0x72, 0x3e, 0xde, 0x40, 0x00, 0x00, 0x00, 0x40, 0x7b, 0x5e, 0x4d, 0x60, 0x00, 0x00, 0x00, 0x40, 0x84, 0x86, 0xba, 0x08, 0x00, 0x00, 0x00, 0x40, 0x8e, 0xca, 0x17, 0x0c, 0x00, 0x00, 0x00, 0x40, 0x97, 0x17, 0x91, 0x49, 0x00, 0x00, 0x00, 0x40, 0xa1, 0x51, 0xac, 0xf6, 0xc0, 0x00, 0x00, 0x40, 0xa9, 0xfa, 0x83, 0x72, 0x20, 0x00, 0x00, 0x40, 0xb3, 0x7b, 0xe2, 0x95, 0x98, 0x00, 0x00, 0x40, 0xbd, 0x39, 0xd3, 0xe0, 0x64, 0x00, 0x00, 0x40, 0xc5, 0xeb, 0x5e, 0xe8, 0x4b, 0x00, 0x00, 0x40, 0xd0, 0x70, 0x87, 0x2e, 0x38, 0x40, 0x00, 0x40, 0xd8, 0xa8, 0xca, 0xc5, 0x54, 0x60, 0x00, 0x40, 0xe2, 0x7e, 0x98, 0x13, 0xff, 0x48, 0x00, 0x40, 0xeb, 0xbd, 0xe4, 0x1d, 0xfe, 0xec, 0x00, 0x40, 0xf4, 0xce, 0x6b, 0x16, 0x7f, 0x31, 0x00, 0x40, 0xff, 0x35, 0xa0, 0xa1, 0xbe, 0xc9, 0x80, 0x41, 0x07, 0x68, 0x38, 0x79, 0x4f, 0x17, 0x20, 0x41, 0x11, 0x8e, 0x2a, 0x5a, 0xfb, 0x51, 0x58, 0x41, 0x1a, 0x55, 0x3f, 0x88, 0x78, 0xfa, 0x04, 0x41, 0x23, 0xbf, 0xef, 0xa6, 0x5a, 0xbb, 0x83, 0x41, 0x2d, 0x9f, 0xe7, 0x79, 0x88, 0x19, 0x44, 0x41, 0x36, 0x37, 0xed, 0x9b, 0x26, 0x12, 0xf3, 0x41, 0x40, 0xa9, 0xf2, 0x34, 0x5c, 0x8e, 0x36, 0x41, 0x48, 0xfe, 0xeb, 0x4e, 0x8a, 0xd5, 0x51, 0x41, 0x52, 0xbf, 0x30, 0x7a, 0xe8, 0x1f, 0xfd, 0x41, 0x5c, 0x1e, 0xc8, 0xb8, 0x5c, 0x2f, 0xfc, 0x41, 0x65, 0x17, 0x16, 0x8a, 0x45, 0x23, 0xfd, 0x41, 0x6f, 0xa2, 0xa1, 0xcf, 0x67, 0xb5, 0xfc, 0x41, 0x77, 0xb9, 0xf9, 0x5b, 0x8d, 0xc8, 0x7d, 0x41, 0x81, 0xcb, 0x7b, 0x04, 0xaa, 0x56, 0x5e, 0x41, 0x8a, 0xb1, 0x38, 0x86, 0xff, 0x81, 0x8d, 0x41, 0x94, 0x04, 0xea, 0x65, 0x3f, 0xa1, 0x2a, 0x41, 0x9e, 0x07, 0x5f, 0x97, 0xdf, 0x71, 0xbf, 0x41, 0xa6, 0x85, 0x87, 0xb1, 0xe7, 0x95, 0x4f, 0x41, 0xb0, 0xe4, 0x25, 0xc5, 0x6d, 0xaf, 0xfb, 0x41, 0xb9, 0x56, 0x38, 0xa8, 0x24, 0x87, 0xf8, 0x41, 0xc3, 0x00, 0xaa, 0x7e, 0x1b, 0x65, 0xfa, 0x41, 0xcc, 0x80, 0xff, 0xbd, 0x29, 0x18, 0xf7, 0x41, 0xd5, 0x60, 0xbf, 0xcd, 0xde, 0xd2, 0xb9, 0x41, 0xe0, 0x08, 0x8f, 0xda, 0x67, 0x1e, 0x0b, 0x41, 0xe8, 0x0c, 0xd7, 0xc7, 0x9a, 0xad, 0x10, 0x41, 0xf2, 0x09, 0xa1, 0xd5, 0xb4, 0x01, 0xcc, 0x41, 0xfb, 0x0e, 0x72, 0xc0, 0x8e, 0x02, 0xb2, 0x42, 0x04, 0x4a, 0xd6, 0x10, 0x6a, 0x82, 0x06, 0x42, 0x0e, 0x70, 0x41, 0x18, 0x9f, 0xc3, 0x09, 0x42, 0x16, 0xd4, 0x30, 0xd2, 0x77, 0xd2, 0x47, 0x42, 0x21, 0x1f, 0x24, 0x9d, 0xd9, 0xdd, 0xb5, 0x42, 0x29, 0xae, 0xb6, 0xec, 0xc6, 0xcc, 0x90, 0x42, 0x33, 0x43, 0x09, 0x31, 0x95, 0x19, 0x6c, 0x42, 0x3c, 0xe4, 0x8d, 0xca, 0x5f, 0xa6, 0x22, 0x42, 0x45, 0xab, 0x6a, 0x57, 0xc7, 0xbc, 0x9a, 0x42, 0x50, 0x40, 0x8f, 0xc1, 0xd5, 0xcd, 0x74, 0x42, 0x58, 0x60, 0xd7, 0xa2, 0xc0, 0xb4, 0x2e, 0x42, 0x62, 0x48, 0xa1, 0xba, 0x10, 0x87, 0x22, 0x42, 0x6b, 0x6c, 0xf2, 0x97, 0x18, 0xca, 0xb3, 0x42, 0x74, 0x91, 0xb5, 0xf1, 0x52, 0x98, 0x06, 0x42, 0x7e, 0xda, 0x90, 0xe9, 0xfb, 0xe4, 0x09, 0x42, 0x87, 0x23, 0xec, 0xaf, 0x7c, 0xeb, 0x07, 0x42, 0x91, 0x5a, 0xf1, 0x83, 0x9d, 0xb0, 0x45, 0x42, 0x9a, 0x08, 0x6a, 0x45, 0x6c, 0x88, 0x68, 0x42, 0xa3, 0x86, 0x4f, 0xb4, 0x11, 0x66, 0x4e, 0x42, 0xad, 0x49, 0x77, 0x8e, 0x1a, 0x19, 0x75, 0x42, 0xb5, 0xf7, 0x19, 0xaa, 0x93, 0x93, 0x18, 0x42, 0xc0, 0x79, 0x53, 0x3f, 0xee, 0xae, 0x52, 0x42, 0xc8, 0xb5, 0xfc, 0xdf, 0xe6, 0x05, 0x7b, 0x42, 0xd2, 0x88, 0x7d, 0xa7, 0xec, 0x84, 0x1c, 0x42, 0xdb, 0xcc, 0xbc, 0x7b, 0xe2, 0xc6, 0x2a, 0x42, 0xe4, 0xd9, 0x8d, 0x5c, 0xea, 0x14, 0xa0, 0x42, 0xef, 0x46, 0x54, 0x0b, 0x5f, 0x1e, 0xf0, 0x42, 0xf7, 0x74, 0xbf, 0x08, 0x87, 0x57, 0x34, 0x43, 0x01, 0x97, 0x8f, 0x46, 0x65, 0x81, 0x67, 0x43, 0x0a, 0x63, 0x56, 0xe9, 0x98, 0x42, 0x1a, 0x43, 0x13, 0xca, 0x81, 0x2f, 0x32, 0x31, 0x94, 0x43, 0x1d, 0xaf, 0xc1, 0xc6, 0xcb, 0x4a, 0x5e, 0x43, 0x26, 0x43, 0xd1, 0x55, 0x18, 0x77, 0xc6, 0x43, 0x30, 0xb2, 0xdc, 0xff, 0xd2, 0x59, 0xd4, 0x43, 0x39, 0x0c, 0x4b, 0x7f, 0xbb, 0x86, 0xbe, 0x43, 0x42, 0xc9, 0x38, 0x9f, 0xcc, 0xa5, 0x0e, 0x43, 0x4c, 0x2d, 0xd4, 0xef, 0xb2, 0xf7, 0x95, 0x43, 0x55, 0x22, 0x5f, 0xb3, 0xc6, 0x39, 0xb0, 0x43, 0x5f, 0xb3, 0x8f, 0x8d, 0xa9, 0x56, 0x88, 0x43, 0x67, 0xc6, 0xab, 0xaa, 0x3f, 0x00, 0xe6, 0x43, 0x71, 0xd5, 0x00, 0xbf, 0xaf, 0x40, 0xac, 0x43, 0x7a, 0xbf, 0x81, 0x1f, 0x86, 0xe1, 0x02, 0x43, 0x84, 0x0f, 0xa0, 0xd7, 0xa5, 0x28, 0xc2, 0x43, 0x8e, 0x17, 0x71, 0x43, 0x77, 0xbd, 0x23, 0x43, 0x96, 0x91, 0x94, 0xf2, 0x99, 0xcd, 0xda, 0x43, 0xa0, 0xed, 0x2f, 0xb5, 0xf3, 0x5a, 0x64, 0x43, 0xa9, 0x63, 0xc7, 0x90, 0xed, 0x07, 0x96, 0x43, 0xb3, 0x0a, 0xd5, 0xac, 0xb1, 0xc5, 0xb0, 0x43, 0xbc, 0x90, 0x40, 0x83, 0x0a, 0xa8, 0x88, 0x43, 0xc5, 0x6c, 0x30, 0x62, 0x47, 0xfe, 0x66, 0x43, 0xd0, 0x11, 0x24, 0x49, 0xb5, 0xfe, 0xcc, 0x43, 0xd8, 0x19, 0xb6, 0x6e, 0x90, 0xfe, 0x32, 0x43, 0xe2, 0x13, 0x48, 0xd2, 0xec, 0xbe, 0xa6, 0x43, 0xeb, 0x1c, 0xed, 0x3c, 0x63, 0x1d, 0xf9, 0x43, 0xf4, 0x55, 0xb1, 0xed, 0x4a, 0x56, 0x7b, 0x43, 0xfe, 0x80, 0x8a, 0xe3, 0xef, 0x81, 0xb8, 0x44, 0x06, 0xe0, 0x68, 0x2a, 0xf3, 0xa1, 0x4a, 0x44, 0x11, 0x28, 0x4e, 0x20, 0x36, 0xb8, 0xf8, 0x44, 0x19, 0xbc, 0x75, 0x30, 0x52, 0x15, 0x74, 0x44, 0x23, 0x4d, 0x57, 0xe4, 0x3d, 0x90, 0x17, 0x44, 0x2c, 0xf4, 0x03, 0xd6, 0x5c, 0x58, 0x22, 0x44, 0x35, 0xb7, 0x02, 0xe0, 0xc5, 0x42, 0x1a, 0x44, 0x40, 0x49, 0x42, 0x28, 0x93, 0xf1, 0x94, 0x44, 0x48, 0x6d, 0xe3, 0x3c, 0xdd, 0xea, 0x5e, 0x44, 0x52, 0x52, 0x6a, 0x6d, 0xa6, 0x6f, 0xc6, 0x44, 0x5b, 0x7b, 0x9f, 0xa4, 0x79, 0xa7, 0xa9, 0x44, 0x64, 0x9c, 0xb7, 0xbb, 0x5b, 0x3d, 0xbf, 0x44, 0x6e, 0xeb, 0x13, 0x99, 0x08, 0xdc, 0x9e, 0x44, 0x77, 0x30, 0x4e, 0xb2, 0xc6, 0xa5, 0x76, 0x44, 0x81, 0x64, 0x3b, 0x06, 0x14, 0xfc, 0x18, 0x44, 0x8a, 0x16, 0x58, 0x89, 0x1f, 0x7a, 0x24, 0x44, 0x93, 0x90, 0xc2, 0x66, 0xd7, 0x9b, 0x9b, 0x44, 0x9d, 0x59, 0x23, 0x9a, 0x43, 0x69, 0x68 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); v[0] = 1.5; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 1.5; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) CHECKFi(i, u[i], v[i + 5]); return r; } libgetdata-0.9.0/test/native_linterp.c0000640000175000017500000000332512614323564020155 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data table\n" "data RAW UINT8 11\n"; const char *table_data = "0 0\n1 1\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, table_data, strlen(table_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "linterp"); error = gd_error(D); CHECKU(type, GD_FLOAT64); CHECKI(error, 0); gd_discard(D); unlink(table); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/cvlist_array_meta.c0000640000175000017500000000416212614323564020642 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CARRAY UINT8 1\n" "parent/data1 CARRAY UINT8 1 2 3 4 5\n" "parent/data2 CARRAY UINT8 2 4 6 8 10 12\n" "parent/data3 CARRAY UINT8 3 6 9 12 15 18 21\n" "META parent data4 LINTERP UINT8 1\n"; int fd, r = 0; size_t i, error; struct uint8_carrays { size_t n; uint8_t *d; } *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 3; ++fd) { CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1)); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_linterp1.c0000640000175000017500000000402312614323564017523 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[64]; int fd, n, error, r = 0; DIRFILE *D; FILE *t; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); t = fopen(table, "wt"); fputs("0 0\n", t); fclose(t); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(table); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_LUT); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/convert_int32_int64.c0000640000175000017500000000376212614323564020662 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_off64.c0000640000175000017500000000422012614323564016710 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #if (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) || __MSVCRT__ # define SKIP_TEST #else # define _FILE_OFFSET_BITS 64 #endif #include "test.h" #include #include #include #include #include #include int main(void) { #ifdef SKIP_TEST return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 40 + i); return r; #endif } libgetdata-0.9.0/test/index_domain.c0000640000175000017500000000360212614323564017566 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Frameindex look-up */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double d[1000], f1; int i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 1000; ++i) d[i] = 0; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, d, sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY); f1 = gd_framenum(D, "data", 1.09); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DOMAIN); CHECK(!isnan(f1),f1,"%.15g","%s",f1,"not a number"); return r; } libgetdata-0.9.0/test/alter_window.c0000640000175000017500000000425212614323564017630 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nwindow WINDOW data data LT 44\n"; unsigned char data_data[256]; unsigned char c[8]; gd_triplet_t threshold; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); threshold.r = 43; ret = gd_alter_window(D, "window", NULL, NULL, GD_WINDOP_GT, threshold); error = gd_error(D); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (i > 3) ? i + 40 : 0); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/parse_meta_implicit2.c0000640000175000017500000000310612614323564021223 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "parent/child/extra CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/convert_complex128_float64.c0000640000175000017500000000365712614323564022143 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST FLOAT64 0\n"; double c = 0; #ifdef GD_NO_C99_API double d[] = {8, 0}; #else double complex d = 8; #endif int fd, n1, n2, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); #ifdef GD_NO_C99_API n1 = gd_put_constant(D, "data", GD_COMPLEX128, d); #else n1 = gd_put_constant(D, "data", GD_COMPLEX128, &d); #endif n2 = gd_get_constant(D, "data", GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKF(c, 8.); return r; } libgetdata-0.9.0/test/svlist_meta_invalid.c0000640000175000017500000000257012614323564021173 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_mstrings(D, "parent"); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error,GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/flush_bad_code.c0000640000175000017500000000310412614323564020046 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to flush a non-existant field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "#\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_flush(D, "no-such-field"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/get_linterp_sort.c0000640000175000017500000000416712614323564020522 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINTERP */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[64]; int fd, n, error, r = 0; DIRFILE *D; FILE *t; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); t = fopen(table, "wt"); fprintf(t, "%s", "100 600\n2 4\n50 100\n0 0\n7 14\n"); fclose(t); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(table); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 10); return r; } libgetdata-0.9.0/test/parse_hidden_field.c0000640000175000017500000000262212614323564020721 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/HIDDEN data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_meta_raw.c0000640000175000017500000000310312614323564020115 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent child RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/trunc.c0000640000175000017500000000351312614323564016264 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int fd, e1, e2, unlink_data, stat_format, r = 0; struct stat buf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format, strlen(format)); close(fd); close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666)); D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); CHECKI(unlink_data, -1); stat_format = stat(format, &buf); CHECKI(stat_format, 0); CHECK((buf.st_size > 0),buf.st_size,"%lli","%s",(long long)buf.st_size,"> 0"); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_include_ref.c0000640000175000017500000000353312614323564020604 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT8 1\n" "/REFERENCE data\n" "INCLUDE format1\n"; const char *format1_data = "zata RAW UINT8 11\n/REFERENCE zata\n"; int fd, r = 0; DIRFILE *D; const char *ref; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); ref = gd_reference(D, NULL); CHECKS(ref, "zata"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_bit_scalar.c0000640000175000017500000000361112614323564020454 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read BIT entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "bitnum CONST UINT8 3\n" "numbits CONST UINT8 4\n" "data BIT in1 bitnum numbits\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_BIT_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKI(E.EN(bit,bitnum), 3); CHECKI(E.EN(bit,numbits), 4); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/get_endian_complex128_arm.c0000640000175000017500000002171512614323564022053 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read arm-endian COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\nENDIAN little arm\n"; #ifdef GD_NO_C99_API double u[20]; double v[20][2]; #else double complex u[10]; double complex v[20]; #endif const unsigned char data_data[64 * 16] = { 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x39, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0xd5, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x9f, 0x55, 0x40, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x37, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x53, 0x68, 0x40, 0x00, 0x00, 0x00, 0x00, 0xde, 0x3e, 0x72, 0x40, 0x00, 0x00, 0x00, 0x40, 0x4d, 0x5e, 0x7b, 0x40, 0x00, 0x00, 0x00, 0x60, 0xba, 0x86, 0x84, 0x40, 0x00, 0x00, 0x00, 0x08, 0x17, 0xca, 0x8e, 0x40, 0x00, 0x00, 0x00, 0x0c, 0x91, 0x17, 0x97, 0x40, 0x00, 0x00, 0x00, 0x49, 0xac, 0x51, 0xa1, 0x40, 0x00, 0x00, 0xc0, 0xf6, 0x83, 0xfa, 0xa9, 0x40, 0x00, 0x00, 0x20, 0x72, 0xe2, 0x7b, 0xb3, 0x40, 0x00, 0x00, 0x98, 0x95, 0xd3, 0x39, 0xbd, 0x40, 0x00, 0x00, 0x64, 0xe0, 0x5e, 0xeb, 0xc5, 0x40, 0x00, 0x00, 0x4b, 0xe8, 0x87, 0x70, 0xd0, 0x40, 0x00, 0x40, 0x38, 0x2e, 0xca, 0xa8, 0xd8, 0x40, 0x00, 0x60, 0x54, 0xc5, 0x98, 0x7e, 0xe2, 0x40, 0x00, 0x48, 0xff, 0x13, 0xe4, 0xbd, 0xeb, 0x40, 0x00, 0xec, 0xfe, 0x1d, 0x6b, 0xce, 0xf4, 0x40, 0x00, 0x31, 0x7f, 0x16, 0xa0, 0x35, 0xff, 0x40, 0x80, 0xc9, 0xbe, 0xa1, 0x38, 0x68, 0x07, 0x41, 0x20, 0x17, 0x4f, 0x79, 0x2a, 0x8e, 0x11, 0x41, 0x58, 0x51, 0xfb, 0x5a, 0x3f, 0x55, 0x1a, 0x41, 0x04, 0xfa, 0x78, 0x88, 0xef, 0xbf, 0x23, 0x41, 0x83, 0xbb, 0x5a, 0xa6, 0xe7, 0x9f, 0x2d, 0x41, 0x44, 0x19, 0x88, 0x79, 0xed, 0x37, 0x36, 0x41, 0xf3, 0x12, 0x26, 0x9b, 0xf2, 0xa9, 0x40, 0x41, 0x36, 0x8e, 0x5c, 0x34, 0xeb, 0xfe, 0x48, 0x41, 0x51, 0xd5, 0x8a, 0x4e, 0x30, 0xbf, 0x52, 0x41, 0xfd, 0x1f, 0xe8, 0x7a, 0xc8, 0x1e, 0x5c, 0x41, 0xfc, 0x2f, 0x5c, 0xb8, 0x16, 0x17, 0x65, 0x41, 0xfd, 0x23, 0x45, 0x8a, 0xa1, 0xa2, 0x6f, 0x41, 0xfc, 0xb5, 0x67, 0xcf, 0xf9, 0xb9, 0x77, 0x41, 0x7d, 0xc8, 0x8d, 0x5b, 0x7b, 0xcb, 0x81, 0x41, 0x5e, 0x56, 0xaa, 0x04, 0x38, 0xb1, 0x8a, 0x41, 0x8d, 0x81, 0xff, 0x86, 0xea, 0x04, 0x94, 0x41, 0x2a, 0xa1, 0x3f, 0x65, 0x5f, 0x07, 0x9e, 0x41, 0xbf, 0x71, 0xdf, 0x97, 0x87, 0x85, 0xa6, 0x41, 0x4f, 0x95, 0xe7, 0xb1, 0x25, 0xe4, 0xb0, 0x41, 0xfb, 0xaf, 0x6d, 0xc5, 0x38, 0x56, 0xb9, 0x41, 0xf8, 0x87, 0x24, 0xa8, 0xaa, 0x00, 0xc3, 0x41, 0xfa, 0x65, 0x1b, 0x7e, 0xff, 0x80, 0xcc, 0x41, 0xf7, 0x18, 0x29, 0xbd, 0xbf, 0x60, 0xd5, 0x41, 0xb9, 0xd2, 0xde, 0xcd, 0x8f, 0x08, 0xe0, 0x41, 0x0b, 0x1e, 0x67, 0xda, 0xd7, 0x0c, 0xe8, 0x41, 0x10, 0xad, 0x9a, 0xc7, 0xa1, 0x09, 0xf2, 0x41, 0xcc, 0x01, 0xb4, 0xd5, 0x72, 0x0e, 0xfb, 0x41, 0xb2, 0x02, 0x8e, 0xc0, 0xd6, 0x4a, 0x04, 0x42, 0x06, 0x82, 0x6a, 0x10, 0x41, 0x70, 0x0e, 0x42, 0x09, 0xc3, 0x9f, 0x18, 0x30, 0xd4, 0x16, 0x42, 0x47, 0xd2, 0x77, 0xd2, 0x24, 0x1f, 0x21, 0x42, 0xb5, 0xdd, 0xd9, 0x9d, 0xb6, 0xae, 0x29, 0x42, 0x90, 0xcc, 0xc6, 0xec, 0x09, 0x43, 0x33, 0x42, 0x6c, 0x19, 0x95, 0x31, 0x8d, 0xe4, 0x3c, 0x42, 0x22, 0xa6, 0x5f, 0xca, 0x6a, 0xab, 0x45, 0x42, 0x9a, 0xbc, 0xc7, 0x57, 0x8f, 0x40, 0x50, 0x42, 0x74, 0xcd, 0xd5, 0xc1, 0xd7, 0x60, 0x58, 0x42, 0x2e, 0xb4, 0xc0, 0xa2, 0xa1, 0x48, 0x62, 0x42, 0x22, 0x87, 0x10, 0xba, 0xf2, 0x6c, 0x6b, 0x42, 0xb3, 0xca, 0x18, 0x97, 0xb5, 0x91, 0x74, 0x42, 0x06, 0x98, 0x52, 0xf1, 0x90, 0xda, 0x7e, 0x42, 0x09, 0xe4, 0xfb, 0xe9, 0xec, 0x23, 0x87, 0x42, 0x07, 0xeb, 0x7c, 0xaf, 0xf1, 0x5a, 0x91, 0x42, 0x45, 0xb0, 0x9d, 0x83, 0x6a, 0x08, 0x9a, 0x42, 0x68, 0x88, 0x6c, 0x45, 0x4f, 0x86, 0xa3, 0x42, 0x4e, 0x66, 0x11, 0xb4, 0x77, 0x49, 0xad, 0x42, 0x75, 0x19, 0x1a, 0x8e, 0x19, 0xf7, 0xb5, 0x42, 0x18, 0x93, 0x93, 0xaa, 0x53, 0x79, 0xc0, 0x42, 0x52, 0xae, 0xee, 0x3f, 0xfc, 0xb5, 0xc8, 0x42, 0x7b, 0x05, 0xe6, 0xdf, 0x7d, 0x88, 0xd2, 0x42, 0x1c, 0x84, 0xec, 0xa7, 0xbc, 0xcc, 0xdb, 0x42, 0x2a, 0xc6, 0xe2, 0x7b, 0x8d, 0xd9, 0xe4, 0x42, 0xa0, 0x14, 0xea, 0x5c, 0x54, 0x46, 0xef, 0x42, 0xf0, 0x1e, 0x5f, 0x0b, 0xbf, 0x74, 0xf7, 0x42, 0x34, 0x57, 0x87, 0x08, 0x8f, 0x97, 0x01, 0x43, 0x67, 0x81, 0x65, 0x46, 0x56, 0x63, 0x0a, 0x43, 0x1a, 0x42, 0x98, 0xe9, 0x81, 0xca, 0x13, 0x43, 0x94, 0x31, 0x32, 0x2f, 0xc1, 0xaf, 0x1d, 0x43, 0x5e, 0x4a, 0xcb, 0xc6, 0xd1, 0x43, 0x26, 0x43, 0xc6, 0x77, 0x18, 0x55, 0xdc, 0xb2, 0x30, 0x43, 0xd4, 0x59, 0xd2, 0xff, 0x4b, 0x0c, 0x39, 0x43, 0xbe, 0x86, 0xbb, 0x7f, 0x38, 0xc9, 0x42, 0x43, 0x0e, 0xa5, 0xcc, 0x9f, 0xd4, 0x2d, 0x4c, 0x43, 0x95, 0xf7, 0xb2, 0xef, 0x5f, 0x22, 0x55, 0x43, 0xb0, 0x39, 0xc6, 0xb3, 0x8f, 0xb3, 0x5f, 0x43, 0x88, 0x56, 0xa9, 0x8d, 0xab, 0xc6, 0x67, 0x43, 0xe6, 0x00, 0x3f, 0xaa, 0x00, 0xd5, 0x71, 0x43, 0xac, 0x40, 0xaf, 0xbf, 0x81, 0xbf, 0x7a, 0x43, 0x02, 0xe1, 0x86, 0x1f, 0xa0, 0x0f, 0x84, 0x43, 0xc2, 0x28, 0xa5, 0xd7, 0x71, 0x17, 0x8e, 0x43, 0x23, 0xbd, 0x77, 0x43, 0x94, 0x91, 0x96, 0x43, 0xda, 0xcd, 0x99, 0xf2, 0x2f, 0xed, 0xa0, 0x43, 0x64, 0x5a, 0xf3, 0xb5, 0xc7, 0x63, 0xa9, 0x43, 0x96, 0x07, 0xed, 0x90, 0xd5, 0x0a, 0xb3, 0x43, 0xb0, 0xc5, 0xb1, 0xac, 0x40, 0x90, 0xbc, 0x43, 0x88, 0xa8, 0x0a, 0x83, 0x30, 0x6c, 0xc5, 0x43, 0x66, 0xfe, 0x47, 0x62, 0x24, 0x11, 0xd0, 0x43, 0xcc, 0xfe, 0xb5, 0x49, 0xb6, 0x19, 0xd8, 0x43, 0x32, 0xfe, 0x90, 0x6e, 0x48, 0x13, 0xe2, 0x43, 0xa6, 0xbe, 0xec, 0xd2, 0xed, 0x1c, 0xeb, 0x43, 0xf9, 0x1d, 0x63, 0x3c, 0xb1, 0x55, 0xf4, 0x43, 0x7b, 0x56, 0x4a, 0xed, 0x8a, 0x80, 0xfe, 0x43, 0xb8, 0x81, 0xef, 0xe3, 0x68, 0xe0, 0x06, 0x44, 0x4a, 0xa1, 0xf3, 0x2a, 0x4e, 0x28, 0x11, 0x44, 0xf8, 0xb8, 0x36, 0x20, 0x75, 0xbc, 0x19, 0x44, 0x74, 0x15, 0x52, 0x30, 0x57, 0x4d, 0x23, 0x44, 0x17, 0x90, 0x3d, 0xe4, 0x03, 0xf4, 0x2c, 0x44, 0x22, 0x58, 0x5c, 0xd6, 0x02, 0xb7, 0x35, 0x44, 0x1a, 0x42, 0xc5, 0xe0, 0x42, 0x49, 0x40, 0x44, 0x94, 0xf1, 0x93, 0x28, 0xe3, 0x6d, 0x48, 0x44, 0x5e, 0xea, 0xdd, 0x3c, 0x6a, 0x52, 0x52, 0x44, 0xc6, 0x6f, 0xa6, 0x6d, 0x9f, 0x7b, 0x5b, 0x44, 0xa9, 0xa7, 0x79, 0xa4, 0xb7, 0x9c, 0x64, 0x44, 0xbf, 0x3d, 0x5b, 0xbb, 0x13, 0xeb, 0x6e, 0x44, 0x9e, 0xdc, 0x08, 0x99, 0x4e, 0x30, 0x77, 0x44, 0x76, 0xa5, 0xc6, 0xb2, 0x3b, 0x64, 0x81, 0x44, 0x18, 0xfc, 0x14, 0x06, 0x58, 0x16, 0x8a, 0x44, 0x24, 0x7a, 0x1f, 0x89, 0xc2, 0x90, 0x93, 0x44, 0x9b, 0x9b, 0xd7, 0x66, 0x23, 0x59, 0x9d, 0x44, 0x68, 0x69, 0x43, 0x9a }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); #ifdef GD_NO_C99_API v[0][0] = 1.5; v[0][1] = 2.25; for (i = 1; i < 20; ++i) { v[i][0] = v[i - 1][0] * 2.25; v[i][1] = v[i - 1][1] * 2.25; } #else v[0] = 1.5 + _Complex_I * 2.25; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 2.25; #endif fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * 16 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) { #ifdef GD_NO_C99_API CHECKCi(i, u + 2 * i, v[i + 5]); #else CHECKCi(i, u[i], v[i + 5]); #endif } return r; } libgetdata-0.9.0/test/bzip_nframes.c0000640000175000017500000000445312614323564017614 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) { perror(BZIP2); r = 1; } #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/convert_uint8_int32.c0000640000175000017500000000376112614323564020764 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; int32_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/entry_bit.c0000640000175000017500000000355512614323564017136 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read BIT entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1 3 4\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_BIT_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKI(E.EN(bit,bitnum), 3); CHECKI(E.EN(bit,numbits), 4); CHECKP(E.scalar[0]); CHECKP(E.scalar[1]); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_uint8_uint32.c0000640000175000017500000000402412614323564021142 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint32_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/convert_int64_int16.c0000640000175000017500000000376212614323564020664 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/dfes_bit.c0000640000175000017500000000311512614323564016706 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a BIT entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in 3 2\n"; int fd, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/open_sym_at.c0000640000175000017500000000332712614323564017451 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD return 77; #else const char *filedir = "dirfile/link/"; const char *format = "dirfile/format"; char *targ; int error, r = 0; int cwd_size = 2048; char *ptr, *cwd = NULL; DIRFILE *D; gdtest_getcwd(ptr, cwd, cwd_size); rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ targ = (char*)malloc(cwd_size + 8); sprintf(targ, "%s/dirfile", cwd); symlink(targ, "dirfile/link"); free(targ); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); free(cwd); return r; #endif } libgetdata-0.9.0/test/parse_mplex.c0000640000175000017500000000262112614323564017447 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MPLEX in1 in2 1 2\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/unclude_open.c0000640000175000017500000000523712614323564017616 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *data = "dirfile/data"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n"; const char *format1_data = "data RAW UINT8 11\n/INCLUDE format2\n"; const char *format2_data = "c CONST UINT8 11\n"; int fd, ret, e1, e2, unlink_format1, unlink_format2, r = 0; unsigned int nfields, nfragments; unsigned char data_data[256]; uint8_t c = 3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_putdata(D, "data", 0, 0, 0, 1, GD_UINT8, &c); ret = gd_uninclude(D, 1, 0); e1 = gd_error(D); CHECKI(ret,0); CHECKI(e1, 0); nfields = gd_nfields(D); CHECKI(nfields,2); nfragments = gd_nfragments(D); CHECKI(nfragments,1); e2 = gd_close(D); CHECKI(e2, 0); unlink_format2 = unlink(format2); unlink_format1 = unlink(format1); unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_format2,0); CHECKI(unlink_format1,0); return r; } libgetdata-0.9.0/test/spf_polynom.c0000640000175000017500000000320312614323564017472 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* The SPF of a polynom should equal the SPF of its input field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in RAW UINT8 11\n" "polynom POLYNOM in 1 2 1 3\n"; int fd, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "polynom"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/flist_meta_invalid.c0000640000175000017500000000257512614323564020775 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_mfield_list(D, "parent"); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/add_raw_spf_scalar.c0000640000175000017500000000373312614323564020733 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); memset(&E, 0, sizeof E); E.field = "data"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 0; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = "const"; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "const CONST UINT8 2", 0); gd_add(D, &E); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); CHECKS(e.scalar[0], "const"); gd_free_entry_strings(&e); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/close_bad.c0000640000175000017500000000213112614323564017037 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Closing an invalid dirfile should succeed cleanly */ #include "test.h" int main(void) { DIRFILE *D = gd_open("a non_existant dirfile", 0); int r = 0; int ret = gd_close(D); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/name_meta.c0000640000175000017500000000446612614323564017067 0ustar alastairalastair/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 8\n" "data/meta1 CONST UINT8 8\n" "data/meta2 CONST UINT8 8\n" "/ALIAS data/meta3 data\n" "/ALIAS data/meta4 data/meta2\n"; int fd, ret, e1, e2, e3, e4, e5, e6, r = 0; DIRFILE *D; const char *s1, *s2; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_rename(D, "data", "zata", 0); e1 = gd_error(D); CHECKI(ret,0); CHECKI(e1,0); gd_get_constant(D, "zata", GD_NULL, NULL); e2 = gd_error(D); CHECKI(e2,0); gd_get_constant(D, "zata/meta1", GD_NULL, NULL); e3 = gd_error(D); CHECKI(e3,0); gd_get_constant(D, "zata/meta2", GD_NULL, NULL); e4 = gd_error(D); CHECKI(e4,0); gd_get_constant(D, "zata/meta3", GD_NULL, NULL); e5 = gd_error(D); s1 = gd_alias_target(D, "zata/meta3"); CHECKI(e5,0); CHECKS(s1, "zata"); gd_get_constant(D, "zata/meta4", GD_NULL, NULL); e6 = gd_error(D); s2 = gd_alias_target(D, "zata/meta4"); CHECKI(e6,0); CHECKS(s2, "zata/meta2"); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_alias.c0000640000175000017500000000265312614323564017420 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n/ALIAS rata data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/nfields_hidden.c0000640000175000017500000000364212614323564020073 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1\n" "/HIDDEN raw1/const\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nfields(D); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 7); return r; } libgetdata-0.9.0/test/parse_lincom.c0000640000175000017500000000305712614323564017607 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM 2 in1 1 0 in2 1 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/flist_type_hidden.c0000640000175000017500000000405312614323564020626 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 STRING UINT8 1\n" "data2 STRING UINT8 1\n" "/HIDDEN data2\n" "data3 STRING UINT8 1\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_field_list_by_type(D, GD_STRING_ENTRY); error = gd_error(D); CHECKI(error, GD_E_OK); CHECKPN(field_list); if (field_list == NULL) r = 1; for (i = 0; field_list[i]; ++i) { CHECKIi(i,strlen(field_list[i]), 5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] != '1' && field_list[i][4] != '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i, 2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_lincom3.c0000640000175000017500000000372012614323564017334 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 3 data 2 3 data 1 0 data 10 4\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 72); return r; } libgetdata-0.9.0/test/convert_int32_uint16.c0000640000175000017500000000376412614323564021046 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; uint16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/fragment_index.c0000640000175000017500000000352012614323564020121 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read fragment index */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n"; const char *format1_data = "data RAW UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_fragment_index(D, "data"); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 1); return r; } libgetdata-0.9.0/test/move_data_endian.c0000640000175000017500000000510312614323564020403 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1\ndata RAW UINT16 11"; #ifdef WORDS_BIGENDIAN const char *format1_data = "ENDIAN little\n"; #else const char *format1_data = "ENDIAN big\n"; #endif uint16_t d, data_data[128]; int fd, i, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = fd * 0x201; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, GD_REN_DATA); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd == -1) { perror("open: "); r = 1; } else { while (read(fd, &d, sizeof(uint16_t))) { CHECKXi(i, d, i * 0x102); i++; } close(fd); } unlink(format1); unlink(format); unlink(data); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/seek_set.c0000640000175000017500000000366412614323564016742 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", 6, 0, GD_SEEK_SET); e1 = gd_error(D); n = gd_tell(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(m, 48); CHECKI(n, 48); return r; } libgetdata-0.9.0/test/flush_invalid.c0000640000175000017500000000246612614323564017766 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Writing data to an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR); gd_flush(D, NULL); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/nframes_off64.c0000640000175000017500000000365312614323564017575 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 # define SKIP_TEST #else # define _FILE_OFFSET_BITS 64 #endif #include "test.h" #include #include #include #include #include #include int main(void) { #ifdef SKIP_TEST return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 1\n"; int fd, r = 0; size_t n; const size_t len = strlen(data); DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKU(n, len); return r; #endif } libgetdata-0.9.0/test/dfes_recip.c0000640000175000017500000000304512614323564017234 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RECIP b e\ne CONST UINT8 3"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/parse_alias_missing.c0000640000175000017500000000263412614323564021150 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS alias target\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/add_alias_meta.c0000640000175000017500000000311712614323564020040 0ustar alastairalastair/* Copyright (C) 2012, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *target; int error, i, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT8, 1, 0); gd_add_alias(D, "data/alias", "data", 0); error = gd_error(D); /* check */ target = gd_alias_target(D, "data/alias"); CHECKS(target, "data"); i = gd_fragment_index(D, "data/alias"); n = gd_naliases(D, "data/alias"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(i, 0); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/parse_raw_ncols.c0000640000175000017500000000302512614323564020310 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/nframes_spf.c0000640000175000017500000000401712614323564017434 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* The number of frames should track the samples per frame */ #include "test.h" #include #include #include #include #include #include #include static void write_format(const char *format, int spf) { char format_data[100]; int fd; sprintf(format_data, "data RAW UINT8 %i\n", spf); fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int fd, i, r = 0; const size_t len = strlen(data); rmdirfile(); mkdir(filedir, 0777); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); for (i = 1; i < (int)len + 1; ++i) { DIRFILE *D; unsigned int spf; size_t n; write_format(format, i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); n = gd_nframes(D); CHECKUi(i, n, len / spf); gd_discard(D); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/eof_phase_neg.c0000640000175000017500000000341012614323564017707 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 1\nphase PHASE data 1000"; int fd, error, r = 0; off_t n; const size_t len = strlen(data); DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_eof(D, "phase"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/put_crecip.c0000640000175000017500000000427212614323564017271 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div RECIP data 0;1000.\ndata RAW INT8 8\n"; int8_t d; double c[16]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) { c[2 * i] = 0; c[2 * i + 1] = (40. + i); } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "div", 5, 0, 1, 0, GD_COMPLEX128, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d, 1000. / i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/eof_bit.c0000640000175000017500000000342112614323564016536 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 1\nbit BIT data 0\n"; int fd, error, r = 0; off_t n; const size_t len = strlen(data); DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_eof(D, "bit"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI((int)n, (int)len / 2); return r; } libgetdata-0.9.0/test/add_crecip.c0000640000175000017500000000356312614323564017213 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; #ifdef GD_NO_C99_API const double cdividend[2] = {33.3, 44.4}; #else const double complex cdividend = 33.3 + _Complex_I * 44.4; #endif gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_crecip(D, "new", "in", cdividend, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RECIP_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKC(e.EN(recip,cdividend), cdividend); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/flist_type_meta_invalid.c0000640000175000017500000000262612614323564022033 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_mfield_list_by_type(D, "parent", GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/gzip_seek.c0000640000175000017500000000413712614323564017114 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; #ifdef USE_GZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); error = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(error, 0); CHECKI(n, 40); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, -1); #endif return r; #endif } libgetdata-0.9.0/test/convert_int16_uint32.c0000640000175000017500000000377512614323564021050 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; uint32_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/fragment_parent.c0000640000175000017500000000371112614323564020305 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n"; const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2 UINT8 11"; const char *format2_data = "c CONST UINT8 11\n"; int fd, parent, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); parent = gd_parent_fragment(D, 2); error = gd_error(D); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(parent, 1); return r; } libgetdata-0.9.0/test/get_bit.c0000640000175000017500000000365612614323564016556 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read BIT */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "bit BIT data 1 3\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 2); return r; } libgetdata-0.9.0/test/lzma_get.c0000640000175000017500000000435512614323564016740 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *lzmadata = "dirfile/data.lzma"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; #ifdef USE_LZMA int i; #endif int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -F lzma -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; #ifdef USE_LZMA D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(lzmadata); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/move_alias.c0000640000175000017500000000353612614323564017255 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n" "/ALIAS alias data\n" "data RAW UINT8 11\n"; const char *format1_data = "#\n"; int fd, ret, error, fa, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "alias", 1, 0); error = gd_error(D); fa = gd_fragment_index(D, "alias"); fd = gd_fragment_index(D, "data"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(fa, 1); CHECKI(fd, 0); return r; } libgetdata-0.9.0/test/put_linterp_notab.c0000640000175000017500000000347512614323564020670 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write LINCOM 1 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n"; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_IO); return r; } libgetdata-0.9.0/test/tell.c0000640000175000017500000000364712614323564016101 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_tell() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL); e1 = gd_error(D); n = gd_tell(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n, 48); return r; } libgetdata-0.9.0/test/get_carray_slice.c0000640000175000017500000000337512614323564020436 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read constant */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n"; double c[4]; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_carray_slice(D, "carray", 2, 4, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); for (i = 0; i < 4; ++i) CHECKFi(i, c[i], 6.1 - i * 1.1); return r; } libgetdata-0.9.0/test/madd_polynom.c0000640000175000017500000000374112614323564017616 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a POLYNOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int j, error, ge_error, r = 0; gd_entry_t e; const char *in_field = "in"; const double a[4] = {1, 0.3, 0.5, 1.8}; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_polynom(D, "new", "meta", 3, in_field, a); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_POLYNOM_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(polynom,poly_ord), 3); CHECKX(e.flags, GD_EN_CALC); for (j = 0; j < 4; ++j) CHECKFi(j, e.EN(polynom,a)[j], a[j]); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/get_linterp_notab.c0000640000175000017500000000411412614323564020626 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINTERP */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[64]; int fd, n1, error1, n2, error2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); D = gd_open(filedir, GD_RDONLY); n1 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error1 = gd_error(D); n2 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n1, 0); CHECKI(error1, GD_E_IO); CHECKI(n2, 0); CHECKI(error2, GD_E_IO); return r; } libgetdata-0.9.0/test/put_recip.c0000640000175000017500000000423212614323564017122 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div RECIP data 1000.\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "div", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d, 1000. / i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_bit_numbits.c0000640000175000017500000000410112614323564020631 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nbit BIT data 1 1\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_bit(D, "bit", NULL, -1, 2); error = gd_error(D); n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i / 2); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/convert_int64_uint8.c0000640000175000017500000000376112614323564020771 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/put_phase_noin.c0000640000175000017500000000335712614323564020152 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write PHASE */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "phase PHASE data -2\n"; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "phase", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/madd_affix.c0000640000175000017500000000437512614323564017222 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 A Z\n"; int fd, e1, e2, e3, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); mkdir(filedir, 0777); memset(&E, 0, sizeof(E)); E.field = "AdataZ"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 1; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = NULL; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); gd_add(D, &E); e1 = gd_error(D); E.field = "data"; E.field_type = GD_CONST_ENTRY; E.EN(scalar,const_type) = GD_UINT8; E.fragment_index = 99; /* ignored */ gd_madd(D, &E, "AdataZ"); e2 = gd_error(D); /* check */ gd_entry(D, "AdataZ/data", &e); e3 = gd_error(D); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(e3, GD_E_OK); if (e3 == 0) { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 1); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } return r; } libgetdata-0.9.0/test/dfes_zero.c0000640000175000017500000000225212614323564017110 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a zeroed entry */ #include "test.h" #include #include #include #include #include #include int main(void) { gd_entry_t E; memset(&E, 0, sizeof(E)); gd_free_entry_strings(&E); return 0; } libgetdata-0.9.0/test/ascii_add.c0000640000175000017500000000346212614323564017034 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; gd_entry_t e; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_TEXT_ENCODED); gd_add_raw(D, "data", GD_UINT8, 2, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); if (unlink(data)) { perror("unlink"); r = 1; } unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/alter_polynom_coeff.c0000640000175000017500000000460712614323564021164 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n" "polynom POLYNOM data 1 2 1\n"; int32_t data_data[256]; const double a[] = {2, 1, 3}; int fd, i, ret, error, n, error2, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_polynom(D, "polynom", 0, NULL, a); error = gd_error(D); CHECKI(error,0); n = gd_entry(D, "polynom", &E); error2 = gd_error(D); gd_discard(D); CHECKS(E.field, "polynom"); CHECKI(E.field_type, GD_POLYNOM_ENTRY); CHECKI(E.EN(polynom,poly_ord), 2); CHECKX(E.flags, GD_EN_CALC); CHECKS(E.in_fields[0], "data"); for (i = 0; i < 3; ++i) CHECKFi(i,E.EN(polynom,a)[i], a[i]); unlink(data); unlink(format); rmdir(filedir); CHECKI(error2,0); CHECKI(n,0); CHECKI(ret,0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/get_phase_affix.c0000640000175000017500000000407412614323564020250 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 pre post\n"; const char *format1_data = "shift CONST INT32 -2\n" "phase PHASE data shift\n" "data RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "prephasepost", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKI(c, 3); return r; } libgetdata-0.9.0/test/madd_phase_invalid.c0000640000175000017500000000252012614323564020721 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_madd_phase(D, "new", "meta", "in", 3); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/get_const_repr.c0000640000175000017500000000332112614323564020143 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read constant with repr */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST COMPLEX128 8.3;9.2\n"; double c; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_constant(D, "const.m", GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKF(c, sqrt(8.3 * 8.3 + 9.2 * 9.2)); return r; } libgetdata-0.9.0/test/file.c0000640000175000017500000000421612614323564016051 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to get RAW filename */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, error, r = 0; char *path; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); path = gd_raw_filename(D, "data"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); /* This only checks whether the end of the returned path is what we expect. * This should work, since we can guarantee that both "dirfile" and "data" * aren't symlinks. */ #if GD_DIRSEP == '/' CHECKEOS(path,"dirfile/data"); #else CHECKEOS(path,"dirfile\\data"); #endif free(path); return r; } libgetdata-0.9.0/test/add_raw_type.c0000640000175000017500000000271312614323564017574 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_raw(D, "new", (gd_type_t)'c', 2, 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_BAD_TYPE); return r; } libgetdata-0.9.0/test/put_bit.c0000640000175000017500000000425212614323564016600 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write BIT */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "bit BIT data 2 3\ndata RAW UINT8 8\n"; uint8_t c[8]; uint8_t d = 0xA5; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); for (i = 0; i < 50; ++i) write(fd, &d, sizeof(uint8_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "bit", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i >= 48) { CHECKXi(i,d, 0xA5); } else CHECKXi(i,d,(0xA1 | (i - 40) << 2)); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); return r; } libgetdata-0.9.0/test/add_duplicate.c0000640000175000017500000000341612614323564017715 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int r = 0; int fd, error, n; gd_entry_t E; DIRFILE *D; E.field = "data"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_add(D, &E); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,2); CHECKI(error, GD_E_DUPLICATE); return r; } libgetdata-0.9.0/test/dfes_null.c0000640000175000017500000000216612614323564017107 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from NULL */ #include "test.h" #include #include #include #include #include #include int main(void) { gd_free_entry_strings(NULL); return 0; } libgetdata-0.9.0/test/convert_uint32_complex128.c0000640000175000017500000000431612614323564022001 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/convert_float64_int8.c0000640000175000017500000000376012614323564021116 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/nmeta_vectors_invalid.c0000640000175000017500000000257112614323564021513 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nmvectors(D, "raw1"); error = gd_error(D); gd_discard(D); CHECKU(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_ref.c0000640000175000017500000000305612614323564017101 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "REFERENCE data\ndata RAW UINT8 1"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/nmeta.c0000640000175000017500000000410412614323564016232 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nmfields(D, "raw1"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(nfields, 6); return r; } libgetdata-0.9.0/test/parse_malias_dup.c0000640000175000017500000000276012614323564020444 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n" "data/cata CONST UINT8 1\n" "/ALIAS eata data\n" "/ALIAS eata/cata data/cata\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/lzma_xz_move_to.c0000640000175000017500000000527612614323564020355 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data_raw = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n"; uint8_t data_in[256]; DIRFILE *D; #ifdef USE_LZMA uint8_t d; char command[4096]; int i; #endif int fd, e1, e2, unlink_raw, r = 0; struct stat buf; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_in[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_in, 256); close(fd); #ifdef USE_LZMA D = gd_open(filedir, GD_RDWR | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR); #endif gd_alter_encoding(D, GD_LZMA_ENCODED, 0, 1); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); #ifdef USE_LZMA if (stat(data_xz, &buf)) { perror("stat"); r = 1; } CHECKI(stat(data_raw, &buf), -1); #else if (stat(data_raw, &buf)) { perror("stat"); r = 1; } CHECKI(stat(data_xz, &buf), -1); #endif #ifdef USE_LZMA /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { fprintf(stderr, "command failed: %s\n", command); r = 1; } else { fd = open(data_raw, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, i); i++; } CHECKI(i, 256); close(fd); } } #endif unlink_raw = unlink(data_raw); unlink(format); rmdir(filedir); CHECKI(unlink_raw, 0); #ifdef USE_LZMA CHECKI(e1, GD_E_OK); #else CHECKI(e1, GD_E_UNSUPPORTED); #endif return r; } libgetdata-0.9.0/test/bof_phase.c0000640000175000017500000000464412614323564017065 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT16 5\n" "phase PHASE data 3\n" "/FRAMEOFFSET 35\n" "lincom LINCOM 2 phase2 1. 0. phase 1. 0.\n" "lincom2 LINCOM 2 phase 1. 0. phase2 1. 0.\n" "INCLUDE format1\n"; const char *format1_data = "data2 RAW UINT8 3\n" "FRAMEOFFSET 43\n" "phase2 PHASE data2 -7\n"; int fd, error1, error2, error3, error4, r = 0; off_t bof_phase, bof_phase2, bof_lincom, bof_lincom2; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); bof_phase = gd_bof(D, "phase"); error1 = gd_error(D); bof_phase2 = gd_bof(D, "phase2"); error2 = gd_error(D); bof_lincom = gd_bof(D, "lincom"); error3 = gd_error(D); bof_lincom2 = gd_bof(D, "lincom2"); error4 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(bof_phase, 172); CHECKI(error2, 0); CHECKI(bof_phase2, 136); CHECKI(error3, 0); CHECKI(bof_lincom, 136); CHECKI(error4, 0); CHECKI(bof_lincom2, 226); return r; } libgetdata-0.9.0/test/convert_uint8_complex64.c0000640000175000017500000000430412614323564021640 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/parse_window_op.c0000640000175000017500000000303112614323564020323 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data WINDOW in1 in2 = 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_meta_parent.c0000640000175000017500000000304612614323564020623 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "META parent child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/flac_get_little.c0000640000175000017500000000455312614323564020257 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; #ifdef USE_FLAC int i; #endif DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* encode */ snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; #ifdef USE_FLAC D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_LITTLE_ENDIAN); #else D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); #ifdef USE_FLAC CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKXi(i,c[i],40+i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/parse_scalar2.c0000640000175000017500000000312212614323564017646 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 9\ndata RAW UINT8 scalar<3\n"; int fd, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error,0); gd_entry(D, "data", &E); CHECKS(E.scalar[0], "scalar<3"); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_endian_complex128_little.c0000640000175000017500000000456412614323564022625 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write little-endian COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\nENDIAN little\n"; unsigned int i; #ifdef GD_NO_C99_API const double c[] = {1.5, 2.25}; #else const double complex c = 1.5 + _Complex_I * 2.25; #endif unsigned char x[2 * sizeof(double)] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40 }; unsigned char u[2 * sizeof(double)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); #else n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c); #endif error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * 2 * sizeof(double), SEEK_SET); read(fd, u, 2 * sizeof(double)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < 2 * sizeof(double); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/flist_meta.c0000640000175000017500000000434212614323564017261 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent data1 LINTERP UINT8 1\n" "META parent data2 LINTERP UINT8 1\n" "META parent data3 LINTERP UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_mfield_list(D, "parent"); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i] != NULL; ++i) { CHECKIi(i,strlen(field_list[i]), 5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i, 3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_mult.c0000640000175000017500000000277212614323564017466 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "mult MULTIPLY data data\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "mult"); error = gd_error(D); CHECKU(type, GD_FLOAT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_lincom_noin.c0000640000175000017500000000322312614323564020272 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM1 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM 1 data 2 3\n"; unsigned char c = 0; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/add_scalar.c0000640000175000017500000000361712614323564017213 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_LINCOM_ENTRY; E.fragment_index = 0; E.EN(lincom,n_fields) = 1; E.in_fields[0] = "INDEX"; E.EN(lincom,m)[0] = 1.; E.scalar[0] = NULL; E.scalar[0 + GD_MAX_LINCOM] = "c"; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "c CONST INT64 4", 0); gd_add(D, &E); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields), 1); CHECKF(e.EN(lincom,m)[0], 1); CHECKF(e.EN(lincom,b)[0], 4); CHECKP(e.scalar[0]); CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c"); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/spf_alias.c0000640000175000017500000000273412614323564017076 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 11\n/ALIAS alias data\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "alias"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/get_endian_complex128_little.c0000640000175000017500000002170612614323564022571 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\nENDIAN little\n"; #ifdef GD_NO_C99_API double u[20]; double v[20][2]; #else double complex u[10]; double complex v[20]; #endif const unsigned char data_data[64 * 16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x39, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0xd5, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x9f, 0x55, 0x40, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x37, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x53, 0x68, 0x40, 0x00, 0x00, 0x00, 0x40, 0xde, 0x3e, 0x72, 0x40, 0x00, 0x00, 0x00, 0x60, 0x4d, 0x5e, 0x7b, 0x40, 0x00, 0x00, 0x00, 0x08, 0xba, 0x86, 0x84, 0x40, 0x00, 0x00, 0x00, 0x0c, 0x17, 0xca, 0x8e, 0x40, 0x00, 0x00, 0x00, 0x49, 0x91, 0x17, 0x97, 0x40, 0x00, 0x00, 0xc0, 0xf6, 0xac, 0x51, 0xa1, 0x40, 0x00, 0x00, 0x20, 0x72, 0x83, 0xfa, 0xa9, 0x40, 0x00, 0x00, 0x98, 0x95, 0xe2, 0x7b, 0xb3, 0x40, 0x00, 0x00, 0x64, 0xe0, 0xd3, 0x39, 0xbd, 0x40, 0x00, 0x00, 0x4b, 0xe8, 0x5e, 0xeb, 0xc5, 0x40, 0x00, 0x40, 0x38, 0x2e, 0x87, 0x70, 0xd0, 0x40, 0x00, 0x60, 0x54, 0xc5, 0xca, 0xa8, 0xd8, 0x40, 0x00, 0x48, 0xff, 0x13, 0x98, 0x7e, 0xe2, 0x40, 0x00, 0xec, 0xfe, 0x1d, 0xe4, 0xbd, 0xeb, 0x40, 0x00, 0x31, 0x7f, 0x16, 0x6b, 0xce, 0xf4, 0x40, 0x80, 0xc9, 0xbe, 0xa1, 0xa0, 0x35, 0xff, 0x40, 0x20, 0x17, 0x4f, 0x79, 0x38, 0x68, 0x07, 0x41, 0x58, 0x51, 0xfb, 0x5a, 0x2a, 0x8e, 0x11, 0x41, 0x04, 0xfa, 0x78, 0x88, 0x3f, 0x55, 0x1a, 0x41, 0x83, 0xbb, 0x5a, 0xa6, 0xef, 0xbf, 0x23, 0x41, 0x44, 0x19, 0x88, 0x79, 0xe7, 0x9f, 0x2d, 0x41, 0xf3, 0x12, 0x26, 0x9b, 0xed, 0x37, 0x36, 0x41, 0x36, 0x8e, 0x5c, 0x34, 0xf2, 0xa9, 0x40, 0x41, 0x51, 0xd5, 0x8a, 0x4e, 0xeb, 0xfe, 0x48, 0x41, 0xfd, 0x1f, 0xe8, 0x7a, 0x30, 0xbf, 0x52, 0x41, 0xfc, 0x2f, 0x5c, 0xb8, 0xc8, 0x1e, 0x5c, 0x41, 0xfd, 0x23, 0x45, 0x8a, 0x16, 0x17, 0x65, 0x41, 0xfc, 0xb5, 0x67, 0xcf, 0xa1, 0xa2, 0x6f, 0x41, 0x7d, 0xc8, 0x8d, 0x5b, 0xf9, 0xb9, 0x77, 0x41, 0x5e, 0x56, 0xaa, 0x04, 0x7b, 0xcb, 0x81, 0x41, 0x8d, 0x81, 0xff, 0x86, 0x38, 0xb1, 0x8a, 0x41, 0x2a, 0xa1, 0x3f, 0x65, 0xea, 0x04, 0x94, 0x41, 0xbf, 0x71, 0xdf, 0x97, 0x5f, 0x07, 0x9e, 0x41, 0x4f, 0x95, 0xe7, 0xb1, 0x87, 0x85, 0xa6, 0x41, 0xfb, 0xaf, 0x6d, 0xc5, 0x25, 0xe4, 0xb0, 0x41, 0xf8, 0x87, 0x24, 0xa8, 0x38, 0x56, 0xb9, 0x41, 0xfa, 0x65, 0x1b, 0x7e, 0xaa, 0x00, 0xc3, 0x41, 0xf7, 0x18, 0x29, 0xbd, 0xff, 0x80, 0xcc, 0x41, 0xb9, 0xd2, 0xde, 0xcd, 0xbf, 0x60, 0xd5, 0x41, 0x0b, 0x1e, 0x67, 0xda, 0x8f, 0x08, 0xe0, 0x41, 0x10, 0xad, 0x9a, 0xc7, 0xd7, 0x0c, 0xe8, 0x41, 0xcc, 0x01, 0xb4, 0xd5, 0xa1, 0x09, 0xf2, 0x41, 0xb2, 0x02, 0x8e, 0xc0, 0x72, 0x0e, 0xfb, 0x41, 0x06, 0x82, 0x6a, 0x10, 0xd6, 0x4a, 0x04, 0x42, 0x09, 0xc3, 0x9f, 0x18, 0x41, 0x70, 0x0e, 0x42, 0x47, 0xd2, 0x77, 0xd2, 0x30, 0xd4, 0x16, 0x42, 0xb5, 0xdd, 0xd9, 0x9d, 0x24, 0x1f, 0x21, 0x42, 0x90, 0xcc, 0xc6, 0xec, 0xb6, 0xae, 0x29, 0x42, 0x6c, 0x19, 0x95, 0x31, 0x09, 0x43, 0x33, 0x42, 0x22, 0xa6, 0x5f, 0xca, 0x8d, 0xe4, 0x3c, 0x42, 0x9a, 0xbc, 0xc7, 0x57, 0x6a, 0xab, 0x45, 0x42, 0x74, 0xcd, 0xd5, 0xc1, 0x8f, 0x40, 0x50, 0x42, 0x2e, 0xb4, 0xc0, 0xa2, 0xd7, 0x60, 0x58, 0x42, 0x22, 0x87, 0x10, 0xba, 0xa1, 0x48, 0x62, 0x42, 0xb3, 0xca, 0x18, 0x97, 0xf2, 0x6c, 0x6b, 0x42, 0x06, 0x98, 0x52, 0xf1, 0xb5, 0x91, 0x74, 0x42, 0x09, 0xe4, 0xfb, 0xe9, 0x90, 0xda, 0x7e, 0x42, 0x07, 0xeb, 0x7c, 0xaf, 0xec, 0x23, 0x87, 0x42, 0x45, 0xb0, 0x9d, 0x83, 0xf1, 0x5a, 0x91, 0x42, 0x68, 0x88, 0x6c, 0x45, 0x6a, 0x08, 0x9a, 0x42, 0x4e, 0x66, 0x11, 0xb4, 0x4f, 0x86, 0xa3, 0x42, 0x75, 0x19, 0x1a, 0x8e, 0x77, 0x49, 0xad, 0x42, 0x18, 0x93, 0x93, 0xaa, 0x19, 0xf7, 0xb5, 0x42, 0x52, 0xae, 0xee, 0x3f, 0x53, 0x79, 0xc0, 0x42, 0x7b, 0x05, 0xe6, 0xdf, 0xfc, 0xb5, 0xc8, 0x42, 0x1c, 0x84, 0xec, 0xa7, 0x7d, 0x88, 0xd2, 0x42, 0x2a, 0xc6, 0xe2, 0x7b, 0xbc, 0xcc, 0xdb, 0x42, 0xa0, 0x14, 0xea, 0x5c, 0x8d, 0xd9, 0xe4, 0x42, 0xf0, 0x1e, 0x5f, 0x0b, 0x54, 0x46, 0xef, 0x42, 0x34, 0x57, 0x87, 0x08, 0xbf, 0x74, 0xf7, 0x42, 0x67, 0x81, 0x65, 0x46, 0x8f, 0x97, 0x01, 0x43, 0x1a, 0x42, 0x98, 0xe9, 0x56, 0x63, 0x0a, 0x43, 0x94, 0x31, 0x32, 0x2f, 0x81, 0xca, 0x13, 0x43, 0x5e, 0x4a, 0xcb, 0xc6, 0xc1, 0xaf, 0x1d, 0x43, 0xc6, 0x77, 0x18, 0x55, 0xd1, 0x43, 0x26, 0x43, 0xd4, 0x59, 0xd2, 0xff, 0xdc, 0xb2, 0x30, 0x43, 0xbe, 0x86, 0xbb, 0x7f, 0x4b, 0x0c, 0x39, 0x43, 0x0e, 0xa5, 0xcc, 0x9f, 0x38, 0xc9, 0x42, 0x43, 0x95, 0xf7, 0xb2, 0xef, 0xd4, 0x2d, 0x4c, 0x43, 0xb0, 0x39, 0xc6, 0xb3, 0x5f, 0x22, 0x55, 0x43, 0x88, 0x56, 0xa9, 0x8d, 0x8f, 0xb3, 0x5f, 0x43, 0xe6, 0x00, 0x3f, 0xaa, 0xab, 0xc6, 0x67, 0x43, 0xac, 0x40, 0xaf, 0xbf, 0x00, 0xd5, 0x71, 0x43, 0x02, 0xe1, 0x86, 0x1f, 0x81, 0xbf, 0x7a, 0x43, 0xc2, 0x28, 0xa5, 0xd7, 0xa0, 0x0f, 0x84, 0x43, 0x23, 0xbd, 0x77, 0x43, 0x71, 0x17, 0x8e, 0x43, 0xda, 0xcd, 0x99, 0xf2, 0x94, 0x91, 0x96, 0x43, 0x64, 0x5a, 0xf3, 0xb5, 0x2f, 0xed, 0xa0, 0x43, 0x96, 0x07, 0xed, 0x90, 0xc7, 0x63, 0xa9, 0x43, 0xb0, 0xc5, 0xb1, 0xac, 0xd5, 0x0a, 0xb3, 0x43, 0x88, 0xa8, 0x0a, 0x83, 0x40, 0x90, 0xbc, 0x43, 0x66, 0xfe, 0x47, 0x62, 0x30, 0x6c, 0xc5, 0x43, 0xcc, 0xfe, 0xb5, 0x49, 0x24, 0x11, 0xd0, 0x43, 0x32, 0xfe, 0x90, 0x6e, 0xb6, 0x19, 0xd8, 0x43, 0xa6, 0xbe, 0xec, 0xd2, 0x48, 0x13, 0xe2, 0x43, 0xf9, 0x1d, 0x63, 0x3c, 0xed, 0x1c, 0xeb, 0x43, 0x7b, 0x56, 0x4a, 0xed, 0xb1, 0x55, 0xf4, 0x43, 0xb8, 0x81, 0xef, 0xe3, 0x8a, 0x80, 0xfe, 0x43, 0x4a, 0xa1, 0xf3, 0x2a, 0x68, 0xe0, 0x06, 0x44, 0xf8, 0xb8, 0x36, 0x20, 0x4e, 0x28, 0x11, 0x44, 0x74, 0x15, 0x52, 0x30, 0x75, 0xbc, 0x19, 0x44, 0x17, 0x90, 0x3d, 0xe4, 0x57, 0x4d, 0x23, 0x44, 0x22, 0x58, 0x5c, 0xd6, 0x03, 0xf4, 0x2c, 0x44, 0x1a, 0x42, 0xc5, 0xe0, 0x02, 0xb7, 0x35, 0x44, 0x94, 0xf1, 0x93, 0x28, 0x42, 0x49, 0x40, 0x44, 0x5e, 0xea, 0xdd, 0x3c, 0xe3, 0x6d, 0x48, 0x44, 0xc6, 0x6f, 0xa6, 0x6d, 0x6a, 0x52, 0x52, 0x44, 0xa9, 0xa7, 0x79, 0xa4, 0x9f, 0x7b, 0x5b, 0x44, 0xbf, 0x3d, 0x5b, 0xbb, 0xb7, 0x9c, 0x64, 0x44, 0x9e, 0xdc, 0x08, 0x99, 0x13, 0xeb, 0x6e, 0x44, 0x76, 0xa5, 0xc6, 0xb2, 0x4e, 0x30, 0x77, 0x44, 0x18, 0xfc, 0x14, 0x06, 0x3b, 0x64, 0x81, 0x44, 0x24, 0x7a, 0x1f, 0x89, 0x58, 0x16, 0x8a, 0x44, 0x9b, 0x9b, 0xd7, 0x66, 0xc2, 0x90, 0x93, 0x44, 0x68, 0x69, 0x43, 0x9a, 0x23, 0x59, 0x9d, 0x44 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); #ifdef GD_NO_C99_API v[0][0] = 1.5; v[0][1] = 2.25; for (i = 1; i < 20; ++i) { v[i][0] = v[i - 1][0] * 2.25; v[i][1] = v[i - 1][1] * 2.25; } #else v[0] = 1.5 + _Complex_I * 2.25; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 2.25; #endif fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * 16 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX128, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) #ifdef GD_NO_C99_API CHECKCi(i, u + 2 * i, v[i + 5]); #else CHECKCi(i, u[i], v[i + 5]); #endif return r; } libgetdata-0.9.0/test/flush_all.c0000640000175000017500000000412712614323564017104 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); gd_flush(D, NULL); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_scalar_repr.c0000640000175000017500000000404012614323564020643 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read LINCOM entry */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "m1 CONST COMPLEX128 1.1;3.2\n" "b1 CONST COMPLEX64 2.2;9.3\n" "data LINCOM 1 in1 m1.r b1.i\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_LINCOM_ENTRY); CHECKI(E.EN(lincom,n_fields), 1); CHECKS(E.in_fields[0], "in1"); CHECKS(E.scalar[0], "m1.r"); CHECKS(E.scalar[GD_MAX_LINCOM], "b1.i"); CHECKF(E.EN(lincom,m)[0], 1.1); CHECKF(E.EN(lincom,b)[0], 9.3); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_int16_uint16.c0000640000175000017500000000377512614323564021052 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; uint16_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/creat_rdonly_exists.c0000640000175000017500000000274212614323564021220 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_CREAT); e1 = gd_error(D); CHECKI(e1, 0); gd_add_spec(D, "test CONST UINT8 1", 0); e2 = gd_error(D); CHECKI(e2, GD_E_ACCMODE); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/move_affix_dup.c0000640000175000017500000000333612614323564020127 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 A B\n" "INCLUDE format1 C D\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); ret = gd_move(D, "AdataB", 2, 0); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, -1); CHECKI(error, GD_E_DUPLICATE); return r; } libgetdata-0.9.0/test/move_protect.c0000640000175000017500000000376612614323564017651 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test move */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\ndata RAW UINT8 11"; const char *format1_data = "/PROTECT all\n"; int fd, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); ret = gd_move(D, "data", 1, 0); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, -1); CHECKI(error, GD_E_PROTECTED); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/parse_malias.c0000640000175000017500000000272012614323564017570 0ustar alastairalastair/* Copyright (C) 2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n" "cata CONST UINT8 1\n" "/ALIAS data/eata cata\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); return r; } libgetdata-0.9.0/test/get_ff.c0000640000175000017500000000373312614323564016367 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/put_carray_client.c0000640000175000017500000000306412614323564020641 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0}; int r = 0, i; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_carray(D, "data", GD_UINT8, 8, GD_UINT8, &val, 0); gd_add_spec(D, "phase PHASE INDEX data<2>", 0); for (i = 0; i < 8; ++i) val[i] = i * (i + 1); gd_getdata(D, "phase", 0, 0, 0, 1, GD_UINT8, val); gd_put_carray(D, "data", GD_UINT8, &val); gd_getdata(D, "phase", 0, 0, 0, 1, GD_UINT8, val + 1); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(val[0], 0); CHECKI(val[1], 2 * (2 + 1)); return r; } libgetdata-0.9.0/test/get_multiply_ccin.c0000640000175000017500000000417712614323564020652 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read MULTIPLY */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data data\ndata RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { const double a = 5 + i; const double b = a / 256.; CHECKFi(i, c[i * 2], a * a - b * b); CHECKFi(i, c[i * 2 + 1], 2 * a * b); } return r; } libgetdata-0.9.0/test/open_nonexistent.c0000640000175000017500000000217012614323564020526 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Opening a non-existent dirfile should fail cleanly */ #include "test.h" int main(void) { DIRFILE *D = gd_open("a non_existant dirfile", 0); int error, r = 0; error = gd_error(D); CHECKI(error, GD_E_IO); gd_discard(D); return r; } libgetdata-0.9.0/test/get_endian16.c0000640000175000017500000000441112614323564017373 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint16_t c = 0; uint16_t data_data[128]; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT16 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); for (fd = 0; fd < 128; ++fd) data_data[fd] = (uint16_t)(fd * (0x0201)); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKX(c, 0x50a); return r; } libgetdata-0.9.0/test/madd_divide.c0000640000175000017500000000337112614323564017364 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_divide(D, "new", "meta", "in1", "in2"); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_DIVIDE_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/nentries_hidden.c0000640000175000017500000000371312614323564020275 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1\n" "/HIDDEN raw1/const\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nentries(D, NULL, GD_ALL_ENTRIES, GD_ENTRIES_HIDDEN); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 8); return r; } libgetdata-0.9.0/test/madd_alias.c0000640000175000017500000000312012614323564017201 0ustar alastairalastair/* Copyright (C) 2011, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, i, r = 0; DIRFILE *D; unsigned int n; const char *target; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT8, 1, 0); gd_madd_alias(D, "data", "alias", "data"); error = gd_error(D); /* check */ target = gd_alias_target(D, "data/alias"); CHECKS(target, "data"); i = gd_fragment_index(D, "data/alias"); n = gd_naliases(D, "data/alias"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(i, 0); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/convert_uint32_float64.c0000640000175000017500000000401212614323564021347 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; double c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_protect_data.c0000640000175000017500000000303412614323564020772 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "PROTECT data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/convert_uint32_uint8.c0000640000175000017500000000376612614323564021156 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/encode_get.c0000640000175000017500000000362212614323564017226 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test endianness */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 13\n"; unsigned char data_data[256]; int fd, error, r = 0; unsigned long n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_encoding(D, 0); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKX(n, GD_UNENCODED); return r; } libgetdata-0.9.0/test/parse_sort.c0000640000175000017500000000463012614323564017313 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Field sort check */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "c RAW UINT8 1\n" "d RAW UINT8 1\n" "g RAW UINT8 1\n" "h RAW UINT8 1\n" "i RAW UINT8 1\n" "k RAW UINT8 1\n" "f RAW UINT8 1\n" "b RAW UINT8 1\n" "a RAW UINT8 1\n" "j RAW UINT8 1\n" "e RAW UINT8 1\n"; int fd, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_field_list(D); if (gd_error(D)) r = 1; else if (field_list == NULL) r = 1; else if (field_list[0][0] != 'I') r = 1; else if (field_list[1][0] != 'a') r = 1; else if (field_list[2][0] != 'b') r = 1; else if (field_list[3][0] != 'c') r = 1; else if (field_list[4][0] != 'd') r = 1; else if (field_list[5][0] != 'e') r = 1; else if (field_list[6][0] != 'f') r = 1; else if (field_list[7][0] != 'g') r = 1; else if (field_list[8][0] != 'h') r = 1; else if (field_list[9][0] != 'i') r = 1; else if (field_list[10][0] != 'j') r = 1; else if (field_list[11][0] != 'k') r = 1; gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flush_lincom.c0000640000175000017500000000526712614323564017623 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *bata = "dirfile/bata"; const char *cata = "dirfile/cata"; const char *data = "dirfile/data"; const char *format_data = "bata RAW UINT8 8\n" "cata RAW UINT8 8\n" "data RAW UINT8 8\n" "lincom LINCOM bata 1 0 cata 1 0 data 1 0\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "bata", 5, 0, 1, 0, GD_UINT8, c); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); gd_flush(D, "lincom"); e1 = gd_error(D); CHECKI(n, 8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat(data)"); r = 1; } else CHECKIi(0, buf.st_size, 40 + 8 * sizeof(uint8_t)); if (!stat(cata, &buf)) { perror("stat(cata)"); r = 1; } if (stat(bata, &buf)) { perror("stat(bata)"); r = 1; } else CHECKIi(0, buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); fd = open(bata, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(1000 + i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(bata); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/open_cb_ignore.c0000640000175000017500000000333412614323564020102 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include static int saw_callback = 0; int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_) { saw_callback = 1; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(saw_callback, 1); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/get_uint32.c0000640000175000017500000000403412614323564017113 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t c[8], i; uint32_t data_data[128]; int fd, n, error, r = 0; unsigned j; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (j = 0; j < 128; ++j) data_data[j] = j * (0x02000001U); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 0x50000028 + i * 0x02000001); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/seek_lincom.c0000640000175000017500000000367512614323564017432 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM cata 1 0 data 1 0\n" "/ENCODING none\n" "cata RAW UINT8 8\n" "data RAW UINT8 8\n"; int fd, e0, e1, e2, e3, r = 0; off_t m, n1, n2, n3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "lincom", 6, 0, GD_SEEK_SET | GD_SEEK_WRITE); e0 = gd_error(D); n1 = gd_tell(D, "lincom"); e1 = gd_error(D); n2 = gd_tell(D, "cata"); e2 = gd_error(D); n3 = gd_tell(D, "data"); e3 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e0, 0); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(e3, 0); CHECKI(m, 48); CHECKI(n1, 48); CHECKI(n2, 48); CHECKI(n3, 48); return r; } libgetdata-0.9.0/test/convert_int64_int32.c0000640000175000017500000000376212614323564020662 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_include_affix_ref.c0000640000175000017500000000350412614323564021757 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT8 1\n" "INCLUDE format1 A B\n"; const char *format1_data = "zata RAW UINT8 11\n/REFERENCE zata\n"; int fd, r = 0; DIRFILE *D; const char *ref; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); ref = gd_reference(D, NULL); CHECKS(ref, "AzataB"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_int16.c0000640000175000017500000000406512614323564016734 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t c[8]; int16_t data_data[64]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (int16_t)(fd * (0x0201) * (2 * (fd % 2) - 1)); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (0x5028 + i * 0x0201) * (2 * (i % 2) - 1)); return r; } libgetdata-0.9.0/test/name_updb_const.c0000640000175000017500000000372712614323564020300 0ustar alastairalastair/* Copyright (C) 2011-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "early RAW UINT8 c\n" "late LINCOM early c 0\n" "/ALIAS b c\n" "c CONST UINT8 2\n"; int fd, e1, e2, e3, r = 0; const char *s1, *s2, *s3; DIRFILE *D; gd_entry_t E; memset(&E, 0, sizeof(E)); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_validate(D, "early"); gd_rename(D, "c", "d", GD_REN_UPDB); e1 = gd_error(D); gd_spf(D, "early"); e2 = gd_error(D); gd_entry(D, "early", &E); s1 = E.scalar[0]; CHECKI(e1,0); CHECKS(s1, "d"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s2 = E.scalar[0]; CHECKI(e2,0); CHECKS(s2, "d"); gd_free_entry_strings(&E); gd_entry(D, "b", &E); e3 = gd_error(D); s3 = gd_alias_target(D, "b"); CHECKI(e3,0); CHECKS(s3, "d"); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_lincom_affix.c0000640000175000017500000000504012614323564020753 0ustar alastairalastair/* Copyright (C) 2012 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "INCLUDE format1 A Z\n"; const char *format1_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 2 data 1 0 data 1 0\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, e1, e2, n, r = 0; DIRFILE *D; const char *in_fields[3] = {"data", "phase", NULL}; const char *Ain_fieldsZ[3] = {"AdataZ", "AphaseZ", NULL}; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR); gd_alter_lincom(D, "AlincomZ", 0, in_fields, NULL, NULL); e1 = gd_error(D); gd_alter_lincom(D, "AlincomZ", 0, Ain_fieldsZ, NULL, NULL); e2 = gd_error(D); n = gd_getdata(D, "AlincomZ", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i * 2 + 81); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_BAD_CODE); CHECKI(e2, 0); CHECKI(n, 8); return r; } libgetdata-0.9.0/test/convert_float64_int64.c0000640000175000017500000000376712614323564021207 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; uint64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_mplex_nomax.c0000640000175000017500000000302712614323564020652 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MPLEX in1 in2 6\n"; int fd, e1, e2, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); e1 = gd_error(D); e2 = gd_entry(D, "data", &E); gd_discard(D); gd_free_entry_strings(&E); unlink(format); rmdir(filedir); CHECKI(e1,0); CHECKI(e2,0); CHECKI(E.EN(mplex,period),0); CHECKI(E.EN(mplex,count_val),6); return r; } libgetdata-0.9.0/test/sie_seek.c0000640000175000017500000000361412614323564016722 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; DIRFILE *D; int fd, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); CHECKI(n, 40); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/gzip_put.c0000640000175000017500000000546012614323564016775 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; #ifdef USE_GZIP char command[4096]; uint8_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_gz, &buf); #ifdef USE_GZIP if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(stat_data, -1); #endif #ifdef USE_GZIP /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(n, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/get_endian64.c0000640000175000017500000000442112614323564017377 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint64_t c = 0; uint64_t data_data[128]; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT64 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); for (fd = 0; fd < 128; ++fd) data_data[fd] = fd * (0x020100000201); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKX(c, 0x50a0000050a0000); return r; } libgetdata-0.9.0/test/flush_amb_code.c0000640000175000017500000000403512614323564020063 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, i = 0, r = 0; DIRFILE *D; gd_entry_t E; /* For no good, but long standing, reason, these are all valid field names, * I guess... */ char *code[] = {"0", "0x1", "02", "3.00", "4e0", "0x5p0"}; memset(&E, 0, sizeof(E)); E.field = "pathological"; E.field_type = GD_POLYNOM_ENTRY; E.EN(polynom,poly_ord) = 5; E.in_fields[0] = "INDEX"; E.scalar[0] = code[0]; E.scalar[1] = code[1]; E.scalar[2] = code[2]; E.scalar[3] = code[3]; E.scalar[4] = code[4]; E.scalar[5] = code[5]; E.scalar_ind[0] = -1; E.scalar_ind[1] = -1; E.scalar_ind[2] = -1; E.scalar_ind[3] = -1; E.scalar_ind[4] = -1; E.scalar_ind[5] = -1; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC | GD_VERBOSE); gd_add(D, &E); e1 = gd_error(D); CHECKI(e1, 0); gd_close(D); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "pathological", &E); e2 = gd_error(D); CHECKI(e2, 0); for (i = 0; i < 6; ++i) CHECKSi(i, E.scalar[i], code[i]); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/svlist0.c0000640000175000017500000000317512614323564016541 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data4 CONST UINT8 1\n"; int fd, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_strings(D); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); CHECKP(field_list[0]); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_uint32.c0000640000175000017500000000417412614323564017151 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t c[8], d, i; struct stat buf; int fd, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 40 + i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint32_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint32_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_endian_float32_arm.c0000640000175000017500000000414112614323564021446 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write arm-endian FLOAT32 (which is just little endian) */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 1\nENDIAN little arm\n"; unsigned int i; const float c = 1.5; unsigned char x[sizeof(float)] = { 0x00, 0x00, 0xC0, 0x3F }; unsigned char u[sizeof(float)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * sizeof(float), SEEK_SET); read(fd, u, sizeof(float)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < sizeof(float); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/get_complex128.c0000640000175000017500000000456312614323564017700 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double c[16]; double data_data[256]; #else double complex c[8]; double complex data_data[128]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) { #ifdef GD_NO_C99_API data_data[2 * fd] = data_data[2 * fd + 1] = 1.5 * fd; #else data_data[fd] = (double complex)(1.5 * (1 + _Complex_I) * fd); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API const double v[2] = {1.5 * (40 + i), 1.5 * (40 + i)}; CHECKCi(i, c + 2 * i, v); #else CHECKCi(i, c[i], 1.5 * (1 + _Complex_I) * (40 + i)); #endif } return r; } libgetdata-0.9.0/test/vlist_hidden.c0000640000175000017500000000351712614323564017611 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "/HIDDEN data2\n" "data3 RAW UINT8 1\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_vector_list(D); error = gd_error(D); CHECKI(error,0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { if (strcmp(field_list[i], "data1") == 0) continue; else if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "INDEX") == 0) continue; r = 1; } CHECKI(i,3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flac_add.c0000640000175000017500000000366012614323564016651 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.flac"; gd_entry_t e; int e1, e2, e3, unlink_data, r = 0; DIRFILE *D; rmdirfile(); #ifdef USE_FLAC D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_FLAC_ENCODED); #else D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_FLAC_ENCODED); #endif gd_add_raw(D, "data", GD_UINT8, 2, 0); e1 = gd_error(D); /* check */ e2 = gd_entry(D, "data", &e); #ifdef USE_FLAC CHECKI(e2, 0); if (e2 == 0) { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } #else CHECKI(e2, -1); #endif e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); #ifdef USE_FLAC CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); #endif unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/name_dot5.c0000640000175000017500000000347712614323564017015 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, r1, e1, r = 0; DIRFILE *D; gd_entry_t E1; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); /* In DSV 5 and earlier, this gives the field the valid name "d.ata" */ gd_dirfile_standards(D, 5); r1 = gd_rename(D, "data", "d.ata", 0); e1 = gd_error(D); CHECKI(r1,0); CHECKI(e1,0); if (gd_entry(D, "d.ata", &E1) == 0) { CHECKI(E1.flags & GD_EN_DOTTED, GD_EN_DOTTED); gd_free_entry_strings(&E1); } else r = 1; gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int64_complex64.c0000640000175000017500000000430312614323564021534 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/alter_lincom_offset.c0000640000175000017500000000432712614323564021153 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 2 data 1 0 data 1 0\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; const char *in_fields[3] = {"data", "phase", NULL}; double b[3] = {2, 3, 0}; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_lincom(D, "lincom", 0, in_fields, NULL, b); error = gd_error(D); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i * 2 + 86); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/parse_version_include.c0000640000175000017500000000347512614323564021522 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* VERSION should cross INCLUDEs */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "VERSION 999999\nINCLUDE format1\n"; const char *format1_data = "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_PERMISSIVE); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/get_cpolynom.c0000640000175000017500000000415212614323564017630 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read POLYNOM */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3;2 2;4 0;1\ndata RAW UINT8 1\n"; #ifdef GD_NO_C99_API double c[2] = {0, 0}; const double v[2] = {13, 47}; #else double complex c = 0; const double complex v = 13 + _Complex_I * 47; #endif unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKC(c, v); return r; } libgetdata-0.9.0/test/parse_protect_bad.c0000640000175000017500000000303412614323564020607 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "PROTECT badprotection\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/alter_raw_type.c0000640000175000017500000000426212614323564020154 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; uint16_t d; int fd, i, ret, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_raw(D, "data", GD_UINT16, 0, 1); error = gd_error(D); n = gd_nframes(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKX(d, i); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 32); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/entry_lincom_scalar.c0000640000175000017500000000466312614323564021167 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read LINCOM entry */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "m1 CONST FLOAT64 1\n" "b1 CONST FLOAT64 2\n" "m2 CONST FLOAT64 3\n" "b2 CONST FLOAT64 4\n" "m3 CONST FLOAT64 5\n" "b3 CONST FLOAT64 6\n" "data LINCOM 3 in1 m1 b1 in2 m2 b2 in3 m3 b3\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_LINCOM_ENTRY); CHECKI(E.EN(lincom,n_fields), 3); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); CHECKS(E.in_fields[2], "in3"); CHECKS(E.scalar[0], "m1"); CHECKS(E.scalar[1], "m2"); CHECKS(E.scalar[2], "m3"); CHECKS(E.scalar[3], "b1"); CHECKS(E.scalar[4], "b2"); CHECKS(E.scalar[5], "b3"); CHECKF(E.EN(lincom,m)[0], 1.); CHECKF(E.EN(lincom,b)[0], 2.); CHECKF(E.EN(lincom,m)[1], 3.); CHECKF(E.EN(lincom,b)[1], 4.); CHECKF(E.EN(lincom,m)[2], 5.); CHECKF(E.EN(lincom,b)[2], 6.); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/convert_float64_uint32.c0000640000175000017500000000376712614323564021367 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; uint32_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/move_index.c0000640000175000017500000000375312614323564017274 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test move */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\ndata RAW UINT8 11"; const char *format1_data = "#\n"; int fd, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); ret = gd_move(D, "data", 2, 0); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, -1); CHECKI(error, GD_E_BAD_INDEX); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/madd_multiply_invalid.c0000640000175000017500000000253012614323564021501 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_madd_multiply(D, "new", "meta", "in1", "in2"); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/zzip_seek.c0000640000175000017500000000377112614323564017142 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_ZZIP || !defined USE_ZZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *rawzip = "dirfile/raw.zip"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); chdir(filedir); snprintf(command, 4096, "%s raw data > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(data); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); CHECKI(n, 40); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(rawzip); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/convert_int8_float64.c0000640000175000017500000000377012614323564021117 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; double c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/move_move.c0000640000175000017500000000376012614323564017131 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test move */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\ndata RAW UINT8 11"; const char *format1_data = "#\n"; int fd, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, 0); error = gd_error(D); ge_ret = gd_entry(D, "data", &E); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/name_updb.c0000640000175000017500000000474612614323564017074 0ustar alastairalastair/* Copyright (C) 2011-2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "early PHASE data 0\n" "late PHASE data 0\n" "/ALIAS bata data\n" "data RAW UINT8 8\n" "lincom LINCOM data 1 0 INDEX 1 0 data 1 0\n" "phase PHASE data2 0\n"; int fd, e1, e2, e3, e4, e5, e6, r = 0; char *s1, *s2, *s4, *s5, *s6, *s7; const char *s3; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_validate(D, "early"); gd_rename(D, "data", "zata", GD_REN_UPDB); e1 = gd_error(D); CHECKI(e1, 0); gd_spf(D, "early"); e2 = gd_error(D); CHECKI(e2, 0); gd_spf(D, "late"); e3 = gd_error(D); CHECKI(e3, 0); gd_entry(D, "early", &E); s1 = E.in_fields[0]; CHECKS(s1, "zata"); gd_free_entry_strings(&E); gd_entry(D, "late", &E); s2 = E.in_fields[0]; CHECKS(s2, "zata"); gd_free_entry_strings(&E); gd_validate(D, "bata"); e4 = gd_error(D); s3 = gd_alias_target(D, "bata"); CHECKS(s3, "zata"); CHECKI(e4, 0); gd_entry(D, "phase", &E); s4 = E.in_fields[0]; e5 = gd_error(D); CHECKI(e5, 0); CHECKS(s4, "data2"); gd_free_entry_strings(&E); gd_entry(D, "lincom", &E); e6 = gd_error(D); s5 = E.in_fields[0]; s6 = E.in_fields[1]; s7 = E.in_fields[2]; CHECKI(e6, 0); CHECKS(s5, "zata"); CHECKS(s6, "INDEX"); CHECKS(s7, "zata"); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_char.c0000640000175000017500000000371512614323564016711 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to use a old-style type character should fail cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", 5, 0, 1, 0, (gd_type_t)'c', c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error, GD_E_BAD_TYPE); return r; } libgetdata-0.9.0/test/repr_float32.c0000640000175000017500000000427212614323564017436 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/foffs_alter_all.c0000640000175000017500000000412212614323564020250 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT8 8\n" "/FRAMEOFFSET 13\n" "/INCLUDE format1\n"; const char *format1_data = "data1 RAW UINT8 8\n/FRAMEOFFSET 14\n"; int fd, ret, error, r = 0; off_t o0, o1, o2, o3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); o0 = gd_frameoffset(D, 0); o1 = gd_frameoffset(D, 1); ret = gd_alter_frameoffset(D, 16, GD_ALL_FRAGMENTS, 0); error = gd_error(D); o2 = gd_frameoffset(D, 0); o3 = gd_frameoffset(D, 1); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(o0, 13); CHECKI(o1, 14); CHECKI(o2, 16); CHECKI(o3, 16); return r; } libgetdata-0.9.0/test/slim_get.c0000640000175000017500000000470112614323564016734 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_SLIM return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *slimdata = "dirfile/data.slm"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; #ifdef USE_SLIM int i; #endif DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) { perror("command"); r = 1; } #ifdef USE_SLIM D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(slimdata); unlink(format); rmdir(filedir); #ifdef USE_SLIM CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/convert_uint16_uint32.c0000640000175000017500000000401412614323564021220 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; uint32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/flist_meta2.c0000640000175000017500000000440412614323564017342 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent data1 LINTERP UINT8 1\n" "META parent data2 LINTERP UINT8 1\n" "META parent data3 LINTERP UINT8 1\n"; int fd, i, z, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); for (z = 0; z < 2; ++z) { field_list = gd_mfield_list(D, "parent"); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i] != NULL; ++i) { CHECKIi(i * 2 + z,strlen(field_list[i]), 5); CHECKIi(i * 2 + z,field_list[i][0], 'd'); CHECKIi(i * 2 + z,field_list[i][1], 'a'); CHECKIi(i * 2 + z,field_list[i][2], 't'); CHECKIi(i * 2 + z,field_list[i][3], 'a'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i@%i] = \"%s\"\n", i, z, field_list[i]); r = 1; } } CHECKIi(z, i, 3); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_scalar_carray.c0000640000175000017500000000375512614323564020557 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_LINCOM_ENTRY; E.fragment_index = 0; E.EN(lincom,n_fields) = 1; E.in_fields[0] = "INDEX"; E.EN(lincom,m)[0] = 1.; E.scalar[0] = NULL; E.scalar[0 + GD_MAX_LINCOM] = "c"; E.scalar_ind[0 + GD_MAX_LINCOM] = 3; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "c CARRAY INT64 1 2 3 4", 0); gd_add(D, &E); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields), 1); CHECKF(e.EN(lincom,m)[0], 1); CHECKF(e.EN(lincom,b)[0], 4); CHECKP(e.scalar[0]); CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c"); CHECKI(e.scalar_ind[0 + GD_MAX_LINCOM], 3); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/native_recip.c0000640000175000017500000000276612614323564017612 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "recip RECIP data 1\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "recip"); error = gd_error(D); CHECKU(type, GD_FLOAT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_divide_crin.c0000640000175000017500000000414112614323564020245 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data phase\n" "phase PHASE data.r 1\n" "data RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { CHECKFi(i, c[i * 2], (5. + i) / (6. + i)); CHECKFi(i, c[i * 2 + 1], (5. + i) / (6. + i) / 256.); } return r; } libgetdata-0.9.0/test/get_cpolynom_int.c0000640000175000017500000000373712614323564020512 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3;2 2;4 0;1\ndata RAW UINT8 1\n"; int32_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "polynom.r", 5, 0, 8, 0, GD_INT32, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 3 + 2 * (5 + i)); return r; } libgetdata-0.9.0/test/alter_linterp_move.c0000640000175000017500000000506712614323564021031 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *table = "dirfile/table"; const char *table1 = "dirfile/table1"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nlut LINTERP data table\n"; const char *tabledata = "0 0\n1000 5000\n"; const char *table1data = "0 0\n1000 10000\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, e1, e2, n, unlink_table, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, tabledata, strlen(tabledata)); close(fd); fd = open(table1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, table1data, strlen(table1data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_linterp(D, "lut", NULL, "table1", 1); e1 = gd_error(D); CHECKI(e1,0); CHECKI(ret,0); n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c); CHECKI(n,8); e2 = gd_close(D); CHECKI(e2, 0); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (i + 40) * 5); unlink(data); unlink_table = unlink(table); unlink(table1); unlink(format); rmdir(filedir); CHECKI(unlink_table,-1); return r; } libgetdata-0.9.0/test/get_heres.c0000640000175000017500000000404312614323564017075 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, m, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", 5, 0, GD_SEEK_SET); n = gd_getdata(D, "data", 0, GD_HERE, 0, 8, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(m, 40); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); return r; } libgetdata-0.9.0/test/add_type.c0000640000175000017500000000265312614323564016726 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; gd_entry_t E; E.field = "new"; E.field_type = GD_NO_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add(D, &E); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,1); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/put_float32.c0000640000175000017500000000422012614323564017267 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (float)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(float)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(float))) { if (i < 40 || i > 48) { CHECKFi(i,d,0); } else CHECKFi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_zero_float.c0000640000175000017500000000374412614323564020142 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "/FRAMEOFFSET 100\ndata RAW FLOAT64 8\n"; double c[8]; double data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8 * sizeof(double)); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd / 256.; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i, c[i], 0); return r; } libgetdata-0.9.0/test/get_polynom.c0000640000175000017500000000374712614323564017476 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read POLYNOM */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3 2 1\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 3 + 2 * 5 + 1 * 5 * 5); return r; } libgetdata-0.9.0/test/add_divide_invalid.c0000640000175000017500000000252212614323564020712 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_multiply(D, "new", "in1", "in2", 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/desync_reopen_inv.c0000640000175000017500000000350112614323564020637 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "bad format\n"; int e1, e2, e3, n1, n2, fd, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY); e1 = gd_error(D); /* ensure mtime ticks over */ sleep(1); /* modify the format file */ fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); n1 = gd_desync(D, GD_DESYNC_REOPEN); e2 = gd_error(D); n2 = gd_validate(D, "data"); e3 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_FORMAT); CHECKI(e3, GD_E_BAD_DIRFILE); CHECKI(n1, -1); CHECKI(n2, -1); return r; } libgetdata-0.9.0/test/parse_polynom_ncols1.c0000640000175000017500000000303312614323564021274 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM in 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/version_7.c0000640000175000017500000000447512614323564017054 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 7 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 7\nar RAW UINT8 8\nar/q SBIT ar 0 10\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "ar/q", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); /* Version 7 is forward compatible with version 8 */ CHECKI(v,7); CHECKI(l,GD_DIRFILE_STANDARDS_VERSION); CHECKI(e,7); return r; } libgetdata-0.9.0/test/add_dot5.c0000640000175000017500000000370412614323564016616 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "dat.a"; E.field_type = GD_PHASE_ENTRY; E.in_fields[0] = "INDEX"; E.EN(phase,shift) = 0; E.scalar[0] = NULL; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_dirfile_standards(D, 5); gd_add(D, &E); error = gd_error(D); CHECKI(error, GD_E_OK); /* check */ gd_entry(D, "dat.a", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_PHASE_ENTRY); CHECKS(e.in_fields[0], "INDEX"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(phase,shift), 0); CHECKP(e.scalar[0]); CHECKI(e.flags & GD_EN_DOTTED, GD_EN_DOTTED); gd_free_entry_strings(&e); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_spec_affix.c0000640000175000017500000000375712614323564020441 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 1\n"; unsigned char data_data[256]; int fd, ret, error, r = 0; off64_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_spec(D, "AdataZ RAW UINT16 4\n", 0); error = gd_error(D); n = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,256 / 2 / 4); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/legacy_estring.c0000640000175000017500000000362112614323564020130 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); n = GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &error); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/add_alias.c0000640000175000017500000000307312614323564017033 0ustar alastairalastair/* Copyright (C) 2011, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *target; int error, i, r = 0; unsigned int n; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT8, 1, 0); gd_add_alias(D, "alias", "data", 0); error = gd_error(D); /* check */ target = gd_alias_target(D, "alias"); CHECKS(target, "data"); i = gd_fragment_index(D, "alias"); n = gd_naliases(D, "alias"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(i, 0); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/dfes_multiply.c0000640000175000017500000000311512614323564020007 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a MULTIPLY entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MULTIPLY e b\n"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/include_include.c0000640000175000017500000000353112614323564020257 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "#\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, error, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include(D, "format1", 0, 0); error = gd_error(D); spf = gd_spf(D, "data"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(spf, 11); return r; } libgetdata-0.9.0/test/parse_meta_jump.c0000640000175000017500000000302112614323564020276 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent child CONST UINT8 1\n" "ALIAS alias parent/child\n" "META alias grandchild CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/get_endian_float32_arm.c0000640000175000017500000001266312614323564021425 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read arm-endian FLOAT32 (which is just little endian) */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 1\nENDIAN little arm\n"; float u[10]; float v[20]; const unsigned char data_data[128 * 4] = { 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x58, 0x40, 0x00, 0x00, 0xA2, 0x40, 0x00, 0x00, 0xF3, 0x40, 0x00, 0x40, 0x36, 0x41, 0x00, 0xB0, 0x88, 0x41, 0x00, 0x08, 0xCD, 0x41, 0x00, 0xC6, 0x19, 0x42, 0x00, 0xA9, 0x66, 0x42, 0xC0, 0xFE, 0xAC, 0x42, 0x10, 0xBF, 0x01, 0x43, 0x98, 0x9E, 0x42, 0x43, 0xF2, 0xF6, 0x91, 0x43, 0x6B, 0xF2, 0xDA, 0x43, 0xD0, 0x35, 0x24, 0x44, 0xB8, 0x50, 0x76, 0x44, 0x8A, 0xBC, 0xB8, 0x44, 0x68, 0x8D, 0x0A, 0x45, 0x1C, 0xD4, 0x4F, 0x45, 0x15, 0xDF, 0x9B, 0x45, 0xA0, 0xCE, 0xE9, 0x45, 0xF8, 0x5A, 0x2F, 0x46, 0x3A, 0x84, 0x83, 0x46, 0x57, 0x46, 0xC5, 0x46, 0xC1, 0xF4, 0x13, 0x47, 0x22, 0xEF, 0x5D, 0x47, 0x5A, 0x73, 0xA6, 0x47, 0x07, 0xAD, 0xF9, 0x47, 0xC5, 0x41, 0x3B, 0x48, 0x54, 0x71, 0x8C, 0x48, 0xFE, 0xA9, 0xD2, 0x48, 0x7E, 0xFF, 0x1D, 0x49, 0x3D, 0xFF, 0x6C, 0x49, 0x6E, 0xBF, 0xB1, 0x49, 0x92, 0x4F, 0x05, 0x4A, 0x5B, 0xF7, 0x47, 0x4A, 0x84, 0xF9, 0x95, 0x4A, 0x46, 0xF6, 0xE0, 0x4A, 0xB4, 0xB8, 0x28, 0x4B, 0x0E, 0x15, 0x7D, 0x4B, 0xCA, 0xCF, 0xBD, 0x4B, 0xD8, 0x5B, 0x0E, 0x4C, 0xC4, 0x89, 0x55, 0x4C, 0x53, 0x27, 0xA0, 0x4C, 0xFC, 0x3A, 0xF0, 0x4C, 0x3D, 0x2C, 0x34, 0x4D, 0x2E, 0x21, 0x87, 0x4D, 0xC5, 0xB1, 0xCA, 0x4D, 0x54, 0x05, 0x18, 0x4E, 0xFE, 0x07, 0x64, 0x4E, 0xFE, 0x05, 0xAB, 0x4E, 0x7E, 0x44, 0x00, 0x4F, 0xBD, 0x66, 0x40, 0x4F, 0x0E, 0x4D, 0x90, 0x4F, 0x95, 0x73, 0xD8, 0x4F, 0xB0, 0x56, 0x22, 0x50, 0x08, 0x82, 0x73, 0x50, 0x86, 0xA1, 0xB6, 0x50, 0x24, 0xF9, 0x08, 0x51, 0xB6, 0x75, 0x4D, 0x51, 0x48, 0x18, 0x9A, 0x51, 0x6C, 0x24, 0xE7, 0x51, 0x51, 0x5B, 0x2D, 0x52, 0x7D, 0x04, 0x82, 0x52, 0xBC, 0x06, 0xC3, 0x52, 0x0D, 0x45, 0x12, 0x53, 0x94, 0x67, 0x5B, 0x53, 0xAF, 0x8D, 0xA4, 0x53, 0x86, 0xD4, 0xF6, 0x53, 0x64, 0x1F, 0x39, 0x54, 0x8B, 0xD7, 0x8A, 0x54, 0x50, 0x43, 0xD0, 0x54, 0x7C, 0x32, 0x1C, 0x55, 0xBA, 0x4B, 0x6A, 0x55, 0xCC, 0xB8, 0xAF, 0x55, 0x99, 0xCA, 0x03, 0x56, 0xE6, 0xAF, 0x45, 0x56, 0xEC, 0x43, 0x94, 0x56, 0xE2, 0x65, 0xDE, 0x56, 0x6A, 0xCC, 0x26, 0x57, 0x9F, 0x32, 0x7A, 0x57, 0xF7, 0xA5, 0xBB, 0x57, 0x79, 0xBC, 0x0C, 0x58, 0xB6, 0x1A, 0x53, 0x58, 0x08, 0x54, 0x9E, 0x58, 0x0C, 0x7E, 0xED, 0x58, 0x89, 0x1E, 0x32, 0x59, 0xE7, 0x96, 0x85, 0x59, 0x5A, 0x62, 0xC8, 0x59, 0xC4, 0x49, 0x16, 0x5A, 0xA6, 0x6E, 0x61, 0x5A, 0xFC, 0x12, 0xA9, 0x5A, 0x7A, 0x9C, 0xFD, 0x5A, 0x5C, 0x35, 0x3E, 0x5B, 0x05, 0xA8, 0x8E, 0x5B, 0x08, 0xFC, 0xD5, 0x5B, 0x06, 0x7D, 0x20, 0x5C, 0x89, 0xBB, 0x70, 0x5C, 0xA7, 0x8C, 0xB4, 0x5C, 0x7D, 0x69, 0x07, 0x5D, 0x3C, 0x1E, 0x4B, 0x5D, 0xAD, 0x56, 0x98, 0x5D, 0x04, 0x82, 0xE4, 0x5D, 0x83, 0x61, 0x2B, 0x5E, 0x22, 0x89, 0x80, 0x5E, 0xB3, 0xCD, 0xC0, 0x5E, 0x46, 0x9A, 0x10, 0x5F, 0x69, 0xE7, 0x58, 0x5F, 0x8F, 0xAD, 0xA2, 0x5F, 0x56, 0x04, 0xF4, 0x5F, 0x40, 0x03, 0x37, 0x60, 0x70, 0x42, 0x89, 0x60, 0xA8, 0xE3, 0xCD, 0x60, 0xBE, 0x6A, 0x1A, 0x61, 0x1D, 0xA0, 0x67, 0x61, 0x16, 0xB8, 0xAD, 0x61, 0x10, 0x4A, 0x02, 0x62, 0x18, 0x6F, 0x43, 0x62, 0x52, 0x93, 0x92, 0x62, 0xFB, 0xDC, 0xDB, 0x62, 0xBC, 0xE5, 0x24, 0x63, 0x9A, 0x58, 0x77, 0x63, 0x74, 0x82, 0xB9, 0x63, 0xD7, 0x21, 0x0B, 0x64, 0xC2, 0xB2, 0x50, 0x64, 0x12, 0x86, 0x9C, 0x64, 0x1B, 0xC9, 0xEA, 0x64 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); v[0] = 1.5; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 1.5; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) CHECKFi(i, u[i], v[i + 5]); return r; } libgetdata-0.9.0/test/flist_hidden.c0000640000175000017500000000363112614323564017566 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "/HIDDEN data2\n" "data3 RAW UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_field_list(D); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; ; ++i) { if (field_list[i] == NULL) break; if (strcmp(field_list[i], "data1") == 0) continue; else if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "INDEX") == 0) continue; fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } CHECKI(i, 3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/name_move_alias.c0000640000175000017500000000434712614323564020256 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *zata = "dirfile/zata"; const char *format_data = "cata RAW UINT8 8\n/ALIAS data cata\n" "eata RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e1, e2, unlink_data, unlink_zata, r = 0; unsigned i, nf; const char **fl; #define NFIELDS 4 const char *field_list[NFIELDS] = { "INDEX", "cata", "eata", "zata" }; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_rename(D, "data", "zata", GD_REN_DATA); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(ret, 0); nf = gd_nfields(D); CHECKI(nf, NFIELDS); if (nf > NFIELDS) nf = NFIELDS; fl = gd_field_list(D); for (i = 0; i < nf; ++i) CHECKSi(i, fl[i], field_list[i]); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); unlink_zata = unlink(zata); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); CHECKI(unlink_zata, -1); return r; } libgetdata-0.9.0/test/trunc_rdonly.c0000640000175000017500000000322512614323564017653 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int fd, e1, e2, unlink_data, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format, strlen(format)); close(fd); close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_TRUNC); e1 = gd_error(D); CHECKI(e1,GD_E_ACCMODE); e2 = gd_discard(D); CHECKI(e2, 0); unlink_data = unlink(data); CHECKI(unlink_data, 0); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_endian_complex64_arm.c0000640000175000017500000001343412614323564021771 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read arm-endian COMPLEX64 (which is just little endian) */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 1\nENDIAN little arm\n"; #ifdef GD_NO_C99_API float u[20]; float v[20][2]; #else float complex u[10]; float complex v[20]; #endif const unsigned char data_data[64 * 8] = { 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x58, 0x40, 0x00, 0x00, 0xA2, 0x40, 0x00, 0x00, 0xF3, 0x40, 0x00, 0x40, 0x36, 0x41, 0x00, 0xB0, 0x88, 0x41, 0x00, 0x08, 0xCD, 0x41, 0x00, 0xC6, 0x19, 0x42, 0x00, 0xA9, 0x66, 0x42, 0xC0, 0xFE, 0xAC, 0x42, 0x10, 0xBF, 0x01, 0x43, 0x98, 0x9E, 0x42, 0x43, 0xF2, 0xF6, 0x91, 0x43, 0x6B, 0xF2, 0xDA, 0x43, 0xD0, 0x35, 0x24, 0x44, 0xB8, 0x50, 0x76, 0x44, 0x8A, 0xBC, 0xB8, 0x44, 0x68, 0x8D, 0x0A, 0x45, 0x1C, 0xD4, 0x4F, 0x45, 0x15, 0xDF, 0x9B, 0x45, 0xA0, 0xCE, 0xE9, 0x45, 0xF8, 0x5A, 0x2F, 0x46, 0x3A, 0x84, 0x83, 0x46, 0x57, 0x46, 0xC5, 0x46, 0xC1, 0xF4, 0x13, 0x47, 0x22, 0xEF, 0x5D, 0x47, 0x5A, 0x73, 0xA6, 0x47, 0x07, 0xAD, 0xF9, 0x47, 0xC5, 0x41, 0x3B, 0x48, 0x54, 0x71, 0x8C, 0x48, 0xFE, 0xA9, 0xD2, 0x48, 0x7E, 0xFF, 0x1D, 0x49, 0x3D, 0xFF, 0x6C, 0x49, 0x6E, 0xBF, 0xB1, 0x49, 0x92, 0x4F, 0x05, 0x4A, 0x5B, 0xF7, 0x47, 0x4A, 0x84, 0xF9, 0x95, 0x4A, 0x46, 0xF6, 0xE0, 0x4A, 0xB4, 0xB8, 0x28, 0x4B, 0x0E, 0x15, 0x7D, 0x4B, 0xCA, 0xCF, 0xBD, 0x4B, 0xD8, 0x5B, 0x0E, 0x4C, 0xC4, 0x89, 0x55, 0x4C, 0x53, 0x27, 0xA0, 0x4C, 0xFC, 0x3A, 0xF0, 0x4C, 0x3D, 0x2C, 0x34, 0x4D, 0x2E, 0x21, 0x87, 0x4D, 0xC5, 0xB1, 0xCA, 0x4D, 0x54, 0x05, 0x18, 0x4E, 0xFE, 0x07, 0x64, 0x4E, 0xFE, 0x05, 0xAB, 0x4E, 0x7E, 0x44, 0x00, 0x4F, 0xBD, 0x66, 0x40, 0x4F, 0x0E, 0x4D, 0x90, 0x4F, 0x95, 0x73, 0xD8, 0x4F, 0xB0, 0x56, 0x22, 0x50, 0x08, 0x82, 0x73, 0x50, 0x86, 0xA1, 0xB6, 0x50, 0x24, 0xF9, 0x08, 0x51, 0xB6, 0x75, 0x4D, 0x51, 0x48, 0x18, 0x9A, 0x51, 0x6C, 0x24, 0xE7, 0x51, 0x51, 0x5B, 0x2D, 0x52, 0x7D, 0x04, 0x82, 0x52, 0xBC, 0x06, 0xC3, 0x52, 0x0D, 0x45, 0x12, 0x53, 0x94, 0x67, 0x5B, 0x53, 0xAF, 0x8D, 0xA4, 0x53, 0x86, 0xD4, 0xF6, 0x53, 0x64, 0x1F, 0x39, 0x54, 0x8B, 0xD7, 0x8A, 0x54, 0x50, 0x43, 0xD0, 0x54, 0x7C, 0x32, 0x1C, 0x55, 0xBA, 0x4B, 0x6A, 0x55, 0xCC, 0xB8, 0xAF, 0x55, 0x99, 0xCA, 0x03, 0x56, 0xE6, 0xAF, 0x45, 0x56, 0xEC, 0x43, 0x94, 0x56, 0xE2, 0x65, 0xDE, 0x56, 0x6A, 0xCC, 0x26, 0x57, 0x9F, 0x32, 0x7A, 0x57, 0xF7, 0xA5, 0xBB, 0x57, 0x79, 0xBC, 0x0C, 0x58, 0xB6, 0x1A, 0x53, 0x58, 0x08, 0x54, 0x9E, 0x58, 0x0C, 0x7E, 0xED, 0x58, 0x89, 0x1E, 0x32, 0x59, 0xE7, 0x96, 0x85, 0x59, 0x5A, 0x62, 0xC8, 0x59, 0xC4, 0x49, 0x16, 0x5A, 0xA6, 0x6E, 0x61, 0x5A, 0xFC, 0x12, 0xA9, 0x5A, 0x7A, 0x9C, 0xFD, 0x5A, 0x5C, 0x35, 0x3E, 0x5B, 0x05, 0xA8, 0x8E, 0x5B, 0x08, 0xFC, 0xD5, 0x5B, 0x06, 0x7D, 0x20, 0x5C, 0x89, 0xBB, 0x70, 0x5C, 0xA7, 0x8C, 0xB4, 0x5C, 0x7D, 0x69, 0x07, 0x5D, 0x3C, 0x1E, 0x4B, 0x5D, 0xAD, 0x56, 0x98, 0x5D, 0x04, 0x82, 0xE4, 0x5D, 0x83, 0x61, 0x2B, 0x5E, 0x22, 0x89, 0x80, 0x5E, 0xB3, 0xCD, 0xC0, 0x5E, 0x46, 0x9A, 0x10, 0x5F, 0x69, 0xE7, 0x58, 0x5F, 0x8F, 0xAD, 0xA2, 0x5F, 0x56, 0x04, 0xF4, 0x5F, 0x40, 0x03, 0x37, 0x60, 0x70, 0x42, 0x89, 0x60, 0xA8, 0xE3, 0xCD, 0x60, 0xBE, 0x6A, 0x1A, 0x61, 0x1D, 0xA0, 0x67, 0x61, 0x16, 0xB8, 0xAD, 0x61, 0x10, 0x4A, 0x02, 0x62, 0x18, 0x6F, 0x43, 0x62, 0x52, 0x93, 0x92, 0x62, 0xFB, 0xDC, 0xDB, 0x62, 0xBC, 0xE5, 0x24, 0x63, 0x9A, 0x58, 0x77, 0x63, 0x74, 0x82, 0xB9, 0x63, 0xD7, 0x21, 0x0B, 0x64, 0xC2, 0xB2, 0x50, 0x64, 0x12, 0x86, 0x9C, 0x64, 0x1B, 0xC9, 0xEA, 0x64 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); #ifdef GD_NO_C99_API v[0][0] = 1.5; v[0][1] = 2.25; for (i = 1; i < 20; ++i) { v[i][0] = v[i - 1][0] * 2.25; v[i][1] = v[i - 1][1] * 2.25; } #else v[0] = 1.5 + _Complex_I * 2.25; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 2.25; #endif fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * 8 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_COMPLEX64, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) #ifdef GD_NO_C99_API CHECKCi(i, u + 2 * i, v[i + 5]); #else CHECKCi(i, u[i], v[i + 5]); #endif return r; } libgetdata-0.9.0/test/convert_uint32_complex64.c0000640000175000017500000000431012614323564021712 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/eof_index.c0000640000175000017500000000445512614323564017077 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 1\n" "mult1 MULTIPLY data INDEX\n" "mult2 MULTIPLY INDEX INDEX\n" "mult3 MULTIPLY INDEX data\n"; int fd, error0, error1, error2, error3, r = 0; const size_t len = strlen(data); off_t eof_INDEX, eof_mult1, eof_mult2, eof_mult3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY); eof_INDEX = gd_eof(D, "INDEX"); error0 = gd_error(D); eof_mult1 = gd_eof(D, "mult1"); error1 = gd_error(D); eof_mult2 = gd_eof(D, "mult2"); error2 = gd_error(D); eof_mult3 = gd_eof(D, "mult3"); error3 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error0, GD_E_BAD_FIELD_TYPE); CHECKI(eof_INDEX, -1); CHECKI(error1, GD_E_OK); CHECKI(eof_mult1, (int)len / 2); CHECKI(error2, GD_E_BAD_FIELD_TYPE); CHECKI(eof_mult2, -1); CHECKI(error3, GD_E_OK); CHECKI(eof_mult3, (int)len / 2); return r; } libgetdata-0.9.0/test/get_float32.c0000640000175000017500000000377212614323564017251 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float c[8]; float data_data[128]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = (float)(1.5 * fd); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 1.5 * (40 + i)); return r; } libgetdata-0.9.0/test/sie_get_little.c0000640000175000017500000000405012614323564020122 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian SIE data */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16]; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; DIRFILE *D; int fd, i, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 16); for (i = 0; i < 16; ++i) CHECKIi(i,c[i], (i <= 8) ? 0x22 : 0x32); return r; } libgetdata-0.9.0/test/global_ref_set.c0000640000175000017500000000326712614323564020106 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n"; int fd, error, r = 0; const char *ref; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ref = gd_reference(D, "data2"); error = gd_error(D); CHECKI(error, GD_E_OK); CHECKS(ref, "data2"); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/gzip_put_get.c0000640000175000017500000000447012614323564017634 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.gz"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d[8]; int fd, i, m, n, e1, e2, e3, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); m = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); for (i = 0; i < m; ++i) CHECKIi(i, d[i], c[i]); e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(n, 8); CHECKI(m, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(e2, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(m, 0); #endif return r; #endif } libgetdata-0.9.0/test/version_9_write.c0000640000175000017500000000543512614323564020265 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format[] = { "dirfile/format", "dirfile/format1", "dirfile/format2", "dirfile/format3", "dirfile/format4" }; const char *data = "dirfile/ar"; const char *format_data[] = { "/VERSION 8\n" "/INCLUDE format1\n", "\n\n\n\n\n" "/VERSION 9\n" "Xr RAW COMPLEX128 0xA\n" "Xy POLYNOM INDEX 8 055 0xAE 2\n" "ar WINDOW d INDEX SET 0x1\n" "/ALIAS BINDEX INDEX\n" "/ALIAS AINDEXYZ BINDEX\n" "/INCLUDE format2 A Z\n" "/ALIAS m AdYZ\n" "/INCLUDE format4\n" "/ALIAS z n\n" "/ALIAS d z\n" "/HIDDEN Xy\n", "/INCLUDE format3 \"\" Y\n", "/ALIAS d INDEX\n/HIDDEN d\n", "/ALIAS n m\n" }; uint16_t c[8]; unsigned char data_data[256]; int fd, i, e1, e2, n, v, h1, h2, r = 0; DIRFILE *D; memset(c, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; for (i = 0; i < 5; ++i) { fd = open(format[i], O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data[i], strlen(format_data[i])); close(fd); } fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); h1 = gd_hidden(D, "AdYZ"); CHECKI(h1,1); gd_rewrite_fragment(D, GD_ALL_FRAGMENTS); e1 = gd_error(D); CHECKI(e1,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); n = gd_getdata(D, "ar", 4, 0, 8, 0, GD_UINT16, c); h2 = gd_hidden(D, "AdYZ"); CHECKI(h2,1); CHECKI(n,8); CHECKI(v,GD_DIRFILE_STANDARDS_VERSION); for (i = 0; i < n; ++i) CHECKUi(i,c[i], (i & 1) ? 4 + i : 0); gd_discard(D); unlink(data); for (i = 0; i < 5; ++i) unlink(format[i]); rmdir(filedir); return r; } libgetdata-0.9.0/test/spf_recip.c0000640000175000017500000000306312614323564017103 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in2 RAW UINT8 13\n" "div RECIP in2 3.\n"; int fd, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "div"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(spf,13); return r; } libgetdata-0.9.0/test/endian_alter_all.c0000640000175000017500000000434212614323564020407 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT16 8\n" "/ENDIAN little\n" "/INCLUDE format1\n"; const char *format1_data = "data1 RAW UINT16 8\n/ENDIAN little arm\n"; unsigned long e0, e1, e2, e3; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e0 = gd_endianness(D, 0); e1 = gd_endianness(D, 1); ret = gd_alter_endianness(D, GD_BIG_ENDIAN, GD_ALL_FRAGMENTS, 0); error = gd_error(D); e2 = gd_endianness(D, 0); e3 = gd_endianness(D, 1); gd_discard(D); unlink(format); unlink(format1); rmdir(filedir); CHECKI(error,0); CHECKI(ret, 0); CHECKU(e0, GD_LITTLE_ENDIAN | GD_NOT_ARM_ENDIAN); CHECKU(e1, GD_LITTLE_ENDIAN | GD_ARM_ENDIAN); CHECKU(e2, GD_BIG_ENDIAN); CHECKU(e3, GD_BIG_ENDIAN); return r; } libgetdata-0.9.0/test/get_lincom_mdt.c0000640000175000017500000000362412614323564020120 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 1 data 1 0\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 5); return r; } libgetdata-0.9.0/test/version_5_strict.c0000640000175000017500000000515712614323564020440 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* CheckStandards Version 5 strictness */ #include "test.h" #include #include #include #include #include #include #include int cb(gd_parser_data_t *pdata, void *ll) { ((int*)ll)[pdata->linenum - 1] = 1; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 5\n" "ENDIAN little\n" "X #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/sie_put_big.c0000640000175000017500000000504512614323564017424 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN big\n"; unsigned char c[16] = { 0x23, 0x23, 0x23, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32 }; #define NREC 4 const uint8_t data_out[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x23, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32 }; uint8_t check[(NREC + 1) * 9]; DIRFILE *D; int fd, i, n, error, r = 0; ssize_t s; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 0, 0x11, 2, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 16); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); s = read(fd, check, (NREC + 1) * 9); close(fd); CHECKI(s, NREC * 9); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < NREC * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/move_data_enc_ra.c0000640000175000017500000000542512614323564020403 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *txtdata = "dirfile/data.txt"; const char *format_data = "/INCLUDE format1\ndata RAW UINT16 11"; const char *format1_data = "ENCODING text\n"; uint16_t data_data[128]; int r = 0; uint16_t d; char line[100]; int fd, i, ret, e1, e2, ge_ret, unlink_data, unlink_txtdata; FILE* stream; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = fd * 0x201; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, GD_REN_DATA); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); ge_ret = gd_entry(D, "data", &E); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); e2 = gd_close(D); CHECKI(e2, 0); stream = fopen(txtdata, "rt"); if (stream != NULL) { i = 0; while (fgets(line, 100, stream)) { d = strtoul(line, NULL, 10); CHECKXi(i, d, (unsigned)i * 0x201); i++; } fclose(stream); } else { perror("open"); r = 1; } unlink(format1); unlink(format); unlink_data = unlink(data); unlink_txtdata = unlink(txtdata); rmdir(filedir); CHECKI(unlink_data, -1); CHECKI(unlink_txtdata, 0); return r; } libgetdata-0.9.0/test/get_linterp_abs.c0000640000175000017500000000507312614323564020275 0ustar alastairalastair/* Copyright (C) 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* this tests handling absolute directories in _GD_GrabDir and also test * garbage collection in _GD_ReleaseDir */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #if defined GD_NO_GETCWD return 77; #else const char *filedir = "dirfile"; const char *lutdir = "dirfile/lut"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/lut/table"; const char *format_data1 = "linterp LINTERP data "; const char *format_data2 = "/dirfile/lut/table\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[64]; int fd, i, n, error, r = 0; DIRFILE *D; FILE *t; int cwd_size = 2048; char *ptr, *cwd = NULL; rmdirfile(); mkdir(filedir, 0777); mkdir(lutdir, 0777); gdtest_getcwd(ptr, cwd, cwd_size); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); gd_pathwrite(fd, cwd); write(fd, format_data2, strlen(format_data2)); close(fd); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); t = fopen(table, "wt"); for (i = 0; i < 30; ++i) fprintf(t, "%i %i\n", i * 6, i * 12); fclose(t); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(table); unlink(data); unlink(format); rmdir(lutdir); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 10); free(cwd); return r; #endif } libgetdata-0.9.0/test/open_sym_pl.c0000640000175000017500000000302012614323564017446 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile/link"; const char *format = "dirfile/format"; const char *targ = "../dirfile/"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ symlink(targ, filedir); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; #endif } libgetdata-0.9.0/test/parse_linterp_ncols.c0000640000175000017500000000302712614323564021176 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data LINTERP in1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/test.h0000640000175000017500000001260012614323564016112 0ustar alastairalastair/* Copyright (C) 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #define GD_TEST #include "internal.h" #ifdef HAVE_FLOAT_H #include #endif #if defined HAVE__ISNAN && ! defined HAVE_ISNAN #define isnan _isnan #endif #if defined HAVE__FINITE && \ (! defined HAVE_DECL_ISFINITE || HAVE_DECL_ISFINITE == 0) #define isfinite _finite #endif /* System call kludge for Win32 */ #if defined __MSVCRT__ && defined MSYS_SHELL #include int gd_system(const char* command) { int ret = -1; char* ptr = malloc(strlen(command) + 3); sprintf(ptr, "\"%s\"", command); ret = _spawnlp(_P_WAIT, MSYS_SHELL, MSYS_SHELL, "-c", ptr, NULL); free(ptr); return ret; } #else #define gd_system system #endif /* rm for MSVC */ #ifdef _WIN32 #define rmdirfile() system("rmdir /q/s dirfile"); #else #define rmdirfile() chmod("dirfile", 0755); system("rm -rf dirfile"); #endif /* sleep for WIN32/64 */ #if defined _WIN32 || defined _WIN64 #include #define sleep(x) Sleep(1000 * (x)) #endif /* path munging for format files */ #define gd_pathwrite(x,y) do { \ char *ptr; \ const char esc = '\\'; \ for (ptr = y; *ptr != '\0'; ++ptr) { \ if (*ptr == '\\' || *ptr == '#' || *ptr == ' ') write(x,&esc,1); \ write(x,ptr,1); \ } \ } while (0) /* getcwd abstraction */ #if defined HAVE_GETCWD || defined HAVE__GETCWD # ifdef HAVE__GETCWD # define getcwd _getcwd # endif # define gdtest_getcwd(ptr,cwd,cwd_size) \ do { \ ptr = (char*)realloc(cwd, cwd_size *= 2); \ if (ptr == NULL) { \ fprintf(stderr, "out of memory for cwd!\n"); \ exit(1); \ } \ } while (!getcwd(cwd = ptr, cwd_size)) #else # define GD_NO_GETCWD #endif #define CHECK(e,n,nf,vf,...) \ do { if (e) { r = 1; \ fprintf(stderr, #n " = " nf " (expected " vf ")\n", __VA_ARGS__); } \ } while(0) #define CHECKi(i,e,n,nf,vf,...) \ do { if (e) { r = 1; \ fprintf(stderr, #i ":%i " #n " = " nf " (expected " vf ")\n", (int)(i), \ __VA_ARGS__); } \ } while(0) #define strcmpn(n,v) (((n) == NULL) ? 1 : strcmp((n),(v))) #ifdef GD_NO_C99_API #define CHECKC(n,v) CHECK(sqrt(((n)[0]-(v)[0])*((n)[0]-(v)[0]) + \ (((n)[1]-(v)[1])*((n)[1]-(v)[1])))>1e-10,n,"%.15g;%.15g","%.15g;%.15g",\ creal((n)), cimag((n)), creal((v)), cimag((v))) #define CHECKCi(i,n,v) CHECKi(i,sqrt(((n)[0]-(v)[0])*((n)[0]-(v)[0]) + \ (((n)[1]-(v)[1])*((n)[1]-(v)[1]))) / cabs((v))>3e-6,n,\ "%.15g;%.15g","%.15g;%.15g",creal((n)), cimag((n)), creal((v)), cimag((v))) #else #define CHECKC(n,v) CHECK(cabs((n)-(v))>1e-10,n,"%.15g;%.15g","%.15g;%.15g",\ creal((n)), cimag((n)), creal((v)), cimag((v))) #define CHECKCi(i,n,v) CHECKi(i,cabs((n)-(v)) / cabs((v))>3e-6,n,"%.15g;%.15g",\ "%.15g;%.15g",creal((n)), cimag((n)), creal((v)), cimag((v))) #endif #define CHECKF(n,v) CHECK(fabs((n)-(v))>1e-10,n,"%.15g","%.15g",(double)(n),\ (double)(v)) #define CHECKFi(i,n,v) CHECKi(i,fabs((n)-(v)) > 1e-10,n,"%.15g","%.15g",\ (double)(n),(double)(v)) #define CHECKI(n,v) CHECK((n) != (v),n,"%lli","%lli",(long long)(n),\ (long long)(v)) #define CHECKIi(i,n,v) CHECKi(i,(long long)(n) != (long long)(v),n,"%lli",\ "%lli", (long long)(n),(long long)(v)) #define CHECKNAN(n) CHECK(!isnan(n),n,"%.15g","%s",(double)(n),"nan") #define CHECKNANi(i,n) CHECKi(i,!isnan(n),n,"%.15g","%s",(double)(n),"nan") #define CHECKP(n) CHECK((n) != NULL,n,"%p","%s",n,"NULL") #define CHECKPi(i,n) CHECKi(i,(n) != NULL,n,"%p","%s",n,"NULL") #define CHECKPN(n) CHECK((n) == NULL,n,"%p","%s",n,"non-NULL") #define CHECKPNi(i,n) CHECKi(i,(n) == NULL,n,"%p","%s",n,"non-NULL") #define CHECKS(n,v) CHECK(strcmpn((n),(v)),n,"\"%s\"","\"%s\"",(n),(v)); #define CHECKSi(i,n,v) CHECKi(i,strcmpn((n),(v)),n,"\"%s\"","\"%s\"",(n),(v)); #define CHECKSp(n,v) CHECK(strncmp((n),(v), sizeof(v) - 1),n,"\"%s\"",\ "\"%s\"",(n),(v)); #define CHECKBOS(n,v) CHECK(strncmp((n),(v),strlen(v)-1),n,"\"%s\"","\"%s\"",\ (n),(v)); #define CHECKSS(n,v) CHECK(strstr((n),(v)) == NULL,n,"\"%s\"","...\"%s\"...",\ (n),(v)); #define CHECKEOS(n,v) CHECK(strcmp((n) + strlen(n) - sizeof(v) + 1,(v)),n,\ "...\"%s\"","\"%s\"",(n) + strlen(n) - sizeof(v) + 1,(v)); #define CHECKU(n,v) CHECK((n) != (v),n,"%llu","%llu",\ (unsigned long long)(n),(unsigned long long)(v)) #define CHECKUi(i,n,v) CHECKi(i,(n) != (v),n,"%llu","%llu",\ (unsigned long long)(n),(unsigned long long)(v)) #define CHECKX(n,v) CHECK((n) != (v),n,"0x%llX","0x%llX",\ (unsigned long long)(n),(unsigned long long)(v)) #define CHECKXi(i,n,v) CHECKi(i,(n) != (v),n,"0x%llX","0x%llX",\ (unsigned long long)(n),(unsigned long long)(v)) libgetdata-0.9.0/test/alias_target_missing.c0000640000175000017500000000272112614323564021321 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS alias target\n"; int fd, e, r = 0; DIRFILE *D; const char *t; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); t = gd_alias_target(D, "alias"); CHECKS(t, "target"); e = gd_error(D); CHECKI(e, GD_E_OK); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int16_uint64.c0000640000175000017500000000377512614323564021055 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; uint64_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_uint64_uint8.c0000640000175000017500000000376612614323564021163 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_uint32_int64.c0000640000175000017500000000376612614323564021053 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/put_polynom1.c0000640000175000017500000000424712614323564017604 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3.0 0.5\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,(i - 3) * 2); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flac_put_float64.c0000640000175000017500000000376712614323564020300 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_FLAC || !defined TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.flac"; double c[8]; double d[13]; off_t nf; int r = 0, i, e1, e2, e3; size_t n1, n2; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 1.234 * i; D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN | GD_VERBOSE | GD_CREAT | GD_EXCL); gd_add_spec(D, "data RAW FLOAT64 1", 0); n1 = gd_putdata(D, "data", 5, 0, 8, 0, GD_FLOAT64, c); CHECKI(n1, 8); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nf = gd_nframes(D); CHECKU(nf, 13); n2 = gd_getdata(D, "data", 0, 0, 0, 13, GD_FLOAT64, d); CHECKI(n2, 13); e3 = gd_error(D); CHECKI(e3, GD_E_OK); for (i = 0; i < 13; ++i) { if (i < 5) CHECKFi(i, d[i], 0); else CHECKFi(i, d[i], 1.234 * (i - 5)); } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/seek_index.c0000640000175000017500000000275112614323564017252 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e0, e1, r = 0; off_t m, n1; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); m = gd_seek(D, "INDEX", 6, 0, GD_SEEK_SET); e0 = gd_error(D); n1 = gd_tell(D, "INDEX"); e1 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e0, 0); CHECKI(e1, 0); CHECKI(m, 6); CHECKI(n1, 6); return r; } libgetdata-0.9.0/test/error.c0000640000175000017500000000277312614323564016271 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* attempt to obtain an error string */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; char string[1000] = ""; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY); gd_error_string(D, string, 1000); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKS(string, "Success"); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/nfields_vector_invalid.c0000640000175000017500000000226512614323564021650 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nvectors(D); error = gd_error(D); gd_discard(D); CHECKI(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/bzip_move_from.c0000640000175000017500000000630212614323564020145 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *bz2data = "dirfile/data.bz2"; const char *format_data = "/INCLUDE format1\ndata RAW UINT16 11\nENCODING bzip2\n"; const char *format1_data = "ENCODING none\n"; uint16_t data_data[128]; int fd, ret, e1, e2, ge_ret, unlink_data, unlink_bz2data, r = 0; char command[4096]; gd_entry_t E; DIRFILE *D; #ifdef USE_BZIP2 uint16_t d; int i = 0; #endif rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = fd * 0x201; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_VERBOSE | GD_UNENCODED); #else D = gd_open(filedir, GD_RDWR | GD_UNENCODED); #endif ret = gd_move(D, "data", 1, 1); e1 = gd_error(D); ge_ret = gd_entry(D, "data", &E); CHECKI(ge_ret, 0); e2 = gd_close(D); CHECKI(e2, 0); #ifdef USE_BZIP2 fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKI(d, i * 0x201); i++; } close(fd); } else { perror("open"); r = 1; } #endif unlink(format1); unlink(format); unlink_data = unlink(data); unlink_bz2data = unlink(bz2data); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(ret, 0); CHECKI(e1, GD_E_OK); CHECKI(E.fragment_index, 1); CHECKI(unlink_data, 0); CHECKI(unlink_bz2data, -1); #else CHECKI(ret, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(E.fragment_index, 0); CHECKI(unlink_data, -1); CHECKI(unlink_bz2data, 0); #endif gd_free_entry_strings(&E); return r; #endif } libgetdata-0.9.0/test/move_affix_updb.c0000640000175000017500000000461712614323564020274 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "INCLUDE format1 A B\n" "INCLUDE format2 C D\n" "phase PHASE AdataB 0\n" "/ALIAS alias AdataB\n"; const char *format1_data = "data RAW UINT8 11\n" "data/meta CONST UINT8 1\n"; const char *format2_data = "#\n"; int fd, r1, r2, r3, e1, e2, e3, r = 0; const char *s1; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); r1 = gd_move(D, "AdataB", 2, GD_REN_UPDB); e1 = gd_error(D); CHECKI(r1, 0); CHECKI(e1, GD_E_OK); r2 = gd_entry(D, "CdataD", &E); CHECKI(r2, 0); CHECKI(E.fragment_index, 2); gd_free_entry_strings(&E); gd_validate(D, "phase"); e2 = gd_error(D); CHECKI(e2, 0); gd_validate(D, "CdataD/meta"); e3 = gd_error(D); CHECKI(e3, 0); s1 = gd_alias_target(D, "alias"); CHECKS(s1, "CdataD"); r3 = gd_close(D); CHECKI(r3, 0); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_lincom.c0000640000175000017500000000404512614323564017223 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a LINCOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; const char *in_fields[2] = {"in1", "in2"}; const double m[2] = {1, 0.3}; const double b[2] = {5, 0.9}; gd_entry_t e; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_lincom(D, "new", 2, in_fields, m, b, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields), 2); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKF(e.EN(lincom,m)[0], m[0]); CHECKF(e.EN(lincom,m)[1], m[1]); CHECKF(e.EN(lincom,b)[0], b[0]); CHECKF(e.EN(lincom,b)[1], b[1]); CHECKX(e.flags, GD_EN_CALC); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/get_linterp_complex.c0000640000175000017500000000420212614323564021170 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n"; double c[2]; unsigned char data_data[64]; int fd, i, n, error, r = 0; DIRFILE *D; FILE *t; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); t = fopen(table, "wt"); for (i = 0; i < 10; ++i) fprintf(t, "%i %i;%i\n", i * 6, i * 12, i * 12 + 3); fclose(t); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(table); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKF(c[0], 10.); CHECKF(c[1], 13.); return r; } libgetdata-0.9.0/test/del_const_deref.c0000640000175000017500000000603712614323564020254 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 13\n" "raw RAW UINT8 data\n" "lincom LINCOM raw data data\n" "polynom POLYNOM lincom data data\n" "recip RECIP polynom data\n" "bit BIT recip data data\n" "phase PHASE bit data\n" "window WINDOW phase bit GT data\n" "mplex MPLEX window phase data data\n" ; int fd, ret, error, r = 0; unsigned int spf; int nb, bn, s, cv, p; double m0, b0, a0, a1, d, t; DIRFILE *D; gd_entry_t entry; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", GD_DEL_DEREF); error = gd_error(D); /* check */ spf = gd_spf(D, "raw"); gd_entry(D, "lincom", &entry); m0 = entry.EN(lincom,m[0]); b0 = entry.EN(lincom,b[0]); gd_free_entry_strings(&entry); gd_entry(D, "polynom", &entry); a0 = entry.EN(polynom,a[0]); a1 = entry.EN(polynom,a[1]); gd_free_entry_strings(&entry); gd_entry(D, "recip", &entry); d = entry.EN(recip,dividend); gd_free_entry_strings(&entry); gd_entry(D, "bit", &entry); nb = entry.EN(bit,numbits); bn = entry.EN(bit,bitnum); gd_free_entry_strings(&entry); gd_entry(D, "phase", &entry); s = (int)entry.EN(phase,shift); gd_free_entry_strings(&entry); gd_entry(D, "window", &entry); t = entry.EN(window,threshold.r); gd_free_entry_strings(&entry); gd_entry(D, "mplex", &entry); cv = entry.EN(mplex,count_val); p = entry.EN(mplex,period); gd_free_entry_strings(&entry); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKU(spf, 13); CHECKF(m0, 13.); CHECKF(b0, 13.); CHECKF(a0, 13.); CHECKF(a1, 13.); CHECKF(d, 13.); CHECKI(nb, 13); CHECKI(bn, 13); CHECKI(s, 13); CHECKF(t, 13.); CHECKI(cv, 13); CHECKI(p, 13); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/get_foffs.c0000640000175000017500000000367512614323564017104 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 with a FRAMEOFFSET */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "FRAMEOFFSET 1\ndata RAW UINT8 1\n"; unsigned char c; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 4); return r; } libgetdata-0.9.0/test/convert_uint64_float32.c0000640000175000017500000000401112614323564021346 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/sie_move_from.c0000640000175000017500000000532112614323564017761 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to decompress an SIE file */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_sie = "dirfile/data.sie"; const char *data_raw = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; uint8_t check[0x31]; const uint8_t data_in[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; const uint8_t data_out[] = { 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32 }; DIRFILE *D; int fd, i, e1, e2, r = 0, unlink_data_sie, unlink_data_raw; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_sie, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_in, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_alter_encoding(D, GD_UNENCODED, 0, 1); e1 = gd_error(D); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); fd = open(data_raw, O_RDONLY | O_BINARY); if (fd < 0) { perror("open"); r = 1; } else { read(fd, check, 0x31); close(fd); for (i = 0; i < 0x31; ++i) CHECKUi(i, check[i], data_out[i]); } unlink_data_sie = unlink(data_sie); unlink_data_raw = unlink(data_raw); unlink(format); rmdir(filedir); CHECKI(unlink_data_sie, -1); CHECKI(unlink_data_raw, 0); return r; } libgetdata-0.9.0/test/add_sbit.c0000640000175000017500000000334112614323564016701 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a SBIT field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_sbit(D, "new", "input", 1, 1, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_SBIT_ENTRY); CHECKS(e.in_fields[0], "input"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(bit,bitnum), 1); CHECKI(e.EN(bit,numbits), 1); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/vlist_invalid.c0000640000175000017500000000256112614323564020002 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_vector_list(D); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error,GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_octal_zero.c0000640000175000017500000000277412614323564020474 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING \\00\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error,GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/repr_a.c0000640000175000017500000000441312614323564016401 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read argument representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\n"; double c[8]; #ifdef GD_NO_C99_API double data_data[100][2]; #else double complex data_data[100]; #endif int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) { #ifdef GD_NO_C99_API const double v = i * 3.14159265358979323846 / 5.; data_data[i][0] = cos(v); data_data[i][1] = sin(v); #else data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.); #endif } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 200 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.a", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],carg(data_data[5 + i])); return r; } libgetdata-0.9.0/test/Makefile.am0000640000175000017500000005561512614323564017033 0ustar alastairalastair# Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign serial-tests LDADD=../src/libgetdata.la AM_CPPFLAGS=${GD_CC_WALL} $(GD_CC_WEXTRA) -I$(top_srcdir)/src EXTRA_DIST=test.h ADD_TESTS=add_add add_affix add_alias add_alias_affix add_alias_meta \ add_amb_code7 add_bit add_bit_bitnum add_bit_bitsize add_bit_invalid \ add_bit_numbits add_bit_scalars add_carray add_clincom add_code \ add_const add_cpolynom add_crecip add_crecip89 add_dangle_dup \ add_divide add_divide_invalid add_dot5 add_dot6 add_duplicate \ add_format add_invalid add_lincom add_lincom_affix \ add_lincom_invalid add_lincom_nfields add_linterp \ add_linterp_invalid add_meta add_meta_alias add_mplex \ add_mplex_scalars add_multiply add_multiply_invalid add_phase \ add_phase_invalid add_polynom add_polynom_scalar add_protect add_raw \ add_raw_include add_raw_invalid add_raw_spf add_raw_spf_scalar \ add_raw_sub add_raw_type add_rdonly add_recip add_resolv add_sbit \ add_scalar add_scalar_carray add_scalar_carray_bad add_sort add_spec \ add_spec_directive add_spec_invalid add_spec_meta add_spec_resolv \ add_string add_string_affix add_type add_window add_window_op ALIAS_TESTS=alias_list alias_list_alias alias_list_missing alias_num \ alias_num_alias alias_num_missing alias_target alias_target_alias \ alias_target_missing ALTER_TESTS=alter_bit_bitnum alter_bit_numbits alter_carray_len \ alter_carray_type alter_clincom alter_const alter_const_c2r \ alter_const_r2c alter_const_r2r alter_cpolynom alter_cpolynom_null \ alter_crecip alter_crecip89 alter_crecip89_null alter_crecip_zero \ alter_divide alter_entry alter_entry_affix alter_entry_hidden \ alter_entry_lincom alter_entry_recode alter_entry_recode_recalc \ alter_entry_scalar1 alter_entry_scalar2a alter_entry_scalar2n \ alter_entry_scalar3 alter_entry_scalar3c alter_entry_scalar4 \ alter_entry_scalar_amb alter_index alter_lincom_23 alter_lincom_32 \ alter_lincom_affix alter_lincom_input alter_lincom_offset \ alter_lincom_slope alter_linterp alter_linterp_move alter_mplex \ alter_mspec alter_mspec_affix alter_multiply alter_phase \ alter_polynom_coeff alter_polynom_input alter_polynom_ord \ alter_raw_spf alter_raw_type alter_recip alter_recip_zero \ alter_scalar_affix alter_spec alter_spec_affix alter_spec_meta \ alter_spec_polynom alter_window ASCII_TESTS=ascii_add ascii_get ascii_get_complex ascii_get_get ascii_get_here \ ascii_get_sub ascii_nframes ascii_put ascii_put_here ascii_seek \ ascii_seek_far ascii_sync BOF_TESTS=bof bof_bit bof_index bof_lincom bof_phase bof_phase_neg BZIP_TESTS=bzip_add bzip_get bzip_get_far bzip_get_get bzip_get_get2 \ bzip_get_put bzip_move_from bzip_move_to bzip_nframes bzip_put \ bzip_put_back bzip_put_endian bzip_put_get bzip_put_pad \ bzip_put_sub bzip_seek bzip_seek_far bzip_sync CLOSE_TESTS=close_bad close_close close_discard close_null CONVERT_TESTS=convert_complex128_complex64 convert_complex128_float64 \ convert_complex128_int64 convert_complex128_uint64 \ convert_complex64_complex128 convert_complex64_float64 \ convert_complex64_int64 convert_complex64_uint64 \ convert_float32_complex128 convert_float32_complex64 \ convert_float32_float64 convert_float32_int16 \ convert_float32_int32 convert_float32_int64 convert_float32_int8 \ convert_float32_uint16 convert_float32_uint32 \ convert_float32_uint64 convert_float32_uint8 \ convert_float64_complex128 convert_float64_complex64 \ convert_float64_float32 convert_float64_int16 \ convert_float64_int32 convert_float64_int64 convert_float64_int8 \ convert_float64_uint16 convert_float64_uint32 \ convert_float64_uint64 convert_float64_uint8 \ convert_int16_complex128 convert_int16_complex64 \ convert_int16_float32 convert_int16_float64 convert_int16_int32 \ convert_int16_int64 convert_int16_int8 convert_int16_uint16 \ convert_int16_uint32 convert_int16_uint64 convert_int16_uint8 \ convert_int32_complex128 convert_int32_complex64 \ convert_int32_float32 convert_int32_float64 convert_int32_int16 \ convert_int32_int64 convert_int32_int8 convert_int32_uint16 \ convert_int32_uint32 convert_int32_uint64 convert_int32_uint8 \ convert_int64_complex128 convert_int64_complex64 \ convert_int64_float32 convert_int64_float64 convert_int64_int16 \ convert_int64_int32 convert_int64_int8 convert_int64_uint16 \ convert_int64_uint32 convert_int64_uint64 convert_int64_uint8 \ convert_int8_complex128 convert_int8_complex64 \ convert_int8_float32 convert_int8_float64 convert_int8_int16 \ convert_int8_int32 convert_int8_int64 convert_int8_uint16 \ convert_int8_uint32 convert_int8_uint64 convert_int8_uint8 \ convert_uint16_complex128 convert_uint16_complex64 \ convert_uint16_float32 convert_uint16_float64 \ convert_uint16_int16 convert_uint16_int32 convert_uint16_int64 \ convert_uint16_int8 convert_uint16_uint32 convert_uint16_uint64 \ convert_uint16_uint8 convert_uint32_complex128 \ convert_uint32_complex64 convert_uint32_float32 \ convert_uint32_float64 convert_uint32_int16 convert_uint32_int32 \ convert_uint32_int64 convert_uint32_int8 convert_uint32_uint16 \ convert_uint32_uint64 convert_uint32_uint8 \ convert_uint64_complex128 convert_uint64_complex64 \ convert_uint64_float32 convert_uint64_float64 \ convert_uint64_int16 convert_uint64_int32 convert_uint64_int64 \ convert_uint64_int8 convert_uint64_uint16 convert_uint64_uint32 \ convert_uint64_uint8 convert_uint8_complex128 \ convert_uint8_complex64 convert_uint8_float32 \ convert_uint8_float64 convert_uint8_int16 convert_uint8_int32 \ convert_uint8_int64 convert_uint8_int8 convert_uint8_uint16 \ convert_uint8_uint32 convert_uint8_uint64 CREAT_TESTS=creat creat_excl creat_rdonly creat_rdonly_exists CVLIST_TESTS=cvlist cvlist_array cvlist_array0 cvlist_array_free \ cvlist_array_hidden cvlist_array_meta cvlist_array_meta0 \ cvlist_array_meta_free cvlist_array_meta_hidden cvlist_hidden \ cvlist_invalid cvlist_meta cvlist_meta0 cvlist_meta_hidden \ cvlist_meta_invalid DEL_TESTS=del_alias del_carray del_carray_deref del_const del_const_deref \ del_const_force del_data del_data_enoent del_data_open del_derived \ del_derived_after del_derived_force del_del del_meta del_meta_force \ del_ref DESYNC_TESTS=desync desync_flush desync_path desync_reopen desync_reopen_inv DFES_TESTS=dfes_bit dfes_divide dfes_lincom dfes_linterp dfes_multiply \ dfes_null dfes_phase dfes_raw dfes_recip dfes_zero ELIST_TESTS=elist_alias elist_hidden elist_noalias elist_scalar ENCODE_TESTS=encode_alter encode_alter_all encode_alter_open encode_get \ encode_recode encode_recode_open encode_support ENDIAN_TESTS=endian_alter endian_alter_all endian_alter_sie endian_get \ endian_move ENTRY_TESTS=entry_bad_code entry_bit entry_bit_scalar entry_divide \ entry_invalid entry_lincom entry_lincom_scalar entry_linterp \ entry_mplex entry_mplex_scalar entry_multiply entry_phase \ entry_phase_scalar entry_polynom entry_polynom_scalar entry_raw \ entry_raw_scalar entry_raw_scalar_code entry_raw_scalar_type \ entry_scalar_repr entry_recip entry_type entry_type_alias \ entry_window entry_window_scalar EOF_TESTS=eof eof_bit eof_index eof_lincom eof_phase eof_phase_neg ERROR_TESTS=error error_error error_num error_short error_verbose \ error_verbose_prefix FILE_TESTS=file file_code file_type FLAC_TESTS=flac_add flac_get_big flac_get_far flac_get_get flac_get_get2 \ flac_get_little flac_nframes flac_put_big flac_put_complex128 \ flac_put_float64 flac_put_int32 flac_put_little flac_seek \ flac_seek_far flac_sync FLIST_TESTS=flist flist0 flist2 flist_hidden flist_invalid flist_meta \ flist_meta2 flist_meta_hidden flist_meta_invalid flist_type \ flist_type_hidden flist_type_invalid flist_type_meta \ flist_type_meta_hidden flist_type_meta_invalid FLUSH_TESTS=flush_all flush_amb_code flush_bad_code flush_flush flush_hex \ flush_invalid flush_lincom flush_lincom1 flush_meta flush_mult \ flush_raw_close flush_ref flush_spec flush_string flush_sync FOFFS_TESTS=foffs_alter foffs_alter_all foffs_get foffs_move FRAGMENT_TESTS=fragment_affix fragment_affix_alter fragment_affix_alter2 \ fragment_affix_alter_code fragment_affix_alter_nop \ fragment_affix_dup fragment_index fragment_index_alias \ fragment_name fragment_name_oor fragment_num fragment_parent GET_TESTS=get64 get_affix get_bad_code get_bit get_carray get_carray_len \ get_carray_c2r get_carray_slice get_char get_clincom get_complex128 \ get_complex64 get_const get_const_carray get_const_complex \ get_const_repr get_cpolynom get_cpolynom1 get_cpolynom_int get_dim \ get_divide get_divide_ccin get_divide_crin get_divide_crinr \ get_divide_rcin get_divide_s get_endian8 get_endian16 get_endian32 \ get_endian64 get_endian_complex128_arm get_endian_complex128_big \ get_endian_complex128_little get_endian_complex64_arm \ get_endian_complex64_big get_endian_complex64_little \ get_endian_float32_arm get_endian_float32_big \ get_endian_float32_little get_endian_float64_arm \ get_endian_float64_big get_endian_float64_little get_ff get_float32 \ get_float64 get_foffs get_foffs2 get_fs get_here get_here_foffs \ get_heres get_index_complex get_int8 get_int16 get_int32 \ get_int64 get_invalid get_lincom1 get_lincom2 get_lincom2s \ get_lincom3 get_lincom3s get_lincom_mdt get_lincom_noin \ get_lincom_non get_lincom_null get_lincom_spf get_linterp \ get_linterp1 get_linterp_abs get_linterp_complex get_linterp_empty \ get_linterp_noin get_linterp_notab get_linterp_sort get_mplex \ get_mplex_bof get_mplex_complex get_mplex_lb get_mplex_lball \ get_mplex_nolb get_mplex_s get_mplex_saved get_multiply \ get_multiply_ccin get_multiply_crin get_multiply_crinr \ get_multiply_noin get_multiply_rcin get_multiply_s get_neg get_none \ get_nonexistent get_null get_off64 get_phase get_phase_affix \ get_polynom get_polynom_cmpin get_polynom_noin get_recip \ get_recip_const get_recurse get_rofs get_sbit get_sf get_ss \ get_string get_type get_uint16 get_uint32 get_uint64 get_window \ get_window_clr get_window_complex get_window_ge get_window_gt \ get_window_le get_window_lt get_window_ne get_window_s \ get_window_set get_zero get_zero_complex get_zero_float GLOBAL_TESTS=global_flags global_name global_ref global_ref_empty global_ref_set GZIP_TESTS=gzip_add gzip_del gzip_get gzip_get_far gzip_get_get gzip_get_get2 \ gzip_get_put gzip_move_from gzip_move_to gzip_nframes gzip_put \ gzip_put_back gzip_put_endian gzip_put_get gzip_put_nframes \ gzip_put_off gzip_put_pad gzip_put_sub gzip_seek gzip_seek_far \ gzip_seek_put gzip_sync HEADER_TESTS=header_complex header_off64t HIDE_TESTS=hide hide_hidden hide_unhide INCLUDE_TESTS=include_accmode include_affix include_auto include_cb \ include_creat include_ignore include_include include_index \ include_invalid include_nonexistent include_pc \ include_ref include_sub include_syntax INDEX_TESTS=index_domain index_index index_range index_s index_subset if INCLUDE_LEGACY_API LEGACY_TESTS=legacy_error legacy_estring legacy_format legacy_get \ legacy_get_put legacy_get_rofs legacy_nframes legacy_nonexistent \ legacy_put legacy_spf endif LZMA_TESTS=lzma_get lzma_nframes lzma_put lzma_xz_add lzma_xz_get \ lzma_xz_get_far lzma_xz_get_get lzma_xz_get_get2 lzma_xz_get_put \ lzma_xz_move_to lzma_xz_nframes lzma_xz_put lzma_xz_put_back \ lzma_xz_put_endian lzma_xz_put_get lzma_xz_put_pad lzma_xz_seek \ lzma_xz_seek_far lzma_xz_sync MADD_TESTS=madd madd_affix madd_alias madd_alias_affix madd_bit \ madd_bit_invalid madd_carray madd_clincom madd_const madd_cpolynom \ madd_crecip madd_crecip89 madd_divide madd_index \ madd_lincom madd_lincom_invalid madd_linterp madd_linterp_invalid \ madd_mplex madd_multiply madd_multiply_invalid madd_phase \ madd_phase_invalid madd_polynom madd_recip madd_sbit \ madd_spec madd_spec_directive madd_spec_invalid \ madd_spec_resolv madd_string madd_window MOVE_TESTS=move_affix move_affix_dup move_affix_meta move_affix_updb \ move_alias move_data_enc_ar move_data_enc_ra move_data_endian \ move_data_foffs move_data_foffs_neg move_data_nop move_index \ move_meta move_move move_protect move_subdir NAME_TESTS=name_affix name_affix_bad name_alias name_dangle name_dot5 \ name_dot5r name_dot9 name_dup name_meta name_move name_move_alias \ name_name name_updb name_updb_affix name_updb_alias \ name_updb_carray name_updb_const name_updb_const_alias NATIVE_TESTS=native_bit native_const native_index native_lincom \ native_lincom_cmpin native_lincom_cmpscal native_linterp \ native_linterp_cmp native_mult native_mult1 native_mult2 \ native_polynom native_polynom_cmpin native_polynom_cmpscal \ native_raw native_phase native_recip native_recip_cmpin \ native_recip_cmpscal native_sbit native_string NENTRIES_TESTS=nentries_alias nentries_hidden nentries_noalias nentries_scalar NFIELDS_TESTS=nfields_hidden nfields_invalid nfields_nfields nfields_type \ nfields_type_hidden nfields_type_invalid nfields_vector \ nfields_vector_hidden nfields_vector_invalid NFRAMES_TESTS=nframes64 nframes_empty nframes_invalid nframes_nframes \ nframes_off64 nframes_spf NMETA_TESTS=nmeta nmeta_hidden nmeta_invalid nmeta_parent nmeta_type \ nmeta_type_hidden nmeta_type_invalid nmeta_type_parent \ nmeta_vectors nmeta_vectors_del nmeta_vectors_hidden \ nmeta_vectors_invalid nmeta_vectors_parent OPEN_TESTS=open_abs open_cb_abort open_cb_cont open_cb_ignore open_cb_invalid \ open_cb_rescan open_cb_rescan_alloc open_eaccess open_invalid \ open_nonexistent open_notdirfile open_open open_rofs open_sym_al \ open_sym_at open_sym_c open_sym_cl open_sym_ct open_sym_d \ open_sym_l open_sym_p open_sym_pl open_sym_pt PARSE_TESTS=parse_alias parse_alias_code parse_alias_dup parse_alias_meta \ parse_alias_missing parse_badline parse_bit parse_bit4 \ parse_bit_bitnum parse_bit_bitsize parse_bit_ncols \ parse_bit_numbits parse_bit_scalar parse_carray parse_carray_long \ parse_const parse_const_complex parse_const_ncols parse_divide \ parse_double parse_duplicate parse_duplicate_ignore \ parse_endian_bad parse_endian_big parse_endian_force \ parse_endian_little parse_endian_slash parse_eol parse_foffs \ parse_foffs_include parse_foffs_slash parse_hex parse_hidden \ parse_hidden_field parse_hidden_meta parse_include \ parse_include_absolute parse_include_absrel \ parse_include_affix_bad parse_include_affix_ref parse_include_dir \ parse_include_loop parse_include_nonexistent parse_include_prefix \ parse_include_prefix_dup parse_include_preprefix parse_include_ref \ parse_include_relabs parse_include_relrel parse_include_slash \ parse_include_suffix parse_include_sufsuffix parse_index \ parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 \ parse_lincom_nfields parse_lincom_nofields parse_lincom_non \ parse_lincom_non_ncols parse_lincom_scalar parse_linterp \ parse_linterp_ncols parse_literal_cmpbad parse_literal_fltcmp \ parse_literal_fltcmp0 parse_literal_intcmp parse_literal_intcmp0 \ parse_literal_uintcmp parse_literal_uintcmp0 parse_malias \ parse_malias_dup parse_malias_meta parse_meta parse_meta_affix \ parse_meta_alias parse_meta_frag parse_meta_implicit \ parse_meta_implicit2 parse_meta_implicit_affix parse_meta_index \ parse_meta_index2 parse_meta_jump parse_meta_malias \ parse_meta_meta parse_meta_parent parse_meta_raw parse_mplex \ parse_mplex_ncols parse_mplex_nomax parse_mplex_scalar \ parse_multiply parse_multiply_ncols parse_name parse_name_dot \ parse_name_ext parse_name_pedantic parse_ncols parse_octal_zero \ parse_phase parse_phase_ncols parse_phase_scalar parse_polynom \ parse_polynom_ncols1 parse_polynom_ncols2 parse_polynom_scalar \ parse_protect_all parse_protect_bad parse_protect_data \ parse_protect_format parse_protect_none parse_quote \ parse_quote_mismatch parse_raw parse_raw_char parse_raw_char_bad \ parse_raw_ncols parse_raw_scalar parse_raw_spf parse_raw_type \ parse_recip parse_ref parse_ref_nonexistent parse_sbit \ parse_scalar1 parse_scalar2 parse_scalar_repr parse_sort \ parse_string parse_string_ncols parse_string_null parse_utf8 \ parse_utf8_invalid parse_utf8_zero parse_version parse_version_89 \ parse_version_98 parse_version_include parse_version_permissive \ parse_version_p8 parse_version_p9 parse_version_slash \ parse_whitespace parse_window parse_window_ncols parse_window_op \ parse_window_scalar PROTECT_TESTS=protect_alter protect_alter_all protect_get PUT_TESTS=put64 put_bad_code put_bit put_bof put_carray put_carray_client \ put_carray_slice put_char put_clincom1 put_complex128 put_complex64 \ put_const put_const_protect put_cpolynom put_crecip put_divide \ put_endian8 put_endian16 put_endian32 put_endian64 \ put_endian_complex128_arm put_endian_complex128_big \ put_endian_complex128_little put_endian_complex64_arm \ put_endian_complex64_big put_endian_complex64_little \ put_endian_float32_arm put_endian_float32_big \ put_endian_float32_little put_endian_float64_arm \ put_endian_float64_big put_endian_float64_little put_ff put_float32 \ put_float64 put_foffs put_fs put_here put_heres put_int8 put_int16 \ put_int32 put_int64 put_invalid put_lincom1 put_lincom2 \ put_lincom_noin put_linterp put_linterp_noin put_linterp_nomono \ put_linterp_notab put_linterp_reverse put_mplex put_mplex_complex \ put_multiply put_nofile put_null put_off64 put_phase put_phase_noin \ put_polynom1 put_polynom2 put_polynom_noin put_protect put_rdonly \ put_recip put_recurse put_repr put_rofs put_sbit put_sf put_ss \ put_string put_string_protect put_sub put_type put_uint16 put_uint32 \ put_uint64 put_window put_zero REF_TESTS=ref ref_none ref_two REPR_TESTS=repr_a repr_bad repr_float32 repr_float64 repr_i repr_int16 \ repr_int32 repr_int64 repr_int8 repr_m repr_r repr_real_a \ repr_real_i repr_real_m repr_real_r repr_uint16 repr_uint32 \ repr_uint64 repr_uint8 SEEK_TESTS=seek64 seek_cur seek_end seek_far seek_foffs seek_foffs2 seek_index \ seek_lincom seek_mult seek_neg seek_phase seek_set seek_sub SIE_TESTS=sie_get_big sie_get_little sie_move_from sie_move_to sie_nframes_big \ sie_nframes_little sie_put_append sie_put_append2 sie_put_back \ sie_put_big sie_put_little sie_put_many sie_put_newo sie_put_newo0 \ sie_put_pad sie_put_pad0 sie_put_trunc sie_put_trunc2 \ sie_put_trunc_nf sie_seek sie_seek_far sie_sync SLIM_TESTS=slim_get slim_nframes slim_seek slim_seek_far SVLIST_TESTS=svlist svlist0 svlist2 svlist_hidden svlist_invalid svlist_meta \ svlist_meta0 svlist_meta_hidden svlist_meta_invalid SPF_TESTS=spf_alias spf_alias_missing spf_alias_meta spf_divide spf_lincom \ spf_multiply spf_polynom spf_raw spf_recip spf_recurse TABLE_TESTS=table table_code table_type TELL_TESTS=tell tell64 tell_multidiv tell_sub TOK_TESTS=tok_arg tok_escape tok_quote TRUNC_TESTS=trunc trunc_dir trunc_rdonly trunc_rofs trunc_truncsub UNCLUDE_TESTS=unclude unclude_del unclude_move unclude_open VERSION_TESTS=version_0 version_0_write version_1 version_1_write version_2 \ version_2_write version_3 version_3_write version_4 \ version_4_write version_5 version_5_strict version_5_write \ version_6 version_6_strict version_6_write version_7 \ version_7_strict version_7_write version_8 version_8_strict \ version_8_write version_9 version_9_strict version_9_write VLIST_TESTS=vlist vlist_alias vlist_hidden vlist_invalid vlist_meta \ vlist_meta_hidden vlist_meta_invalid ZZIP_TESTS=zzip_data zzip_get zzip_get_get zzip_nframes zzip_seek zzip_seek_far ZZSLIM_TESTS=zzslim_get zzslim_nframes zzslim_seek zzslim_seek_far TESTS=$(ADD_TESTS) $(ALIAS_TESTS) $(ALTER_TESTS) $(ASCII_TESTS) \ $(BOF_TESTS) $(BZIP_TESTS) $(CLOSE_TESTS) $(CONVERT_TESTS) \ $(CREAT_TESTS) $(CVLIST_TESTS) $(DEL_TESTS) $(DFES_TESTS) \ $(DESYNC_TESTS) $(ELIST_TESTS) $(ENCODE_TESTS) $(ENDIAN_TESTS) \ $(ENTRY_TESTS) $(EOF_TESTS) $(ERROR_TESTS) $(FILE_TESTS) \ $(FLAC_TESTS) $(FLIST_TESTS) $(FLUSH_TESTS) $(FOFFS_TESTS) \ $(FRAGMENT_TESTS) $(GET_TESTS) $(GLOBAL_TESTS) $(GZIP_TESTS) \ $(HEADER_TESTS) $(HIDE_TESTS) $(INCLUDE_TESTS) $(INDEX_TESTS) \ $(LEGACY_TESTS) $(LZMA_TESTS) $(MADD_TESTS) $(MOVE_TESTS) \ $(NAME_TESTS) $(NATIVE_TESTS) $(NENTRIES_TESTS) $(NFIELDS_TESTS) \ $(NFRAMES_TESTS) $(NMETA_TESTS) $(OPEN_TESTS) $(PARSE_TESTS) \ $(PROTECT_TESTS) $(PUT_TESTS) $(REF_TESTS) $(REPR_TESTS) \ $(SEEK_TESTS) $(SIE_TESTS) $(SLIM_TESTS) $(SPF_TESTS) \ $(SVLIST_TESTS) $(TABLE_TESTS) $(TELL_TESTS) $(TOK_TESTS) \ $(TRUNC_TESTS) $(UNCLUDE_TESTS) $(VERSION_TESTS) $(VLIST_TESTS) \ $(ZZIP_TESTS) $(ZZSLIM_TESTS) check_PROGRAMS=$(TESTS) # fast tests .PHONY: fastcheck fastcheck: touch $(TESTS) ${MAKE} check # valgrind valgrind.log: $(TESTS) rm -f $@; \ for x in $^; do ( \ echo $$x:; \ sed -e 's/exec "/exec valgrind --leak-check=full --track-origins=yes --track-fds=yes --suppressions=valgrind.suppressions "/' $$x | sh; \ echo $$x = $$? ); done &> $@; # clean up after the tests check-local: check-TESTS $(MAKE) getdata-clean-dir getdata-clean-dir: rm -rf dirfile clean-local: $(MAKE) getdata-clean-dir rm -rf *~ libgetdata-0.9.0/test/nmeta_type.c0000640000175000017500000000413512614323564017277 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(nfields, 2); return r; } libgetdata-0.9.0/test/put_linterp.c0000640000175000017500000000454312614323564017502 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; FILE *t; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); t = fopen(table, "wt"); for (i = 0; i < 10; ++i) fprintf(t, "%i %i\n", i * 6, i * 3); fclose(t); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i * 2); i++; } close(fd); } unlink(table); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_index.c0000640000175000017500000000301712614323564017426 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int ret, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); memset(&E, 0, sizeof(E)); E.field_type = GD_INDEX_ENTRY; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL); ret = gd_alter_entry(D, "INDEX", &E, 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_FIELD_TYPE); CHECKI(ret, -1); return r; } libgetdata-0.9.0/test/version_1_write.c0000640000175000017500000000341212614323564020246 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "INCLUDE RAW c 8\nFRAMEOFFSET 1\na&b RAW c 8\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 1); q = gd_rewrite_fragment(D, 0); CHECKI(e,1); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_EARLIEST); CHECKI(c,1); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_literal_uintcmp.c0000640000175000017500000000277312614323564021525 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1;1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error,GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flac_put_int32.c0000640000175000017500000000401612614323564017744 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_FLAC || !defined TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.flac"; uint32_t c[8]; uint32_t d[13]; off_t nf; int r = 0, e1, e2, e3; size_t n1, n2; unsigned i; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 0x01020304 * i; D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_LITTLE_ENDIAN | GD_VERBOSE | GD_CREAT | GD_EXCL); gd_add_spec(D, "data RAW UINT32 1", 0); n1 = gd_putdata(D, "data", 5, 0, 8, 0, GD_UINT32, c); CHECKI(n1, 8); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nf = gd_nframes(D); CHECKU(nf, 13); n2 = gd_getdata(D, "data", 0, 0, 0, 13, GD_UINT32, d); CHECKI(n2, 13); e3 = gd_error(D); CHECKI(e3, GD_E_OK); for (i = 0; i < 13; ++i) { if (i < 5) CHECKXi(i, d[i], 0); else CHECKXi(i, d[i], 0x01020304U * (i - 5)); } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/sie_put_append2.c0000640000175000017500000000465312614323564020220 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, }; #define NREC 3 const uint8_t data_out[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34 }; uint8_t check[(NREC + 1) * 9]; DIRFILE *D; int fd, i, n, error, r = 0; ssize_t l; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 2 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 16); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); l = read(fd, check, (NREC + 1) * 9); close(fd); CHECKI(l, NREC * 9); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < NREC * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/convert_int16_int32.c0000640000175000017500000000377112614323564020657 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_divide_ccin.c0000640000175000017500000000410612614323564020227 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data phase\n" "phase PHASE data 1\n" "data RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { CHECKFi(i, c[i * 2], (5. + i) / (6. + i)); CHECKFi(i, c[i * 2 + 1], 0); } return r; } libgetdata-0.9.0/test/version_3_write.c0000640000175000017500000000400412614323564020246 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/RAW"; const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n"; const char *format_data1 = "m MULTIPLY ENDIAN ENDIAN\na&b RAW c 8\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 3); q = gd_rewrite_fragment(D, GD_ALL_FRAGMENTS); CHECKI(e,3); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_EARLIEST); CHECKI(c,3); gd_discard(D); unlink(format); unlink(format1); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_lincom_slope.c0000640000175000017500000000433012614323564021001 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 2 data 1 0 data 1 0\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; const char *in_fields[3] = {"data", "phase", NULL}; double m[3] = {2, 3, 0}; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_lincom(D, "lincom", 0, in_fields, m, NULL); error = gd_error(D); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i * 5 + 203); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/entry_raw_scalar.c0000640000175000017500000000353612614323564020475 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read RAW entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST UINT32 8\ndata RAW UINT8 const\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_RAW_ENTRY); CHECKS(E.scalar[0], "const"); CHECKU(E.EN(raw,spf), 8); CHECKX(E.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/ref_two.c0000640000175000017500000000416412614323564016601 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "REFERENCE data1\n" "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "REFERENCE data2\n" ; const char *data1 = "dirfile/data1"; const char *data2 = "dirfile/data2"; uint8_t data_data[4] = { 0, 1, 2, 3 }; int fd, error, error2, r = 0; DIRFILE *D; off_t nf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data1, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 4); close(fd); fd = open(data2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error, 0); nf = gd_nframes(D); error2 = gd_error(D); CHECKI(error2, 0); CHECKI(nf,3); gd_discard(D); unlink(format); unlink(data1); unlink(data2); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int32_uint64.c0000640000175000017500000000377612614323564021054 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; uint64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/get_lincom_null.c0000640000175000017500000000360412614323564020304 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 2 data 2 3 data 1 0\ndata RAW UINT8 1\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 10, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); return r; } libgetdata-0.9.0/test/parse_sbit.c0000640000175000017500000000303712614323564017265 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data SBIT in1 3\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/fragment_affix.c0000640000175000017500000000345312614323564020114 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 11\n"; char *prefix; char *suffix; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); ret = gd_fragment_affixes(D, 1, &prefix, &suffix); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKS(prefix,"A"); CHECKS(suffix,"Z"); CHECKI(ret,0); CHECKI(error,0); free(prefix); free(suffix); return r; } libgetdata-0.9.0/test/ascii_seek_far.c0000640000175000017500000000317712614323564020066 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; int fd, i, n, error, r = 0; DIRFILE *D; FILE* stream; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(n, 256); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/flush_meta.c0000640000175000017500000000313012614323564017253 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/new"; struct stat buf; int e1, e2, stat_format, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_TRUNC | GD_VERBOSE); gd_add_raw(D, "new", GD_UINT8, 2, 0); gd_metaflush(D); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); stat_format = stat(format, &buf); CHECKI(stat_format, 0); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/include_sub.c0000640000175000017500000000416012614323564017424 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "#\n"; const char *format1_data = "data RAW UINT8 11\nINCLUDE format2"; const char *format2_data = "#\n"; int fd, n, error, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_include(D, "format1", 0, 0); error = gd_error(D); CHECKI(error, 0); gd_entry(D, "data", &E); CHECKI(n, E.fragment_index); gd_free_entry_strings(&E); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/del_data_open.c0000640000175000017500000000424712614323564017714 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* delete an open data file */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e0, e1, n, e2, e3, unlink_data, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data); e0 = gd_error(D); CHECKI(e0, GD_E_OK); ret = gd_delete(D, "data", GD_DEL_DATA); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data); e2 = gd_error(D); CHECKI(e2, GD_E_BAD_CODE); CHECKI(n, 0); e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, -1); return r; } libgetdata-0.9.0/test/alter_divide.c0000640000175000017500000000416412614323564017567 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div DIVIDE data data\n"; int32_t data_data[256]; double c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_divide(D, "div", NULL, "phase"); error = gd_error(D); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], (i + 40.) / (i + 41.)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/repr_real_i.c0000640000175000017500000000400612614323564017412 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read imaginary representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double c[8]; double data_data[100]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) data_data[i] = sin(i * 3.14159265358979323846 / 5.); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 100 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.i", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],0); return r; } libgetdata-0.9.0/test/open_sym_l.c0000640000175000017500000000320312614323564017271 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* this tests whether _GD_CanonicalPath can deal with symlink loops */ #include "test.h" #include #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD return 77; #else const char *link = "dirfile/link"; const char *filedir = "dirfile/link/dirfile"; int error, r = 0; int cwd_size = 2048; char *ptr, *cwd = NULL; DIRFILE *D; gdtest_getcwd(ptr, cwd, cwd_size); rmdirfile(); mkdir("dirfile", 0777); /* make a bad symlink */ symlink("link", link); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(link); rmdir("dirfile"); CHECKI(error, GD_E_IO); free(cwd); return r; #endif } libgetdata-0.9.0/test/add_lincom_invalid.c0000640000175000017500000000270412614323564020731 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char *in_fields[2] = {"in1", "in2"}; const double m[2] = {1, 0.3}; const double b[2] = {0, 0.9}; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_lincom(D, "new", 2, in_fields, m, b, 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/flush_lincom1.c0000640000175000017500000000415712614323564017701 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n" "lincom LINCOM data 1 0\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, c); gd_flush(D, "lincom"); e1 = gd_error(D); CHECKI(n, 8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat(data)"); r = 1; } else CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_endian_float64_arm.c0000640000175000017500000002113012614323564021417 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read arm-endian FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\nENDIAN little arm\n"; double u[10]; double v[20]; const unsigned char data_data[128 * 8] = { 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x14, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x26, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x31, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x39, 0x40, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x38, 0x43, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0xd5, 0x4c, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd8, 0x9f, 0x55, 0x40, 0x00, 0x00, 0x00, 0x00, 0xe2, 0x37, 0x60, 0x40, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x53, 0x68, 0x40, 0x00, 0x00, 0x00, 0x00, 0xde, 0x3e, 0x72, 0x40, 0x00, 0x00, 0x00, 0x40, 0x4d, 0x5e, 0x7b, 0x40, 0x00, 0x00, 0x00, 0x60, 0xba, 0x86, 0x84, 0x40, 0x00, 0x00, 0x00, 0x08, 0x17, 0xca, 0x8e, 0x40, 0x00, 0x00, 0x00, 0x0c, 0x91, 0x17, 0x97, 0x40, 0x00, 0x00, 0x00, 0x49, 0xac, 0x51, 0xa1, 0x40, 0x00, 0x00, 0xc0, 0xf6, 0x83, 0xfa, 0xa9, 0x40, 0x00, 0x00, 0x20, 0x72, 0xe2, 0x7b, 0xb3, 0x40, 0x00, 0x00, 0x98, 0x95, 0xd3, 0x39, 0xbd, 0x40, 0x00, 0x00, 0x64, 0xe0, 0x5e, 0xeb, 0xc5, 0x40, 0x00, 0x00, 0x4b, 0xe8, 0x87, 0x70, 0xd0, 0x40, 0x00, 0x40, 0x38, 0x2e, 0xca, 0xa8, 0xd8, 0x40, 0x00, 0x60, 0x54, 0xc5, 0x98, 0x7e, 0xe2, 0x40, 0x00, 0x48, 0xff, 0x13, 0xe4, 0xbd, 0xeb, 0x40, 0x00, 0xec, 0xfe, 0x1d, 0x6b, 0xce, 0xf4, 0x40, 0x00, 0x31, 0x7f, 0x16, 0xa0, 0x35, 0xff, 0x40, 0x80, 0xc9, 0xbe, 0xa1, 0x38, 0x68, 0x07, 0x41, 0x20, 0x17, 0x4f, 0x79, 0x2a, 0x8e, 0x11, 0x41, 0x58, 0x51, 0xfb, 0x5a, 0x3f, 0x55, 0x1a, 0x41, 0x04, 0xfa, 0x78, 0x88, 0xef, 0xbf, 0x23, 0x41, 0x83, 0xbb, 0x5a, 0xa6, 0xe7, 0x9f, 0x2d, 0x41, 0x44, 0x19, 0x88, 0x79, 0xed, 0x37, 0x36, 0x41, 0xf3, 0x12, 0x26, 0x9b, 0xf2, 0xa9, 0x40, 0x41, 0x36, 0x8e, 0x5c, 0x34, 0xeb, 0xfe, 0x48, 0x41, 0x51, 0xd5, 0x8a, 0x4e, 0x30, 0xbf, 0x52, 0x41, 0xfd, 0x1f, 0xe8, 0x7a, 0xc8, 0x1e, 0x5c, 0x41, 0xfc, 0x2f, 0x5c, 0xb8, 0x16, 0x17, 0x65, 0x41, 0xfd, 0x23, 0x45, 0x8a, 0xa1, 0xa2, 0x6f, 0x41, 0xfc, 0xb5, 0x67, 0xcf, 0xf9, 0xb9, 0x77, 0x41, 0x7d, 0xc8, 0x8d, 0x5b, 0x7b, 0xcb, 0x81, 0x41, 0x5e, 0x56, 0xaa, 0x04, 0x38, 0xb1, 0x8a, 0x41, 0x8d, 0x81, 0xff, 0x86, 0xea, 0x04, 0x94, 0x41, 0x2a, 0xa1, 0x3f, 0x65, 0x5f, 0x07, 0x9e, 0x41, 0xbf, 0x71, 0xdf, 0x97, 0x87, 0x85, 0xa6, 0x41, 0x4f, 0x95, 0xe7, 0xb1, 0x25, 0xe4, 0xb0, 0x41, 0xfb, 0xaf, 0x6d, 0xc5, 0x38, 0x56, 0xb9, 0x41, 0xf8, 0x87, 0x24, 0xa8, 0xaa, 0x00, 0xc3, 0x41, 0xfa, 0x65, 0x1b, 0x7e, 0xff, 0x80, 0xcc, 0x41, 0xf7, 0x18, 0x29, 0xbd, 0xbf, 0x60, 0xd5, 0x41, 0xb9, 0xd2, 0xde, 0xcd, 0x8f, 0x08, 0xe0, 0x41, 0x0b, 0x1e, 0x67, 0xda, 0xd7, 0x0c, 0xe8, 0x41, 0x10, 0xad, 0x9a, 0xc7, 0xa1, 0x09, 0xf2, 0x41, 0xcc, 0x01, 0xb4, 0xd5, 0x72, 0x0e, 0xfb, 0x41, 0xb2, 0x02, 0x8e, 0xc0, 0xd6, 0x4a, 0x04, 0x42, 0x06, 0x82, 0x6a, 0x10, 0x41, 0x70, 0x0e, 0x42, 0x09, 0xc3, 0x9f, 0x18, 0x30, 0xd4, 0x16, 0x42, 0x47, 0xd2, 0x77, 0xd2, 0x24, 0x1f, 0x21, 0x42, 0xb5, 0xdd, 0xd9, 0x9d, 0xb6, 0xae, 0x29, 0x42, 0x90, 0xcc, 0xc6, 0xec, 0x09, 0x43, 0x33, 0x42, 0x6c, 0x19, 0x95, 0x31, 0x8d, 0xe4, 0x3c, 0x42, 0x22, 0xa6, 0x5f, 0xca, 0x6a, 0xab, 0x45, 0x42, 0x9a, 0xbc, 0xc7, 0x57, 0x8f, 0x40, 0x50, 0x42, 0x74, 0xcd, 0xd5, 0xc1, 0xd7, 0x60, 0x58, 0x42, 0x2e, 0xb4, 0xc0, 0xa2, 0xa1, 0x48, 0x62, 0x42, 0x22, 0x87, 0x10, 0xba, 0xf2, 0x6c, 0x6b, 0x42, 0xb3, 0xca, 0x18, 0x97, 0xb5, 0x91, 0x74, 0x42, 0x06, 0x98, 0x52, 0xf1, 0x90, 0xda, 0x7e, 0x42, 0x09, 0xe4, 0xfb, 0xe9, 0xec, 0x23, 0x87, 0x42, 0x07, 0xeb, 0x7c, 0xaf, 0xf1, 0x5a, 0x91, 0x42, 0x45, 0xb0, 0x9d, 0x83, 0x6a, 0x08, 0x9a, 0x42, 0x68, 0x88, 0x6c, 0x45, 0x4f, 0x86, 0xa3, 0x42, 0x4e, 0x66, 0x11, 0xb4, 0x77, 0x49, 0xad, 0x42, 0x75, 0x19, 0x1a, 0x8e, 0x19, 0xf7, 0xb5, 0x42, 0x18, 0x93, 0x93, 0xaa, 0x53, 0x79, 0xc0, 0x42, 0x52, 0xae, 0xee, 0x3f, 0xfc, 0xb5, 0xc8, 0x42, 0x7b, 0x05, 0xe6, 0xdf, 0x7d, 0x88, 0xd2, 0x42, 0x1c, 0x84, 0xec, 0xa7, 0xbc, 0xcc, 0xdb, 0x42, 0x2a, 0xc6, 0xe2, 0x7b, 0x8d, 0xd9, 0xe4, 0x42, 0xa0, 0x14, 0xea, 0x5c, 0x54, 0x46, 0xef, 0x42, 0xf0, 0x1e, 0x5f, 0x0b, 0xbf, 0x74, 0xf7, 0x42, 0x34, 0x57, 0x87, 0x08, 0x8f, 0x97, 0x01, 0x43, 0x67, 0x81, 0x65, 0x46, 0x56, 0x63, 0x0a, 0x43, 0x1a, 0x42, 0x98, 0xe9, 0x81, 0xca, 0x13, 0x43, 0x94, 0x31, 0x32, 0x2f, 0xc1, 0xaf, 0x1d, 0x43, 0x5e, 0x4a, 0xcb, 0xc6, 0xd1, 0x43, 0x26, 0x43, 0xc6, 0x77, 0x18, 0x55, 0xdc, 0xb2, 0x30, 0x43, 0xd4, 0x59, 0xd2, 0xff, 0x4b, 0x0c, 0x39, 0x43, 0xbe, 0x86, 0xbb, 0x7f, 0x38, 0xc9, 0x42, 0x43, 0x0e, 0xa5, 0xcc, 0x9f, 0xd4, 0x2d, 0x4c, 0x43, 0x95, 0xf7, 0xb2, 0xef, 0x5f, 0x22, 0x55, 0x43, 0xb0, 0x39, 0xc6, 0xb3, 0x8f, 0xb3, 0x5f, 0x43, 0x88, 0x56, 0xa9, 0x8d, 0xab, 0xc6, 0x67, 0x43, 0xe6, 0x00, 0x3f, 0xaa, 0x00, 0xd5, 0x71, 0x43, 0xac, 0x40, 0xaf, 0xbf, 0x81, 0xbf, 0x7a, 0x43, 0x02, 0xe1, 0x86, 0x1f, 0xa0, 0x0f, 0x84, 0x43, 0xc2, 0x28, 0xa5, 0xd7, 0x71, 0x17, 0x8e, 0x43, 0x23, 0xbd, 0x77, 0x43, 0x94, 0x91, 0x96, 0x43, 0xda, 0xcd, 0x99, 0xf2, 0x2f, 0xed, 0xa0, 0x43, 0x64, 0x5a, 0xf3, 0xb5, 0xc7, 0x63, 0xa9, 0x43, 0x96, 0x07, 0xed, 0x90, 0xd5, 0x0a, 0xb3, 0x43, 0xb0, 0xc5, 0xb1, 0xac, 0x40, 0x90, 0xbc, 0x43, 0x88, 0xa8, 0x0a, 0x83, 0x30, 0x6c, 0xc5, 0x43, 0x66, 0xfe, 0x47, 0x62, 0x24, 0x11, 0xd0, 0x43, 0xcc, 0xfe, 0xb5, 0x49, 0xb6, 0x19, 0xd8, 0x43, 0x32, 0xfe, 0x90, 0x6e, 0x48, 0x13, 0xe2, 0x43, 0xa6, 0xbe, 0xec, 0xd2, 0xed, 0x1c, 0xeb, 0x43, 0xf9, 0x1d, 0x63, 0x3c, 0xb1, 0x55, 0xf4, 0x43, 0x7b, 0x56, 0x4a, 0xed, 0x8a, 0x80, 0xfe, 0x43, 0xb8, 0x81, 0xef, 0xe3, 0x68, 0xe0, 0x06, 0x44, 0x4a, 0xa1, 0xf3, 0x2a, 0x4e, 0x28, 0x11, 0x44, 0xf8, 0xb8, 0x36, 0x20, 0x75, 0xbc, 0x19, 0x44, 0x74, 0x15, 0x52, 0x30, 0x57, 0x4d, 0x23, 0x44, 0x17, 0x90, 0x3d, 0xe4, 0x03, 0xf4, 0x2c, 0x44, 0x22, 0x58, 0x5c, 0xd6, 0x02, 0xb7, 0x35, 0x44, 0x1a, 0x42, 0xc5, 0xe0, 0x42, 0x49, 0x40, 0x44, 0x94, 0xf1, 0x93, 0x28, 0xe3, 0x6d, 0x48, 0x44, 0x5e, 0xea, 0xdd, 0x3c, 0x6a, 0x52, 0x52, 0x44, 0xc6, 0x6f, 0xa6, 0x6d, 0x9f, 0x7b, 0x5b, 0x44, 0xa9, 0xa7, 0x79, 0xa4, 0xb7, 0x9c, 0x64, 0x44, 0xbf, 0x3d, 0x5b, 0xbb, 0x13, 0xeb, 0x6e, 0x44, 0x9e, 0xdc, 0x08, 0x99, 0x4e, 0x30, 0x77, 0x44, 0x76, 0xa5, 0xc6, 0xb2, 0x3b, 0x64, 0x81, 0x44, 0x18, 0xfc, 0x14, 0x06, 0x58, 0x16, 0x8a, 0x44, 0x24, 0x7a, 0x1f, 0x89, 0xc2, 0x90, 0x93, 0x44, 0x9b, 0x9b, 0xd7, 0x66, 0x23, 0x59, 0x9d, 0x44, 0x68, 0x69, 0x43, 0x9a }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); v[0] = 1.5; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 1.5; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT64, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) CHECKFi(i, u[i], v[i + 5]); return r; } libgetdata-0.9.0/test/parse_version_slash.c0000640000175000017500000000310012614323564021172 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 999999\nBADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/nframes64.c0000640000175000017500000000344712614323564016744 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #define _LARGEFILE64_SOURCE 1 #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 1\n"; int fd, r = 0; size_t n; const size_t len = strlen(data); DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes64(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKU(n, len); return r; } libgetdata-0.9.0/test/madd_spec.c0000640000175000017500000000353312614323564017052 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_madd_spec() */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, n, r = 0; unsigned char val; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_madd_spec(D, "meta CONST UINT8 2", "INDEX"); error = gd_error(D); /* check */ n = gd_nfields(D); CHECKI(n, 1); gd_entry(D, "INDEX/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_get_constant(D, "INDEX/meta", GD_UINT8, &val); CHECKU(val, 2); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_int64_float32.c0000640000175000017500000000400612614323564021165 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/convert_uint8_int8.c0000640000175000017500000000375212614323564020707 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; int8_t c[8]; uint8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/spf_multiply.c0000640000175000017500000000323212614323564017656 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* The SPF of a MULTIPLY should equal the SPF of the first field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in1 RAW UINT8 11\n" "in2 RAW UINT8 13\n" "lincom MULTIPLY in1 in2\n"; int fd, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "lincom"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/get_foffs2.c0000640000175000017500000000417012614323564017155 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "FRAMEOFFSET 2\ndata RAW UINT8 1\n"; unsigned char c1[5], c2[5]; unsigned char data_data[256]; int i, fd, n1, n2, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (unsigned char)i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 0, 5, 0, GD_UINT8, c1); e1 = gd_error(D); CHECKI(n1, 5); CHECKI(e1, 0); for (i = 0; i < 5; ++i) CHECKUi(i, c1[i], (i < 2) ? 0 : i - 2); n2 = gd_getdata(D, "data", 0, 0, 5, 0, GD_UINT8, c2); e2 = gd_error(D); CHECKI(n2, 5); CHECKI(e2, 0); for (i = 0; i < 5; ++i) CHECKUi(i, c2[i], (i < 2) ? 0 : i - 2); gd_close(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/legacy_get.c0000640000175000017500000000371312614323564017236 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 via the legacy interface */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); n = GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &error); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 40 + i); unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/get_mplex_lb.c0000640000175000017500000000413212614323564017570 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 2 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 38 + 3 * ((i + 2) / 3)); return r; } libgetdata-0.9.0/test/repr_bad.c0000640000175000017500000000362612614323564016714 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data.3", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_CODE); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/gzip_put_back.c0000640000175000017500000000534512614323564017757 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #if ! (defined TEST_GZIP) || ! (defined USE_GZIP) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); n2 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_gz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/entry_mplex_scalar.c0000640000175000017500000000356212614323564021030 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "a CONST UINT16 1\n" "b CARRAY UINT16 2 3 4 5\n" "data MPLEX in1 in2 a b<3>\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_MPLEX_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); CHECKS(E.scalar[0], "a"); CHECKS(E.scalar[1], "b"); CHECKI(E.scalar_ind[0], -1); CHECKI(E.scalar_ind[1], 3); CHECKI(E.EN(mplex,count_val), 1); CHECKI(E.EN(mplex,period), 5); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/put_polynom_noin.c0000640000175000017500000000337412614323564020546 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write POLYNOM */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM data 0.5 3.0\n"; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/add_spec_meta.c0000640000175000017500000000352612614323564017705 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* add a barth-style meta field with add_spec */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; gd_entry_t e; unsigned char val; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "INDEX/meta CONST UINT8 2", 0); error = gd_error(D); /* check */ n = gd_nfields(D); CHECKI(n, 1); gd_entry(D, "INDEX/meta", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_get_constant(D, "INDEX/meta", GD_UINT8, &val); CHECKI(val, 2); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/open_cb_abort.c0000640000175000017500000000346412614323564017732 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include #include static int saw_callback = 0; int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_) { saw_callback++; return GD_SYNTAX_ABORT; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n" "BADDIRECTIVE BADTYPE\n" "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(saw_callback, 1); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/add_clincom.c0000640000175000017500000000471212614323564017367 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a complex LINCOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; DIRFILE *D; const char *in_fields[2] = {"in1", "in2"}; #ifdef GD_NO_C99_API const double m[4] = {1, 3.3, 0.3, 18.3}; const double b[4] = {2, 3.8, 2.1, 9.8}; #else const double complex m[2] = {1 + _Complex_I * 3.3, 0.3 + _Complex_I * 18.3}; const double complex b[2] = {2 + _Complex_I * 3.8, 2.1 + _Complex_I * 9.8}; #endif int error, r = 0; gd_entry_t e; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_clincom(D, "new", 2, in_fields, m, b, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields),2); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); #ifdef GD_NO_C99_API CHECKC(e.EN(lincom,cm)[0], m); CHECKC(e.EN(lincom,cm)[1], m + 2); CHECKC(e.EN(lincom,cb)[0], b); CHECKC(e.EN(lincom,cb)[1], b + 2); #else CHECKC(e.EN(lincom,cm)[0], m[0]); CHECKC(e.EN(lincom,cm)[1], m[1]); CHECKC(e.EN(lincom,cb)[0], b[0]); CHECKC(e.EN(lincom,cb)[1], b[1]); #endif CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_uint16_int32.c0000640000175000017500000000377712614323564021052 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/dfes_lincom.c0000640000175000017500000000312712614323564017414 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a LINCOM entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data LINCOM 2 in1 2 1 in2 2 1\n"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/parse_bit.c0000640000175000017500000000303612614323564017101 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1 3\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/cvlist_array.c0000640000175000017500000000404312614323564017632 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CARRAY UINT8 1 2 3 4 5\n" "data2 CARRAY UINT8 2 4 6 8 10 12\n" "data3 CARRAY UINT8 3 6 9 12 15 18 21\n" "data4 RAW UINT8 1\n"; int fd, error, r = 0; size_t i; struct uint8_carrays { size_t n; uint8_t *d; } *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 3; ++fd) { CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1)); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/bof_lincom.c0000640000175000017500000000452512614323564017244 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT16 2\n" "/FRAMEOFFSET 35\n" "lincom LINCOM 2 data2 1. 0. data 1. 0.\n" "lincom2 LINCOM 2 data 1. 0. data2 1. 0.\n" "INCLUDE format1\n"; const char *format1_data = "data2 RAW UINT8 3\nFRAMEOFFSET 33\n"; int fd, error1, error2, error3, error4, r = 0; off_t bof_data, bof_data2, bof_lincom, bof_lincom2; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); bof_data = gd_bof(D, "data"); error1 = gd_error(D); bof_data2 = gd_bof(D, "data2"); error2 = gd_error(D); bof_lincom = gd_bof(D, "lincom"); error3 = gd_error(D); bof_lincom2 = gd_bof(D, "lincom2"); error4 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(bof_data, 70); CHECKI(error2, 0); CHECKI(bof_data2, 99); CHECKI(error3, 0); CHECKI(bof_lincom, 105); CHECKI(error4, 0); CHECKI(bof_lincom2, 70); return r; } libgetdata-0.9.0/test/lzma_xz_get_get2.c0000640000175000017500000000442412614323564020377 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_LZMA || !defined TEST_LZMA return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, error1, n2, error2, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c1); error1 = gd_error(D); n2 = gd_getdata(D, "data", 0, 0, 1, 0, GD_UINT16, c2); error2 = gd_error(D); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); CHECKI(error1, 0); CHECKI(error2, 0); CHECKI(n1, 8); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKUi(i,c1[i], i); CHECKUi(i,c2[i], i); } return r; #endif } libgetdata-0.9.0/test/convert_uint16_int16.c0000640000175000017500000000377712614323564021054 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/add_multiply.c0000640000175000017500000000331012614323564017613 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a MULTIPLY field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_multiply(D, "new", "in1", "in2", 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_MULTIPLY_ENTRY); CHECKS(e.in_fields[0], "in1"); CHECKS(e.in_fields[1], "in2"); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/encode_alter_open.c0000640000175000017500000000454312614323564020602 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *txtdata = "dirfile/data.txt"; const char *format_data = "data RAW UINT16 8\nENCODING none\n"; const char *txt_data = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n"; uint16_t data_data[128]; uint16_t c1, c2; int fd, ret, error, r = 0; off_t n1, n2; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 0x201 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(txtdata, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, txt_data, strlen(txt_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c1); ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 0); error = gd_error(D); n2 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c2); gd_discard(D); unlink(txtdata); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(n1, 1); CHECKI(n2, 1); CHECKI(c1, 0x603); CHECKI(c2, 3); return r; } libgetdata-0.9.0/test/convert_int64_complex128.c0000640000175000017500000000431112614323564021614 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/convert_float64_uint8.c0000640000175000017500000000376312614323564021306 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; uint8_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_float32_int32.c0000640000175000017500000000377012614323564021167 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; int32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_meta_index2.c0000640000175000017500000000311612614323564020521 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent INDEX CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/get_window_complex.c0000640000175000017500000000417112614323564021027 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data.r EQ 44\n" "data RAW COMPLEX128 8\n"; double c[16]; double data_data[512]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { data_data[2 * fd] = (double)fd; data_data[2 * fd + 1] = (double)fd / 256.; } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { CHECKFi(i, c[2 * i], (i == 4) ? 40 + i : 0); CHECKFi(i, c[2 * i + 1], (i == 4) ? (40 + i) / 256. : 0); } return r; } libgetdata-0.9.0/test/nmeta_vectors_hidden.c0000640000175000017500000000363212614323564021317 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1/linterp2\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nmvectors(D, "raw1"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(nfields, 2); return r; } libgetdata-0.9.0/test/add_mplex_scalars.c0000640000175000017500000000325212614323564020576 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "mplex1"; E.field_type = GD_MPLEX_ENTRY; E.in_fields[0] = "INDEX"; E.in_fields[1] = "INDEX"; E.EN(mplex,count_val) = 0; E.EN(mplex,period) = -1; E.scalar[1] = "const"; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/nentries_scalar.c0000640000175000017500000000367612614323564020317 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1\n" "/HIDDEN raw1/const\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nentries(D, NULL, GD_SCALAR_ENTRIES, 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 3); return r; } libgetdata-0.9.0/test/error_short.c0000640000175000017500000000273112614323564017502 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* a short error string should still be NULL-terminated */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; char string[1000] = "abc"; int r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY); gd_error_string(D, string, 2); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(string[1], 0); return r; } libgetdata-0.9.0/test/gzip_seek_far.c0000640000175000017500000000424512614323564017744 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; #ifdef USE_GZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); error = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(error, 0); /* Either of these values is fine with us */ if (n != 256) CHECKI(n, 4000); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, -1); #endif return r; #endif } libgetdata-0.9.0/test/madd_string.c0000640000175000017500000000362012614323564017423 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, mf_error, ge_error, r = 0; gd_entry_t e; char val[1000]; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_string(D, "new", "meta", "A string."); error = gd_error(D); CHECKI(error, GD_E_OK); gd_metaflush(D); mf_error = gd_error(D); CHECKI(mf_error, GD_E_OK); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_STRING_ENTRY); CHECKI(e.fragment_index, 0); gd_get_string(D, "new/meta", 1000, val); CHECKS(val, "A string."); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_include_relrel.c0000640000175000017500000000414412614323564021314 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format1"; const char *format2 = "dirfile/sub/format2"; const char *format_data = "INCLUDE sub/format1\n"; const char *format1_data = "INCLUDE format2\n"; const char *format2_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "data"); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); CHECKU(spf, 11); return r; } libgetdata-0.9.0/test/desync_reopen.c0000640000175000017500000000346312614323564017772 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n"; int e1, e2, e3, n1, n2, fd, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); e1 = gd_error(D); /* ensure mtime ticks over */ sleep(1); /* modify the format file */ fd = open(format, O_CREAT | O_TRUNC | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); n1 = gd_desync(D, GD_DESYNC_REOPEN); e2 = gd_error(D); n2 = gd_validate(D, "data"); e3 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(e3, 0); CHECKI(n1, 1); CHECKI(n2, 0); return r; } libgetdata-0.9.0/test/parse_lincom_nofields.c0000640000175000017500000000302612614323564021466 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/flush_mult.c0000640000175000017500000000435712614323564017322 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *cata = "dirfile/cata"; const char *data = "dirfile/data"; const char *format_data = "cata RAW UINT8 8\n" "data RAW UINT8 8\n" "mult MULTIPLY cata data\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); gd_flush(D, "mult"); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n, 8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat(data)"); r = 1; } else CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); if (!stat(cata, &buf)) { perror("stat(cata)"); r = 1; } fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, (i < 40 || i > 48) ? 0 : i); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_endian_float32_big.c0000640000175000017500000001261612614323564021405 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read big-endian FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 1\nENDIAN big\n"; float u[10]; float v[20]; const unsigned char data_data[128 * 4] = { 0x3F, 0xC0, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x40, 0x58, 0x00, 0x00, 0x40, 0xA2, 0x00, 0x00, 0x40, 0xF3, 0x00, 0x00, 0x41, 0x36, 0x40, 0x00, 0x41, 0x88, 0xB0, 0x00, 0x41, 0xCD, 0x08, 0x00, 0x42, 0x19, 0xC6, 0x00, 0x42, 0x66, 0xA9, 0x00, 0x42, 0xAC, 0xFE, 0xC0, 0x43, 0x01, 0xBF, 0x10, 0x43, 0x42, 0x9E, 0x98, 0x43, 0x91, 0xF6, 0xF2, 0x43, 0xDA, 0xF2, 0x6B, 0x44, 0x24, 0x35, 0xD0, 0x44, 0x76, 0x50, 0xB8, 0x44, 0xB8, 0xBC, 0x8A, 0x45, 0x0A, 0x8D, 0x68, 0x45, 0x4F, 0xD4, 0x1C, 0x45, 0x9B, 0xDF, 0x15, 0x45, 0xE9, 0xCE, 0xA0, 0x46, 0x2F, 0x5A, 0xF8, 0x46, 0x83, 0x84, 0x3A, 0x46, 0xC5, 0x46, 0x57, 0x47, 0x13, 0xF4, 0xC1, 0x47, 0x5D, 0xEF, 0x22, 0x47, 0xA6, 0x73, 0x5A, 0x47, 0xF9, 0xAD, 0x07, 0x48, 0x3B, 0x41, 0xC5, 0x48, 0x8C, 0x71, 0x54, 0x48, 0xD2, 0xA9, 0xFE, 0x49, 0x1D, 0xFF, 0x7E, 0x49, 0x6C, 0xFF, 0x3D, 0x49, 0xB1, 0xBF, 0x6E, 0x4A, 0x05, 0x4F, 0x92, 0x4A, 0x47, 0xF7, 0x5B, 0x4A, 0x95, 0xF9, 0x84, 0x4A, 0xE0, 0xF6, 0x46, 0x4B, 0x28, 0xB8, 0xB4, 0x4B, 0x7D, 0x15, 0x0E, 0x4B, 0xBD, 0xCF, 0xCA, 0x4C, 0x0E, 0x5B, 0xD8, 0x4C, 0x55, 0x89, 0xC4, 0x4C, 0xA0, 0x27, 0x53, 0x4C, 0xF0, 0x3A, 0xFC, 0x4D, 0x34, 0x2C, 0x3D, 0x4D, 0x87, 0x21, 0x2E, 0x4D, 0xCA, 0xB1, 0xC5, 0x4E, 0x18, 0x05, 0x54, 0x4E, 0x64, 0x07, 0xFE, 0x4E, 0xAB, 0x05, 0xFE, 0x4F, 0x00, 0x44, 0x7E, 0x4F, 0x40, 0x66, 0xBD, 0x4F, 0x90, 0x4D, 0x0E, 0x4F, 0xD8, 0x73, 0x95, 0x50, 0x22, 0x56, 0xB0, 0x50, 0x73, 0x82, 0x08, 0x50, 0xB6, 0xA1, 0x86, 0x51, 0x08, 0xF9, 0x24, 0x51, 0x4D, 0x75, 0xB6, 0x51, 0x9A, 0x18, 0x48, 0x51, 0xE7, 0x24, 0x6C, 0x52, 0x2D, 0x5B, 0x51, 0x52, 0x82, 0x04, 0x7D, 0x52, 0xC3, 0x06, 0xBC, 0x53, 0x12, 0x45, 0x0D, 0x53, 0x5B, 0x67, 0x94, 0x53, 0xA4, 0x8D, 0xAF, 0x53, 0xF6, 0xD4, 0x86, 0x54, 0x39, 0x1F, 0x64, 0x54, 0x8A, 0xD7, 0x8B, 0x54, 0xD0, 0x43, 0x50, 0x55, 0x1C, 0x32, 0x7C, 0x55, 0x6A, 0x4B, 0xBA, 0x55, 0xAF, 0xB8, 0xCC, 0x56, 0x03, 0xCA, 0x99, 0x56, 0x45, 0xAF, 0xE6, 0x56, 0x94, 0x43, 0xEC, 0x56, 0xDE, 0x65, 0xE2, 0x57, 0x26, 0xCC, 0x6A, 0x57, 0x7A, 0x32, 0x9F, 0x57, 0xBB, 0xA5, 0xF7, 0x58, 0x0C, 0xBC, 0x79, 0x58, 0x53, 0x1A, 0xB6, 0x58, 0x9E, 0x54, 0x08, 0x58, 0xED, 0x7E, 0x0C, 0x59, 0x32, 0x1E, 0x89, 0x59, 0x85, 0x96, 0xE7, 0x59, 0xC8, 0x62, 0x5A, 0x5A, 0x16, 0x49, 0xC4, 0x5A, 0x61, 0x6E, 0xA6, 0x5A, 0xA9, 0x12, 0xFC, 0x5A, 0xFD, 0x9C, 0x7A, 0x5B, 0x3E, 0x35, 0x5C, 0x5B, 0x8E, 0xA8, 0x05, 0x5B, 0xD5, 0xFC, 0x08, 0x5C, 0x20, 0x7D, 0x06, 0x5C, 0x70, 0xBB, 0x89, 0x5C, 0xB4, 0x8C, 0xA7, 0x5D, 0x07, 0x69, 0x7D, 0x5D, 0x4B, 0x1E, 0x3C, 0x5D, 0x98, 0x56, 0xAD, 0x5D, 0xE4, 0x82, 0x04, 0x5E, 0x2B, 0x61, 0x83, 0x5E, 0x80, 0x89, 0x22, 0x5E, 0xC0, 0xCD, 0xB3, 0x5F, 0x10, 0x9A, 0x46, 0x5F, 0x58, 0xE7, 0x69, 0x5F, 0xA2, 0xAD, 0x8F, 0x5F, 0xF4, 0x04, 0x56, 0x60, 0x37, 0x03, 0x40, 0x60, 0x89, 0x42, 0x70, 0x60, 0xCD, 0xE3, 0xA8, 0x61, 0x1A, 0x6A, 0xBE, 0x61, 0x67, 0xA0, 0x1D, 0x61, 0xAD, 0xB8, 0x16, 0x62, 0x02, 0x4A, 0x10, 0x62, 0x43, 0x6F, 0x18, 0x62, 0x92, 0x93, 0x52, 0x62, 0xDB, 0xDC, 0xFB, 0x63, 0x24, 0xE5, 0xBC, 0x63, 0x77, 0x58, 0x9A, 0x63, 0xB9, 0x82, 0x74, 0x64, 0x0B, 0x21, 0xD7, 0x64, 0x50, 0xB2, 0xC2, 0x64, 0x9C, 0x86, 0x12, 0x64, 0xEA, 0xC9, 0x1B }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); v[0] = 1.5; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 1.5; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) CHECKFi(i, u[i], v[i + 5]); return r; } libgetdata-0.9.0/test/get_mplex_lball.c0000640000175000017500000000427312614323564020267 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 7 8\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; data_data[0] = 111; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; data_data[0] = 7; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_mplex_lookback(D, GD_LOOKBACK_ALL); e1 = gd_error(D); n = gd_getdata(D, "mplex", 12, 0, 1, 0, GD_UINT8, &c); e2 = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 111); return r; } libgetdata-0.9.0/test/open_sym_pt.c0000640000175000017500000000302712614323564017465 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile/link/"; const char *format = "dirfile/format"; const char *targ = "../dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ symlink(targ, "dirfile/link"); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; #endif } libgetdata-0.9.0/test/nmeta_vectors_del.c0000640000175000017500000000442212614323564020626 0ustar alastairalastair/* Copyright (C) 2010-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, error2, error3, r = 0; unsigned int nvec, nvec2, nvec3; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); nvec = gd_nmvectors(D, "raw1"); error = gd_error(D); gd_delete(D, "raw1/linterp3", 0); nvec2 = gd_nmvectors(D, "raw1"); error2 = gd_error(D); gd_delete(D, "raw1/string", 0); nvec3 = gd_nmvectors(D, "raw1"); error3 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(nvec,3); CHECKI(error2,0); CHECKI(nvec2,2); CHECKI(error3,0); CHECKI(nvec3,2); return r; } libgetdata-0.9.0/test/zzip_nframes.c0000640000175000017500000000447612614323564017651 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_ZZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *rawzip = "dirfile/raw.zip"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; size_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ chdir(filedir); snprintf(command, 4096, "%s raw data > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(data); #ifdef USE_ZZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(rawzip); unlink(format); rmdir(filedir); #ifdef USE_ZZIP CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNKNOWN_ENCODING); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/get_window_clr.c0000640000175000017500000000401712614323564020137 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data CLR 0x2\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (~i & 2) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/endian_alter_sie.c0000640000175000017500000000517112614323564020420 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test endianness */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\nENDIAN little\nENCODING sie\n"; const uint8_t data_in[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; const uint8_t data_out[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x32 }; uint8_t c[8], d[3 * 9]; int fd, ret, error, n, i = 0, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_in, 3 * 9); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_endianness(D, GD_BIG_ENDIAN, 0, 1); error = gd_error(D); n = gd_getdata(D, "data", 3, 0, 1, 0, GD_UINT8, c); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { read(fd, d, 3 * 9); close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < 8; ++i) CHECKXi(i,c[i], 0x22); for (i = 0; i < 3 * 9; ++i) CHECKXi(i,d[i], data_out[i]); CHECKI(error,0); CHECKI(ret, 0); CHECKI(n, 8); return r; } libgetdata-0.9.0/test/nmeta_type_parent.c0000640000175000017500000000413412614323564020647 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); nfields = gd_nmfields_by_type(D, "raw9", GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKU(nfields, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/tell64.c0000640000175000017500000000371212614323564016244 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_tell() */ #define _LARGEFILE64_SOURCE 1 #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off64_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL); e1 = gd_error(D); n = gd_tell64(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(n, 48); return r; } libgetdata-0.9.0/test/entry_bad_code.c0000640000175000017500000000315712614323564020076 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read RAW entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_entry(D, "not a field", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_CODE); CHECKI(n, -1); return r; } libgetdata-0.9.0/test/put_here.c0000640000175000017500000000433112614323564016743 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; struct stat buf; int fd, i, m, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); m = gd_seek(D, "data", 5, 0, GD_SEEK_WRITE | GD_SEEK_SET); CHECKI(m,40); n = gd_putdata(D, "data", GD_HERE, 0, 0, 8, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_code.c0000640000175000017500000000265612614323564016662 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; gd_entry_t E; DIRFILE *D; E.field = "ne/w"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add(D, &E); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/encode_alter.c0000640000175000017500000000436712614323564017565 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test encoding */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *txtdata = "dirfile/data.txt"; const char *format_data = "data RAW UINT16 8\nENCODING none\n"; const char *txt_data = "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n"; uint16_t data_data[128]; uint16_t c[8]; int fd, ret, error, r = 0; off_t n; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 0x201 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(txtdata, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, txt_data, strlen(txt_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 0); error = gd_error(D); n = gd_nframes(D); gd_discard(D); unlink(txtdata); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(n, 2); return r; } libgetdata-0.9.0/test/cvlist_array_meta_free.c0000640000175000017500000000472112614323564021644 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CARRAY UINT8 1\n" "parent/data1 CARRAY UINT8 1 2 3 4 5\n" "parent/data2 CARRAY UINT8 2 4 6 8 10 12\n" "META parent data4 LINTERP UINT8 1\n"; int fd, r = 0; size_t i, error; struct uint8_carrays { size_t n; uint8_t *d; } *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 2; ++fd) { CHECKUi(fd,field_list[fd].n, (size_t)(5 + fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 1000 + i,field_list[fd].d[i], (fd + 1) * (i + 1)); } gd_add_spec(D, "parent/data3 CARRAY UINT8 3 6 9 12 15 18 21", 0); field_list = (struct uint8_carrays *)gd_mcarrays(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 3; ++fd) { CHECKUi(fd * 2000,field_list[fd].n, (size_t)(5 + fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 3000 + i,field_list[fd].d[i], (fd + 1) * (i + 1)); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_endian_bad.c0000640000175000017500000000303312614323564020364 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "ENDIAN badendianness\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_string.c0000640000175000017500000000304312614323564017627 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING value\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/get_divide_rcin.c0000640000175000017500000000417512614323564020254 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data.r phase\n" "phase PHASE data 1\n" "data RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { CHECKFi(i, c[i * 2], (5. + i) * 65536. / 65537. / (6. + i)); CHECKFi(i, c[i * 2 + 1], -(5. + i) * 256. / 65537. / (6. + i)); } return r; } libgetdata-0.9.0/test/flist_type.c0000640000175000017500000000435712614323564017322 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 STRING UINT8 1\n" "data2 STRING UINT8 1\n" "data3 STRING UINT8 1\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_field_list_by_type(D, GD_STRING_ENTRY); error = gd_error(D); CHECKI(error, GD_E_OK); CHECKPN(field_list); if (field_list == NULL) r = 1; for (i = 0; field_list[i]; ++i) { CHECKIi(i,strlen(field_list[i]), 5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i, 3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint64_uint16.c0000640000175000017500000000400312614323564021223 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; uint16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/cvlist_meta.c0000640000175000017500000000360712614323564017447 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CONST UINT8 1\n" "META parent data1 CONST UINT8 1\n" "META parent data2 CONST UINT8 2\n" "META parent data3 CONST UINT8 3\n" "META parent data4 LINTERP UINT8 1\n"; int fd, error, r = 0; uint8_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (uint8_t *)gd_mconstants(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 3; ++fd) CHECKUi(fd,field_list[fd], fd + 1); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/close_discard.c0000640000175000017500000000320612614323564017726 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Closing a dirfile should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int ret, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); gd_add_spec(D, "data RAW UINT8 1", 0); ret = gd_discard(D); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nfields(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(ret, 0); CHECKI(n, 1); return r; } libgetdata-0.9.0/test/parse_double.c0000640000175000017500000000435612614323564017603 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "hex CONST FLOAT64 0xABC\n" "dec CONST FLOAT64 1.3e3\n" "flt CONST FLOAT64 -0x1.3p+3\n" "inf CONST FLOAT64 INF\n" "nan CONST FLOAT64 NAN\n"; int fd, e1, e2, e3, e4, e5, e6, r = 0; double d, h, i, n, p; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); e1 = gd_error(D); gd_get_constant(D, "dec", GD_FLOAT64, &d); e2 = gd_error(D); gd_get_constant(D, "flt", GD_FLOAT64, &p); e3 = gd_error(D); gd_get_constant(D, "inf", GD_FLOAT64, &i); e4 = gd_error(D); gd_get_constant(D, "nan", GD_FLOAT64, &n); e5 = gd_error(D); gd_get_constant(D, "hex", GD_FLOAT64, &h); e6 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1,GD_E_OK); CHECKI(e2,GD_E_OK); CHECKI(e3,GD_E_OK); CHECKI(e4,GD_E_OK); CHECKI(e5,GD_E_OK); CHECKI(e6,GD_E_OK); CHECKF(h,2748.); CHECKF(d,1300.); CHECKF(p,-9.5); CHECK(isfinite(i),i,"%g","infinity",i); CHECKNAN(n); return r; } libgetdata-0.9.0/test/put_endian_float32_big.c0000640000175000017500000000407412614323564021435 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write big-endian FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 1\nENDIAN big\n"; unsigned int i; const float c = 1.5; unsigned char x[sizeof(float)] = { 0x3F, 0xC0, 0x00, 0x00 }; unsigned char u[sizeof(float)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * sizeof(float), SEEK_SET); read(fd, u, sizeof(float)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < sizeof(float); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/convert_int8_complex128.c0000640000175000017500000000427412614323564021542 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/gzip_get_put.c0000640000175000017500000001162712614323564017636 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; const unsigned char gzdata[279] = { 0x1f, 0x8b, 0x08, 0x00, 0x0d, 0x87, 0xb0, 0x4e, 0x00, 0x03, 0x01, 0x00, 0x01, 0xff, 0xfe, 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, 0x73, 0x8c, 0x05, 0x29, 0x00, 0x01, 0x00, 0x00 }; uint8_t c[8], d[8]; #ifdef USE_GZIP uint8_t b; char command[4096]; #endif int fd, i, m, n, e1, e2, e3, unlink_data, unlink_datagz, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) d[i] = (uint8_t)(80 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_gz, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, gzdata, 279); close(fd); #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); e3 = gd_close(D); CHECKI(e3, 0); #ifdef USE_GZIP /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &b, sizeof(uint8_t))) { if (i < 40 || i >= 48) { CHECKIi(i, b, i); } else CHECKIi(i, b, i + 40); i++; } CHECKI(i, 256); close(fd); } } for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 40 + i); #endif unlink_data = unlink(data); unlink_datagz = unlink(data_gz); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(unlink_data, 0); CHECKI(unlink_datagz, -1); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(n, 8); CHECKI(m, 8); #else CHECKI(unlink_data, -1); CHECKI(unlink_datagz, 0); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(e2, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(m, 0); #endif return r; #endif } libgetdata-0.9.0/test/repr_int64.c0000640000175000017500000000424712614323564017132 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif uint64_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i],40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/nframes_empty.c0000640000175000017500000000301412614323564017776 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of frames from an empty dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; size_t n; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKU(n, 0); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_uint32_int16.c0000640000175000017500000000376612614323564021050 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT32 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT32 8\n"; uint32_t data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/zzslim_get.c0000640000175000017500000000500512614323564017316 0ustar alastairalastair/* Copyright (C) 2012-2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined(TEST_ZZIP) || !defined(TEST_SLIM) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *dataslm = "dirfile/data.slm"; const char *testzip = "dirfile/test.zip"; const char *format_data = "data RAW UINT16 8\n" "/ENCODING zzslim test\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; #ifdef USE_ZZSLIM int i; #endif DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress, twice */ snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) return 1; chdir(filedir); snprintf(command, 4096, "%s test data.slm > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(dataslm); unlink(data); #ifdef USE_ZZSLIM D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(testzip); unlink(format); rmdir(filedir); #ifdef USE_ZZSLIM CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/parse_utf8.c0000640000175000017500000000357512614323564017221 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "string STRING \\u65\\u654\\u6543\\u65432\n"; int i, fd, error, r = 0; #define STRLEN 11 const unsigned char u[STRLEN] = { 0x65, /* U+65 */ 0xD9, 0x94, /* U+654 */ 0xE6, 0x95, 0x83, /* U+6543 */ 0xF1, 0xA5, 0x90, 0xB2, /* U+65432 */ 0x00 }; unsigned char s[STRLEN]; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error,GD_E_OK); gd_get_string(D, "string", STRLEN, (char*)s); gd_discard(D); unlink(format); rmdir(filedir); for (i = 0; i < STRLEN; ++i) CHECKXi(i, s[i], u[i]); return r; } libgetdata-0.9.0/test/del_del.c0000640000175000017500000000404212614323564016517 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, ret, e1, n, e2, e3, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", 0); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(n, 0); CHECKI(e2, GD_E_BAD_CODE); e3 = gd_discard(D); CHECKI(e3, 0); fd = unlink(data); unlink(format); rmdir(filedir); CHECKI(fd, 0); return r; } libgetdata-0.9.0/test/name_dot9.c0000640000175000017500000000323312614323564017007 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, r1, e1, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); /* IN DSV 6 through 9, this is an invalid field name */ gd_dirfile_standards(D, 9); r1 = gd_rename(D, "data", "d.ata", 0); e1 = gd_error(D); CHECKI(r1,-1); CHECKI(e1,GD_E_BAD_CODE); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_lincom_cmpin.c0000640000175000017500000000300212614323564021137 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM data 1 0\n" "data RAW COMPLEX64 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "lincom"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_lincom_noin.c0000640000175000017500000000337412614323564020332 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write LINCOM 1 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM 1 data 0.5 3.0\n"; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "lincom", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/alter_polynom_ord.c0000640000175000017500000000417412614323564020665 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n" "polynom POLYNOM data 1 2 1\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_polynom(D, "polynom", 1, NULL, NULL); error = gd_error(D); n = gd_getdata(D, "polynom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) { int x = i + 40; CHECKIi(i,c[i], 2 * x + 1); } unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/alter_entry.c0000640000175000017500000000406112614323564017460 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, error, r = 0; off_t n; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); E.EN(raw,data_type) = GD_UINT16; E.EN(raw,spf) = 11; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); n = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 11); CHECKI(ret, 0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/protect_alter_all.c0000640000175000017500000000400112614323564020621 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT8 8\n" "INCLUDE format1\n" "PROTECT format\n"; const char *format1_data = "PROTECT none\n"; int fd, ret, p0, p1, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_protection(D, GD_PROTECT_DATA, GD_ALL_FRAGMENTS); error = gd_error(D); CHECKI(error, 0); CHECKI(ret, 0); p0 = gd_protection(D, 0); CHECKI(p0, GD_PROTECT_DATA); p1 = gd_protection(D, 1); CHECKI(p1, GD_PROTECT_DATA); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_raw_scalar_code.c0000640000175000017500000000316512614323564021465 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 const\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_entry(D, "data", &E); error = gd_error(D); CHECKI(error, 0); CHECKI(E.flags, 0); CHECKI(n, 0); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_float64.c0000640000175000017500000000421212614323564017275 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 40 + i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(double)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(double))) { if (i < 40 || i > 48) { CHECKFi(i,d,0); } else CHECKFi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_bof.c0000640000175000017500000000331012614323564016562 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write UINT8 past the beginning-of-field*/ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nFRAMEOFFSET 10000"; uint8_t c[8]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_RANGE); return r; } libgetdata-0.9.0/test/include_invalid.c0000640000175000017500000000311012614323564020253 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format1 = "dirfile/format1"; const char *format1_data = "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); gd_include(D, "format1", 0, 0); error = gd_error(D); gd_discard(D); unlink(format1); rmdir(filedir); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/index_range.c0000640000175000017500000000361012614323564017412 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Frameindex look-up */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double d[1000], f1; int i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 1000; ++i) d[i] = 0; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, d, 1000 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY); f1 = gd_framenum(D, "data", 1.09); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_RANGE); CHECK(!isnan(f1),f1,"%.15g","%s",f1,"not a number"); return r; } libgetdata-0.9.0/test/put_endian_float32_little.c0000640000175000017500000000410212614323564022161 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write little-endian FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 1\nENDIAN little\n"; unsigned int i; const float c = 1.5; unsigned char x[sizeof(float)] = { 0x00, 0x00, 0xC0, 0x3F }; unsigned char u[sizeof(float)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * sizeof(float), SEEK_SET); read(fd, u, sizeof(float)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < sizeof(float); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/add_add.c0000640000175000017500000000362712614323564016477 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_RAW_ENTRY; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = NULL; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); CHECKP(e.scalar[0]); gd_free_entry_strings(&e); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/lzma_put.c0000640000175000017500000000402312614323564016761 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_lzma = "dirfile/data.lzma"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8] = {40, 41, 42, 43, 44, 45, 46, 47}; uint8_t data_data[256]; char command[4096]; int fd, n, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -F lzma -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDWR); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); e2 = gd_discard(D); CHECKI(e2, 0); unlink(data_lzma); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/zzslim_seek.c0000640000175000017500000000437712614323564017501 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined(TEST_ZZIP) || !defined(TEST_SLIM) || !defined(USE_ZZSLIM) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *dataslm = "dirfile/data.slm"; const char *testzip = "dirfile/test.zip"; const char *format_data = "data RAW UINT16 8\n" "/ENCODING zzslim test\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress, twice */ snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) return 1; chdir(filedir); snprintf(command, 4096, "%s test data.slm > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(dataslm); unlink(data); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); CHECKI(n, 40); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(testzip); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/add_string_affix.c0000640000175000017500000000341012614323564020420 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 A Z\n"; int fd, e1, e2, r = 0; char val[1000]; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); gd_add_string(D, "AdataZ", "A string.", 1); e1 = gd_error(D); /* check */ gd_get_string(D, "AdataZ", 1000, val); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKS(val, "A string."); return r; } libgetdata-0.9.0/test/alter_crecip.c0000640000175000017500000000433612614323564017571 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div RECIP data 230.\n"; int32_t data_data[256]; double c[8]; #ifdef GD_NO_C99_API double v[2] = {1093, 3290}; #else double complex v = 1093 + _Complex_I * 3290; #endif int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_crecip(D, "div", "phase", v); error = gd_error(D); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], creal(v) / (i + 41.)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/get_window_set.c0000640000175000017500000000401412614323564020147 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read WINDOW */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "window WINDOW data data SET 2\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "window", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i & 2) ? 40 + i : 0); return r; } libgetdata-0.9.0/test/add_bit.c0000640000175000017500000000333512614323564016521 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a BIT field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_bit(D, "new", "input", 1, 1, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_BIT_ENTRY); CHECKS(e.in_fields[0], "input"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(bit,bitnum), 1); CHECKI(e.EN(bit,numbits), 1); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/legacy_get_rofs.c0000640000175000017500000000374512614323564020274 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 from a read-only filesystem via the legacy interface */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0444); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0444); write(fd, data_data, 256); close(fd); n = GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &error); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; #endif } libgetdata-0.9.0/test/alter_linterp.c0000640000175000017500000000550512614323564020000 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *table = "dirfile/table"; const char *table1 = "dirfile/table1"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nlut LINTERP data table\n"; const char *tabledata = "0 0\n1000 5000\n"; const char *table1data = "0 0\n1000 10000\n"; int32_t data_data[256]; int32_t c[8]; gd_entry_t e; int fd, i, ret, e1, e2, e3, n, unlink_table, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, tabledata, strlen(tabledata)); close(fd); fd = open(table1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, table1data, strlen(table1data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_getdata(D, "lut", 5, 0, 1, 0, GD_NULL, NULL); ret = gd_alter_linterp(D, "lut", NULL, "table1", 0); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, 0); gd_entry(D, "lut", &e); e2 = gd_error(D); CHECKI(e2, 0); CHECKS(e.in_fields[0], "data"); CHECKS(e.EN(linterp,table), "table1"); gd_free_entry_strings(&e); n = gd_getdata(D, "lut", 5, 0, 1, 0, GD_INT32, c); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (i + 40) * 10); e3 = gd_close(D); CHECKI(e3, 0); unlink(data); unlink_table = unlink(table); unlink(table1); unlink(format); rmdir(filedir); CHECKI(unlink_table, 0); return r; } libgetdata-0.9.0/test/svlist_meta.c0000640000175000017500000000451612614323564017467 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retrieve a list of string metafields */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent STRING valu1\n" "META parent data1 STRING valu1\n" "META parent data2 STRING valu2\n" "META parent data3 STRING valu3\n" "META parent data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_nfields(D); gd_nmfields(D, "parent"); gd_nmfields_by_type(D, "parent", GD_STRING_ENTRY); field_list = gd_mstrings(D, "parent"); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i,len,5); CHECKIi(i,field_list[i][0], 'v'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 'l'); CHECKIi(i,field_list[i][3], 'u'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i,3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/repr_real_r.c0000640000175000017500000000402012614323564017417 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read real representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double c[8]; double data_data[100]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) data_data[i] = sin(i * 3.14159265358979323846 / 5.); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 100 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.r", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],data_data[5 + i]); return r; } libgetdata-0.9.0/test/madd_cpolynom.c0000640000175000017500000000441712614323564017762 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a complex POLYNOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int j, error, ge_error, r = 0; gd_entry_t e; #ifdef GD_NO_C99_API const double a[4][2] = {{1, 29.03}, {0.3, 12.34}, {0.5, 99.55}, {1.8, 45.32}}; #else const double complex a[4] = {1 + _Complex_I * 29.03, 0.3 + _Complex_I * 12.34, 0.5 + _Complex_I * 99.55, 1.8 + _Complex_I * 45.32}; #endif DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); #ifdef GD_NO_C99_API gd_madd_cpolynom(D, "new", "meta", 3, "in", (const double *)a); #else gd_madd_cpolynom(D, "new", "meta", 3, "in", a); #endif error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_POLYNOM_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(polynom,poly_ord), 3); CHECKX(e.flags, GD_EN_COMPSCAL | GD_EN_CALC); for (j = 0; j < 4; ++j) CHECKCi(j,e.EN(polynom,ca)[j], a[j]); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/tok_escape.c0000640000175000017500000000352112614323564017245 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *spec = "string STRING \\ value"; int e1, e2, e3, e4, e5, r = 0; char *tok1, *tok2, *tok3, *tok4; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1,GD_E_OK); tok1 = gd_strtok(D, spec); e2 = gd_error(D); CHECKI(e2,GD_E_OK); CHECKS(tok1,"string"); free(tok1); tok2 = gd_strtok(D, NULL); e3 = gd_error(D); CHECKI(e3,GD_E_OK); CHECKS(tok2,"STRING"); free(tok2); tok3 = gd_strtok(D, NULL); e4 = gd_error(D); CHECKI(e4,GD_E_OK); CHECKS(tok3," value"); free(tok3); tok4 = gd_strtok(D, NULL); e5 = gd_error(D); CHECKI(e5,GD_E_OK); CHECKP(tok4); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/protect_alter.c0000640000175000017500000000372112614323564020001 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test frameoffset */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nPROTECT format\n"; unsigned char data_data[256]; int fd, ret, p, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_protection(D, GD_PROTECT_DATA, 0); error = gd_error(D); p = gd_protection(D, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(p, GD_PROTECT_DATA); return r; } libgetdata-0.9.0/test/error_verbose_prefix.c0000640000175000017500000000432212614323564021363 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #ifdef HAVE_SYS_WAIT_H #include #endif #include #include #include #include int main(void) { #if !defined HAVE_MKFIFO || !defined HAVE_WORKING_FORK || defined __CYGWIN__ return 77; /* skip */ #else const char *filedir = "dirfile"; const char *fifo = "dirfile/fifo"; const char *format = "dirfile/format"; int e1, e2, r = 0, status; FILE *stream; pid_t pid; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); mkfifo(fifo, 0666); /* read our standard error */ if ((pid = fork()) == 0) { char string[1024]; stream = fopen(fifo, "r"); fgets(string, 1024, stream); CHECKS(string, "getdata-test: libgetdata: Field not found: data\n"); return r; } /* retarget stderr */ freopen(fifo, "w", stderr); D = gd_open(filedir, GD_RDONLY); e1 = gd_error(D); gd_flags(D, GD_VERBOSE, 0); gd_verbose_prefix(D, "getdata-test: "); gd_validate(D, "data"); e2 = gd_error(D); gd_discard(D); fputs("\n", stderr); fflush(stderr); /* restore stderr */ freopen("/dev/stderr", "w", stderr); unlink(fifo); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, GD_E_BAD_CODE); wait(&status); if (status) r = 1; return r; #endif } libgetdata-0.9.0/test/global_name.c0000640000175000017500000000320212614323564017364 0ustar alastairalastair/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; const char *name; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); name = gd_dirfilename(D); error = gd_error(D); CHECKI(error, GD_E_OK); CHECKEOS(name, "dirfile"); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_lincom_spf.c0000640000175000017500000000431512614323564020122 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *cata = "dirfile/cata"; const char *format_data = "lincom LINCOM 2 data 2 3 cata 1 0\n" "data RAW UINT8 2\n" "cata RAW UINT8 3\n"; unsigned char c[10]; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 10); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); fd = open(cata, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 5, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(cata); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (n = 0; n < 10; ++n) CHECKUi(n, c[n], 38 + n * 7 / 2); return r; } libgetdata-0.9.0/test/convert_int16_uint8.c0000640000175000017500000000377212614323564020770 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_lincom_scalar.c0000640000175000017500000000312012614323564021123 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT64 3.2\n" "lincom LINCOM 1 in1 const 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/alter_multiply.c0000640000175000017500000000417012614323564020177 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "mult MULTIPLY data data\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_multiply(D, "mult", NULL, "phase"); error = gd_error(D); n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], (i + 40) * (i + 41)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/get_lincom1.c0000640000175000017500000000367612614323564017344 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM1 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 1 data 2 3\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 13); return r; } libgetdata-0.9.0/test/svlist_invalid.c0000640000175000017500000000255512614323564020170 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_strings(D); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error,GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/bzip_seek_far.c0000640000175000017500000000375112614323564017740 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_BZIP2 || !defined TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *bzip2data = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; int fd, n, error, r = 0; char command[4096]; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); error = gd_error(D); CHECKI(n, 256); CHECKI(error, 0); gd_discard(D); unlink(bzip2data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/put_off64.c0000640000175000017500000000446712614323564016756 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #if (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) || __MSVCRT__ # define SKIP_TEST #else # define _FILE_OFFSET_BITS 64 #endif #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifdef SKIP_TEST return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/add_affix.c0000640000175000017500000000524412614323564017041 0ustar alastairalastair/* Copyright (C) 2011-2012 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "AconstZ CONST UINT8 3\n/INCLUDE format1 A Z\n"; int n, fd, e1, e2, e3, e4, e5, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); close(open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); memset(&E, 0, sizeof(E)); E.field = "Adata1Z"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 1; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = NULL; gd_add(D, &E); e1 = gd_error(D); memset(&E, 0, sizeof(E)); E.field = "Adata2Z"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 1; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = "const"; gd_add(D, &E); e2 = gd_error(D); memset(&E, 0, sizeof(E)); E.field = "Adata3Z"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 1; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; E.scalar[0] = "AconstZ"; gd_add(D, &E); e3 = gd_error(D); /* check */ gd_entry(D, "Adata1Z", &e); e4 = gd_error(D); n = gd_spf(D, "Adata3Z"); e5 = gd_error(D); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_BAD_CODE); CHECKI(e3, GD_E_OK); CHECKI(e4, GD_E_OK); CHECKI(e5, GD_E_OK); CHECKI(n, 3); CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 1); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); CHECKP(e.scalar[0]); gd_free_entry_strings(&e); return r; } libgetdata-0.9.0/test/svlist_meta0.c0000640000175000017500000000342612614323564017546 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent STRING valu1\n" "META parent data4 CONST UINT8 1\n"; int fd, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_nfields(D); gd_nmfields(D, "parent"); gd_nmfields_by_type(D, "parent", GD_STRING_ENTRY); field_list = gd_mstrings(D, "parent"); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); CHECKP(field_list[0]); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_multiply.c0000640000175000017500000000343512614323564020234 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read MULTIPLY entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MULTIPLY in1 in2\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_MULTIPLY_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/put_ss.c0000640000175000017500000000420712614323564016447 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 0, 40, 0, 8, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 40 + 8 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint16_float32.c0000640000175000017500000000402312614323564021346 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/sie_put_trunc.c0000640000175000017500000000436212614323564020017 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[0x32]; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; const uint8_t data_out[] = { 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43 }; uint8_t check[2 * 9]; DIRFILE *D; int fd, i, n, error, r = 0; ssize_t l; memset(c, 0x43, 0x32); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 3 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 0, 0, 0, 0x32, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 0x32); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); l = read(fd, check, 2 * 9); CHECKI(l, 9); close(fd); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/add_phase_invalid.c0000640000175000017500000000251212614323564020545 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_phase(D, "new", "in", 3, 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/parse_quote_mismatch.c0000640000175000017500000000303112614323564021340 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 \"1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/fragment_name.c0000640000175000017500000000425412614323564017737 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n"; const char *format1_data = "data RAW UINT8 11\n"; const char *form0; const char *form1; int fd, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); form0 = gd_fragmentname(D, 0); form1 = gd_fragmentname(D, 1); /* This only checks whether the end of the returned path is what we expect. * This should work, since we can guarantee that both "dirfile" and "format*" * aren't symlinks. */ #if GD_DIRSEP == '/' CHECKEOS(form0,"dirfile/format"); CHECKEOS(form1,"dirfile/format1"); #else CHECKEOS(form0,"dirfile\\format"); CHECKEOS(form1,"dirfile\\format1"); #endif gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_include_affix_bad.c0000640000175000017500000000342112614323564021727 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data RAW UINT8 1\n" "INCLUDE format1 \"\" .txt\n"; const char *format1_data = "zata RAW UINT8 11\n"; int fd, e, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); e = gd_error(D); CHECKI(e, GD_E_FORMAT); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_carray.c0000640000175000017500000000320212614323564017275 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0}; int e1, e2, r = 0, i; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_carray(D, "data", GD_UINT8, 8, GD_UINT8, &val, 0); for (i = 0; i < 8; ++i) val[i] = i * (i + 1); gd_put_carray(D, "data", GD_UINT8, &val); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); /* check */ memset(val, 0, 8); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_get_carray(D, "data", GD_UINT8, &val); gd_discard(D); unlink(format); rmdir(filedir); for (i = 0; i < 8; ++i) CHECKIi(i, val[i], i * (i + 1)); return r; } libgetdata-0.9.0/test/get_divide.c0000640000175000017500000000370712614323564017241 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read DIVIDE */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data INDEX\n" "data RAW UINT8 1\n"; double c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)(fd + 2); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKF(c, 7. / 5); return r; } libgetdata-0.9.0/test/close_null.c0000640000175000017500000000205212614323564017265 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Passing NULL to dirfile_close should succeed cleanly */ #include "test.h" int main(void) { int r = 0; int ret = gd_close(NULL); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/flac_sync.c0000640000175000017500000000472612614323564017101 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_FLAC || !defined USE_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_flac = "dirfile/data.flac"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n, e1, e2, stat_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_FLAC_ENCODED | GD_VERBOSE); gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); n = gd_flush(D, "data"); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n, 0); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_flac, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s --silent --decode --delete-input-file " "--force-raw-format --sign=signed --endian=little %s --output-name=%s", FLAC, data_flac, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/ascii_get.c0000640000175000017500000000363212614323564017062 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; int fd, i, n, error, r = 0; DIRFILE *D; FILE* stream; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_int8.c0000640000175000017500000000377712614323564016666 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; signed char c[8]; signed char data_data[128]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = (signed char)(fd * (2 * (fd % 2) - 1)); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (40 + i) * (2 * (i % 2) - 1)); return r; } libgetdata-0.9.0/test/convert_uint64_complex128.c0000640000175000017500000000431612614323564022006 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/parse_meta_implicit.c0000640000175000017500000000331412614323564021142 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "parent/child CONST UINT8 1\n"; signed char c; int fd, error, error2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error,0); gd_get_constant(D, "parent/child", GD_INT8, &c); error2 = gd_error(D); CHECKI(error2,0); CHECKI(c,1); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/ascii_sync.c0000640000175000017500000000416212614323564017256 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; int d, n, e1, e2; int fd, i, r = 0; struct stat buf; FILE* stream; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_TEXT_ENCODED | GD_VERBOSE); gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); n = gd_flush(D, "data"); e1 = gd_error(D); CHECKI(e1,0); CHECKI(n,0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) return 1; stream = fopen(data, "r"); i = 0; for (;;) { fscanf(stream, "%i", &d); if (feof(stream)) break; if (i < 40 || i > 48) { CHECKI(d, 0); } else CHECKI(d, i); i++; } fclose(stream); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/lzma_xz_seek_far.c0000640000175000017500000000371212614323564020455 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_LZMA || !defined USE_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(n,256); error = gd_error(D); CHECKI(error,0); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/get_endian8.c0000640000175000017500000000436312614323564017322 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 with the opposite endianness */ #include "test.h" #include #include #include #include #include #include #include #include static int BigEndian(void) { union { long int li; char ch[sizeof(long int)]; } un; un.li = 1; return (un.ch[sizeof(long int) - 1] == 1); } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; char format_data[1000]; uint8_t c = 0; uint8_t data_data[128]; const int big_endian = BigEndian(); int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); sprintf(format_data, "data RAW UINT8 1\nENDIAN %s\n", (big_endian) ? "little" : "big"); for (fd = 0; fd < 128; ++fd) data_data[fd] = (uint8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint8_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKX(c, 0x5); return r; } libgetdata-0.9.0/test/add_scalar_carray_bad.c0000640000175000017500000000374312614323564021362 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; gd_entry_t E, e; memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_LINCOM_ENTRY; E.fragment_index = 0; E.EN(lincom,n_fields) = 1; E.in_fields[0] = "INDEX"; E.EN(lincom,m)[0] = 1.; E.scalar[0] = NULL; E.scalar[0 + GD_MAX_LINCOM] = "c"; E.scalar_ind[0 + GD_MAX_LINCOM] = -1; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "c CARRAY INT64 1 2 3 4", 0); gd_add(D, &E); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_LINCOM_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(lincom,n_fields), 1); CHECKF(e.EN(lincom,m)[0], 1); CHECKF(e.EN(lincom,b)[0], 1); CHECKP(e.scalar[0]); CHECKS(e.scalar[0 + GD_MAX_LINCOM], "c"); CHECKI(e.scalar_ind[0 + GD_MAX_LINCOM], 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/move_affix_meta.c0000640000175000017500000000500312614323564020256 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 A Z\n" "data RAW UINT8 11\n" "data/meta1 CONST UINT8 1\n" "data/meta2 CONST UINT8 2\n" "/ALIAS data/meta3 data/meta2\n"; const char *format1_data = "#\n"; int fd, ret, e1, e2, e3, e4, e5, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, 0); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); gd_entry(D, "AdataZ", &E); e2 = gd_error(D); CHECKI(e2, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); gd_entry(D, "AdataZ/meta1", &E); e3 = gd_error(D); CHECKI(e3, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); gd_entry(D, "AdataZ/meta2", &E); e4 = gd_error(D); CHECKI(e4, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); gd_entry(D, "AdataZ/meta3", &E); e5 = gd_error(D); CHECKI(e5, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/ascii_nframes.c0000640000175000017500000000344212614323564017735 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 1\n"; int i, r = 0; FILE* stream; size_t n, m; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_nframes(D); m = gd_nframes(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n, 256); CHECKI(m, 256); return r; } libgetdata-0.9.0/test/add_polynom.c0000640000175000017500000000356412614323564017444 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a POLYNOM field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int r = 0; int j, error; gd_entry_t e; DIRFILE *D; const double a[4] = {1, 0.3, 0.5, 1.8}; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_polynom(D, "new", 3, "in", a, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_POLYNOM_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(polynom,poly_ord), 3); CHECKX(e.flags, GD_EN_CALC); for (j = 0; j < 4; ++j) CHECKFi(j,e.EN(polynom,a)[j], a[j]); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/alter_entry_scalar2n.c0000640000175000017500000000417112614323564021247 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nconst CONST INT64 11\n"; unsigned char data_data[256]; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); E.scalar[0] = "const"; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); E.scalar[0] = NULL; gd_free_entry_strings(&E); n = gd_entry(D, "data", &E); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKI(E.EN(raw,spf), 11); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/zzslim_seek_far.c0000640000175000017500000000440212614323564020316 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined(TEST_ZZIP) || !defined(TEST_SLIM) || !defined(USE_ZZSLIM) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *dataslm = "dirfile/data.slm"; const char *testzip = "dirfile/test.zip"; const char *format_data = "data RAW UINT16 8\n" "/ENCODING zzslim test\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress, twice */ snprintf(command, 4096, "%s -k %s > /dev/null", SLIMDATA, data); if (gd_system(command)) return 1; chdir(filedir); snprintf(command, 4096, "%s test data.slm > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(dataslm); unlink(data); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(n, 256); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(testzip); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/name_dot5r.c0000640000175000017500000000361412614323564017170 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 5\nda.ta RAW UINT8 8\n"; int fd, r1, e1, r = 0; DIRFILE *D; gd_entry_t E1, E2; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); if (gd_entry(D, "da.ta", &E1) == 0) { CHECKI(E1.flags & GD_EN_DOTTED, GD_EN_DOTTED); gd_free_entry_strings(&E1); } else r = 1; /* This should always work */ r1 = gd_rename(D, "da.ta", "data", 0); e1 = gd_error(D); CHECKI(r1,0); CHECKI(e1,0); if (gd_entry(D, "data", &E2) == 0) { CHECKI(E2.flags & GD_EN_DOTTED, 0); gd_free_entry_strings(&E2); } else r = 1; gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_1.c0000640000175000017500000000445512614323564017044 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 1 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/INCLUDE"; const char *format_data = "INCLUDE RAW c 8\nFRAMEOFFSET 1\na&b RAW c 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "INCLUDE", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],32 + i); /* Version 1 is forwards compatible with version 2 */ CHECKI(v,2); CHECKI(l,2); CHECKI(e,1); return r; } libgetdata-0.9.0/test/parse_const_ncols.c0000640000175000017500000000302612614323564020646 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const RAW UINT8\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/convert_float32_int16.c0000640000175000017500000000377012614323564021171 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; int16_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_bit_ncols.c0000640000175000017500000000302312614323564020273 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/unclude.c0000640000175000017500000000453412614323564016574 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n"; const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2\n"; const char *format2_data = "c CONST UINT8 11\n"; int fd, ret, e1, e2, unlink_format1, unlink_format2, r = 0; unsigned int nfields, nfragments; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_uninclude(D, 1, 0); e1 = gd_error(D); CHECKI(ret,0); CHECKI(e1,0); nfields = gd_nfields(D); CHECKI(nfields,2); nfragments = gd_nfragments(D); CHECKI(nfragments,1); e2 = gd_close(D); CHECKI(e2, 0); unlink_format2 = unlink(format2); unlink_format1 = unlink(format1); unlink(format); rmdir(filedir); CHECKI(unlink_format2,0); CHECKI(unlink_format1,0); return r; } libgetdata-0.9.0/test/alter_recip_zero.c0000640000175000017500000000414612614323564020464 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div RECIP data 230.\n"; int32_t data_data[256]; double c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_recip(D, "div", "phase", 0.); error = gd_error(D); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 230. / (i + 41.)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/bof.c0000640000175000017500000000336512614323564015704 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 2\n/FRAMEOFFSET 35\n"; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, strlen(data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_bof(D, "data"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 70); return r; } libgetdata-0.9.0/test/repr_int8.c0000640000175000017500000000424312614323564017044 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_entry_scalar2a.c0000640000175000017500000000363412614323564021235 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in c1 3\nc1 CONST INT64 3\n" "c2 CONST INT64 11\n"; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_entry(D, "data", &E); free(E.scalar[0]); E.scalar[0] = "c2"; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); E.scalar[0] = NULL; gd_free_entry_strings(&E); n = gd_entry(D, "data", &E); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKI(E.EN(bit,bitnum), 11); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/add_meta.c0000640000175000017500000000365612614323564016677 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a dirfile field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int e1, e2, r = 0; DIRFILE *D; gd_entry_t E, e; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "data"; E.field_type = GD_CONST_ENTRY; E.fragment_index = 0; E.EN(scalar,const_type) = GD_UINT8; D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add(D, &E); e1 = gd_error(D); E.field = "data/data"; gd_add(D, &E); e2 = gd_error(D); /* check */ gd_entry(D, "data/data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_CONST_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); return r; } libgetdata-0.9.0/test/get_recurse.c0000640000175000017500000000334712614323564017445 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempting to resove a recursively defined field should fail cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in1 RAW UINT8 11\n" "lincom LINCOM 2 lincom 1 0 in1 1 0\n"; unsigned char c[8]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error,GD_E_RECURSE_LEVEL); return r; } libgetdata-0.9.0/test/parse_scalar_repr.c0000640000175000017500000000301212614323564020612 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 scalar.r\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error,GD_E_OK); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_mult2.c0000640000175000017500000000303612614323564017542 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "mult MULTIPLY data cdata\n" "data RAW UINT8 11\n" "cdata RAW COMPLEX128 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "mult"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/trunc_dir.c0000640000175000017500000000371112614323564017122 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int fd, e1, e2, unlink_data, rmdir_sub, stat_format, r = 0; struct stat buf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format, strlen(format)); close(fd); close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666)); D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); CHECKI(unlink_data, -1); stat_format = stat(format, &buf); CHECKI(stat_format, 0); CHECK((buf.st_size > 0),buf.st_size,"%lli","%s",(long long)buf.st_size,"> 0"); rmdir_sub = rmdir(subdir); CHECKI(rmdir_sub, 0); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_uint16.c0000640000175000017500000000402112614323564017111 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8], i; uint16_t data_data[128]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = (uint16_t)(fd * (0x0201)); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKXi(i,c[i], 0x5028 + i * 0x0201); return r; } libgetdata-0.9.0/test/convert_float32_int8.c0000640000175000017500000000376512614323564021116 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_int8_uint32.c0000640000175000017500000000376012614323564020763 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; uint32_t c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/get_int32.c0000640000175000017500000000406612614323564016733 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t c[8]; int32_t data_data[64]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = fd * (0x02000001) * (2 * (fd % 2) - 1); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT32, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (0x50000028 + i * 0x02000001) * (2 * (i % 2) - 1)); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_sort.c0000640000175000017500000000525112614323564016731 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int r = 0; void CheckSPF(DIRFILE *D, const char *f, unsigned int v) { gd_entry_t e; gd_entry(D, f, &e); if (gd_error(D)) { r = 1; return; } CHECKS(e.field, f); CHECKI(e.EN(raw,spf), v); gd_free_entry_strings(&e); } int main (void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *a = "dirfile/a"; const char *b = "dirfile/b"; const char *c = "dirfile/c"; const char *d = "dirfile/d"; const char *e = "dirfile/e"; const char *f = "dirfile/f"; const char *g = "dirfile/g"; const char *h = "dirfile/h"; const char *i = "dirfile/i"; const char *j = "dirfile/j"; const char *k = "dirfile/k"; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_EXCL | GD_VERBOSE); gd_add_raw(D, "d", GD_FLOAT64, 1, 0); gd_add_raw(D, "b", GD_FLOAT64, 2, 0); gd_add_raw(D, "h", GD_FLOAT64, 3, 0); gd_add_raw(D, "e", GD_FLOAT64, 4, 0); gd_add_raw(D, "g", GD_FLOAT64, 5, 0); gd_add_raw(D, "c", GD_FLOAT64, 6, 0); gd_add_raw(D, "k", GD_FLOAT64, 7, 0); gd_add_raw(D, "a", GD_FLOAT64, 8, 0); gd_add_raw(D, "f", GD_FLOAT64, 9, 0); gd_add_raw(D, "i", GD_FLOAT64, 10, 0); gd_add_raw(D, "j", GD_FLOAT64, 11, 0); /* The idea here is that a field look-up will fail unless the library has * added the field in the correct location */ CheckSPF(D, "a", 8); CheckSPF(D, "b", 2); CheckSPF(D, "c", 6); CheckSPF(D, "d", 1); CheckSPF(D, "e", 4); CheckSPF(D, "f", 9); CheckSPF(D, "g", 5); CheckSPF(D, "h", 3); CheckSPF(D, "i", 10); CheckSPF(D, "j", 11); CheckSPF(D, "k", 7); gd_discard(D); unlink(k); unlink(j); unlink(i); unlink(h); unlink(g); unlink(f); unlink(e); unlink(d); unlink(c); unlink(b); unlink(a); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alias_target.c0000640000175000017500000000274712614323564017600 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS alias target\ntarget CONST UINT8 1\n"; int fd, e, r = 0; DIRFILE *D; const char *t; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); t = gd_alias_target(D, "alias"); CHECKS(t, "target"); e = gd_error(D); CHECKI(e, GD_E_OK); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/include_creat.c0000640000175000017500000000313412614323564017731 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; int fd, e1, e2, unlink_format1, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include(D, "format1", 0, GD_CREAT); e1 = gd_error(D); CHECKI(e1,0); e2 = gd_close(D); CHECKI(e2, 0); unlink_format1 = unlink(format1); unlink(format); rmdir(filedir); CHECKI(unlink_format1, 0); return r; } libgetdata-0.9.0/test/parse_hex.c0000640000175000017500000000417112614323564017110 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #define GOOD "z\\x1y\\xcx\\xDw\\x0eE\\x0Ff\\x10g\\x1ah\\x1Ei" #define GOODs "z\x1y\xcx\xDw\x0e" "E\x0F" "f\x10g\x1ah\x1Ei" #define BAD0 "a\\x00g" #define BAD1 "a\\xg" static const char *goods = GOODs; static int callback(gd_parser_data_t *p, void *extra) { int *le = (int*)extra; le[p->linenum - 1] = 1; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "good STRING " GOOD "\n" "bad0 STRING " BAD0 "\n" "bad1 STRING " BAD1 "\n"; int fd, error, r = 0; int le[3] = {0, 0, 0}; char s[100]; size_t i; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, le); error = gd_error(D); gd_get_string(D, "good", 100, s); gd_discard(D); CHECKI(le[0], 0); CHECKI(le[1], 1); CHECKI(le[2], 1); for (i = 0; i < sizeof(GOODs); ++i) CHECKIi(i, s[i], goods[i]); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/parse_include_suffix.c0000640000175000017500000000327612614323564021340 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 pre post\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf, spfaff; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); spf = gd_spf(D, "data"); spfaff = gd_spf(D, "predatapost"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 0); CHECKU(spfaff, 11); return r; } libgetdata-0.9.0/test/lzma_xz_put.c0000640000175000017500000000532012614323564017503 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; #ifdef USE_LZMA char command[4096]; uint8_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, unlink_xz, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_LZMA D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_xz, &buf); #ifdef USE_LZMA if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(stat_data, -1); #endif #ifdef USE_LZMA /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_xz = unlink(data_xz); CHECKI(unlink_xz, -1); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(n, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/ascii_get_get.c0000640000175000017500000000410712614323564017717 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8], d[8]; int fd, i, n, error, n2, error2, r = 0; DIRFILE *D; FILE* stream; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); error2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(error2, 0); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKIi(i,c[i], 40 + i); CHECKIi(i+8,d[i], 40 + i); } return r; } libgetdata-0.9.0/test/parse_badline.c0000640000175000017500000000303312614323564017716 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_mplex_scalar.c0000640000175000017500000000262112614323564020774 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MPLEX in1 in2 a b\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/fragment_index_alias.c0000640000175000017500000000326212614323564021275 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n"; const char *format1_data = "/ALIAS alias target\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_fragment_index(D, "alias"); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 1); return r; } libgetdata-0.9.0/test/encode_support.c0000640000175000017500000000435312614323564020165 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" /* figure out expected support */ #ifdef USE_SLIM #define GD_SLIM_MODE GD_RDONLY #else #define GD_SLIM_MODE -1 #endif #ifdef USE_GZIP #define GD_GZIP_MODE GD_RDWR #else #define GD_GZIP_MODE -1 #endif #ifdef USE_BZIP2 #define GD_BZIP2_MODE GD_RDWR #else #define GD_BZIP2_MODE -1 #endif #ifdef USE_LZMA #define GD_LZMA_MODE GD_RDWR #else #define GD_LZMA_MODE -1 #endif #ifdef USE_ZZIP #define GD_ZZIP_MODE GD_RDONLY #else #define GD_ZZIP_MODE -1 #endif #ifdef USE_ZZSLIM #define GD_ZZSLIM_MODE GD_RDONLY #else #define GD_ZZSLIM_MODE -1 #endif #define N 13 int main(void) { int i, r = 0; struct { unsigned long e; int v; } d[N] = { { GD_AUTO_ENCODED, -1 }, /* 0 */ { GD_UNENCODED, GD_RDWR }, /* 1 */ { GD_TEXT_ENCODED, GD_RDWR }, /* 2 */ { GD_SLIM_ENCODED, GD_SLIM_MODE }, /* 3 */ { GD_GZIP_ENCODED, GD_GZIP_MODE }, /* 4 */ { GD_BZIP2_ENCODED, GD_BZIP2_MODE }, /* 5 */ { GD_LZMA_ENCODED, GD_LZMA_MODE }, /* 6 */ { GD_SIE_ENCODED, GD_RDWR }, /* 7 */ { GD_ZZIP_ENCODED, GD_ZZIP_MODE }, /* 8 */ { GD_ZZSLIM_ENCODED, GD_ZZSLIM_MODE }, /* 9 */ { GD_ENC_UNSUPPORTED, -1 }, /* 10 */ { GD_ENCODING, -1 }, /* 11 */ { 765, -1 } /* 12 */ }; for (i = 0; i < N; ++i) { int q = gd_encoding_support(d[i].e); CHECKIi(i, q, d[i].v); } return r; } libgetdata-0.9.0/test/parse_foffs.c0000640000175000017500000000303612614323564017426 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "FRAMEOFFSET 73\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/sie_put_pad.c0000640000175000017500000000456712614323564017437 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12 }; #define NREC 4 const uint8_t data_out[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34 }; uint8_t check[NREC * 9]; DIRFILE *D; int fd, i, n, error, r = 0; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 1 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); read(fd, check, NREC * 9); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 16); for (i = 0; i < NREC * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/parse_recip.c0000640000175000017500000000304012614323564017420 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RECIP in2 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/madd_spec_resolv.c0000640000175000017500000000316612614323564020446 0ustar alastairalastair/* Copyright (C) 2011, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int error, i, r = 0; unsigned int n; DIRFILE *D; const char *target; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_spec(D, "data RAW UINT8 1", 0); gd_add_alias(D, "alias", "data/data", 0); gd_madd_spec(D, "data CONST UINT8 1", "data"); error = gd_error(D); /* check */ target = gd_alias_target(D, "alias"); CHECKS(target, "data/data"); i = gd_fragment_index(D, "alias"); n = gd_naliases(D, "alias"); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(i, 0); CHECKU(n, 2); return r; } libgetdata-0.9.0/test/convert_complex128_complex64.c0000640000175000017500000000455212614323564022500 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[512]; float c[16]; #else double complex data_data[256]; float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[2 * fd] = data_data[2 * fd + 1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 40 + i}; CHECKCi(i,c + 2 * i, v); #else CHECKCi(i,c[i], (40 + i) * (1 + _Complex_I)); #endif } return r; } libgetdata-0.9.0/test/native_polynom_cmpscal.c0000640000175000017500000000300312614323564021670 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM data 1;1 0\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "polynom"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/seek_foffs2.c0000640000175000017500000000363112614323564017326 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "FRAMEOFFSET 2\ndata RAW UINT8 1\n"; unsigned char data_data[256]; int i, fd, e, r = 0; off_t t, s; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); memset(data_data, 0, 256); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); for (i = 0; i < 10; ++i) { s = gd_seek(D, "data", i, 0, GD_SEEK_SET); e = gd_error(D); t = gd_tell(D, "data"); CHECKIi(i, s, i); CHECKIi(i, e, GD_E_OK); CHECKIi(i, t, i); } gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_bit.c0000640000175000017500000000275712614323564017266 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "bit BIT data 1\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "bit"); error = gd_error(D); CHECKU(type, GD_UINT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_polynom.c0000640000175000017500000000305212614323564020016 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "polynom POLYNOM in 1 2 3 4\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/bzip_move_to.c0000640000175000017500000000530112614323564017622 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data_raw = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n"; uint8_t data_in[256]; DIRFILE *D; #ifdef USE_BZIP2 uint8_t d; char command[4096]; int i; #endif int fd, e1, e2, unlink_raw, r = 0; struct stat buf; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_in[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_in, 256); close(fd); #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR); #endif gd_alter_encoding(D, GD_BZIP2_ENCODED, 0, 1); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); #ifdef USE_BZIP2 if (stat(data_bz2, &buf)) { perror("stat"); r = 1; } CHECKI(stat(data_raw, &buf), -1); #else if (stat(data_raw, &buf)) { perror("stat"); r = 1; } CHECKI(stat(data_bz2, &buf), -1); #endif #ifdef USE_BZIP2 /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { fprintf(stderr, "command failed: %s\n", command); r = 1; } else { fd = open(data_raw, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { CHECKIi(i, d, i); i++; } CHECKI(i, 256); close(fd); } } #endif unlink_raw = unlink(data_raw); unlink(format); rmdir(filedir); CHECKI(unlink_raw, 0); #ifdef USE_BZIP2 CHECKI(e1, GD_E_OK); #else CHECKI(e1, GD_E_UNSUPPORTED); #endif return r; } libgetdata-0.9.0/test/alter_bit_bitnum.c0000640000175000017500000000411112614323564020447 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nbit BIT data 1 1\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_bit(D, "bit", NULL, 2, 0); error = gd_error(D); n = gd_getdata(D, "bit", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i],((i & 4) != 0)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/ascii_get_here.c0000640000175000017500000000352412614323564020065 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; int fd, i, n1, n2, e1, e2, r = 0; DIRFILE *D; FILE* stream; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_seek(D, "data", 5, 0, GD_SEEK_SET); e1 = gd_error(D); CHECKI(n1, 40); CHECKI(e1, 0); n2 = gd_getdata(D, "data", GD_HERE, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(n2, 8); CHECKI(e2, 0); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_uint8_complex128.c0000640000175000017500000000431212614323564021720 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/cvlist_array_hidden.c0000640000175000017500000000362712614323564021154 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CARRAY UINT8 1 2 3 4 5\n" "data2 CARRAY UINT8 2 4 6 8 10 12\n" "/HIDDEN data2\n" "data3 CARRAY UINT8 3 6 9 12 15 18 21\n" "data4 RAW UINT8 1\n"; int fd, error, r = 0; size_t i; struct uint8_carrays { size_t n; uint8_t *d; } *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (struct uint8_carrays*)gd_carrays(D, GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 2; ++fd) { CHECKUi(fd,field_list[fd].n, (size_t)(5 + 2 * fd)); for (i = 0; i < field_list[fd].n; ++i) CHECKUi(fd * 1000 + i,field_list[fd].d[i], (2 * fd + 1) * (i + 1)); } gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/index_s.c0000640000175000017500000000437312614323564016567 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include #define F(x) sqrt(((x) + 600.) / 500.) /* inverse of F(x) via linear interpolation between x and x+1 */ #define G(x,y) (x + ((y - F(x)) / (F(x+1) - F(x)))) int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\n"; double d[1000], f1, f2, f3; int i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 1000; ++i) d[i] = F(i); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, d, 1000 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); f1 = gd_framenum_subset(D, "data", 1.09, 100, 8000); f2 = gd_framenum_subset(D, "data", 1.49, 100, 8000); f3 = gd_framenum_subset(D, "data", 1.79, 100, 8000); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKF(f1, G( 100, 1.09)); /* = -10.3339841573191 */ CHECKF(f2, G( 510, 1.49)); /* = 510.050010695549 */ CHECKF(f3, G( 998, 1.79)); /* = 995.067417578234 */ return r; } libgetdata-0.9.0/test/get_endian_float32_little.c0000640000175000017500000001262412614323564022140 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read little-endian FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 1\nENDIAN little\n"; float u[10]; float v[20]; const unsigned char data_data[128 * 4] = { 0x00, 0x00, 0xC0, 0x3F, 0x00, 0x00, 0x10, 0x40, 0x00, 0x00, 0x58, 0x40, 0x00, 0x00, 0xA2, 0x40, 0x00, 0x00, 0xF3, 0x40, 0x00, 0x40, 0x36, 0x41, 0x00, 0xB0, 0x88, 0x41, 0x00, 0x08, 0xCD, 0x41, 0x00, 0xC6, 0x19, 0x42, 0x00, 0xA9, 0x66, 0x42, 0xC0, 0xFE, 0xAC, 0x42, 0x10, 0xBF, 0x01, 0x43, 0x98, 0x9E, 0x42, 0x43, 0xF2, 0xF6, 0x91, 0x43, 0x6B, 0xF2, 0xDA, 0x43, 0xD0, 0x35, 0x24, 0x44, 0xB8, 0x50, 0x76, 0x44, 0x8A, 0xBC, 0xB8, 0x44, 0x68, 0x8D, 0x0A, 0x45, 0x1C, 0xD4, 0x4F, 0x45, 0x15, 0xDF, 0x9B, 0x45, 0xA0, 0xCE, 0xE9, 0x45, 0xF8, 0x5A, 0x2F, 0x46, 0x3A, 0x84, 0x83, 0x46, 0x57, 0x46, 0xC5, 0x46, 0xC1, 0xF4, 0x13, 0x47, 0x22, 0xEF, 0x5D, 0x47, 0x5A, 0x73, 0xA6, 0x47, 0x07, 0xAD, 0xF9, 0x47, 0xC5, 0x41, 0x3B, 0x48, 0x54, 0x71, 0x8C, 0x48, 0xFE, 0xA9, 0xD2, 0x48, 0x7E, 0xFF, 0x1D, 0x49, 0x3D, 0xFF, 0x6C, 0x49, 0x6E, 0xBF, 0xB1, 0x49, 0x92, 0x4F, 0x05, 0x4A, 0x5B, 0xF7, 0x47, 0x4A, 0x84, 0xF9, 0x95, 0x4A, 0x46, 0xF6, 0xE0, 0x4A, 0xB4, 0xB8, 0x28, 0x4B, 0x0E, 0x15, 0x7D, 0x4B, 0xCA, 0xCF, 0xBD, 0x4B, 0xD8, 0x5B, 0x0E, 0x4C, 0xC4, 0x89, 0x55, 0x4C, 0x53, 0x27, 0xA0, 0x4C, 0xFC, 0x3A, 0xF0, 0x4C, 0x3D, 0x2C, 0x34, 0x4D, 0x2E, 0x21, 0x87, 0x4D, 0xC5, 0xB1, 0xCA, 0x4D, 0x54, 0x05, 0x18, 0x4E, 0xFE, 0x07, 0x64, 0x4E, 0xFE, 0x05, 0xAB, 0x4E, 0x7E, 0x44, 0x00, 0x4F, 0xBD, 0x66, 0x40, 0x4F, 0x0E, 0x4D, 0x90, 0x4F, 0x95, 0x73, 0xD8, 0x4F, 0xB0, 0x56, 0x22, 0x50, 0x08, 0x82, 0x73, 0x50, 0x86, 0xA1, 0xB6, 0x50, 0x24, 0xF9, 0x08, 0x51, 0xB6, 0x75, 0x4D, 0x51, 0x48, 0x18, 0x9A, 0x51, 0x6C, 0x24, 0xE7, 0x51, 0x51, 0x5B, 0x2D, 0x52, 0x7D, 0x04, 0x82, 0x52, 0xBC, 0x06, 0xC3, 0x52, 0x0D, 0x45, 0x12, 0x53, 0x94, 0x67, 0x5B, 0x53, 0xAF, 0x8D, 0xA4, 0x53, 0x86, 0xD4, 0xF6, 0x53, 0x64, 0x1F, 0x39, 0x54, 0x8B, 0xD7, 0x8A, 0x54, 0x50, 0x43, 0xD0, 0x54, 0x7C, 0x32, 0x1C, 0x55, 0xBA, 0x4B, 0x6A, 0x55, 0xCC, 0xB8, 0xAF, 0x55, 0x99, 0xCA, 0x03, 0x56, 0xE6, 0xAF, 0x45, 0x56, 0xEC, 0x43, 0x94, 0x56, 0xE2, 0x65, 0xDE, 0x56, 0x6A, 0xCC, 0x26, 0x57, 0x9F, 0x32, 0x7A, 0x57, 0xF7, 0xA5, 0xBB, 0x57, 0x79, 0xBC, 0x0C, 0x58, 0xB6, 0x1A, 0x53, 0x58, 0x08, 0x54, 0x9E, 0x58, 0x0C, 0x7E, 0xED, 0x58, 0x89, 0x1E, 0x32, 0x59, 0xE7, 0x96, 0x85, 0x59, 0x5A, 0x62, 0xC8, 0x59, 0xC4, 0x49, 0x16, 0x5A, 0xA6, 0x6E, 0x61, 0x5A, 0xFC, 0x12, 0xA9, 0x5A, 0x7A, 0x9C, 0xFD, 0x5A, 0x5C, 0x35, 0x3E, 0x5B, 0x05, 0xA8, 0x8E, 0x5B, 0x08, 0xFC, 0xD5, 0x5B, 0x06, 0x7D, 0x20, 0x5C, 0x89, 0xBB, 0x70, 0x5C, 0xA7, 0x8C, 0xB4, 0x5C, 0x7D, 0x69, 0x07, 0x5D, 0x3C, 0x1E, 0x4B, 0x5D, 0xAD, 0x56, 0x98, 0x5D, 0x04, 0x82, 0xE4, 0x5D, 0x83, 0x61, 0x2B, 0x5E, 0x22, 0x89, 0x80, 0x5E, 0xB3, 0xCD, 0xC0, 0x5E, 0x46, 0x9A, 0x10, 0x5F, 0x69, 0xE7, 0x58, 0x5F, 0x8F, 0xAD, 0xA2, 0x5F, 0x56, 0x04, 0xF4, 0x5F, 0x40, 0x03, 0x37, 0x60, 0x70, 0x42, 0x89, 0x60, 0xA8, 0xE3, 0xCD, 0x60, 0xBE, 0x6A, 0x1A, 0x61, 0x1D, 0xA0, 0x67, 0x61, 0x16, 0xB8, 0xAD, 0x61, 0x10, 0x4A, 0x02, 0x62, 0x18, 0x6F, 0x43, 0x62, 0x52, 0x93, 0x92, 0x62, 0xFB, 0xDC, 0xDB, 0x62, 0xBC, 0xE5, 0x24, 0x63, 0x9A, 0x58, 0x77, 0x63, 0x74, 0x82, 0xB9, 0x63, 0xD7, 0x21, 0x0B, 0x64, 0xC2, 0xB2, 0x50, 0x64, 0x12, 0x86, 0x9C, 0x64, 0x1B, 0xC9, 0xEA, 0x64 }; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); v[0] = 1.5; for (i = 1; i < 20; ++i) v[i] = v[i - 1] * 1.5; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 0, 10, GD_FLOAT32, u); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 10); for (i = 0; i < 10; ++i) CHECKFi(i, u[i], v[i + 5]); return r; } libgetdata-0.9.0/test/get_zero.c0000640000175000017500000000401112614323564016741 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read from before the BOF */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "/FRAMEOFFSET 100\ndata RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i, c[i], 0); return r; } libgetdata-0.9.0/test/parse_lincom_nfields.c0000640000175000017500000000306612614323564021313 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM 4 in1 1 0 in2 1 0 in1 1 0 in2 1 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/get_divide_s.c0000640000175000017500000000362512614323564017562 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data phase\n" "phase PHASE data 128\n" "data RAW UINT8 1\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 0, 0, 1000, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 128); return r; } libgetdata-0.9.0/test/include_cb.c0000640000175000017500000000373412614323564017225 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int saw_callback = 0; int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_) { saw_callback++; return GD_SYNTAX_IGNORE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "#\n"; const char *format1_data = "data ROW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_cbopen(filedir, GD_RDWR, callback, NULL); gd_include(D, "format1", 0, 0); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(saw_callback, 1); return r; } libgetdata-0.9.0/test/convert_int64_uint64.c0000640000175000017500000000377612614323564021061 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; uint64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/parse_raw_char_bad.c0000640000175000017500000000276512614323564020727 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW z 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_endian_force.c0000640000175000017500000000306612614323564020742 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "ENDIAN badendianness\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_FORCE_ENDIAN | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/bzip_get.c0000640000175000017500000000466312614323564016743 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *bzip2data = "dirfile/data.bz2"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; #ifdef USE_BZIP2 int i; #endif memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", BZIP2, data); if (gd_system(command)) return 1; #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(bzip2data); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n,0); #endif return r; #endif } libgetdata-0.9.0/test/get_index_complex.c0000640000175000017500000000317112614323564020626 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int i, n, error, r = 0; double c[16]; DIRFILE *D; memset(c, 0, 16 * sizeof(double)); rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "INDEX", 5, 0, 8, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 16; i += 2) { CHECKFi(i, c[i], 5. + i / 2); CHECKFi(i, c[i + 1], 0); } return r; } libgetdata-0.9.0/test/parse_literal_intcmp.c0000640000175000017500000000277412614323564021341 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data PHASE in1 1;1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); CHECKI(error,GD_E_FORMAT); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_mplex.c0000640000175000017500000000412412614323564017114 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 1 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 40 + 3 * (i / 3)); return r; } libgetdata-0.9.0/test/svlist_meta_hidden.c0000640000175000017500000000425612614323564021003 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent STRING valu1\n" "META parent data1 STRING valu1\n" "META parent data2 STRING valu2\n" "/HIDDEN parent/data2\n" "META parent data3 STRING valu3\n" "META parent data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_nfields(D); gd_nmfields(D, "parent"); gd_nmfields_by_type(D, "parent", GD_STRING_ENTRY); field_list = gd_mstrings(D, "parent"); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i,len,5); CHECKIi(i,field_list[i][0], 'v'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 'l'); CHECKIi(i,field_list[i][3], 'u'); if (field_list[i][4] != '1' && field_list[i][4] != '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i,2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_polynom_scalar.c0000640000175000017500000000432112614323564021372 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read LINCOM entry */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "a0 CONST FLOAT64 1\n" "a1 CONST FLOAT64 2\n" "a2 CONST FLOAT64 3\n" "a3 CONST FLOAT64 4\n" "a4 CONST FLOAT64 5\n" "data POLYNOM in a0 a1 a2 a3 a4\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_POLYNOM_ENTRY); CHECKX(E.flags, GD_EN_CALC); CHECKI(E.EN(polynom,poly_ord), 4); CHECKS(E.in_fields[0], "in"); CHECKS(E.scalar[0], "a0"); CHECKS(E.scalar[1], "a1"); CHECKS(E.scalar[2], "a2"); CHECKS(E.scalar[3], "a3"); CHECKS(E.scalar[4], "a4"); for (fd = 0; fd < 4; ++fd) CHECKFi(fd,E.EN(polynom,a)[fd], fd + 1.); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/put_ff.c0000640000175000017500000000426112614323564016415 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; int fd, i, n, e1, e2, r = 0; DIRFILE *D; struct stat buf; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } CHECKI(buf.st_size, 48 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); if (fd < 0) { perror("open"); r = 1; } else { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_literal_uintcmp0.c0000640000175000017500000000277612614323564021610 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1;0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); CHECKI(error,0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/error_num.c0000640000175000017500000000272612614323564017146 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int ne1, ne2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY); gd_validate(D, "1"); gd_validate(D, "2"); gd_validate(D, "3"); ne1 = gd_error_count(D); ne2 = gd_error_count(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(ne1, 3); CHECKI(ne2, 0); return r; } libgetdata-0.9.0/test/bzip_get_put.c0000640000175000017500000001323612614323564017627 0ustar alastairalastair/* Copyright (C) 2014, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; const unsigned char bz2data[425] = { 0x42, 0x5a, 0x68, 0x39, 0x31, 0x41, 0x59, 0x26, 0x53, 0x59, 0xb6, 0xb5, 0xee, 0x95, 0x00, 0x00, 0x00, 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0x00, 0xc5, 0x52, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x09, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x04, 0xc0, 0x04, 0x98, 0x00, 0x26, 0x00, 0x02, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x4c, 0x00, 0x13, 0x00, 0x01, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x08, 0x0c, 0x10, 0x14, 0x18, 0x1c, 0x20, 0x24, 0x28, 0x2c, 0x30, 0x34, 0x38, 0x3c, 0x40, 0x44, 0x48, 0x4c, 0x50, 0x54, 0x58, 0x5c, 0x60, 0x64, 0x68, 0x6c, 0x70, 0x74, 0x78, 0x7c, 0x80, 0x84, 0x88, 0x8c, 0x90, 0x94, 0x98, 0x9c, 0xa0, 0xa4, 0xa8, 0xac, 0xb0, 0xb4, 0xb8, 0xbc, 0xc0, 0xc4, 0xc8, 0xcc, 0xd0, 0xd4, 0xd8, 0xdc, 0xe0, 0xe4, 0xe8, 0xec, 0xf0, 0xf4, 0xf8, 0xfd, 0x01, 0x05, 0x09, 0x0d, 0x11, 0x15, 0x19, 0x1d, 0x21, 0x25, 0x29, 0x2d, 0x31, 0x35, 0x39, 0x3d, 0x41, 0x45, 0x49, 0x4d, 0x51, 0x55, 0x59, 0x5d, 0x61, 0x65, 0x69, 0x6d, 0x71, 0x75, 0x79, 0x7d, 0x81, 0x85, 0x89, 0x8d, 0x91, 0x85, 0x89, 0x8d, 0x91, 0x95, 0x99, 0x9d, 0xa1, 0xa5, 0xa9, 0xad, 0xb1, 0xb5, 0xb9, 0xbd, 0xc1, 0xc5, 0xc9, 0xcd, 0xd1, 0xd5, 0xd9, 0xdd, 0xe1, 0xe5, 0xe9, 0xed, 0xf1, 0xf5, 0xf9, 0xfe, 0x02, 0x06, 0x0a, 0x0e, 0x12, 0x16, 0x1a, 0x1e, 0x22, 0x26, 0x2a, 0x2e, 0x32, 0x36, 0x3a, 0x3e, 0x42, 0x46, 0x4a, 0x56, 0x5a, 0x5e, 0x62, 0x66, 0x6a, 0x6e, 0x72, 0x76, 0x7a, 0x7e, 0x82, 0x86, 0x8a, 0x8e, 0x92, 0x96, 0x9a, 0x9e, 0xa2, 0xa6, 0xaa, 0xae, 0xb2, 0xb6, 0xba, 0xbe, 0xc2, 0xc6, 0xca, 0xce, 0xd2, 0xd6, 0xda, 0xde, 0xe2, 0xe6, 0xea, 0xee, 0xf2, 0xf6, 0xfa, 0xff, 0x03, 0x07, 0x0b, 0x0f, 0x13, 0x17, 0x1b, 0x17, 0x1b, 0x1f, 0x23, 0x27, 0x2b, 0x2f, 0x33, 0x37, 0x3b, 0x3f, 0x43, 0x47, 0x4b, 0x4f, 0x53, 0x57, 0x5b, 0x5f, 0x63, 0x67, 0x6b, 0x6f, 0x73, 0x77, 0x7b, 0x7f, 0x83, 0x87, 0x8b, 0x8f, 0x93, 0x97, 0x9b, 0x9f, 0xa3, 0xa7, 0xab, 0xaf, 0xb3, 0xb7, 0xbb, 0xbf, 0xc3, 0xc7, 0xcb, 0xcf, 0xd3, 0xd7, 0xdb, 0xdf, 0xe3, 0xe7, 0xeb, 0xef, 0xf3, 0xf4, 0x5d, 0xc9, 0x14, 0xe1, 0x42, 0x42, 0xda, 0xd7, 0xba, 0x54 }; uint8_t c[8], d[8]; #ifdef USE_BZIP2 uint8_t b; char command[4096]; #endif int fd, i, m, n, e1, e2, e3, unlink_data, unlink_databz2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) d[i] = (uint8_t)(80 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_bz2, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, bz2data, 425); close(fd); #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); m = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, d); e2 = gd_error(D); e3 = gd_close(D); CHECKI(e3, 0); #ifdef USE_BZIP2 /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &b, sizeof(uint8_t))) { if (i < 40 || i >= 48) { CHECKIi(i, b, i); } else CHECKIi(i, b, i + 40); i++; } CHECKI(i, 256); close(fd); } } for (i = 0; i < 8; ++i) CHECKIi(i, c[i], 40 + i); #endif unlink_data = unlink(data); unlink_databz2 = unlink(data_bz2); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(unlink_data, 0); CHECKI(unlink_databz2, -1); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_OK); CHECKI(n, 8); CHECKI(m, 8); #else CHECKI(unlink_data, -1); CHECKI(unlink_databz2, 0); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(e2, GD_E_UNSUPPORTED); CHECKI(n, 0); CHECKI(m, 0); #endif return r; #endif } libgetdata-0.9.0/test/parse_name.c0000640000175000017500000000302712614323564017243 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "d/ta RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/put_heres.c0000640000175000017500000000433112614323564017126 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8], d; struct stat buf; int fd, i, m, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); m = gd_seek(D, "data", 5, 0, GD_SEEK_WRITE | GD_SEEK_SET); CHECKI(m,40); n = gd_putdata(D, "data", 0, GD_HERE, 0, 8, GD_UINT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(uint8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKUi(i,d,0); } else CHECKUi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int32_uint32.c0000640000175000017500000000377612614323564021047 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; uint32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/get_float64.c0000640000175000017500000000376412614323564017257 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double c[8]; double data_data[128]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 1.5 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 128 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 1.5 * (40 + i)); return r; } libgetdata-0.9.0/test/convert_uint64_uint32.c0000640000175000017500000000400312614323564021221 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; uint32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/gzip_get_get.c0000640000175000017500000000502712614323564017602 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #if !defined USE_GZIP || !defined TEST_GZIP return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, e1, e2, n2, e3, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n1, 8); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2); e3 = gd_error(D); CHECKI(e3, 0); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKUi(i,c1[i], 40 + i); CHECKUi(i,c2[i], 40 + i); } gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/put_linterp_reverse.c0000640000175000017500000000454312614323564021235 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; FILE *t; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); t = fopen(table, "wt"); for (i = 0; i < 10; ++i) fprintf(t, "%i %i\n", i, 100 - i); fclose(t); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "linterp", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,100 - i); i++; } close(fd); } unlink(table); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_clincom.c0000640000175000017500000000522612614323564017747 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 2 data 1 0 data 1 0\n"; int32_t data_data[256]; int fd, ret, error, r = 0; DIRFILE *D; gd_entry_t E; #ifdef GD_NO_C99_API const double m[4] = {1, 2, 3, 4}; const double b[4] = {8, 7, 6, 5}; #else const double complex m[2] = {1 + _Complex_I * 2, 3 + _Complex_I * 4}; const double complex b[2] = {8 + _Complex_I * 7, 6 + _Complex_I * 5}; #endif rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_clincom(D, "lincom", 0, NULL, m, b); error = gd_error(D); gd_entry(D, "lincom", &E); CHECKX(E.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKI(E.EN(lincom,n_fields), 2); #ifdef GD_NO_C99_API CHECKC(E.EN(lincom,cm)[0], m); CHECKC(E.EN(lincom,cm)[1], m + 2); CHECKC(E.EN(lincom,cb)[0], b); CHECKC(E.EN(lincom,cb)[1], b + 2); #else CHECKC(E.EN(lincom,cm)[0], m[0]); CHECKC(E.EN(lincom,cm)[1], m[1]); CHECKC(E.EN(lincom,cb)[0], b[0]); CHECKC(E.EN(lincom,cb)[1], b[1]); #endif gd_free_entry_strings(&E); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/convert_uint8_int16.c0000640000175000017500000000376112614323564020766 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as INT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; int16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/parse_malias_meta.c0000640000175000017500000000300212614323564020570 0ustar alastairalastair/* Copyright (C) 2011-2012 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n" "data/cata CONST UINT8 1\n" "/ALIAS data/eata data\n"; int fd, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); e1 = gd_error(D); e2 = gd_validate(D, "data/eata/cata"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1,0); CHECKI(e2,-1); return r; } libgetdata-0.9.0/test/repr_uint16.c0000640000175000017500000000425012614323564017306 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif uint16_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_mplex_ncols.c0000640000175000017500000000260412614323564020646 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data MPLEX in1 in2\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/convert_int32_complex128.c0000640000175000017500000000431112614323564021607 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/get_neg.c0000640000175000017500000000314312614323564016540 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", -5, 0, 1, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_RANGE); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/move_meta.c0000640000175000017500000000403012614323564017100 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test move */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\ndata RAW UINT8 11\n" "data/meta CONST UINT8 11\n"; const char *format1_data = "#\n"; int fd, ret, error, ge_ret, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, 0); error = gd_error(D); ge_ret = gd_entry(D, "data/meta", &E); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret, 0); CHECKI(error, GD_E_OK); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/fragment_num.c0000640000175000017500000000321212614323564017607 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, nfragments, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfragments = gd_nfragments(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(nfragments, 2); return r; } libgetdata-0.9.0/test/native_sbit.c0000640000175000017500000000276112614323564017444 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "sbit SBIT data 1\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "sbit"); error = gd_error(D); CHECKU(type, GD_INT64); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int32_float32.c0000640000175000017500000000400612614323564021160 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40. + i); return r; } libgetdata-0.9.0/test/del_derived_after.c0000640000175000017500000000332612614323564020562 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\nlincom LINCOM 1 data 1 0\n"; int fd, ret, v, e1, e2, r = 0; size_t n; double c; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); /* in order to initialise the lincom's entry cache */ v = gd_validate(D, "lincom"); ret = gd_delete(D, "data", GD_DEL_FORCE); e1 = gd_error(D); n = gd_getdata(D, "lincom", 0, 0, 0, 1, GD_FLOAT64, &c); e2 = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_OK); CHECKI(e2, GD_E_BAD_CODE); CHECKI(ret, 0); CHECKI(n, 0); CHECKI(v, 0); return r; } libgetdata-0.9.0/test/convert_float32_int64.c0000640000175000017500000000377012614323564021174 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/convert_uint16_int64.c0000640000175000017500000000377712614323564021057 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT16 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; uint16_t data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (uint16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_window_s.c0000640000175000017500000000363212614323564017623 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "win WINDOW data phase EQ 0\n" "phase PHASE data 128\n" "data RAW UINT8 1\n"; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "win", 0, 0, 1000, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 128); return r; } libgetdata-0.9.0/test/put_mplex_complex.c0000640000175000017500000000461112614323564020675 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 1 3\n" "count RAW UINT8 8\n" "data RAW COMPLEX128 8\n"; double c[16], d[16]; double data_data[512]; uint8_t count_data[256]; int i, n, m, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); for (i = 0; i < 256; ++i) { data_data[2 * i] = i; data_data[2 * i + 1] = i * 2; } i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); for (i = 0; i < 256; ++i) count_data[i] = i % 3; i = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, count_data, 256); close(i); for (i = 0; i < 8; ++i) { d[2 * i] = i + 3.; d[2 * i + 1] = i + 4.; } D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "mplex", 5, 0, 1, 0, GD_COMPLEX128, &d); error = gd_error(D); m = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(m, 8); for (i = 0; i < 8; ++i) { CHECKIi(i, c[2 * i], ((i % 3) == 0) ? 3 + i : 40 + i); CHECKIi(i, c[2 * i + 1], ((i % 3) == 0) ? 4 + i : (40 + i) * 2); } return r; } libgetdata-0.9.0/test/open_cb_cont.c0000640000175000017500000000344412614323564017564 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include static int saw_callback = 0; int callback(gd_parser_data_t *pdata gd_unused_, void *extra gd_unused_) { saw_callback++; return GD_SYNTAX_CONTINUE; } int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "BADDIRECTIVE BADTYPE\n" "BADDIRECTIVE BADTYPE\n" "BADDIRECTIVE BADTYPE\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_cbopen(filedir, GD_RDONLY, callback, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(saw_callback, 3); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_endian_slash.c0000640000175000017500000000303312614323564020750 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ENDIAN big\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/vlist_meta.c0000640000175000017500000000442412614323564017302 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent data1 LINTERP UINT8 1\n" "META parent data2 LINTERP UINT8 1\n" "META parent data3 LINTERP UINT8 1\n" "META parent data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_mvector_list(D, "parent"); error = gd_error(D); CHECKI(error,0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i,len,5); CHECKIi(i,field_list[i][0], 'd'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 't'); CHECKIi(i,field_list[i][3], 'a'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i,3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/nfields_type.c0000640000175000017500000000412412614323564017615 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nfields_by_type(D, GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 2); return r; } libgetdata-0.9.0/test/sie_put_newo.c0000640000175000017500000000354212614323564017633 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; uint8_t c[6], d[20]; DIRFILE *D; int i, n1, n2, n3, e1, e2, e3, r = 0; rmdirfile(); for (i = 0; i < 6; ++i) c[i] = i + 10; D = gd_open(filedir, GD_RDWR | GD_SIE_ENCODED | GD_CREAT | GD_LITTLE_ENDIAN | GD_VERBOSE); n1 = gd_add_raw(D, "data", GD_UINT8, 20, 0); e1 = gd_error(D); CHECKI(n1, 0); CHECKI(e1, 0); n2 = gd_putdata(D, "data", 0, 10, 0, 6, GD_UINT8, c); e2 = gd_error(D); CHECKI(n2, 6); CHECKI(e2, 0); gd_close(D); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n3 = gd_getdata(D, "data", 0, 0, 0, 20, GD_UINT8, d); e3 = gd_error(D); CHECKI(n3, 16); CHECKI(e3, 0); for (i = 0; i < 16; ++i) if (i < 10) CHECKIi(i, d[i], 0); else CHECKIi(i, d[i], c[i - 10]); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_4.c0000640000175000017500000000473012614323564017043 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Open a Standards Version 4 conformant dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/RAW"; const char *data = "dirfile/ENDIAN"; const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n"; const char *format_data1 = "VERSION PHASE ENDIAN 1\na&b RAW c 8\n"; uint16_t c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "VERSION", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); unlink(format1); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],41 + i); CHECKI(v,4); CHECKI(l,4); CHECKI(e,4); return r; } libgetdata-0.9.0/test/cvlist_hidden.c0000640000175000017500000000325012614323564017746 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CONST UINT8 1\n" "data2 CONST UINT8 2\n" "/HIDDEN data2\n" "data3 CONST UINT8 3\n" "data4 RAW UINT8 1\n"; int fd, error, r = 0; const uint8_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (const uint8_t *)gd_constants(D, GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 2; ++fd) CHECKUi(fd,field_list[fd], 2 * fd + 1); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int8_uint16.c0000640000175000017500000000374612614323564020771 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as UINT16 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; uint16_t c[8]; int8_t data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/vlist_meta_invalid.c0000640000175000017500000000257512614323564021015 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const char **fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_mvector_list(D, "parent"); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error,GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/native_mult1.c0000640000175000017500000000303612614323564017541 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "mult MULTIPLY cdata data\n" "data RAW UINT8 11\n" "cdata RAW COMPLEX128 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "mult"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/open_open.c0000640000175000017500000000267312614323564017121 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Opening an empty dirfile should succeed cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/get_dim.c0000640000175000017500000000311412614323564016536 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_NULL, NULL); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DIMENSION); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/nfields_vector.c0000640000175000017500000000362612614323564020144 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "carray CARRAY UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nvectors(D); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(nfields, 5); return r; } libgetdata-0.9.0/test/move_subdir.c0000640000175000017500000000471112614323564017450 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/subdir"; const char *format = "dirfile/format"; const char *format1 = "dirfile/subdir/format1"; const char *data = "dirfile/data"; const char *new_data = "dirfile/subdir/data"; const char *format_data = "INCLUDE subdir/format1\ndata RAW UINT8 11\n"; const char *format1_data = "#\n"; int fd, ret, e1, e2, ge_ret, unlink_data, unlink_new_data, r = 0; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, GD_REN_DATA); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); ge_ret = gd_entry(D, "data", &E); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); unlink_new_data = unlink(new_data); unlink(format1); unlink(format); rmdir(subdir); rmdir(filedir); CHECKI(unlink_data, -1); CHECKI(unlink_new_data, 0); return r; } libgetdata-0.9.0/test/zzip_get_get.c0000640000175000017500000000462712614323564017632 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined USE_ZZIP || !defined TEST_ZZIP return 77; /* skip test */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *rawzip = "dirfile/raw.zip"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c1[8], c2[8]; char command[4096]; uint16_t data_data[256]; int fd, i, n1, e1, e2, n2, e3, r = 0; DIRFILE *D; memset(c1, 0, 16); memset(c2, 0, 16); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ chdir(filedir); snprintf(command, 4096, "%s raw data > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(data); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n1 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c1); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n1, 8); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n2 = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c2); e3 = gd_error(D); CHECKI(e3, 0); CHECKI(n2, 8); for (i = 0; i < 8; ++i) { CHECKIi(i,c1[i], 40 + i); CHECKIi(i,c2[i], 40 + i); } gd_discard(D); unlink(rawzip); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/get64.c0000640000175000017500000000377212614323564016071 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #define _LARGEFILE64_SOURCE 1 #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata64(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/gzip_get.c0000640000175000017500000000465212614323564016746 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *gzipdata = "dirfile/data.gz"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; #ifdef USE_GZIP int i; #endif memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* compress */ snprintf(command, 4096, "%s -f %s > /dev/null", GZIP, data); if (gd_system(command)) return 1; #ifdef USE_GZIP D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); gd_discard(D); unlink(gzipdata); unlink(format); rmdir(filedir); #ifdef USE_GZIP CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40+i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/entry_raw.c0000640000175000017500000000342112614323564017141 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read RAW entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_RAW_ENTRY); CHECKU(E.EN(raw,spf), 8); CHECKX(E.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/repr_m.c0000640000175000017500000000441412614323564016416 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read argument representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\n"; double c[8]; #ifdef GD_NO_C99_API double data_data[100][2]; #else double complex data_data[100]; #endif int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) { #ifdef GD_NO_C99_API const double v = i * 3.14159265358979323846 / 5.; data_data[i][0] = cos(v); data_data[i][1] = sin(v); #else data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.); #endif } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 200 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.m", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], cabs(data_data[5 + i])); return r; } libgetdata-0.9.0/test/fragment_name_oor.c0000640000175000017500000000373112614323564020615 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test gd_fragmentname out-of-range handling */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1\n"; const char *format1_data = "data RAW UINT8 11\n"; const char *form0 = NULL; const char *form1 = NULL; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); form0 = gd_fragmentname(D, -3000); form1 = gd_fragmentname(D, 1000); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKP(form0); CHECKP(form1); CHECKI(error, GD_E_BAD_INDEX); return r; } libgetdata-0.9.0/test/flac_seek_far.c0000640000175000017500000000422512614323564017676 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* encode */ snprintf(command, 4096, "%s --endian=little --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_LITTLE_ENDIAN); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); error = gd_error(D); #ifdef USE_FLAC CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, -1); #endif gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/flac_get_big.c0000640000175000017500000000454212614323564017521 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_FLAC return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *flacdata = "dirfile/data.flac"; const char *format_data = "data RAW UINT16 8\n"; uint16_t c[8]; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; #ifdef USE_FLAC int i; #endif DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); /* encode */ snprintf(command, 4096, "%s --endian=big --silent --sample-rate=1 --channels=1 --bps=16 " "--sign=signed --delete-input-file %s > /dev/null", FLAC, data); if (gd_system(command)) return 1; #ifdef USE_FLAC D = gd_open(filedir, GD_RDONLY | GD_VERBOSE | GD_BIG_ENDIAN); #else D = gd_open(filedir, GD_RDONLY | GD_BIG_ENDIAN); #endif n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); error = gd_error(D); #ifdef USE_FLAC CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKXi(i,c[i],40+i); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif gd_discard(D); unlink(flacdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/put_carray_slice.c0000640000175000017500000000362512614323564020465 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val[] = {0, 0, 0, 0, 0, 0, 0, 0}; int r = 0, e1, e2, i; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_carray(D, "data", GD_UINT8, 8, GD_UINT8, &val, 0); for (i = 0; i < 8; ++i) val[i] = i * (i + 1); gd_put_carray_slice(D, "data", 2, 3, GD_UINT8, &val); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); /* check */ memset(val, 0, 8); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_get_carray(D, "data", GD_UINT8, &val); gd_discard(D); unlink(format); rmdir(filedir); for (i = 0; i < 8; ++i) if (i >= 2 && i <= 4) { CHECKIi(i, val[i], (i - 2) * (i - 1)); } else CHECKIi(i, val[i], 0); return r; } libgetdata-0.9.0/test/get_carray_c2r.c0000640000175000017500000000332212614323564020015 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY COMPLEX128 8.3;7.2 6.1;5.0 3.9;2.8 1.7;0.6\n"; double c[4]; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_carray(D, "carray", GD_FLOAT64, c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); for (i = 0; i < 4; ++i) CHECKFi(i, c[i], 8.3 - 2 * i * 1.1); return r; } libgetdata-0.9.0/test/get_recip.c0000640000175000017500000000370412614323564017074 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read DIVIDE */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div RECIP data 2.\n" "data RAW UINT8 1\n"; double c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)(fd + 2); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKF(c, 2. / 7.); return r; } libgetdata-0.9.0/test/tell_multidiv.c0000640000175000017500000000357012614323564020011 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nphase PHASE data 1\ndiv DIVIDE phase data"; unsigned char data_data[256]; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_tell(D, "div"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DOMAIN); CHECKI(n, -1); return r; } libgetdata-0.9.0/test/get_mplex_bof.c0000640000175000017500000000414712614323564017747 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 2 3\n" "count RAW UINT8 8\n" "data RAW UINT8 8\n"; unsigned char c[8]; unsigned char data_data[256]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); for (fd = 0; fd < 256; ++fd) data_data[fd] %= 3; fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mplex", 0, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i, c[i], (i < 2) ? 0 : 3 * ((i + 1) / 3) - 1); return r; } libgetdata-0.9.0/test/hide.c0000640000175000017500000000301112614323564016033 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd, n, h, m, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_nfields(D); h = gd_hide(D, "data"); error = gd_error(D); m = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 2); CHECKI(h, 0); CHECKI(m, 1); return r; } libgetdata-0.9.0/test/parse_name_pedantic.c0000640000175000017500000000304512614323564021112 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "d.ta RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_PEDANTIC); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/del_data.c0000640000175000017500000000405212614323564016665 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, ret, e1, n, e2, e3, unlink_data, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", GD_DEL_DATA); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, data_data); e2 = gd_error(D); CHECKI(n, 0); CHECKI(e2, GD_E_BAD_CODE); e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, -1); return r; } libgetdata-0.9.0/test/version_2_write.c0000640000175000017500000000345212614323564020253 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "INCLUDE RAW c 8\n" "a&b RAW c 8\n" "m MULTIPLY INCLUDE INCLUDE\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 2); q = gd_rewrite_fragment(D, 0); CHECKI(e,2); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_EARLIEST); CHECKI(c,2); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/sie_put_append.c0000640000175000017500000000474312614323564020136 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.sie"; const char *format_data = "data RAW UINT8 8\n/ENCODING sie\n/ENDIAN little\n"; unsigned char c[16] = { 0x22, 0x22, 0x22, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34, 0x34 }; const uint8_t data_data[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, }; #define NREC 4 const uint8_t data_out[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x42, 0x1A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34 }; uint8_t check[(NREC + 1) * 9]; DIRFILE *D; int fd, i, n, error, r = 0; ssize_t l; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 2 * 9 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n = gd_putdata(D, "data", 3, 0, 2, 0, GD_UINT8, c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 16); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); l = read(fd, check, (NREC + 1) * 9); close(fd); CHECKI(l, NREC * 9); unlink(data); unlink(format); rmdir(filedir); for (i = 0; i < 4 * 9; ++i) CHECKXi(i, check[i], data_out[i]); return r; } libgetdata-0.9.0/test/gzip_add.c0000640000175000017500000000411012614323564016704 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.gz"; gd_entry_t e; int e1, e2, e3, unlink_data, r = 0; DIRFILE *D; rmdirfile(); #ifdef USE_GZIP D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE | GD_GZIP_ENCODED); #else D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_GZIP_ENCODED); #endif gd_add_raw(D, "data", GD_UINT8, 2, 0); e1 = gd_error(D); /* check */ e2 = gd_entry(D, "data", &e); #ifdef USE_GZIP CHECKI(e2, 0); if (e2 == 0) { CHECKI(e.field_type, GD_RAW_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(raw,spf), 2); CHECKI(e.EN(raw,data_type), GD_UINT8); gd_free_entry_strings(&e); } #else CHECKI(e2, -1); #endif e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); #ifdef USE_GZIP CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); #endif unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/include_nonexistent.c0000640000175000017500000000302312614323564021206 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "#\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_include(D, "format1", 0, 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_IO); return r; } libgetdata-0.9.0/test/get_mplex_complex.c0000640000175000017500000000435112614323564020645 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *count = "dirfile/count"; const char *format_data = "mplex MPLEX data count 1 3\n" "count RAW UINT8 8\n" "data RAW COMPLEX128 8\n"; double c[16]; unsigned char count_data[256]; double data_data[512]; int fd, n, i, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); for (fd = 0; fd < 256; ++fd) { count_data[fd] = (unsigned char)(fd % 3); data_data[fd * 2] = (double)fd; data_data[fd * 2 + 1] = (double)fd / 256.; } fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); fd = open(count, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, count_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mplex", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(count); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { CHECKFi(i, c[2 * i], 40 + 3 * (i / 3)); CHECKFi(i, c[2 * i + 1], (40 + 3 * (i / 3)) / 256.); } return r; } libgetdata-0.9.0/test/ascii_seek.c0000640000175000017500000000317412614323564017233 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW UINT8 8\n"; int fd, i, n, error, r = 0; DIRFILE *D; FILE* stream; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i\n", i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); CHECKI(n, 40); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_protect_none.c0000640000175000017500000000303412614323564021020 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "PROTECT none\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/encode_recode_open.c0000640000175000017500000000444512614323564020735 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *txtdata = "dirfile/data.txt"; const char *format_data = "data RAW UINT16 8\nENCODING none\n"; uint16_t data_data[128]; uint16_t c1, c2; int fd, ret, e1, e2, unlink_txtdata, unlink_data, r = 0; DIRFILE *D; off_t n1, n2; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 0x201 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); n1 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c1); CHECKI(n1, 1); CHECKI(c1, 0x603); ret = gd_alter_encoding(D, GD_TEXT_ENCODED, 0, 1); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, 0); n2 = gd_getdata(D, "data", 0, 3, 0, 1, GD_UINT16, &c2); CHECKI(n2, 1); CHECKI(c2, 0x603); e2 = gd_close(D); CHECKI(e2, 0); unlink_txtdata = unlink(txtdata); unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_txtdata, 0); CHECKI(unlink_data, -1); return r; } libgetdata-0.9.0/test/open_sym_c.c0000640000175000017500000000300612614323564017261 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile/link"; const char *format = "dirfile/format"; const char *targ = "."; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ symlink(targ, filedir); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; #endif } libgetdata-0.9.0/test/fragment_affix_alter2.c0000640000175000017500000000373212614323564021365 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "B CONST UINT8 1\nINCLUDE format1 A Z\n"; const char *format1_data = "/INCLUDE format2 B Y\n"; const char *format2_data = "data RAW UINT8 11\n"; int fd, ret, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_alter_affixes(D, 1, NULL, ""); e1 = gd_error(D); gd_spf(D, "ABdataY"); e2 = gd_error(D); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret,0); CHECKI(e1,0); CHECKI(e2,0); return r; } libgetdata-0.9.0/test/alter_phase.c0000640000175000017500000000410412614323564017415 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\nphase PHASE data 1\n"; unsigned char data_data[256]; unsigned char c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_phase(D, "phase", NULL, 2); error = gd_error(D); n = gd_getdata(D, "phase", 5, 0, 1, 0, GD_UINT8, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i + 42); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/version_9.c0000640000175000017500000000445112614323564017050 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 9\n" "ar RAW UINT8 8\n" "/HIDDEN ar\n" "r WINDOW ar ar LT 0x2C\n"; double c[8]; unsigned char data_data[256]; int fd, i, n, error, v, l, e, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "r", 5, 0, 1, 0, GD_FLOAT64, c); error = gd_error(D); v = gd_dirfile_standards(D, GD_VERSION_CURRENT); l = gd_dirfile_standards(D, GD_VERSION_LATEST); e = gd_dirfile_standards(D, GD_VERSION_EARLIEST); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) if (i >= 4) CHECKNANi(i,c[i]); else CHECKFi(i,c[i],(40 + i)); CHECKI(v,9); CHECKI(l,GD_DIRFILE_STANDARDS_VERSION); CHECKI(e,9); return r; } libgetdata-0.9.0/test/alter_cpolynom_null.c0000640000175000017500000000437712614323564021223 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW INT32 8\n" "polynom POLYNOM data 1;2 2;3 1;9\n"; int fd, i, ret, error, n, error2, r = 0; gd_entry_t E; #ifdef GD_NO_C99_API const double a[2][2] = {{1, 2}, {2, 3}}; #endif DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_cpolynom(D, "polynom", 1, NULL, NULL); error = gd_error(D); CHECKI(error,0); n = gd_entry(D, "polynom", &E); error2 = gd_error(D); gd_discard(D); CHECKS(E.field, "polynom"); CHECKI(E.field_type, GD_POLYNOM_ENTRY); CHECKI(E.EN(polynom,poly_ord), 1); CHECKX(E.flags, GD_EN_COMPSCAL | GD_EN_CALC); CHECKS(E.in_fields[0], "data"); for (i = 0; i < 2; ++i) { #ifdef GD_NO_C99_API CHECKCi(i,E.EN(polynom,ca)[i], a[i]); #else CHECKCi(i,E.EN(polynom,ca)[i], i + 1 + _Complex_I * (i + 2)); #endif } unlink(format); rmdir(filedir); CHECKI(error2,0); CHECKI(n,0); CHECKI(ret,0); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/alter_scalar_affix.c0000640000175000017500000000461312614323564020744 0ustar alastairalastair/* Copyright (C) 2012 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *format_data = "/INCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 8\nconst CONST INT64 11\n"; unsigned char data_data[256]; int fd, e1, e2, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR); gd_entry(D, "AdataZ", &E); E.scalar[0] = "const"; gd_alter_entry(D, "AdataZ", &E, 0); e1 = gd_error(D); E.scalar[0] = "AconstZ"; gd_alter_entry(D, "AdataZ", &E, 0); e2 = gd_error(D); E.scalar[0] = NULL; gd_free_entry_strings(&E); n = gd_entry(D, "AdataZ", &E); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(e1, GD_E_BAD_CODE); CHECKI(e2, 0); CHECKI(n, 0); CHECKI(E.EN(raw,spf), 11); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/seek_end.c0000640000175000017500000000366712614323564016720 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* gd_seek() */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; unsigned char data_data[256]; int fd, e1, e2, r = 0; off_t m, n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); m = gd_seek(D, "data", -2, 0, GD_SEEK_END); e1 = gd_error(D); n = gd_tell(D, "data"); e2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(e1, 0); CHECKI(e2, 0); CHECKI(m, 240); CHECKI(n, 240); return r; } libgetdata-0.9.0/test/put_string.c0000640000175000017500000000327312614323564017332 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; char string[1024] = ""; int e1, e2, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_string(D, "data", "some string", 0); gd_put_string(D, "data", "some other string"); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); /* check */ D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_get_string(D, "data", 1023, string); gd_discard(D); unlink(format); rmdir(filedir); CHECKS(string,"some other string"); return r; } libgetdata-0.9.0/test/get_multiply_crinr.c0000640000175000017500000000402312614323564021041 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read MULTIPLY */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data INDEX\ndata RAW COMPLEX128 1\n"; double c[8]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i, c[i], (5. + i) * (5 + i)); return r; } libgetdata-0.9.0/test/include_ref.c0000640000175000017500000000402612614323564017410 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "data1 RAW UINT8 1\n"; const char *format1_data = "data RAW UINT8 11\nREFERENCE data\n"; int fd, error1, error2, r = 0; const char *reference; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include(D, "format1", 0, GD_VERBOSE); error1 = gd_error(D); CHECKI(error1, 0); reference = gd_reference(D, NULL); error2 = gd_error(D); CHECKI(error2, 0); CHECKS(reference, "data"); spf = gd_spf(D, "data"); CHECKU(spf, 11); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/madd_bit_invalid.c0000640000175000017500000000252512614323564020404 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_madd_bit(D, "new", "meta", "input", 1, 1); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/put_rofs.c0000640000175000017500000000376112614323564016777 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write a read-only dirfile */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 1\n"; unsigned char c = 0; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0555)); /* ensure filesystem honours read-onlyness */ if ((fd = open(data, O_RDWR)) >= 0 || errno != EACCES) { if (fd >= 0) close(fd); unlink(format); unlink(data); rmdir(filedir); return 77; } D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error,GD_E_RAW_IO); return r; } libgetdata-0.9.0/test/put_endian_complex64_big.c0000640000175000017500000000445712614323564022011 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write big-endian COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 1\nENDIAN big\n"; unsigned int i; #ifdef GD_NO_C99_API const float c[] = {1.5, 2.25}; #else const float complex c = 1.5 + _Complex_I * 2.25; #endif unsigned char x[2 * sizeof(float)] = { 0x3F, 0xC0, 0x00, 0x00, 0x40, 0x10, 0x00, 0x00 }; unsigned char u[2 * sizeof(float)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); #else n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, &c); #endif error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * 2 * sizeof(float), SEEK_SET); read(fd, u, 2 * sizeof(float)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < 2 * sizeof(float); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/alter_recip.c0000640000175000017500000000415712614323564017427 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "div RECIP data 230.\n"; int32_t data_data[256]; double c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_recip(D, "div", "phase", 1093.); error = gd_error(D); n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 1093. / (i + 41.)); unlink(data); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,8); CHECKI(ret,0); return r; } libgetdata-0.9.0/test/add_dangle_dup.c0000640000175000017500000000263712614323564020051 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, e3, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_alias(D, "name", "target", 0); e1 = gd_error(D); CHECKI(e1, GD_E_OK); gd_add_raw(D, "name", GD_UINT8, 1, 0); e2 = gd_error(D); CHECKI(e2, GD_E_DUPLICATE); gd_add_alias(D, "name", "target", 0); e3 = gd_error(D); CHECKI(e3, GD_E_DUPLICATE); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_divide.c0000640000175000017500000000355612614323564017274 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "div DIVIDE data data\ndata RAW INT8 8\n"; int8_t c[8]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "div", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,0); CHECKI(e1,GD_E_BAD_FIELD_TYPE); e2 = gd_close(D); CHECKI(e2, 0); if (!stat(data, &buf)) { perror("stat"); r = 1; } unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_zero.c0000640000175000017500000000322212614323564016775 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\n"; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 0, 0, 0, 0, GD_UINT8, NULL); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n,0); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/entry_divide.c0000640000175000017500000000342712614323564017622 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read DIVIDE entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data DIVIDE in1 in2\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKX(E.field_type, GD_DIVIDE_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/nmeta_vectors.c0000640000175000017500000000410512614323564020000 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nmvectors(D, "raw1"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(nfields, 3); return r; } libgetdata-0.9.0/test/global_ref.c0000640000175000017500000000317312614323564017227 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n"; int fd, error, r = 0; const char *ref; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); ref = gd_reference(D, NULL); error = gd_error(D); CHECKS(ref, "data"); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_whitespace.c0000640000175000017500000000304312614323564020455 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "da\\ ta RAW UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/parse_lincom_non_ncols.c0000640000175000017500000000304012614323564021647 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM in1 1 0 in2\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/alter_const.c0000640000175000017500000000340612614323564017447 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST FLOAT32 8.3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; double d; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_const(D, "const", GD_UINT8); error = gd_error(D); n = gd_get_constant(D, "const", GD_FLOAT64, &d); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKF(d, 8.); return r; } libgetdata-0.9.0/test/cvlist.c0000640000175000017500000000357412614323564016444 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the list of constant values should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 CONST UINT8 1\n" "data2 CONST UINT8 2\n" "data3 CONST UINT8 3\n" "data4 RAW UINT8 1\n"; int fd, error, r = 0; const uint8_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (const uint8_t *)gd_constants(D, GD_UINT8); error = gd_error(D); CHECKI(error, 0); if (!r) for (fd = 0; fd < 3; ++fd) CHECKUi(fd,field_list[fd], fd + 1); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/fragment_affix_alter_nop.c0000640000175000017500000000365112614323564022157 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "B CONST UINT8 1\nINCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 11\n"; char *prefix; char *suffix; int fd, ret, e1, e2, e3, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_alter_affixes(D, 1, "A", "Z"); e1 = gd_error(D); gd_fragment_affixes(D, 1, &prefix, &suffix); e2 = gd_error(D); gd_spf(D, "AdataZ"); e3 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKS(prefix,"A"); CHECKS(suffix,"Z"); CHECKI(ret,0); CHECKI(e1,0); CHECKI(e2,0); CHECKI(e3,0); free(prefix); free(suffix); return r; } libgetdata-0.9.0/test/parse_ncols.c0000640000175000017500000000301512614323564017436 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "ENDIAN\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/get_clincom.c0000640000175000017500000000415712614323564017421 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 2 data 2;3 3;2 data 0;1 0\ndata RAW UINT8 1\n"; #ifdef GD_NO_C99_API double c[2] = {0, 0}; const double v[2] = {13, 22}; #else double complex c = 0; const double complex v = 13 + _Complex_I * 22; #endif unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKC(c, v); return r; } libgetdata-0.9.0/test/put_repr.c0000640000175000017500000000351112614323564016767 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX64 8\n"; float c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = 40 + i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "data.r", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_CODE); CHECKI(n,0); return r; } libgetdata-0.9.0/test/parse_meta_malias.c0000640000175000017500000000301412614323564020573 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "const CONST UINT8 1\n" "ALIAS parent/alias const\n" "META parent/alias grandchild CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/convert_float64_complex64.c0000640000175000017500000000430512614323564022051 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/parse_phase_ncols.c0000640000175000017500000000302512614323564020617 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data PHASE in1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/unclude_move.c0000640000175000017500000000453612614323564017624 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n"; const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2\n"; const char *format2_data = "c CONST UINT8 11\n"; int fd, ret1, ret2, error1, error2, r = 0; unsigned int nfields, nfragments; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret1 = gd_uninclude(D, 2, 0); error1 = gd_error(D); ret2 = gd_include(D, "format2", 0, 0); error2 = gd_error(D); nfields = gd_nfields(D); nfragments = gd_nfragments(D); gd_discard(D); unlink(format2); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error1,0); CHECKI(error2,0); CHECKI(ret1,0); CHECKI(ret2,2); CHECKI(nfields,4); CHECKI(nfragments,3); return r; } libgetdata-0.9.0/test/convert_uint8_float32.c0000640000175000017500000000400512614323564021267 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT8 as FLOAT32 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; float c[8]; unsigned char data_data[256]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_FLOAT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKFi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/endian_move.c0000640000175000017500000000457512614323564017426 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test endianness */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\nENDIAN little\n"; uint16_t data_data[128]; uint16_t c[8], d; int fd, ret, error, n, i = 0, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 0x201 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_endianness(D, GD_BIG_ENDIAN, 0, 1); error = gd_error(D); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKX(d, i * 0x102); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); #ifdef WORDS_BIGENDIAN # define FACTOR 0x102 #else # define FACTOR 0x201 #endif for (i = 0; i < 8; ++i) CHECKXi(i,c[i], (40 + i) * FACTOR); CHECKI(error, 0); CHECKI(ret, 0); CHECKI(n, 8); return r; } libgetdata-0.9.0/test/dfes_phase.c0000640000175000017500000000311012614323564017223 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a PHASE entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data PHASE in 8\n"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/open_sym_d.c0000640000175000017500000000335212614323564017266 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* this tests whether _GD_CanonicalPath can deal with bad intermediate * symlinks */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK || defined GD_NO_GETCWD return 77; #else const char *link = "dirfile/link"; const char *filedir = "dirfile/link/dirfile"; int error, r = 0; int cwd_size = 2048; char *ptr, *cwd = NULL; DIRFILE *D; gdtest_getcwd(ptr, cwd, cwd_size); rmdirfile(); mkdir("dirfile", 0777); /* make a bad symlink */ symlink("non_existent", link); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); ptr = gd_error_string(D, NULL, 0); CHECKI(error, GD_E_IO); CHECKSS(ptr, "dirfile/non_existent/dirfile"); free(ptr); gd_discard(D); unlink(link); rmdir("dirfile"); free(cwd); return r; #endif } libgetdata-0.9.0/test/put_polynom2.c0000640000175000017500000000360112614323564017576 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 3.0 2.0 1.0 0.5\ndata RAW INT8 8\n"; int8_t c[8]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,0); CHECKI(e1,GD_E_BAD_FIELD_TYPE); e2 = gd_close(D); CHECKI(e2, 0); if (!stat(data, &buf)) { perror("stat"); r = 1; } unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/cvlist_invalid.c0000640000175000017500000000257212614323564020147 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; const void *fl; rmdirfile(); D = gd_open(filedir, GD_RDONLY); fl = gd_constants(D, GD_UINT8); error = gd_error(D); gd_discard(D); CHECKP(fl); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/nmeta_type_invalid.c0000640000175000017500000000262112614323564021003 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nmfields_by_type(D, "raw1", GD_STRING_ENTRY); error = gd_error(D); gd_discard(D); CHECKU(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/put_int8.c0000640000175000017500000000417412614323564016707 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; int8_t c[8], d; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/parse_include_prefix.c0000640000175000017500000000326512614323564021327 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 pre\n"; const char *format1_data = "data RAW UINT8 11\n"; int fd, r = 0; DIRFILE *D; unsigned int spf, spfaff; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); spf = gd_spf(D, "data"); spfaff = gd_spf(D, "predata"); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKU(spf, 0); CHECKU(spfaff, 11); return r; } libgetdata-0.9.0/test/put_endian_complex128_arm.c0000640000175000017500000000456212614323564022105 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write arm-endian COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\nENDIAN little arm\n"; unsigned int i; #ifdef GD_NO_C99_API const double c[] = {1.5, 2.25}; #else const double complex c = 1.5 + _Complex_I * 2.25; #endif unsigned char x[2 * sizeof(double)] = { 0x00, 0x00, 0xF8, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00 }; unsigned char u[2 * sizeof(double)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); #else n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, &c); #endif error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 10 * sizeof(double), SEEK_SET); read(fd, u, 2 * sizeof(double)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < 2 * sizeof(double); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/move_data_enc_ar.c0000640000175000017500000000524712614323564020405 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test move */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/data"; const char *txtdata = "dirfile/data.txt"; const char *format_data = "/INCLUDE format1\ndata RAW UINT16 11\nENCODING text\n"; const char *format1_data = "ENCODING none\n"; int r = 0; uint16_t d; int fd, i, ret, e1, e2, ge_ret, unlink_data, unlink_txtdata; FILE* stream; gd_entry_t E; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); stream = fopen(txtdata, "w"); for (i = 0; i < 128; ++i) fprintf(stream, "%i\n", i * 0x201); fclose(stream); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); ret = gd_move(D, "data", 1, GD_REN_DATA); e1 = gd_error(D); CHECKI(ret, 0); CHECKI(e1, GD_E_OK); ge_ret = gd_entry(D, "data", &E); CHECKI(ge_ret, 0); CHECKI(E.fragment_index, 1); gd_free_entry_strings(&E); e2 = gd_close(D); CHECKI(e2, 0); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKXi(i,d,i * 0x201); i++; } close(fd); } else { perror("open"); r = 1; } unlink(format1); unlink(format); unlink_data = unlink(data); unlink_txtdata = unlink(txtdata); rmdir(filedir); CHECKI(unlink_data, 0); CHECKI(unlink_txtdata, -1); return r; } libgetdata-0.9.0/test/parse_raw_type.c0000640000175000017500000000303212614323564020151 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW BADTYPE 11\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/legacy_format.c0000640000175000017500000001146512614323564017752 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "bit BIT raw 5 6\n" "const CONST UINT8 1\n" "carray CARRAY UINT8 1 2 3\n" "div DIVIDE raw bit\n" "lincom LINCOM raw 1 2 phase 3 4 div 5 6\n" "linterp LINTERP raw /table/path\n" "mplex MPLEX raw lincom 54 94\n" "mult MULTIPLY sbit bit\n" "phase PHASE raw 33\n" "polynom POLYNOM raw 8 9 10 11\n" "raw RAW UINT8 8\n" "recip RECIP sbit 3\n" "sbit SBIT raw 7 8\n" "window WINDOW raw phase LE 3\n" "/FRAMEOFFSET 12\n"; int fd, i, error = 0, r = 0; double three = 3.; int *three_ptr = (void*)(&three); struct FormatType *f; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); f = GetFormat(filedir, &error); CHECKI(error, 0); /* global metadata */ CHECKS(f->FileDirName, filedir); CHECKI(f->frame_offset, 12); /* reference field */ CHECKS(f->first_field.field, "raw"); CHECKI(f->first_field.type, 'c'); CHECKI(f->first_field.size, 1); CHECKI(f->first_field.samples_per_frame, 8); /* field metadata */ CHECKI(f->n_raw, 1); CHECKS(f->rawEntries[0].field, "raw"); CHECKI(f->rawEntries[0].type, 'c'); CHECKI(f->rawEntries[0].size, 1); CHECKI(f->rawEntries[0].samples_per_frame, 8); CHECKI(f->n_lincom, 3); CHECKS(f->lincomEntries[0].field, "lincom"); CHECKI(f->lincomEntries[0].n_fields, 3); CHECKS(f->lincomEntries[0].in_fields[0], "raw"); CHECKS(f->lincomEntries[0].in_fields[1], "phase"); CHECKS(f->lincomEntries[0].in_fields[2], "div"); for (i = 0; i < 3; ++i) { CHECKFi(i, f->lincomEntries[0].m[i], i * 2. + 1); CHECKFi(i, f->lincomEntries[0].b[i], i * 2. + 2); } CHECKS(f->lincomEntries[1].field, "polynom"); CHECKI(f->lincomEntries[1].n_fields, 1); CHECKS(f->lincomEntries[1].in_fields[0], "raw"); CHECKF(f->lincomEntries[1].m[0], 9); CHECKF(f->lincomEntries[1].b[0], 8); CHECKS(f->lincomEntries[2].field, "recip"); CHECKI(f->lincomEntries[2].n_fields, 1); CHECKS(f->lincomEntries[2].in_fields[0], "sbit"); CHECKF(f->lincomEntries[2].m[0], 3); CHECKF(f->lincomEntries[2].b[0], 0); CHECKI(f->n_linterp, 1); CHECKS(f->linterpEntries[0].field, "linterp"); CHECKS(f->linterpEntries[0].raw_field, "raw"); CHECKS(f->linterpEntries[0].linterp_file, "/table/path"); CHECKI(f->n_bit, 2); CHECKS(f->bitEntries[0].field, "bit"); CHECKS(f->bitEntries[0].raw_field, "raw"); CHECKI(f->bitEntries[0].bitnum, 5); CHECKI(f->bitEntries[0].numbits, 6); CHECKS(f->bitEntries[1].field, "sbit"); CHECKS(f->bitEntries[1].raw_field, "raw"); CHECKI(f->bitEntries[1].bitnum, 7); CHECKI(f->bitEntries[1].numbits, 8); CHECKI(f->n_multiply, 2); CHECKS(f->multiplyEntries[0].field, "div"); CHECKS(f->multiplyEntries[0].in_fields[0], "raw"); CHECKS(f->multiplyEntries[0].in_fields[1], "bit"); CHECKS(f->multiplyEntries[1].field, "mult"); CHECKS(f->multiplyEntries[1].in_fields[0], "sbit"); CHECKS(f->multiplyEntries[1].in_fields[1], "bit"); CHECKI(f->n_phase, 1); CHECKS(f->phaseEntries[0].field, "phase"); CHECKS(f->phaseEntries[0].raw_field, "raw"); CHECKI(f->phaseEntries[0].shift, 33); CHECKI(f->n_mplex, 2); CHECKS(f->mplexEntries[0].field, "mplex"); CHECKS(f->mplexEntries[0].data_field, "raw"); CHECKS(f->mplexEntries[0].cnt_field, "lincom"); CHECKI(f->mplexEntries[0].i, 54); CHECKI(f->mplexEntries[0].max_i, 94); CHECKS(f->mplexEntries[1].field, "window"); CHECKS(f->mplexEntries[1].data_field, "raw"); CHECKS(f->mplexEntries[1].cnt_field, "phase"); CHECKI(f->mplexEntries[1].i, GD_WINDOP_LE); CHECKI(f->mplexEntries[1].max_i, *three_ptr); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/creat.c0000640000175000017500000000270712614323564016233 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int e1, e2, unlink_ret, rmdir_ret, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); unlink_ret = unlink(format); rmdir_ret = rmdir(filedir); CHECKI(unlink_ret, 0); CHECKI(rmdir_ret, 0); return r; } libgetdata-0.9.0/test/convert_int32_uint8.c0000640000175000017500000000376112614323564020764 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as UINT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; uint8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/trunc_truncsub.c0000640000175000017500000000372212614323564020213 0ustar alastairalastair/* Copyright (C) 2008-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; int fd, e1, e2, unlink_data, rmdir_sub, stat_format, r = 0; struct stat buf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format, strlen(format)); close(fd); close(open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666)); D = gd_open(filedir, GD_RDWR | GD_TRUNC | GD_TRUNCSUB | GD_VERBOSE); e1 = gd_error(D); CHECKI(e1, GD_E_OK); e2 = gd_close(D); CHECKI(e2, 0); unlink_data = unlink(data); CHECKI(unlink_data, -1); stat_format = stat(format, &buf); CHECKI(stat_format, 0); CHECK((buf.st_size > 0),buf.st_size,"%lli","%s",(long long)buf.st_size,"> 0"); rmdir_sub = rmdir(subdir); CHECKI(rmdir_sub, -1); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/get_lincom2.c0000640000175000017500000000370612614323564017337 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read LINCOM */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "lincom LINCOM 2 data 2 3 data 1 0\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 18); return r; } libgetdata-0.9.0/test/include_index.c0000640000175000017500000000305512614323564017744 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "#\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_include(D, "format1", 1, 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_BAD_INDEX); return r; } libgetdata-0.9.0/test/sie_move_to.c0000640000175000017500000000520512614323564017441 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to compress an SIE file */ #include "test.h" #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_sie = "dirfile/data.sie"; const char *data_raw = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n/ENCODING none\n/ENDIAN little\n"; uint8_t check[27]; const uint8_t data_out[] = { 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32 }; const uint8_t data_in[] = { 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x12, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32, 0x32 }; DIRFILE *D; int fd, i, e1, e2, r = 0, unlink_data_sie, unlink_data_raw; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data_raw, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_in, 0x31 * sizeof(unsigned char)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_alter_encoding(D, GD_SIE_ENCODED, 0, 1); e1 = gd_error(D); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); fd = open(data_sie, O_RDONLY | O_BINARY); read(fd, check, 27); close(fd); for (i = 0; i < 27; ++i) CHECKUi(i, check[i], data_out[i]); unlink_data_sie = unlink(data_sie); unlink_data_raw = unlink(data_raw); unlink(format); rmdir(filedir); CHECKI(unlink_data_sie, 0); CHECKI(unlink_data_raw, -1); return r; } libgetdata-0.9.0/test/lzma_nframes.c0000640000175000017500000000442412614323564017611 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of frames should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef TEST_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.lzma"; const char *format_data = "data RAW UINT16 1\n"; char command[4096]; uint16_t data_data[256]; int i, error, r = 0; DIRFILE *D; size_t n; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) data_data[i] = (uint16_t)i; i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 256 * sizeof(uint16_t)); close(i); /* compress */ snprintf(command, 4096, "%s -F lzma -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; #ifdef USE_LZMA D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #else D = gd_open(filedir, GD_RDONLY); #endif n = gd_nframes(D); error = gd_error(D); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); #ifdef USE_LZMA CHECKI(error, 0); CHECKI(n, 256); #else CHECKI(error, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/get_multiply_rcin.c0000640000175000017500000000416412614323564020665 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read MULTIPLY */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY INDEX data\ndata RAW COMPLEX128 1\n"; double c[16]; double data_data[512]; int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 256; ++i) { data_data[i * 2] = (double)i; data_data[i * 2 + 1] = (double)i / 256.; } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 512 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mult", 5, 0, 8, 0, GD_COMPLEX128, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { const double a = 5 + i; const double b = a / 256.; CHECKFi(i, c[i * 2], a * a); CHECKFi(i, c[i * 2 + 1], a * b); } return r; } libgetdata-0.9.0/test/spf_divide.c0000640000175000017500000000311612614323564017244 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in1 RAW UINT8 11\n" "in2 RAW UINT8 13\n" "div DIVIDE in1 in2\n"; int fd, r = 0; DIRFILE *D; unsigned int spf; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "div"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/legacy_get_put.c0000640000175000017500000000421412614323564020123 0ustar alastairalastair/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt a write following a read via the legacy API -- this requires * closing and then re-opening the legacy dirfile */ #include "test.h" #include #include #include #include #include #include #include int main(void) { #ifndef GD_LEGACY_API return 77; /* skipped */ #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; unsigned char data_data[256]; int fd, i, get_error, put_error, n, r = 0; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); GetData(filedir, "data", 5, 0, 1, 0, 'c', c, &get_error); n = PutData(filedir, "data", 5, 0, 1, 0, 'c', c, &put_error); unlink(data); unlink(format); rmdir(filedir); CHECKI(get_error,0); CHECKI(put_error,0); CHECKI(n,8); return r; #endif } libgetdata-0.9.0/test/open_sym_p.c0000640000175000017500000000301712614323564017300 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include int main(void) { #if ! defined HAVE_SYMLINK return 77; #else const char *filedir = "dirfile/link"; const char *format = "dirfile/format"; const char *targ = "../dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); mkdir("dirfile", 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0666)); /* make a symlink */ symlink(targ, filedir); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); return r; #endif } libgetdata-0.9.0/test/convert_int16_complex128.c0000640000175000017500000000432312614323564021614 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT16 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT16 8\n"; int16_t data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int16_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int16_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/add_recip.c0000640000175000017500000000331212614323564017040 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_recip(D, "new", "in", 33.3, 0); error = gd_error(D); /* check */ gd_entry(D, "new", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_RECIP_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKX(e.flags, GD_EN_CALC); CHECKF(e.EN(recip,dividend), 33.3); CHECKI(e.fragment_index, 0); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/convert_int32_complex64.c0000640000175000017500000000430412614323564021530 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as COMPLEX64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; #ifdef GD_NO_C99_API float c[16]; #else float complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API float v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex float v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/bof_index.c0000640000175000017500000000335212614323564017067 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 2\n/FRAMEOFFSET 35\n"; int fd, error, r = 0; off_t n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, strlen(data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_bof(D, "INDEX"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); return r; } libgetdata-0.9.0/test/fragment_affix_alter.c0000640000175000017500000000366012614323564021303 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "B CONST UINT8 1\nINCLUDE format1 A Z\n"; const char *format1_data = "data RAW UINT8 11\n"; char *prefix; char *suffix; int fd, ret, e1, e2, e3, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_alter_affixes(D, 1, "C", NULL); e1 = gd_error(D); gd_fragment_affixes(D, 1, &prefix, &suffix); e2 = gd_error(D); gd_spf(D, "CdataZ"); e3 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKS(prefix,"C"); CHECKS(suffix,"Z"); CHECKI(ret,0); CHECKI(e1,0); CHECKI(e2,0); CHECKI(e3,0); free(prefix); free(suffix); return r; } libgetdata-0.9.0/test/unclude_del.c0000640000175000017500000000453612614323564017422 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format2 = "dirfile/format2"; const char *format_data = "/INCLUDE format1\na CONST UINT8 1\n"; const char *format1_data = "b CONST UINT8 11\n/INCLUDE format2\n"; const char *format2_data = "c CONST UINT8 11\n"; int fd, ret, e1, e2, unlink_format1, unlink_format2, r = 0; unsigned int nfields, nfragments; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); fd = open(format2, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format2_data, strlen(format2_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_uninclude(D, 2, 1); e1 = gd_error(D); CHECKI(ret,0); CHECKI(e1, 0); nfields = gd_nfields(D); CHECKI(nfields,3); nfragments = gd_nfragments(D); CHECKI(nfragments,2); e2 = gd_close(D); CHECKI(e2, 0); unlink_format2 = unlink(format2); unlink_format1 = unlink(format1); unlink(format); rmdir(filedir); CHECKI(unlink_format2,-1); CHECKI(unlink_format1,0); return r; } libgetdata-0.9.0/test/parse_endian_little.c0000640000175000017500000000303512614323564021135 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "ENDIAN little\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/get_multiply.c0000640000175000017500000000367412614323564017657 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read MULTIPLY */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data data\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "mult", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); CHECKU(c, 25); return r; } libgetdata-0.9.0/test/madd_phase.c0000640000175000017500000000341012614323564017212 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a PHASE field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, ge_error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_phase(D, "new", "in", 3, 0); gd_madd_phase(D, "new", "meta", "in", 3); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); ge_error = gd_error(D); CHECKI(ge_error, 0); if (!r) { CHECKI(e.field_type, GD_PHASE_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(phase,shift), 3); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/put_multiply.c0000640000175000017500000000356212614323564017704 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "mult MULTIPLY data data\ndata RAW INT8 8\n"; int8_t c[8]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (int8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "mult", 5, 0, 1, 0, GD_INT8, c); e1 = gd_error(D); CHECKI(n,0); CHECKI(e1,GD_E_BAD_FIELD_TYPE); e2 = gd_close(D); CHECKI(e2, 0); if (!stat(data, &buf)) { perror("stat"); r = 1; } unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/repr_i.c0000640000175000017500000000441412614323564016412 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read argument representation */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 1\n"; double c[8]; #ifdef GD_NO_C99_API double data_data[100][2]; #else double complex data_data[100]; #endif int i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 100; ++i) { #ifdef GD_NO_C99_API const double v = i * 3.14159265358979323846 / 5.; data_data[i][0] = cos(v); data_data[i][1] = sin(v); #else data_data[i] = cexp(_Complex_I * i * 3.14159265358979323846 / 5.); #endif } i = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(i, format_data, strlen(format_data)); close(i); i = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(i, data_data, 200 * sizeof(double)); close(i); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data.i", 5, 0, 8, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(n,8); CHECKI(error,0); for (i = 0; i < 8; ++i) CHECKFi(i,c[i],cimag(data_data[5 + i])); return r; } libgetdata-0.9.0/test/parse_lincom_ncols2.c0000640000175000017500000000303612614323564021064 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM 2 in1 1 0\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/entry_window_scalar.c0000640000175000017500000000367412614323564021216 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to read WINDOW entry */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST UINT8 3\ndata WINDOW in1 in2 GE const\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_entry(D, "data", &E); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); CHECKI(n, 0); CHECKS(E.field, "data"); CHECKI(E.field_type, GD_WINDOW_ENTRY); CHECKS(E.in_fields[0], "in1"); CHECKS(E.in_fields[1], "in2"); CHECKS(E.scalar[0], "const"); CHECKI(E.EN(window,windop), GD_WINDOP_GE); CHECKF(E.EN(window,threshold.r), 3); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/lzma_xz_put_pad.c0000640000175000017500000000523312614323564020332 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if ! (defined TEST_LZMA) || ! (defined USE_LZMA) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_xz = "dirfile/data.xz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); gd_close(D); D = gd_open(filedir, GD_RDWR | GD_LZMA_ENCODED | GD_VERBOSE); n2 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_xz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s --decompress -f %s > /dev/null", XZ, data_xz); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/convert_float64_complex128.c0000640000175000017500000000431312614323564022131 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT64 as COMPLEX128 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 8\n"; double data_data[256]; #ifdef GD_NO_C99_API double c[16]; #else double complex c[8]; #endif int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API double v[] = {40 + i, 0}; CHECKCi(i,c + 2 * i, v); #else _Complex double v = 40 + i; CHECKCi(i,c[i], v); #endif } return r; } libgetdata-0.9.0/test/add_bit_numbits.c0000640000175000017500000000270712614323564020264 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a BIT field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_bit(D, "new", "input", 1, 0, 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/put_bad_code.c0000640000175000017500000000323312614323564017540 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write a non-existant field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "#\n"; unsigned char c = 0; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED); n = gd_putdata(D, "no-such-field", 5, 0, 1, 0, GD_UINT8, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 0); CHECKI(error,GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/madd_mplex.c0000640000175000017500000000324612614323564017246 0ustar alastairalastair/* Copyright (C) 2012-2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_mplex(D, "new", "in", "count", 3, 4, 0); gd_madd_mplex(D, "new", "meta", "in", "count", 5, 6); error = gd_error(D); /* check */ gd_entry(D, "new/meta", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_MPLEX_ENTRY); CHECKS(e.in_fields[0], "in"); CHECKS(e.in_fields[1], "count"); CHECKI(e.fragment_index, 0); CHECKI(e.EN(mplex,count_val), 5); CHECKI(e.EN(mplex,period), 6); gd_free_entry_strings(&e); } gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/gzip_del.c0000640000175000017500000000435212614323564016730 0ustar alastairalastair/* Copyright (C) 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" /* this tests discarding OOP-writable (also temporary) RAW files */ int main(void) { #if !(defined TEST_GZIP) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.gz"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; int fd, i, n, e1, e2, e3, unlink_data, ret, r = 0; int rmdir_filedir; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #if defined USE_GZIP D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); #if defined USE_GZIP CHECKI(n, 8); CHECKI(e1, GD_E_OK); #else CHECKI(n, 0); CHECKI(e1, GD_E_UNSUPPORTED); #endif ret = gd_delete(D, "data", GD_DEL_DATA); e2 = gd_error(D); #if defined USE_GZIP CHECKI(ret, 0); CHECKI(e2, GD_E_OK); #else CHECKI(ret, -1); CHECKI(e2, GD_E_UNSUPPORTED); #endif e3 = gd_close(D); CHECKI(e3, 0); unlink_data = unlink(data); unlink(format); rmdir_filedir = rmdir(filedir); CHECKI(unlink_data, -1); CHECKI(rmdir_filedir, 0); return r; #endif } libgetdata-0.9.0/test/native_phase.c0000640000175000017500000000276412614323564017606 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "phase PHASE data 1\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "phase"); error = gd_error(D); CHECKU(type, GD_UINT8); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/entry_raw_scalar_type.c0000640000175000017500000000320512614323564021527 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const STRING 8\ndata RAW UINT8 const\n"; int fd, n, error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); n = gd_entry(D, "data", &E); error = gd_error(D); CHECKI(error, 0); CHECKI(E.flags, 0); CHECKI(n, 0); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/version_4_write.c0000640000175000017500000000400212614323564020245 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/RAW"; const char *format_data = "ENDIAN RAW c 8\nINCLUDE RAW\n"; const char *format_data1 = "VERSION PHASE ENDIAN 1\na&b RAW c 8\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data1, strlen(format_data1)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 4); q = gd_rewrite_fragment(D, GD_ALL_FRAGMENTS); CHECKI(e,4); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_EARLIEST); CHECKI(c,4); gd_discard(D); unlink(format); unlink(format1); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_int32_int8.c0000640000175000017500000000375712614323564020604 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT32 as INT8 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\n"; int32_t data_data[256]; int8_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/zzip_seek_far.c0000640000175000017500000000377412614323564017775 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_ZZIP || !defined USE_ZZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *rawzip = "dirfile/raw.zip"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); chdir(filedir); snprintf(command, 4096, "%s raw data > /dev/null", ZIP); if (gd_system(command)) return 1; chdir(".."); unlink(data); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 500, 0, GD_SEEK_SET); CHECKI(n, 256); error = gd_error(D); CHECKI(error, 0); gd_discard(D); unlink(rawzip); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/endian_alter.c0000640000175000017500000000457412614323564017566 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test endianness */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 8\nENDIAN little\n"; uint16_t data_data[128]; uint16_t c[8], d; int fd, ret, error, n, i = 0, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 128; ++fd) data_data[fd] = 0x201 * fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_endianness(D, GD_BIG_ENDIAN, 0, 0); error = gd_error(D); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT16, c); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKX(d, i * 0x201); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); #ifdef WORDS_BIGENDIAN # define FACTOR 0x201 #else # define FACTOR 0x102 #endif for (i = 0; i < 8; ++i) CHECKXi(i,c[i], (40 + i) * FACTOR); CHECKI(error,0); CHECKI(ret, 0); CHECKI(n, 8); return r; } libgetdata-0.9.0/test/parse_endian_big.c0000640000175000017500000000303212614323564020376 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "ENDIAN big\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/get_const_carray.c0000640000175000017500000000311612614323564020456 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY FLOAT64 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n"; double c; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_get_constant(D, "carray", GD_FLOAT64, &c); error = gd_error(D); CHECKI(error, 0); CHECKI(n, 0); CHECKF(c, 8.3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/add_invalid.c0000640000175000017500000000244212614323564017367 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; gd_entry_t E; E.field = "data"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add(D, &E); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/add_dot6.c0000640000175000017500000000306312614323564016615 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); memset(&E, 0, sizeof(E)); E.field = "dat.a"; E.field_type = GD_PHASE_ENTRY; E.in_fields[0] = "INDEX"; E.EN(phase,shift) = 0; E.scalar[0] = NULL; D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_dirfile_standards(D, 6); gd_add(D, &E); error = gd_error(D); CHECKI(error, GD_E_BAD_CODE); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_entry_recode_recalc.c0000640000175000017500000000453712614323564022322 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 a\n" "a CONST UINT8 8\n" "b CONST UINT8 11\n"; unsigned char data_data[256]; uint16_t d; int fd, i, ret, error, r = 0; off_t n; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); memset(&E, 0, sizeof(E)); E.field_type = GD_RAW_ENTRY; E.EN(raw,data_type) = GD_UINT16; E.EN(raw,spf) = 0; E.scalar[0] = "b"; ret = gd_alter_entry(D, "data", &E, 1); error = gd_error(D); n = gd_nframes(D); CHECKI(error, 0); CHECKI(n, 32); CHECKI(ret, 0); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; if (fd >= 0) { while (read(fd, &d, sizeof(uint16_t))) { CHECKXi(i, d, i * 8 / 11); i++; } close(fd); } else { perror("open"); r = 1; } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_float32_uint64.c0000640000175000017500000000377312614323564021364 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read FLOAT32 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT32 8\n"; float data_data[256]; uint64_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (float)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(float)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/add_spec_directive.c0000640000175000017500000000305312614323564020730 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a RAW field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/INCLUDE"; int error, n, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_dirfile_standards(D, 7); gd_add_spec(D, "INCLUDE RAW UINT8 2", 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); if (!unlink(data)) r = 1; unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/fragment_affix_alter_code.c0000640000175000017500000000324712614323564022276 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "INCLUDE format1 A Z\n"; const char *format1_data = "data RAW INT16 11\n"; int fd, ret, e1, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_alter_affixes(D, 1, NULL, ".txt"); e1 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(ret,-1); CHECKI(e1,GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/put_complex128.c0000640000175000017500000000526212614323564017726 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double c[8][2], d[2]; const double zero[] = {0, 0}; #else double complex c[8], d; const double complex zero = 0; #endif int fd, i, n, e1, e2, r = 0; struct stat buf; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) { #ifdef GD_NO_C99_API c[i][0] = 40 + i; c[i][1] = i; #else c[i] = 40 + i * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); e1 = gd_error(D); CHECKI(e1, 0); CHECKI(n,8); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } CHECKI(buf.st_size, 48 * 2 * sizeof(double)); fd = open(data, O_RDONLY | O_BINARY); if (fd < 0) { perror("open"); r = 1; } else { i = 0; #ifdef GD_NO_C99_API while (read(fd, d, 2 * sizeof(double))) #else while (read(fd, &d, sizeof(double complex))) #endif { if (i < 40 || i > 48) { CHECKCi(i,d,zero); } else { #ifdef GD_NO_C99_API double v[] = {i, i - 40}; #else double complex v = i + _Complex_I * (i - 40); #endif CHECKCi(i,d,v); } i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/native_recip_cmpscal.c0000640000175000017500000000277312614323564021312 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "recip RECIP data 1;1\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "recip"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/ascii_get_complex.c0000640000175000017500000000365212614323564020613 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.txt"; const char *format_data = "data RAW COMPLEX128 8\n"; double c[16]; int fd, i, n, error, r = 0; DIRFILE *D; FILE* stream; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); stream = fopen(data, "w"); for (i = 0; i < 256; ++i) fprintf(stream, "%i;%g\n", i, 0.1 * i); fclose(stream); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_COMPLEX128, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 16; ++i) CHECKFi(i,c[i], (i % 2) ? 0.1 * (40 + (i /2)) : 40 + (i / 2)); return r; } libgetdata-0.9.0/test/spf_lincom.c0000640000175000017500000000324012614323564017257 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* The SPF of a lincom should equal the SPF of the first field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "in1 RAW UINT8 11\n" "in2 RAW UINT8 13\n" "lincom LINCOM 2 in1 1 0 in2 1 0\n"; int fd, r = 0; unsigned int spf; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); spf = gd_spf(D, "lincom"); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(spf,11); return r; } libgetdata-0.9.0/test/flush_ref.c0000640000175000017500000000417012614323564017106 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *subdir = "dirfile/sub"; const char *format = "dirfile/format"; const char *format1 = "dirfile/sub/format"; const char *format_data = "data RAW UINT8 1\nREFERENCE data\n"; const char *format1_data = "mata RAW UINT8 11\nREFERENCE mata\n"; int fd, e1, e2, r = 0; const char *r1; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); mkdir(subdir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); gd_include_affix(D, "sub/format", 0, "prefix_", NULL, GD_IGNORE_REFS); gd_rewrite_fragment(D, GD_ALL_FRAGMENTS); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(subdir, GD_RDONLY | GD_VERBOSE); r1 = gd_reference(D, NULL); CHECKS(r1, "mata"); e1 = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(e1, 0); return r; } libgetdata-0.9.0/test/parse_version_98.c0000640000175000017500000000334412614323564020332 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test version leakage */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *data = "dirfile/ar"; const char *format_data = "/VERSION 9\n" "/INCLUDE format1\n" "r WINDOW a b EQ 1.\n"; const char *format1_data = "/VERSION 8\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(data); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/add_spec_invalid.c0000640000175000017500000000251612614323564020403 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDONLY); gd_add_spec(D, "data RAW UINT8 2", 0); error = gd_error(D); gd_discard(D); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/alter_entry_scalar1.c0000640000175000017500000000357612614323564021100 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data BIT in 3 3\n"; int fd, ret, error, n, r = 0; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); memset(&E, 0, sizeof(E)); E.field_type = GD_BIT_ENTRY; E.EN(bit,bitnum) = 4; E.EN(bit,numbits) = 3; E.in_fields[0] = "in"; E.scalar[0] = ""; ret = gd_alter_entry(D, "data", &E, 0); error = gd_error(D); n = gd_entry(D, "data", &E); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,0); CHECKI(n,0); CHECKI(ret,0); CHECKI(E.EN(bit,bitnum), 4); CHECKP(E.scalar[0]); gd_free_entry_strings(&E); return r; } libgetdata-0.9.0/test/include_syntax.c0000640000175000017500000000344712614323564020170 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test include */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format1 = "dirfile/format1"; const char *format_data = "#\n"; const char *format1_data = "data ROW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(format1, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format1_data, strlen(format1_data)); close(fd); D = gd_open(filedir, GD_RDWR); gd_include(D, "format1", 0, 0); error = gd_error(D); gd_discard(D); unlink(format1); unlink(format); rmdir(filedir); CHECKI(error, GD_E_FORMAT); return r; } libgetdata-0.9.0/test/parse_lincom_ncols1.c0000640000175000017500000000302412614323564021060 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_FORMAT); return r; } libgetdata-0.9.0/test/del_const.c0000640000175000017500000000321512614323564017102 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to delete a field */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST UINT8 1\n" "raw RAW UINT8 data\n"; int fd, ret, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); ret = gd_delete(D, "data", 0); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_DELETE); CHECKI(ret, -1); return r; } libgetdata-0.9.0/test/bzip_put.c0000640000175000017500000000533012614323564016764 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #ifndef TEST_BZIP2 return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; #ifdef USE_BZIP2 char command[4096]; uint8_t d; #endif struct stat buf; int fd, i, n, e1, e2, stat_data, unlink_data, unlink_bz2, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); #ifdef USE_BZIP2 D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); #else D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED); #endif n = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_bz2, &buf); #ifdef USE_BZIP2 if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); #else CHECKI(stat_data, -1); #endif #ifdef USE_BZIP2 /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } #endif unlink_bz2 = unlink(data_bz2); CHECKI(unlink_bz2, -1); unlink_data = unlink(data); unlink(format); rmdir(filedir); #ifdef USE_BZIP2 CHECKI(unlink_data, 0); CHECKI(e1, GD_E_OK); CHECKI(n, 8); #else CHECKI(unlink_data, -1); CHECKI(e1, GD_E_UNSUPPORTED); CHECKI(n, 0); #endif return r; #endif } libgetdata-0.9.0/test/gzip_put_off.c0000640000175000017500000000367712614323564017637 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" uint32_t d[GD_BUFFER_SIZE]; int main(void) { #ifndef USE_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data.gz"; int i, e1, e2, r = 0; size_t n1, n2; off_t nf; DIRFILE *D; for (i = 0; i < GD_BUFFER_SIZE; ++i) d[i] = i; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_CREAT | GD_EXCL | GD_VERBOSE); gd_add_raw(D, "data", GD_UINT32, 1, 0); n1 = gd_putdata(D, "data", 0, 0, 0, GD_BUFFER_SIZE, GD_UINT32, d); CHECKU(n1, GD_BUFFER_SIZE); e1 = gd_error(D); CHECKI(e1, GD_E_OK); gd_close(D); for (i = 0; i < GD_BUFFER_SIZE; ++i) d[i] = i + 0x100000; D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); n2 = gd_putdata(D, "data", 0, GD_BUFFER_SIZE, 0, GD_BUFFER_SIZE, GD_UINT32, d); CHECKU(n2, GD_BUFFER_SIZE); e2 = gd_error(D); CHECKI(e2, GD_E_OK); nf = gd_nframes(D); CHECKU(nf, GD_BUFFER_SIZE * 2); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/nfields_invalid.c0000640000175000017500000000256012614323564020264 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nfields(D); error = gd_error(D); gd_discard(D); CHECKI(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/get_linterp_empty.c0000640000175000017500000000424212614323564020663 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *table = "dirfile/table"; const char *format_data = "linterp LINTERP data ./table\ndata RAW UINT8 1\n"; unsigned char c = 0; unsigned char data_data[64]; int fd, n1, error1, n2, error2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 64; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(table, O_CREAT | O_EXCL | O_WRONLY, 0666); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 64); close(fd); D = gd_open(filedir, GD_RDONLY); n1 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error1 = gd_error(D); n2 = gd_getdata(D, "linterp", 5, 0, 1, 0, GD_UINT8, &c); error2 = gd_error(D); gd_discard(D); unlink(data); unlink(format); unlink(table); rmdir(filedir); CHECKI(n1, 0); CHECKI(error1, GD_E_LUT); CHECKI(n2, 0); CHECKI(error2, GD_E_LUT); return r; } libgetdata-0.9.0/test/gzip_sync.c0000640000175000017500000000500412614323564017133 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { #if !defined TEST_GZIP || !defined USE_GZIP return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_gz = "dirfile/data.gz"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n, e1, e2, stat_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_GZIP_ENCODED | GD_VERBOSE); gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); n = gd_flush(D, "data"); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n, 0); e2 = gd_close(D); CHECKI(e2, 0); stat_data = stat(data_gz, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", GUNZIP, data); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink(data); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/version_7_write.c0000640000175000017500000000341512614323564020257 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/VERSION 7\nar RAW UINT8 8\nar/q SBIT ar 0 10\n"; int fd, e, e2, q, c, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); e = gd_dirfile_standards(D, 7); CHECKI(e,7); q = gd_rewrite_fragment(D, 0); CHECKI(q,0); e2 = gd_close(D); CHECKI(e2, 0); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); c = gd_dirfile_standards(D, GD_VERSION_CURRENT); CHECKI(c,7); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/nfields_type_invalid.c0000640000175000017500000000260512614323564021325 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of fields from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; unsigned int n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nfields_by_type(D, GD_RAW_ENTRY); error = gd_error(D); gd_discard(D); CHECKI(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/error_verbose.c0000640000175000017500000000370312614323564020010 0ustar alastairalastair/* Copyright (C) 2012-2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #ifdef HAVE_SYS_WAIT_H #include #endif #include #include #include #include #define DIRFILENAME "a non-existant dirfile" int main(void) { #if !defined HAVE_MKFIFO || !defined HAVE_WORKING_FORK || defined __CYGWIN__ return 77; /* skip */ #else const char *fifo = "./dirfile"; int error, r = 0, status; FILE *stream; pid_t pid; DIRFILE *D; rmdirfile(); mkfifo(fifo, 0666); /* read our standard error */ if ((pid = fork()) == 0) { char string[10000]; stream = fopen(fifo, "r"); fgets(string, 10000, stream); CHECKBOS(string, "libgetdata:"); CHECKSS(string, DIRFILENAME); return r; } /* retarget stderr */ freopen(fifo, "w", stderr); D = gd_open(DIRFILENAME, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); fputs("\n", stderr); fflush(stderr); /* restore stderr */ freopen("/dev/stderr", "w", stderr); unlink(fifo); CHECKI(error, GD_E_IO); wait(&status); if (status) r = 1; return r; #endif } libgetdata-0.9.0/test/parse_carray.c0000640000175000017500000000304612614323564017605 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "c CARRAY UINT8 1 2 3 4\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/bzip_put_pad.c0000640000175000017500000000523312614323564017612 0ustar alastairalastair/* Copyright (C) 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if ! (defined TEST_BZIP2) || ! (defined USE_BZIP2) return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data_bz2 = "dirfile/data.bz2"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT8 8\n"; uint8_t c[8]; char command[4096]; uint8_t d; struct stat buf; int fd, i, n1, n2, e1, e2, e3, stat_data, unlink_data, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = (uint8_t)(40 + i); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); n1 = gd_putdata(D, "data", 0, 0, 1, 0, GD_UINT8, c); e1 = gd_error(D); CHECKI(e1, GD_E_OK); CHECKI(n1, 8); gd_close(D); D = gd_open(filedir, GD_RDWR | GD_BZIP2_ENCODED | GD_VERBOSE); n2 = gd_putdata(D, "data", 5, 0, 1, 0, GD_UINT8, c); e2 = gd_error(D); CHECKI(e2, GD_E_OK); CHECKI(n2, 8); e3 = gd_close(D); CHECKI(e3, 0); stat_data = stat(data_bz2, &buf); if (stat_data) { perror("stat"); } CHECKI(stat_data, 0); /* uncompress */ snprintf(command, 4096, "%s -f %s > /dev/null", BUNZIP2, data_bz2); if (gd_system(command)) { r = 1; } else { fd = open(data, O_RDONLY | O_BINARY); if (fd >= 0) { i = 0; while (read(fd, &d, sizeof(uint8_t))) { if (i < 8) { CHECKIi(i, d, i + 40); } else if (i < 40 || i > 48) { CHECKIi(i, d, 0); } else CHECKIi(i, d, i); i++; } CHECKI(i, 48); close(fd); } } unlink_data = unlink(data); unlink(format); rmdir(filedir); CHECKI(unlink_data, 0); return r; #endif } libgetdata-0.9.0/test/convert_int64_uint32.c0000640000175000017500000000377612614323564021054 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT64 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT64 8\n"; int64_t data_data[256]; uint32_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + (unsigned)i); return r; } libgetdata-0.9.0/test/put_sbit.c0000640000175000017500000000424212614323564016762 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write BIT */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "bit SBIT data 2 3\ndata RAW INT8 8\n"; int8_t c[8]; int8_t d = 0xA5; int fd, i, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) c[i] = i; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); for (i = 0; i < 50; ++i) write(fd, &d, sizeof(int8_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "bit", 5, 0, 1, 0, GD_INT8, c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i >= 48) { CHECKIi(i,d,-91); } else CHECKIi(i,d,(-95 | (i - 40) << 2)); i++; } close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(n,8); CHECKI(error, 0); return r; } libgetdata-0.9.0/test/parse_hidden.c0000640000175000017500000000265512614323564017564 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 1\n/HIDDEN data\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/put_cpolynom.c0000640000175000017500000000430212614323564017656 0ustar alastairalastair/* Copyright (C) 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "polynom POLYNOM data 0;1 0.5;0.5\n" "data RAW INT8 8\n"; int8_t d; double c[16]; struct stat buf; int fd, i, n, e1, e2, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (i = 0; i < 8; ++i) { c[2 * i] = 0.5; c[2 * i + 1] = 40 + i + 0.5; } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "polynom", 5, 0, 1, 0, GD_COMPLEX128, c); e1 = gd_error(D); CHECKI(n,8); CHECKI(e1, 0); e2 = gd_close(D); CHECKI(e2, 0); if (stat(data, &buf)) { perror("stat"); r = 1; } else { CHECKI(buf.st_size, 48 * sizeof(int8_t)); fd = open(data, O_RDONLY | O_BINARY); i = 0; while (read(fd, &d, sizeof(int8_t))) { if (i < 40 || i > 48) { CHECKIi(i,d,0); } else CHECKIi(i,d,i); i++; } close(fd); } unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/svlist.c0000640000175000017500000000426212614323564016457 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 STRING valu1\n" "data2 STRING valu2\n" "data3 STRING valu3\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_strings(D); error = gd_error(D); CHECKI(error, 0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { int len = strlen(field_list[i]); CHECKIi(i,len,5); CHECKIi(i,field_list[i][0], 'v'); CHECKIi(i,field_list[i][1], 'a'); CHECKIi(i,field_list[i][2], 'l'); CHECKIi(i,field_list[i][3], 'u'); if (field_list[i][4] < '1' || field_list[i][4] > '3') { fprintf(stderr, "field_list[%i] = \"%s\"\n", i, field_list[i]); r = 1; } } CHECKI(i,3); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/lzma_xz_seek.c0000640000175000017500000000370712614323564017631 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { #if !defined TEST_LZMA || !defined USE_LZMA return 77; #else const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *xzdata = "dirfile/data.xz"; const char *format_data = "data RAW UINT16 8\n"; char command[4096]; uint16_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (unsigned char)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint16_t)); close(fd); snprintf(command, 4096, "%s -f %s > /dev/null", XZ, data); if (gd_system(command)) return 1; D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_seek(D, "data", 5, 0, GD_SEEK_SET); CHECKI(n,40); error = gd_error(D); CHECKI(error,0); gd_discard(D); unlink(xzdata); unlink(format); rmdir(filedir); return r; #endif } libgetdata-0.9.0/test/nmeta_hidden.c0000640000175000017500000000362612614323564017555 0ustar alastairalastair/* Copyright (C) 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "/HIDDEN raw1/const\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); nfields = gd_nmfields(D, "raw1"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKU(nfields, 5); return r; } libgetdata-0.9.0/test/convert_uint64_int64.c0000640000175000017500000000376612614323564021060 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read UINT64 as INT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT64 8\n"; uint64_t data_data[256]; int64_t c[8]; int fd, i, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(uint64_t)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_INT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/get_const_complex.c0000640000175000017500000000363312614323564020650 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read complex constant */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "const CONST COMPLEX128 8.3;9.2\n"; #ifdef GD_NO_C99_API double c[2]; const double v[2] = {8.3, 9.2}; #else double complex c; const double complex v = 8.3 + _Complex_I * 9.2; #endif int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); #ifdef GD_NO_C99_API n = gd_get_constant(D, "const", GD_COMPLEX128, c); #else n = gd_get_constant(D, "const", GD_COMPLEX128, &c); #endif error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKC(c, v); return r; } libgetdata-0.9.0/test/add_bit_bitnum.c0000640000175000017500000000271012614323564020073 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Add a BIT field */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int error, n, r = 0; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT); gd_add_bit(D, "new", "input", -1, 1, 0); error = gd_error(D); /* check */ n = gd_nfields(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(n, 1); CHECKI(error, GD_E_BAD_ENTRY); return r; } libgetdata-0.9.0/test/parse_protect_format.c0000640000175000017500000000303612614323564021353 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "PROTECT format\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/native_lincom_cmpscal.c0000640000175000017500000000300012614323564021451 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "lincom LINCOM data 1;1 0\n" "data RAW UINT8 11\n"; int fd, error, r = 0; DIRFILE *D; gd_type_t type; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); type = gd_native_type(D, "lincom"); error = gd_error(D); CHECKU(type, GD_COMPLEX128); CHECKI(error, 0); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/alter_lincom_input.c0000640000175000017500000000427712614323564021030 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT32 8\nphase PHASE data 1\n" "lincom LINCOM 2 data 1 0 data 1 0\n"; int32_t data_data[256]; int32_t c[8]; int fd, i, ret, error, n, r = 0; DIRFILE *D; const char *in_fields[3] = {"data", "phase", NULL}; rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int32_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256 * sizeof(int32_t)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_lincom(D, "lincom", 0, in_fields, NULL, NULL); error = gd_error(D); n = gd_getdata(D, "lincom", 5, 0, 1, 0, GD_INT32, c); gd_discard(D); for (i = 0; i < 8; ++i) CHECKIi(i,c[i], i * 2 + 81); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); CHECKI(ret, 0); return r; } libgetdata-0.9.0/test/eof_phase.c0000640000175000017500000000343712614323564017067 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW UINT16 1\nphase PHASE data 3"; int fd, error, r = 0; off_t n; const size_t len = strlen(data); DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data, len); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_eof(D, "phase"); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, (int)len / 2 - 3); return r; } libgetdata-0.9.0/test/parse_meta.c0000640000175000017500000000311612614323564017250 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent RAW UINT8 1\n" "META parent child CONST UINT8 1\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/open_eaccess.c0000640000175000017500000000313212614323564017555 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); close(open(format, O_CREAT | O_EXCL | O_WRONLY, 0000)); /* ensure filesystem honours access */ if ((fd = open(format, O_RDONLY)) >= 0 || errno != EACCES) { if (fd >= 0) close(fd); unlink(format); rmdir(filedir); return 77; } D = gd_open(filedir, GD_RDONLY); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_IO); return r; } libgetdata-0.9.0/test/nframes_invalid.c0000640000175000017500000000255112614323564020273 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Requesting the number of frames from an invalid dirfile should fail cleanly */ #include "test.h" #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; int error, r = 0; DIRFILE *D; size_t n; rmdirfile(); D = gd_open(filedir, GD_RDONLY); n = gd_nframes(D); error = gd_error(D); gd_discard(D); CHECKU(n, 0); CHECKI(error, GD_E_BAD_DIRFILE); return r; } libgetdata-0.9.0/test/add_carray.c0000640000175000017500000000362312614323564017224 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; uint8_t val[] = {3, 4, 5, 6, 7}; uint8_t data[5]; int n, error; int r = 0; gd_entry_t e; DIRFILE *D; rmdirfile(); D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_carray(D, "data", GD_UINT8, 5, GD_UINT8, &val, 0); error = gd_error(D); /* check */ gd_entry(D, "data", &e); if (gd_error(D)) r = 1; else { CHECKI(e.field_type, GD_CARRAY_ENTRY); CHECKI(e.fragment_index, 0); CHECKI(e.EN(scalar,const_type), GD_UINT8); gd_free_entry_strings(&e); } n = (int)gd_array_len(D, "data"); CHECKI(n, 5); gd_get_carray(D, "data", GD_UINT8, &data); for (n = 0; n < 5; ++n) CHECKIi(n, data[n], 3 + n); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, GD_E_OK); return r; } libgetdata-0.9.0/test/parse_foffs_slash.c0000640000175000017500000000303712614323564020621 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Parser check */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/FRAMEOFFSET 73\n"; int fd, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error,GD_E_OK); return r; } libgetdata-0.9.0/test/cvlist_meta0.c0000640000175000017500000000330612614323564017523 0ustar alastairalastair/* Copyright (C) 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "parent CONST UINT8 1\n" "META parent data4 LINTERP UINT8 1\n"; int fd, error, r = 0; uint8_t *field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = (uint8_t *)gd_mconstants(D, "parent", GD_UINT8); error = gd_error(D); CHECKI(error, 0); CHECKP(field_list); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/dfes_raw.c0000640000175000017500000000310712614323564016722 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Try to free the strings from a RAW entry */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data RAW UINT8 8\n"; int fd; DIRFILE *D; gd_entry_t E; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); gd_entry(D, "data", &E); gd_free_entry_strings(&E); gd_discard(D); unlink(format); rmdir(filedir); return 0; } libgetdata-0.9.0/test/repr_uint32.c0000640000175000017500000000424712614323564017312 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX128 as UINT32 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW COMPLEX128 8\n"; #ifdef GD_NO_C99_API double data_data[256][2]; #else double complex data_data[256]; #endif uint32_t c[8], i; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) { #ifdef GD_NO_C99_API data_data[fd][0] = data_data[fd][1] = fd; #else data_data[fd] = fd * (1 + _Complex_I); #endif } fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 512 * sizeof(double)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT32, c); error = gd_error(D); CHECKI(error,0); CHECKI(n,8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i],40 + i); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/convert_complex64_float64.c0000640000175000017500000000365212614323564022055 0ustar alastairalastair/* Copyright (C) 2009-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read COMPLEX64 as FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data CONST FLOAT64 0\n"; double c = 0; #ifdef GD_NO_C99_API float d[] = {8, 0}; #else float complex d = 8; #endif int fd, n1, n2, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR); #ifdef GD_NO_C99_API n1 = gd_put_constant(D, "data", GD_COMPLEX64, d); #else n1 = gd_put_constant(D, "data", GD_COMPLEX64, &d); #endif n2 = gd_get_constant(D, "data", GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n1, 0); CHECKI(n2, 0); CHECKF(c, 8.); return r; } libgetdata-0.9.0/test/convert_int8_uint64.c0000640000175000017500000000374612614323564020774 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to read INT8 as UINT64 */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW INT8 8\n"; uint64_t c[8], i; int8_t data_data[256]; int fd, n, error, r = 0; DIRFILE *D; memset(c, 0, 8); rmdirfile(); mkdir(filedir, 0777); for (fd = 0; fd < 256; ++fd) data_data[fd] = (int8_t)fd; fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); fd = open(data, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, data_data, 256); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_getdata(D, "data", 5, 0, 1, 0, GD_UINT64, c); error = gd_error(D); gd_discard(D); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 8); for (i = 0; i < 8; ++i) CHECKUi(i,c[i], 40 + i); return r; } libgetdata-0.9.0/test/alter_carray_type.c0000640000175000017500000000363712614323564020651 0ustar alastairalastair/* Copyright (C) 2010-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Test field modifying */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "carray CARRAY FLOAT32 8.3 7.2 6.1 5.0 3.9 2.8 1.7\n"; int fd, i, ret, error, n, r = 0; size_t z; DIRFILE *D; double d[7]; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_VERBOSE); ret = gd_alter_carray(D, "carray", GD_UINT8, 0); error = gd_error(D); z = gd_array_len(D, "carray"); n = gd_get_carray(D, "carray", GD_FLOAT64, &d); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 0); CHECKI(ret, 0); CHECKU(z, 7); for (i = 0; i < 7; ++i) CHECKFi(i, d[i], ((i > 3) ? 7. : 8.) - i); return r; } libgetdata-0.9.0/test/alias_num_alias.c0000640000175000017500000000305012614323564020246 0ustar alastairalastair/* Copyright (C) 2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "/ALIAS e f\n" "/ALIAS a b\n" "/ALIAS b d\n" "/ALIAS c d\n" "/ALIAS d f\n" "f CONST UINT8 1\n"; int fd, e, r = 0; unsigned int n; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); n = gd_naliases(D, "a"); e = gd_error(D); CHECKI(e, GD_E_OK); CHECKU(n, 6); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/put_endian_float64_little.c0000640000175000017500000000414612614323564022176 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Attempt to write little-endian FLOAT64 */ #include "test.h" #include #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *data = "dirfile/data"; const char *format_data = "data RAW FLOAT64 1\nENDIAN little\n"; unsigned int i; const double c = 1.5; unsigned char x[sizeof(double)] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x3F }; unsigned char u[sizeof(double)]; int fd, n, error, r = 0; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDWR | GD_UNENCODED | GD_VERBOSE); n = gd_putdata(D, "data", 5, 0, 1, 0, GD_FLOAT64, &c); error = gd_error(D); gd_discard(D); fd = open(data, O_RDONLY); lseek(fd, 5 * sizeof(double), SEEK_SET); read(fd, u, sizeof(double)); close(fd); unlink(data); unlink(format); rmdir(filedir); CHECKI(error, 0); CHECKI(n, 1); for (i = 0; i < sizeof(double); ++i) CHECKXi(i, u[i], x[i]); return r; } libgetdata-0.9.0/test/nmeta_parent.c0000640000175000017500000000410312614323564017602 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "raw1 RAW UINT8 1\n" "META raw1 linterp1 LINTERP raw2 table\n" "META raw1 linterp2 LINTERP raw3 table\n" "META raw1 linterp3 LINTERP raw4 table\n" "META raw1 const CONST UINT8 1\n" "META raw1 string STRING value\n" "META raw1 string2 STRING value\n" "raw2 RAW UINT8 1\n" "raw3 RAW UINT8 1\n" "raw4 RAW UINT8 1\n" "const CONST UINT8 1\n" "string STRING value\n" "string2 STRING value\n"; int fd, error, r = 0; unsigned int nfields; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY); nfields = gd_nmfields(D, "raw9"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKU(nfields, 0); CHECKI(error, GD_E_BAD_CODE); return r; } libgetdata-0.9.0/test/vlist_alias.c0000640000175000017500000000432212614323564017442 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* Retreiving the number of fields of a field should succeed cleanly */ #include "test.h" #include #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "data1 RAW UINT8 1\n" "data2 RAW UINT8 1\n" "data3 RAW UINT8 1\n" "/ALIAS alias1 data3\n" "/ALIAS alias2 data4\n" "data4 CONST UINT8 1\n"; int fd, i, error, r = 0; const char **field_list; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); field_list = gd_vector_list(D); error = gd_error(D); CHECKI(error,0); CHECKPN(field_list); for (i = 0; field_list[i]; ++i) { if (strcmp(field_list[i], "data1") == 0) continue; else if (strcmp(field_list[i], "data2") == 0) continue; else if (strcmp(field_list[i], "data3") == 0) continue; else if (strcmp(field_list[i], "alias1") == 0) continue; else if (strcmp(field_list[i], "INDEX") == 0) continue; r = 1; } CHECKI(i,5); gd_discard(D); unlink(format); rmdir(filedir); return r; } libgetdata-0.9.0/test/table.c0000640000175000017500000000356312614323564016225 0ustar alastairalastair/* Copyright (C) 2012-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "test.h" #include #include #include #include #include #include int main(void) { const char *filedir = "dirfile"; const char *format = "dirfile/format"; const char *format_data = "linterp LINTERP INDEX table\n"; int fd, error, r = 0; char *path; DIRFILE *D; rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL | O_WRONLY, 0666); write(fd, format_data, strlen(format_data)); close(fd); D = gd_open(filedir, GD_RDONLY | GD_VERBOSE); path = gd_linterp_tablename(D, "linterp"); error = gd_error(D); gd_discard(D); unlink(format); rmdir(filedir); CHECKI(error, 0); /* This only checks whether the end of the returned path is what we expect. * This should work, since we can guarantee that both "dirfile" and "data" * aren't symlinks. */ #if GD_DIRSEP == '/' CHECKEOS(path,"dirfile/table"); #else CHECKEOS(path,"dirfile\\table"); #endif free(path); return r; } libgetdata-0.9.0/Makefile.am0000640000175000017500000001470312614323564016045 0ustar alastairalastair# Copyright (C) 2008-2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign dist-xz check-news 1.13 EXTRA_DIST = ChangeLog ACLOCAL_AMFLAGS = -I m4 SUBDIRS = src . test bindings util man doc dist_doc_DATA = COPYING.DOC clean-local: if [ -e $(distdir) ]; then chmod -R u+w $(distdir); fi if [ -e idl_$(distdir) ]; then chmod -R u+w idl_$(distdir); fi if [ -e matlab_$(distdir) ]; then chmod -R u+w matlab_$(distdir); fi rm -rf *~ m4/*~ README.txt $(distdir) idl_$(distdir) matlab_$(distdir) %.sig: % gpg -abo $@ $< DISTCHECK_CONFIGURE_FLAGS = --enable-legacy-api --enable-modules \ --with-idl-dlm-dir="$$dc_install_base/idl" \ --with-perl-dir="$$dc_install_base/perl" \ --with-php-dir="$$dc_install_base/php" \ --with-python-module-dir="$$dc_install_base/python" # a locally-installed library for building and testing the IDL and matlab packages $(distdir)/_inst/lib/pkgconfig: $(distdir).tar.gz tar -zxvf $(distdir).tar.gz cd $(distdir) && \ mkdir _inst && \ ./configure --enable-legacy-api --disable-bindings --prefix=`pwd`/_inst && \ ${MAKE} && \ ${MAKE} install # matlab-only package matlabdist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig rm -rf svn_export svn export $(top_srcdir) svn_export PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ( cd svn_export && \ mkdir matlab_getdata && \ mkdir matlab_getdata/m4 && \ mkdir matlab_getdata/src && \ cp bindings/matlab/package/* matlab_getdata && \ cp -r bindings/matlab/Makefile.am bindings/matlab/gd_*.[cm] \ bindings/matlab/matlab.c bindings/matlab/gd_matlab.h bindings/matlab/test \ bindings/matlab/doc.tail bindings/matlab/Contents.m.head \ bindings/matlab/make_contents.sh.in \ matlab_getdata/src && \ cp -r bindings/make_parameters.c matlab_getdata && \ cp -r m4/matlab.m4 m4/compiler.m4 m4/version.m4 matlab_getdata/m4 && \ cp -r doc/README.matlab COPYING AUTHORS ChangeLog INSTALL NEWS \ matlab_getdata && \ ( cd matlab_getdata && \ aclocal -I m4 && \ libtoolize && \ autoconf && \ autoheader && \ automake --add-missing --force-missing && \ ./configure && \ ${MAKE} dist && \ cp matlab_${distdir}* ../.. \ ) ) rm -rf svn_export matlabdistcheck: matlab_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig if [ -e matlab_$(distdir) ]; then \ chmod -R u+w matlab_$(distdir); rm -rf matlab_$(distdir); \ fi tar -zxvf $< PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \ cd matlab_$(distdir) && ./configure && make dist && make distcheck rm -rf matlab_$(distdir) rm -rf $(distdir) # idl-only package idldist: $(DISTFILES) $(distdir)/_inst/lib/pkgconfig rm -rf svn_export svn export $(top_srcdir) svn_export PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ( cd svn_export && \ mkdir idl_getdata && \ mkdir idl_getdata/m4 && \ mkdir idl_getdata/src && \ cp bindings/idl/package/* idl_getdata && \ cp -r bindings/idl/Makefile.am bindings/idl/makedlm.sh.in \ bindings/idl/getdata.c bindings/idl/test idl_getdata/src && \ cp -r bindings/make_parameters.c idl_getdata && \ cp -r m4/idl.m4 m4/compiler.m4 m4/ax_compare_version.m4 m4/version.m4 \ idl_getdata/m4 && \ cp -r doc/README.idl COPYING AUTHORS ChangeLog INSTALL NEWS idl_getdata && \ ( cd idl_getdata && \ aclocal -I m4 && \ libtoolize && \ autoconf && \ autoheader && \ automake --add-missing --force-missing && \ ./configure && \ ${MAKE} dist && \ cp idl_${distdir}* ../.. \ ) ) rm -rf svn_export idldistcheck: idl_$(distdir).tar.gz $(distdir)/_inst/lib/pkgconfig if [ -e idl_$(distdir) ]; then \ chmod -R u+w idl_$(distdir); rm -rf idl_$(distdir); \ fi tar -zxvf $< PKG_CONFIG_PATH=`pwd`/$(distdir)/_inst/lib/pkgconfig && \ ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:`pwd`/$(distdir)/_inst/lib && \ cd idl_$(distdir) && ./configure && make dist && make distcheck rm -rf idl_$(distdir) rm -rf $(distdir) # windows source package windist: $(DISTFILES) rm -rf crlf_export cd man && $(MAKE) htmlman svn --native-eol CRLF export $(top_srcdir) crlf_export ( cd crlf_export && \ mkdir $(distdir) && \ mkdir $(distdir)/bindings && \ mkdir $(distdir)/doc && \ mkdir $(distdir)/man && \ cp ../man/*[35].html $(distdir)/man && \ cp -r bindings/cxx $(distdir)/bindings && \ cp -r cmake util src test $(distdir) && \ $(SED) cmake/CMakeLists.txt \ -e 's/-DPACKAGE_VERSION=\\".*\\"/-DPACKAGE_VERSION=\\"$(PACKAGE_VERSION)\\"/' \ > $(distdir)/cmake/CMakeLists.txt && \ cp -r doc/README.cxx doc/unclean_database_recovery.txt $(distdir)/doc && \ cp AUTHORS COPYING COPYING.DOC ChangeLog NEWS TODO $(distdir) && \ cp README.win $(distdir)/README && \ rm -f $(distdir)/*/Makefile.am $(distdir)/*/*/Makefile.am && \ zip -rq getdata_win-$(PACKAGE_VERSION).zip $(distdir) && \ cp getdata_win*.zip .. \ ) rm -rf crlf_export # coverity scan target cov-scan: rm -rf cov-int make clean ./config.status --recheck cov-build --dir cov-int make tar -zcvf getdata-cov-int-${PACKAGE_VERSION}.tgz cov-int/ # package lists PACKAGES=$(distdir).tar.gz $(distdir).tar.xz idl_$(distdir).tar.gz \ idl_$(distdir).tar.xz getdata_win-$(PACKAGE_VERSION).zip \ matlab_$(distdir).tar.gz matlab_$(distdir).tar.xz SIGS=$(addsuffix .sig,$(PACKAGES)) # release stuff README.txt: NEWS RELEASE_NOTES.in cp -f RELEASE_NOTES.in $@ head -n `grep -nm 1 '^|' NEWS | awk 'BEGIN {FS=":"} {print $$1-1}'` NEWS >> $@ dist-post: $(SIGS) dist-push: $(PACKAGES) $(SIGS) README.txt @if [ -z "${SFUSER}" ]; then echo "ERROR: SFUSER unset"; false; fi rsync -avP -e ssh $^ $(SFUSER),getdata@frs.sourceforge.net:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/ libgetdata-0.9.0/config.guess0000740000175000017500000013135512614323564016332 0ustar alastairalastair#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-11-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 1992-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 case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/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-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or1k:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /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 eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac 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: libgetdata-0.9.0/missing0000740000175000017500000001533012614323564015403 0ustar alastairalastair#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # 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 'autom4te' 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: libgetdata-0.9.0/src/0000740000175000017500000000000012614323564014571 5ustar alastairalastairlibgetdata-0.9.0/src/entry.c0000640000175000017500000005233512614323564016110 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" void _GD_FreeE(DIRFILE *restrict D, gd_entry_t *restrict entry, int priv) { int i; dtrace("%p, %p, %i", D, entry, priv); if (!entry || entry->field_type == GD_NO_ENTRY) { dreturnvoid(); return; } free(entry->field); switch(entry->field_type) { case GD_LINCOM_ENTRY: for (i = 0; i < entry->EN(lincom,n_fields); ++i) { free(entry->in_fields[i]); free(entry->scalar[i]); free(entry->scalar[i + GD_MAX_LINCOM]); } break; case GD_LINTERP_ENTRY: free(entry->in_fields[0]); free(entry->EN(linterp,table)); if (priv) { if (entry->e->u.linterp.table_dirfd > 0) _GD_ReleaseDir(D, entry->e->u.linterp.table_dirfd); free(entry->e->u.linterp.table_file); free(entry->e->u.linterp.lut); } else entry->EN(linterp,table) = NULL; break; case GD_DIVIDE_ENTRY: case GD_MULTIPLY_ENTRY: free(entry->in_fields[1]); free(entry->in_fields[0]); break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: free(entry->scalar[0]); free(entry->scalar[1]); free(entry->in_fields[0]); break; case GD_PHASE_ENTRY: case GD_RECIP_ENTRY: free(entry->scalar[0]); free(entry->in_fields[0]); break; case GD_POLYNOM_ENTRY: free(entry->in_fields[0]); for (i = 0; i <= entry->EN(polynom,poly_ord); ++i) free(entry->scalar[i]); break; case GD_STRING_ENTRY: if (priv) free(entry->e->u.string); break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: if (priv) { free(entry->e->u.scalar.client); free(entry->e->u.scalar.d); } break; case GD_RAW_ENTRY: free(entry->scalar[0]); if (priv) { free(entry->e->u.raw.filebase); free(entry->e->u.raw.file[0].name); free(entry->e->u.raw.file[1].name); } break; case GD_WINDOW_ENTRY: free(entry->scalar[0]); free(entry->in_fields[0]); free(entry->in_fields[1]); break; case GD_MPLEX_ENTRY: free(entry->scalar[0]); free(entry->scalar[1]); free(entry->in_fields[0]); free(entry->in_fields[1]); break; case GD_ALIAS_ENTRY: free(entry->in_fields[0]); break; case GD_INDEX_ENTRY: case GD_NO_ENTRY: break; } if (priv) { free(entry->e->alias_list); for (i = 0; i < GD_N_ENTRY_LISTS; ++i) free(entry->e->entry_list[i]); free(entry->e->string_value_list); free(entry->e->const_value_list); if (entry->e->carray_value_list) { for (i = 0; entry->e->carray_value_list[i].n != 0; ++i) free(entry->e->carray_value_list[i].d); free(entry->e->carray_value_list); } if (entry->e->n_meta > -1) free(entry->e->p.meta_entry); free(entry->e); free(entry); } else { entry->field = NULL; memset(entry->in_fields, 0, sizeof(char*) * GD_MAX_LINCOM); memset(entry->scalar, 0, sizeof(char*) * GD_MAX_LINCOM * 2); } dreturnvoid(); return; } gd_entry_t* gd_free_entry_strings(gd_entry_t* entry) gd_nothrow { dtrace("%p", entry); _GD_FreeE(NULL, entry, 0); dreturn("%p", entry); return entry; } static int _GD_GetScalar(DIRFILE *restrict D, gd_entry_t *restrict E, int i, gd_type_t type, void *restrict data, int err) { void *ptr = NULL; gd_entry_t* C = NULL; int repr, e = 0; char* field_code; const char* scalar = E->scalar[i]; int index = E->scalar_ind[i]; dtrace("%p, %p, %i, %i, %p, %i", D, E, i, type, data, err); if (scalar != NULL) { C = _GD_FindFieldAndRepr(D, scalar, &field_code, &repr, NULL, 0, 1); if (D->error) { dreturn("%i", 1); return 1; } if (C == NULL) { if (err) _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_CODE, E->field, 0, field_code); e = 1; } else if (C->field_type != GD_CONST_ENTRY && C->field_type != GD_CARRAY_ENTRY) { if (err) _GD_SetError(D, GD_E_BAD_SCALAR, GD_E_SCALAR_TYPE, E->field, 0, field_code); e = 1; } else { if (C->field_type == GD_CONST_ENTRY) { index = 0; E->scalar_ind[i] = -1; } else if (index < 0) { /* a CARRAY masquerading as a CONST; default to the first element */ index = E->scalar_ind[i] = 0; } if ((D->flags & GD_ACCMODE) == GD_RDWR) ptr = _GD_Realloc(D, C->e->u.scalar.client, (C->e->u.scalar.n_client + 1) * sizeof(gd_entry_t*)); _GD_DoField(D, C, repr, index, 1, type, data); if (ptr) { C->e->u.scalar.client = (gd_entry_t **)ptr; C->e->u.scalar.client[C->e->u.scalar.n_client++] = E; } } if (field_code != scalar) free(field_code); } dreturn("%i", e); return e; } /* resolve non-literal scalars */ int _GD_CalculateEntry(DIRFILE *restrict D, gd_entry_t *restrict E, int err) { int i, e = 0, cs = 0; dtrace("%p, %p, %i", D, E, err); switch(E->field_type) { case GD_RAW_ENTRY: e = _GD_GetScalar(D, E, 0, GD_UINT_TYPE, &E->EN(raw,spf), err); break; case GD_POLYNOM_ENTRY: for (i = 0; i <= E->EN(polynom,poly_ord); ++i) { if (_GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(polynom,ca)[i], err)) e = 1; else { E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]); if (!cs && cimag(E->EN(polynom,ca)[i])) cs = 1; } if (D->error) break; } break; case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) { if (_GD_GetScalar(D, E, i, GD_COMPLEX128, &E->EN(lincom,cm)[i], err)) e = 1; else { E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]); if (!cs && cimag(E->EN(lincom,cm)[i])) cs = 1; } if (_GD_GetScalar(D, E, i + GD_MAX_LINCOM, GD_COMPLEX128, &E->EN(lincom,cb)[i], err)) { e = 1; } else { E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]); if (!cs && cimag(E->EN(lincom,cb)[i])) cs = 1; } if (D->error) break; } break; case GD_RECIP_ENTRY: if (_GD_GetScalar(D, E, 0, GD_COMPLEX128, &E->EN(recip,cdividend), err)) e = 1; else { E->EN(recip,dividend) = creal(E->EN(recip,cdividend)); if (cimag(E->EN(recip,cdividend))) cs = 1; } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: e = _GD_GetScalar(D, E, 0, GD_INT_TYPE, &E->EN(bit,bitnum), err); e |= _GD_GetScalar(D, E, 1, GD_INT_TYPE, &E->EN(bit,numbits), err); break; case GD_PHASE_ENTRY: e = _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(phase,shift), err); break; case GD_WINDOW_ENTRY: switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: e = _GD_GetScalar(D, E, 0, GD_INT64, &E->EN(window,threshold.i), err); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: e = _GD_GetScalar(D, E, 0, GD_UINT64, &E->EN(window,threshold.u), err); break; default: e = _GD_GetScalar(D, E, 0, GD_FLOAT64, &E->EN(window,threshold.r), err); break; } break; case GD_MPLEX_ENTRY: e = _GD_GetScalar(D, E, 0, GD_INT_TYPE, &E->EN(mplex,count_val), err); e |= _GD_GetScalar(D, E, 1, GD_INT_TYPE, &E->EN(mplex,period), err); break; case GD_NO_ENTRY: case GD_LINTERP_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_STRING_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_INDEX_ENTRY: case GD_ALIAS_ENTRY: break; } if (!e) E->flags |= GD_EN_CALC; if (cs) E->flags |= GD_EN_COMPSCAL; else E->flags &= ~GD_EN_COMPSCAL; dreturn("%i", !e); return !e; } char* gd_raw_filename(DIRFILE* D, const char* field_code) gd_nothrow { char *filename; gd_entry_t *E; dtrace("%p, \"%s\"", D, field_code); _GD_ClearError(D); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } /* Check field */ E = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%p", NULL); return NULL; } if (E->field_type != GD_RAW_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } if (E->e->u.raw.file[0].name == NULL) { /* ensure encoding sybtype is known */ if (!_GD_Supports(D, E, GD_EF_NAME)) { dreturn("%p", NULL); return NULL; } if (E->e->u.raw.file[0].subenc == GD_ENC_UNKNOWN) { _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } else if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D, (const char*)D->fragment[E->fragment_index].enc_data, E->e->u.raw.file, E->e->u.raw.filebase, 0, 0)) { dreturn("%p", NULL); return NULL; } } filename = _GD_MakeFullPath(D, D->fragment[E->fragment_index].dirfd, E->e->u.raw.file->name, 1); dreturn("%p", filename); return filename; } int gd_entry(DIRFILE* D, const char* field_code, gd_entry_t* entry) gd_nothrow { int i; gd_entry_t *E; dtrace("%p, \"%s\", %p", D, field_code, entry); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 1); return -1; } _GD_ClearError(D); E = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } /* Calculate the entry, if necessary */ if (!(E->flags & GD_EN_CALC)) _GD_CalculateEntry(D, E, 0); /* now copy to the user supplied buffer */ memcpy(entry, E, sizeof(gd_entry_t)); entry->e = NULL; /* duplicate strings */ entry->field = strdup(E->field); switch(E->field_type) { case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) { entry->in_fields[i] = strdup(E->in_fields[i]); if (E->scalar[i]) entry->scalar[i] = strdup(E->scalar[i]); if (E->scalar[i + GD_MAX_LINCOM]) entry->scalar[i + GD_MAX_LINCOM] = strdup(E->scalar[i + GD_MAX_LINCOM]); } break; case GD_LINTERP_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); entry->EN(linterp,table) = strdup(E->EN(linterp,table)); break; case GD_POLYNOM_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); for (i = 0; i <= E->EN(polynom,poly_ord); ++i) if (E->scalar[i]) entry->scalar[i] = strdup(E->scalar[i]); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); entry->in_fields[1] = strdup(E->in_fields[1]); break; case GD_RECIP_ENTRY: case GD_PHASE_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); if (E->scalar[0]) entry->scalar[0] = strdup(E->scalar[0]); break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); if (E->scalar[0]) entry->scalar[0] = strdup(E->scalar[0]); if (E->scalar[1]) entry->scalar[1] = strdup(E->scalar[1]); break; case GD_RAW_ENTRY: if (E->scalar[0]) entry->scalar[0] = strdup(E->scalar[0]); break; case GD_WINDOW_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); entry->in_fields[1] = strdup(E->in_fields[1]); if (E->scalar[0]) entry->scalar[0] = strdup(E->scalar[0]); break; case GD_MPLEX_ENTRY: entry->in_fields[0] = strdup(E->in_fields[0]); entry->in_fields[1] = strdup(E->in_fields[1]); if (E->scalar[0]) entry->scalar[0] = strdup(E->scalar[0]); if (E->scalar[1]) entry->scalar[1] = strdup(E->scalar[1]); break; case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: break; } dreturn("%i", 0); return 0; } const char *gd_alias_target(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } if (E->field_type != GD_ALIAS_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } dreturn("\"%s\"", E->in_fields[0]); return E->in_fields[0]; } const char **gd_aliases(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; int j = 1; unsigned u, n; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } n = gd_naliases(D, field_code) + 1; if (D->error) { dreturn("%p", NULL); return NULL; } E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } E->e->alias_list = (const char**)_GD_Realloc(D, E->e->alias_list, sizeof(const char *) * n); if (D->error) { dreturn("%p", NULL); return NULL; } E->e->alias_list[0] = E->field; for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->field_type == GD_ALIAS_ENTRY && D->entry[u]->e->entry[0] == E) { E->e->alias_list[j++] = D->entry[u]->field; } /* terminate */ E->e->alias_list[j] = NULL; dreturn("%p", E->e->alias_list); return E->e->alias_list; } unsigned int gd_naliases(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; unsigned u, n = 1; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%u", 0); return 0; } E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%u", 0); return 0; } for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->field_type == GD_ALIAS_ENTRY && D->entry[u]->e->entry[0] == E) { n++; } dreturn("%u", n); return n; } gd_entype_t gd_entry_type(DIRFILE* D, const char* field_code) gd_nothrow { gd_entry_t* E; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", GD_NO_ENTRY); return GD_NO_ENTRY; } _GD_ClearError(D); E = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%i", GD_NO_ENTRY); return GD_NO_ENTRY; } dreturn("%i", E->field_type); return E->field_type; } int gd_fragment_index(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } dreturn("%i", E->fragment_index); return E->fragment_index; } int gd_hide(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } else if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL); if (D->error) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", -1); return -1; } if (!(E->flags & GD_EN_HIDDEN)) { E->flags |= GD_EN_HIDDEN; D->fragment[E->fragment_index].modified = 1; } dreturn("%i", 0); return 0; } int gd_hidden(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL); if (D->error) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } dreturn("%i", (E->flags & GD_EN_HIDDEN) ? 1 : 0); return (E->flags & GD_EN_HIDDEN) ? 1 : 0; } int gd_unhide(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } else if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL); if (D->error) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", -1); return -1; } if (E->flags & GD_EN_HIDDEN) { E->flags &= ~GD_EN_HIDDEN; D->fragment[E->fragment_index].modified = 1; } dreturn("%i", 0); return 0; } int gd_validate(DIRFILE *D, const char *field_code_in) gd_nothrow { int i, repr; gd_entry_t* E; char *field_code; dtrace("%p, \"%s\"", D, field_code_in); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("%i", -1); return -1; } if (field_code != field_code_in) free(field_code); /* calculate scalars */ if (!(E->flags & GD_EN_CALC)) _GD_CalculateEntry(D, E, 1); /* check input fields */ switch (E->field_type) { case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) _GD_BadInput(D, E, i, GD_NO_ENTRY, 1); break; case GD_DIVIDE_ENTRY: case GD_MULTIPLY_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1); /* fallthrough */ case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: _GD_BadInput(D, E, 0, GD_NO_ENTRY, 1); /* Fallthrough */ case GD_RAW_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_INDEX_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: break; } if (D->error) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } char *gd_linterp_tablename(DIRFILE *D, const char *field_code) gd_nothrow { gd_entry_t *E; char *table; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); E = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%p", NULL); return NULL; } if (E->field_type != GD_LINTERP_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } /* initialise */ if (E->e->u.linterp.table_file == NULL) if (_GD_SetTablePath(D, E, E->e)) { dreturn("%p", NULL); return NULL; } table = _GD_MakeFullPath(D, E->e->u.linterp.table_dirfd, E->e->u.linterp.table_file, 1); dreturn("%s", table); return table; } libgetdata-0.9.0/src/constant.c0000640000175000017500000001646112614323564016600 0ustar alastairalastair/* Copyright (C) 2008, 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" int gd_get_carray_slice(DIRFILE *D, const char *field_code_in, unsigned long start, size_t n, gd_type_t return_type, void *data_out) gd_nothrow { gd_entry_t *entry; char* field_code; int repr; dtrace("%p, \"%s\", %lu, %" PRNsize_t ", 0x%x, %p", D, field_code_in, start, n, return_type, data_out); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("%i", -1); return -1; } if (entry->field_type != GD_CARRAY_ENTRY && entry->field_type != GD_CONST_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); } else if (start + n > ((entry->field_type == GD_CONST_ENTRY) ? 1 : entry->EN(scalar,array_len))) { _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL); } else if (!D->error) _GD_DoField(D, entry, repr, start, n, return_type, data_out); if (field_code != field_code_in) free(field_code); if (D->error) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int gd_get_carray(DIRFILE *D, const char *field_code_in, gd_type_t return_type, void *data_out) gd_nothrow { gd_entry_t *entry; char* field_code; int repr; dtrace("%p, \"%s\", 0x%x, %p", D, field_code_in, return_type, data_out); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("%i", -1); return -1; } if (entry->field_type != GD_CARRAY_ENTRY && entry->field_type != GD_CONST_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); } else if (!D->error) _GD_DoField(D, entry, repr, 0, (entry->field_type == GD_CONST_ENTRY) ? 1 : entry->EN(scalar,array_len), return_type, data_out); if (field_code != field_code_in) free(field_code); if (D->error) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int gd_get_constant(DIRFILE* D, const char *field_code_in, gd_type_t return_type, void *data_out) gd_nothrow { return gd_get_carray_slice(D, field_code_in, 0, 1, return_type, data_out); } size_t gd_array_len(DIRFILE *D, const char *field_code_in) gd_nothrow { gd_entry_t *entry; char* field_code; int repr; size_t len = 0; dtrace("%p, \"%s\"", D, field_code_in); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } _GD_ClearError(D); entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("%i", 0); return 0; } if (entry->field_type == GD_CARRAY_ENTRY) { len = entry->EN(scalar,array_len); } else if (entry->field_type == GD_CONST_ENTRY || entry->field_type == GD_STRING_ENTRY) { len = 1; } else _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); if (field_code != field_code_in) free(field_code); dreturn("%" PRNsize_t, len); return len; } /* Deprecated alias */ size_t gd_carray_len(DIRFILE *D, const char *field_code) gd_nothrow { return gd_array_len(D, field_code); } static int _GD_PutCarraySlice(DIRFILE* D, gd_entry_t *E, unsigned long first, size_t n, gd_type_t data_type, const void *data_in) gd_nothrow { int i; dtrace("%p, %p, %lu, %" PRNsize_t ", 0x%X, %p", D, E, first, n, data_type, data_in); if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (first + n > ((E->field_type == GD_CONST_ENTRY) ? 1 : E->EN(scalar,array_len))) { _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL); } else _GD_DoFieldOut(D, E, first, n, data_type, data_in); if (D->error) { dreturn("%i", -1); return -1; } /* Flag all clients as needing recalculation */ for (i = 0; i < E->e->u.scalar.n_client; ++i) E->e->u.scalar.client[i]->flags &= ~GD_EN_CALC; /* Clear the client list */ free(E->e->u.scalar.client); E->e->u.scalar.client = NULL; E->e->u.scalar.n_client = 0; dreturn("%i", 0); return 0; } int gd_put_carray_slice(DIRFILE* D, const char *field_code, unsigned long first, size_t n, gd_type_t data_type, const void *data_in) gd_nothrow { gd_entry_t *entry; int r = -1; dtrace("%p, \"%s\", %lu, %" PRNsize_t ", 0x%X, %p", D, field_code, first, n, data_type, data_in); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (entry == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (entry->field_type != GD_CARRAY_ENTRY && entry->field_type != GD_CONST_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); } else r = _GD_PutCarraySlice(D, entry, first, n, data_type, data_in); dreturn("%i", r); return r; } int gd_put_carray(DIRFILE* D, const char *field_code, gd_type_t data_type, const void *data_in) gd_nothrow { gd_entry_t *entry; int r = -1; dtrace("%p, \"%s\", 0x%x, %p", D, field_code, data_type, data_in); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (entry == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (entry->field_type != GD_CARRAY_ENTRY && entry->field_type != GD_CONST_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); } else r = _GD_PutCarraySlice(D, entry, 0, (entry->field_type == GD_CONST_ENTRY) ? 1 : entry->EN(scalar,array_len), data_type, data_in); dreturn("%i", r); return r; } int gd_put_constant(DIRFILE* D, const char *field_code, gd_type_t data_type, const void *data_in) gd_nothrow { return gd_put_carray_slice(D, field_code, 0, 1, data_type, data_in); } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/Makefile.in0000640000175000017500000015200112614323564016637 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/gd_config.h.in $(srcdir)/getdata.h.in \ $(srcdir)/getdata.pc.in $(top_srcdir)/depcomp \ $(am__include_HEADERS_DIST) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = gd_config.h getdata.h CONFIG_CLEAN_FILES = getdata.h.in2 getdata.pc 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)$(moduledir)" \ "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) $(module_LTLIBRARIES) am__DEPENDENCIES_1 = @USE_MODULES_TRUE@@USE_SLIM_TRUE@am__DEPENDENCIES_2 = \ @USE_MODULES_TRUE@@USE_SLIM_TRUE@ libgetdataslim.la @USE_GZIP_TRUE@@USE_MODULES_TRUE@am__DEPENDENCIES_3 = \ @USE_GZIP_TRUE@@USE_MODULES_TRUE@ libgetdatagzip.la libgetdata_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_3) am__libgetdata_la_SOURCES_DIST = add.c ascii.c bzip.c close.c common.c \ compat.c constant.c debug.c del.c encoding.c endian.c entry.c \ errors.c field_list.c flac.c flimits.c flush.c fpos.c \ fragment.c getdata.c globals.c gzip.c index.c include.c \ legacy.c lzma.c mod.c move.c name.c native.c nfields.c \ nframes.c open.c parse.c protect.c putdata.c raw.c sie.c \ slim.c spf.c string.c types.c zzip.c zzslim.c getdata_legacy.h \ internal.h @USE_BZIP2_TRUE@@USE_MODULES_FALSE@am__objects_1 = bzip.lo @GETDATA_DEBUG_TRUE@am__objects_2 = debug.lo @USE_FLAC_TRUE@@USE_MODULES_FALSE@am__objects_3 = flac.lo @USE_GZIP_TRUE@@USE_MODULES_FALSE@am__objects_4 = gzip.lo @INCLUDE_LEGACY_API_TRUE@am__objects_5 = legacy.lo @USE_LZMA_TRUE@@USE_MODULES_FALSE@am__objects_6 = lzma.lo @USE_MODULES_FALSE@@USE_SLIM_TRUE@am__objects_7 = slim.lo @USE_MODULES_FALSE@@USE_ZZIP_TRUE@am__objects_8 = zzip.lo @USE_MODULES_FALSE@@USE_ZZSLIM_TRUE@am__objects_9 = zzslim.lo am__objects_10 = am_libgetdata_la_OBJECTS = add.lo ascii.lo $(am__objects_1) close.lo \ common.lo compat.lo constant.lo $(am__objects_2) del.lo \ encoding.lo endian.lo entry.lo errors.lo field_list.lo \ $(am__objects_3) flimits.lo flush.lo fpos.lo fragment.lo \ getdata.lo globals.lo $(am__objects_4) index.lo include.lo \ $(am__objects_5) $(am__objects_6) mod.lo move.lo name.lo \ native.lo nfields.lo nframes.lo open.lo parse.lo protect.lo \ putdata.lo raw.lo sie.lo $(am__objects_7) spf.lo string.lo \ types.lo $(am__objects_8) $(am__objects_9) $(am__objects_10) libgetdata_la_OBJECTS = $(am_libgetdata_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 = libgetdata_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libgetdata_la_LDFLAGS) $(LDFLAGS) -o $@ libgetdatabzip2_la_LIBADD = am_libgetdatabzip2_la_OBJECTS = libgetdatabzip2_la-bzip.lo libgetdatabzip2_la_OBJECTS = $(am_libgetdatabzip2_la_OBJECTS) libgetdatabzip2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdatabzip2_la_LDFLAGS) \ $(LDFLAGS) -o $@ @USE_BZIP2_TRUE@@USE_MODULES_TRUE@am_libgetdatabzip2_la_rpath = \ @USE_BZIP2_TRUE@@USE_MODULES_TRUE@ -rpath $(moduledir) libgetdataflac_la_LIBADD = am_libgetdataflac_la_OBJECTS = libgetdataflac_la-flac.lo libgetdataflac_la_OBJECTS = $(am_libgetdataflac_la_OBJECTS) libgetdataflac_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdataflac_la_LDFLAGS) $(LDFLAGS) \ -o $@ @USE_FLAC_TRUE@@USE_MODULES_TRUE@am_libgetdataflac_la_rpath = -rpath \ @USE_FLAC_TRUE@@USE_MODULES_TRUE@ $(moduledir) libgetdatagzip_la_LIBADD = am_libgetdatagzip_la_OBJECTS = libgetdatagzip_la-gzip.lo libgetdatagzip_la_OBJECTS = $(am_libgetdatagzip_la_OBJECTS) libgetdatagzip_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdatagzip_la_LDFLAGS) $(LDFLAGS) \ -o $@ @USE_GZIP_TRUE@@USE_MODULES_TRUE@am_libgetdatagzip_la_rpath = -rpath \ @USE_GZIP_TRUE@@USE_MODULES_TRUE@ $(moduledir) libgetdatalzma_la_LIBADD = am_libgetdatalzma_la_OBJECTS = libgetdatalzma_la-lzma.lo libgetdatalzma_la_OBJECTS = $(am_libgetdatalzma_la_OBJECTS) libgetdatalzma_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdatalzma_la_LDFLAGS) $(LDFLAGS) \ -o $@ @USE_LZMA_TRUE@@USE_MODULES_TRUE@am_libgetdatalzma_la_rpath = -rpath \ @USE_LZMA_TRUE@@USE_MODULES_TRUE@ $(moduledir) libgetdataslim_la_LIBADD = am_libgetdataslim_la_OBJECTS = libgetdataslim_la-slim.lo libgetdataslim_la_OBJECTS = $(am_libgetdataslim_la_OBJECTS) libgetdataslim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdataslim_la_LDFLAGS) $(LDFLAGS) \ -o $@ @USE_MODULES_TRUE@@USE_SLIM_TRUE@am_libgetdataslim_la_rpath = -rpath \ @USE_MODULES_TRUE@@USE_SLIM_TRUE@ $(moduledir) libgetdatazzip_la_LIBADD = am_libgetdatazzip_la_OBJECTS = libgetdatazzip_la-zzip.lo libgetdatazzip_la_OBJECTS = $(am_libgetdatazzip_la_OBJECTS) libgetdatazzip_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdatazzip_la_LDFLAGS) $(LDFLAGS) \ -o $@ @USE_MODULES_TRUE@@USE_ZZIP_TRUE@am_libgetdatazzip_la_rpath = -rpath \ @USE_MODULES_TRUE@@USE_ZZIP_TRUE@ $(moduledir) libgetdatazzslim_la_LIBADD = am_libgetdatazzslim_la_OBJECTS = libgetdatazzslim_la-zzslim.lo libgetdatazzslim_la_OBJECTS = $(am_libgetdatazzslim_la_OBJECTS) libgetdatazzslim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libgetdatazzslim_la_LDFLAGS) \ $(LDFLAGS) -o $@ @USE_MODULES_TRUE@@USE_ZZSLIM_TRUE@am_libgetdatazzslim_la_rpath = \ @USE_MODULES_TRUE@@USE_ZZSLIM_TRUE@ -rpath $(moduledir) 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 = $(libgetdata_la_SOURCES) $(libgetdatabzip2_la_SOURCES) \ $(libgetdataflac_la_SOURCES) $(libgetdatagzip_la_SOURCES) \ $(libgetdatalzma_la_SOURCES) $(libgetdataslim_la_SOURCES) \ $(libgetdatazzip_la_SOURCES) $(libgetdatazzslim_la_SOURCES) DIST_SOURCES = $(am__libgetdata_la_SOURCES_DIST) \ $(libgetdatabzip2_la_SOURCES) $(libgetdataflac_la_SOURCES) \ $(libgetdatagzip_la_SOURCES) $(libgetdatalzma_la_SOURCES) \ $(libgetdataslim_la_SOURCES) $(libgetdatazzip_la_SOURCES) \ $(libgetdatazzslim_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(pkgconfig_DATA) am__include_HEADERS_DIST = getdata_legacy.h HEADERS = $(include_HEADERS) $(nodist_include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)gd_config.h.in getdata.h.in2 # 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 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2013, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign @USE_MODULES_TRUE@@USE_SLIM_TRUE@LIBGETDATASLIM_LA = libgetdataslim.la @USE_MODULES_TRUE@@USE_SLIM_TRUE@DLOPEN_LIBGETDATASLIM_LA = -dlopen libgetdataslim.la @USE_MODULES_FALSE@@USE_SLIM_TRUE@SLIM_C = slim.c @USE_FLAC_TRUE@@USE_MODULES_TRUE@LIBGETDATAFLAC_LA = libgetdataflac.la @USE_FLAC_TRUE@@USE_MODULES_TRUE@DLOPEN_LIBGETDATAFLAC_LA = -dlopen libgetdataflac.la @USE_FLAC_TRUE@@USE_MODULES_FALSE@FLAC_C = flac.c @USE_GZIP_TRUE@@USE_MODULES_TRUE@LIBGETDATAGZIP_LA = libgetdatagzip.la @USE_GZIP_TRUE@@USE_MODULES_TRUE@DLOPEN_LIBGETDATAGZIP_LA = -dlopen libgetdatagzip.la @USE_GZIP_TRUE@@USE_MODULES_FALSE@GZIP_C = gzip.c @USE_BZIP2_TRUE@@USE_MODULES_TRUE@LIBGETDATABZIP2_LA = libgetdatabzip2.la @USE_BZIP2_TRUE@@USE_MODULES_TRUE@DLOPEN_LIBGETDATABZIP2_LA = -dlopen libgetdatabzip2.la @USE_BZIP2_TRUE@@USE_MODULES_FALSE@BZIP2_C = bzip.c @USE_LZMA_TRUE@@USE_MODULES_TRUE@LIBGETDATALZMA_LA = libgetdatalzma.la @USE_LZMA_TRUE@@USE_MODULES_TRUE@DLOPEN_LIBGETDATALZMA_LA = -dlopen libgetdatalzma.la @USE_LZMA_TRUE@@USE_MODULES_FALSE@LZMA_C = lzma.c @USE_MODULES_TRUE@@USE_ZZIP_TRUE@LIBGETDATAZZIP_LA = libgetdatazzip.la @USE_MODULES_TRUE@@USE_ZZIP_TRUE@DLOPEN_LIBGETDATAZZIP_LA = -dlopen libgetdatazzip.la @USE_MODULES_FALSE@@USE_ZZIP_TRUE@ZZIP_C = zzip.c @USE_MODULES_TRUE@@USE_ZZSLIM_TRUE@LIBGETDATAZZSLIM_LA = libgetdatazzslim.la @USE_MODULES_TRUE@@USE_ZZSLIM_TRUE@DLOPEN_LIBGETDATAZZSLIM_LA = -dlopen libgetdatazzslim.la @USE_MODULES_FALSE@@USE_ZZSLIM_TRUE@ZZSLIM_C = zzslim.c @USE_MODULES_TRUE@EXPORT_DYNAMIC = -export-dynamic @USE_MODULES_TRUE@DGETDATA_MODULEDIR = -DGETDATA_MODULEDIR="\"$(moduledir)\"" @USE_MODULES_FALSE@EXTERNAL_CPPFLAGS = $(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \ @USE_MODULES_FALSE@ $(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS) $(FLAC_CPPFLAGS) @USE_MODULES_FALSE@EXTERNAL_LDFLAGS = $(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \ @USE_MODULES_FALSE@ $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS) $(FLAC_LDFLAGS) @USE_MODULES_FALSE@EXTERNAL_LIBS = $(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) \ @USE_MODULES_FALSE@ $(ZZIP_LIBS) $(FLAC_LIBS) @INCLUDE_LEGACY_API_TRUE@LEGACY_C = legacy.c @INCLUDE_LEGACY_API_TRUE@GETDATA_LEGACY_H = getdata_legacy.h @GETDATA_DEBUG_TRUE@DEBUG_C = debug.c pkgconfigdir = @libdir@/pkgconfig AM_CFLAGS = ${GD_CC_WALL} ${GD_CC_WEXTRA} $(DGETDATA_MODULEDIR) AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS) BUILT_SOURCES = getdata.h nodist_include_HEADERS = getdata.h include_HEADERS = ${GETDATA_LEGACY_H} pkgconfig_DATA = getdata.pc lib_LTLIBRARIES = libgetdata.la module_LTLIBRARIES = ${LIBGETDATABZIP2_LA} ${LIBGETDATAFLAC_LA} \ ${LIBGETDATAGZIP_LA} ${LIBGETDATALZMA_LA} \ ${LIBGETDATASLIM_LA} ${LIBGETDATAZZIP_LA} \ ${LIBGETDATAZZSLIM_LA} libgetdata_la_SOURCES = add.c ascii.c ${BZIP2_C} close.c common.c compat.c \ constant.c ${DEBUG_C} del.c encoding.c endian.c \ entry.c errors.c field_list.c ${FLAC_C} flimits.c \ flush.c fpos.c fragment.c getdata.c globals.c \ ${GZIP_C} index.c include.c ${LEGACY_C} ${LZMA_C} \ mod.c move.c name.c native.c nfields.c nframes.c \ open.c parse.c protect.c putdata.c raw.c sie.c \ ${SLIM_C} spf.c string.c types.c ${ZZIP_C} ${ZZSLIM_C} \ ${GETDATA_LEGACY_H} internal.h libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \ -version-info \ ${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \ $(EXTERNAL_LDFLAGS) $(EXTERNAL_LIBS) libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \ $(DLOPEN_LIBGETDATAGZIP_LA) libgetdataslim_la_SOURCES = slim.c libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(SLIM_LIBS) libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS) libgetdataflac_la_SOURCES = flac.c libgetdataflac_la_LDFLAGS = $(FLAC_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(FLAC_LIBS) libgetdataflac_la_CPPFLAGS = $(AM_CPPFLAGS) $(FLAC_CPPFLAGS) libgetdatagzip_la_SOURCES = gzip.c libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(GZIP_LIBS) libgetdatagzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(GZIP_CPPFLAGS) libgetdatabzip2_la_SOURCES = bzip.c libgetdatabzip2_la_LDFLAGS = $(BZIP2_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(BZIP2_LIBS) libgetdatabzip2_la_CPPFLAGS = $(AM_CPPFLAGS) $(BZIP2_CPPFLAGS) libgetdatalzma_la_SOURCES = lzma.c libgetdatalzma_la_LDFLAGS = $(LZMA_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(LZMA_LIBS) libgetdatalzma_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZMA_CPPFLAGS) libgetdatazzip_la_SOURCES = zzip.c libgetdatazzip_la_LDFLAGS = $(ZZIP_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(ZZIP_LIBS) libgetdatazzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZZIP_CPPFLAGS) libgetdatazzslim_la_SOURCES = zzslim.c libgetdatazzslim_la_LDFLAGS = $(SLIM_LDFLAGS) $(ZZIP_LDFLAGS) \ -release $(PACKAGE_VERSION) -module \ $(SLIM_LIBS) $(ZZIP_LIBS) libgetdatazzslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS) $(ZZIP_CPPFLAGS) all: $(BUILT_SOURCES) gd_config.h getdata.h $(MAKE) $(AM_MAKEFLAGS) 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 src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign 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: $(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): gd_config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/gd_config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/gd_config.h $(srcdir)/gd_config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ getdata.h: stamp-h2 @test -f $@ || rm -f stamp-h2 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h2 stamp-h2: getdata.h.in2 $(top_builddir)/config.status @rm -f stamp-h2 cd $(top_builddir) && $(SHELL) ./config.status src/getdata.h distclean-hdr: -rm -f gd_config.h stamp-h1 getdata.h stamp-h2 getdata.h.in2: $(top_builddir)/config.status $(srcdir)/getdata.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ getdata.pc: $(top_builddir)/config.status $(srcdir)/getdata.pc.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ 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}; \ } install-moduleLTLIBRARIES: $(module_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || 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)$(moduledir)'"; \ $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ } uninstall-moduleLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ done clean-moduleLTLIBRARIES: -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) @list='$(module_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}; \ } libgetdata.la: $(libgetdata_la_OBJECTS) $(libgetdata_la_DEPENDENCIES) $(EXTRA_libgetdata_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdata_la_LINK) -rpath $(libdir) $(libgetdata_la_OBJECTS) $(libgetdata_la_LIBADD) $(LIBS) libgetdatabzip2.la: $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_DEPENDENCIES) $(EXTRA_libgetdatabzip2_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdatabzip2_la_LINK) $(am_libgetdatabzip2_la_rpath) $(libgetdatabzip2_la_OBJECTS) $(libgetdatabzip2_la_LIBADD) $(LIBS) libgetdataflac.la: $(libgetdataflac_la_OBJECTS) $(libgetdataflac_la_DEPENDENCIES) $(EXTRA_libgetdataflac_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdataflac_la_LINK) $(am_libgetdataflac_la_rpath) $(libgetdataflac_la_OBJECTS) $(libgetdataflac_la_LIBADD) $(LIBS) libgetdatagzip.la: $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_DEPENDENCIES) $(EXTRA_libgetdatagzip_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdatagzip_la_LINK) $(am_libgetdatagzip_la_rpath) $(libgetdatagzip_la_OBJECTS) $(libgetdatagzip_la_LIBADD) $(LIBS) libgetdatalzma.la: $(libgetdatalzma_la_OBJECTS) $(libgetdatalzma_la_DEPENDENCIES) $(EXTRA_libgetdatalzma_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdatalzma_la_LINK) $(am_libgetdatalzma_la_rpath) $(libgetdatalzma_la_OBJECTS) $(libgetdatalzma_la_LIBADD) $(LIBS) libgetdataslim.la: $(libgetdataslim_la_OBJECTS) $(libgetdataslim_la_DEPENDENCIES) $(EXTRA_libgetdataslim_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdataslim_la_LINK) $(am_libgetdataslim_la_rpath) $(libgetdataslim_la_OBJECTS) $(libgetdataslim_la_LIBADD) $(LIBS) libgetdatazzip.la: $(libgetdatazzip_la_OBJECTS) $(libgetdatazzip_la_DEPENDENCIES) $(EXTRA_libgetdatazzip_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdatazzip_la_LINK) $(am_libgetdatazzip_la_rpath) $(libgetdatazzip_la_OBJECTS) $(libgetdatazzip_la_LIBADD) $(LIBS) libgetdatazzslim.la: $(libgetdatazzslim_la_OBJECTS) $(libgetdatazzslim_la_DEPENDENCIES) $(EXTRA_libgetdatazzslim_la_DEPENDENCIES) $(AM_V_CCLD)$(libgetdatazzslim_la_LINK) $(am_libgetdatazzslim_la_rpath) $(libgetdatazzslim_la_OBJECTS) $(libgetdatazzslim_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ascii.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/compat.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/constant.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/del.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encoding.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/endian.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/entry.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/errors.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/field_list.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flimits.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpos.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fragment.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/include.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/legacy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdatabzip2_la-bzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdataflac_la-flac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdatagzip_la-gzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdatalzma_la-lzma.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdataslim_la-slim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdatazzip_la-zzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgetdatazzslim_la-zzslim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzma.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/name.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/native.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfields.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nframes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putdata.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sie.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/types.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzip.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zzslim.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 -o $@ $< .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 -o $@ `$(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 $@ $< libgetdatabzip2_la-bzip.lo: bzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatabzip2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatabzip2_la-bzip.lo -MD -MP -MF $(DEPDIR)/libgetdatabzip2_la-bzip.Tpo -c -o libgetdatabzip2_la-bzip.lo `test -f 'bzip.c' || echo '$(srcdir)/'`bzip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatabzip2_la-bzip.Tpo $(DEPDIR)/libgetdatabzip2_la-bzip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bzip.c' object='libgetdatabzip2_la-bzip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatabzip2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatabzip2_la-bzip.lo `test -f 'bzip.c' || echo '$(srcdir)/'`bzip.c libgetdataflac_la-flac.lo: flac.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataflac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdataflac_la-flac.lo -MD -MP -MF $(DEPDIR)/libgetdataflac_la-flac.Tpo -c -o libgetdataflac_la-flac.lo `test -f 'flac.c' || echo '$(srcdir)/'`flac.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdataflac_la-flac.Tpo $(DEPDIR)/libgetdataflac_la-flac.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='flac.c' object='libgetdataflac_la-flac.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataflac_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdataflac_la-flac.lo `test -f 'flac.c' || echo '$(srcdir)/'`flac.c libgetdatagzip_la-gzip.lo: gzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatagzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatagzip_la-gzip.lo -MD -MP -MF $(DEPDIR)/libgetdatagzip_la-gzip.Tpo -c -o libgetdatagzip_la-gzip.lo `test -f 'gzip.c' || echo '$(srcdir)/'`gzip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatagzip_la-gzip.Tpo $(DEPDIR)/libgetdatagzip_la-gzip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='gzip.c' object='libgetdatagzip_la-gzip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatagzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatagzip_la-gzip.lo `test -f 'gzip.c' || echo '$(srcdir)/'`gzip.c libgetdatalzma_la-lzma.lo: lzma.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatalzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatalzma_la-lzma.lo -MD -MP -MF $(DEPDIR)/libgetdatalzma_la-lzma.Tpo -c -o libgetdatalzma_la-lzma.lo `test -f 'lzma.c' || echo '$(srcdir)/'`lzma.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatalzma_la-lzma.Tpo $(DEPDIR)/libgetdatalzma_la-lzma.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lzma.c' object='libgetdatalzma_la-lzma.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatalzma_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatalzma_la-lzma.lo `test -f 'lzma.c' || echo '$(srcdir)/'`lzma.c libgetdataslim_la-slim.lo: slim.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdataslim_la-slim.lo -MD -MP -MF $(DEPDIR)/libgetdataslim_la-slim.Tpo -c -o libgetdataslim_la-slim.lo `test -f 'slim.c' || echo '$(srcdir)/'`slim.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdataslim_la-slim.Tpo $(DEPDIR)/libgetdataslim_la-slim.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='slim.c' object='libgetdataslim_la-slim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdataslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdataslim_la-slim.lo `test -f 'slim.c' || echo '$(srcdir)/'`slim.c libgetdatazzip_la-zzip.lo: zzip.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatazzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatazzip_la-zzip.lo -MD -MP -MF $(DEPDIR)/libgetdatazzip_la-zzip.Tpo -c -o libgetdatazzip_la-zzip.lo `test -f 'zzip.c' || echo '$(srcdir)/'`zzip.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatazzip_la-zzip.Tpo $(DEPDIR)/libgetdatazzip_la-zzip.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zzip.c' object='libgetdatazzip_la-zzip.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatazzip_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatazzip_la-zzip.lo `test -f 'zzip.c' || echo '$(srcdir)/'`zzip.c libgetdatazzslim_la-zzslim.lo: zzslim.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatazzslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libgetdatazzslim_la-zzslim.lo -MD -MP -MF $(DEPDIR)/libgetdatazzslim_la-zzslim.Tpo -c -o libgetdatazzslim_la-zzslim.lo `test -f 'zzslim.c' || echo '$(srcdir)/'`zzslim.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libgetdatazzslim_la-zzslim.Tpo $(DEPDIR)/libgetdatazzslim_la-zzslim.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='zzslim.c' object='libgetdatazzslim_la-zzslim.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libgetdatazzslim_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libgetdatazzslim_la-zzslim.lo `test -f 'zzslim.c' || echo '$(srcdir)/'`zzslim.c mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs 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) 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) install-nodist_includeHEADERS: $(nodist_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_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-nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_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" 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 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: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(DATA) $(HEADERS) gd_config.h \ getdata.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) @INCLUDE_LEGACY_API_FALSE@install-data-hook: @INCLUDE_LEGACY_API_FALSE@uninstall-hook: clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool clean-local \ clean-moduleLTLIBRARIES 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-includeHEADERS install-moduleLTLIBRARIES \ install-nodist_includeHEADERS install-pkgconfigDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook 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-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-moduleLTLIBRARIES uninstall-nodist_includeHEADERS \ uninstall-pkgconfigDATA @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook .MAKE: all check install install-am install-data-am install-strip \ uninstall-am .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-local \ clean-moduleLTLIBRARIES cscopelist-am ctags ctags-am 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-data-hook 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-moduleLTLIBRARIES \ install-nodist_includeHEADERS install-pdf install-pdf-am \ install-pkgconfigDATA 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-hook \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-moduleLTLIBRARIES uninstall-nodist_includeHEADERS \ uninstall-pkgconfigDATA @INCLUDE_LEGACY_API_TRUE@install-data-hook: @INCLUDE_LEGACY_API_TRUE@ cd $(DESTDIR)$(includedir) && \ @INCLUDE_LEGACY_API_TRUE@ $(LN_S) -f getdata.h getdata_struct.h @INCLUDE_LEGACY_API_TRUE@uninstall-hook: @INCLUDE_LEGACY_API_TRUE@ cd $(DESTDIR)$(includedir) && rm -rf getdata_struct.h $(DLOPEN_LIBGETDATABZIP2_LA) \ $(DLOPEN_LIBGETDATALZMA_LA) $(DLOPEN_LIBGETDATAZZIP_LA) \ $(DLOPEN_LIBGETDATAZZSLIM_LA) $(DLOPEN_LIBGETDATAFLAC_LA) clean-local: rm -rf *~ getdata.pc # 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: libgetdata-0.9.0/src/gd_config.h.in0000640000175000017500000004777012614323564017307 0ustar alastairalastair/* src/gd_config.h.in. Generated from configure.ac by autoheader. */ /* Define if building universal (internal helper macro) */ #undef AC_APPLE_UNIVERSAL_BUILD /* Define to 1 if your processor stores double-precision floats in the old ARM middle-endian format */ #undef ARM_ENDIAN_DOUBLES /* Define to the full path to the `bunzip2' binary */ #undef BUNZIP2 /* Define to the full path to the `bzip2' binary */ #undef BZIP2 /* Define to 1 if your C++ compiler doesn't accept -c and -o together. */ #undef CXX_NO_MINUS_C_MINUS_O /* Define to dummy `main' function (if any) required to link to the Fortran libraries. */ #undef F77_DUMMY_MAIN /* Define to a macro mangling the given C identifier (in lower and upper case), which must not contain underscores, for linking with Fortran. */ #undef F77_FUNC /* As F77_FUNC, but for C identifiers containing underscores. */ #undef F77_FUNC_ /* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */ #undef F77_NO_MINUS_C_MINUS_O /* Define if F77 and FC dummy `main' functions are identical. */ #undef FC_DUMMY_MAIN_EQ_F77 /* Define to 1 if your Fortran compiler doesn't accept -c and -o together. */ #undef FC_NO_MINUS_C_MINUS_O /* Define to the full path to the `flac' binary */ #undef FLAC /* Define to 1 if your processor stores double-precision floats in big-endian order */ #undef FLOATS_BIGENDIAN /* The directory separator between path elements */ #undef GD_DIRSEP /* Define to 1 if restrict can used on pointer arrays */ #undef GD_RESTRICT_ARRAY_OK /* Define to enable debugging messages */ #undef GETDATA_DEBUG /* The major version number */ #undef GETDATA_MAJOR /* The minor version number */ #undef GETDATA_MINOR /* The revision number */ #undef GETDATA_REVISION /* Other qualifiers on the version number triplet (if any) */ #undef GETDATA_VERSION_SUFFIX /* Define to the full path to the `gunzip' binary */ #undef GUNZIP /* Define to the full path to the `gzip' binary */ #undef GZIP /* Define to 1 if you have the header file. */ #undef HAVE_ASM_UNALIGNED_H /* Define to 1 if you have the header file. */ #undef HAVE_AVAILABILITY_H /* Define to 1 if you have the `basename' function. */ #undef HAVE_BASENAME /* Define to 1 if you have the header file. */ #undef HAVE_BYTESWAP_H /* Define to 1 if you have the header file. */ #undef HAVE_BZLIB_H /* Define to 1 if you have the `cabs' function. */ #undef HAVE_CABS /* Define to 1 if you have the header file. */ #undef HAVE_COMPLEX_H /* Define to 1 if you have the declaration of `bswap16', and to 0 if you don't. */ #undef HAVE_DECL_BSWAP16 /* Define to 1 if you have the declaration of `bswap_16', and to 0 if you don't. */ #undef HAVE_DECL_BSWAP_16 /* Define to 1 if you have the declaration of `get_unaligned', and to 0 if you don't. */ #undef HAVE_DECL_GET_UNALIGNED /* Define to 1 if you have the declaration of `isfinite', and to 0 if you don't. */ #undef HAVE_DECL_ISFINITE /* Define to 1 if you have the declaration of `OSSwapInt16', and to 0 if you don't. */ #undef HAVE_DECL_OSSWAPINT16 /* Define to 1 if you have the declaration of `put_unaligned', and to 0 if you don't. */ #undef HAVE_DECL_PUT_UNALIGNED /* Define to 1 if you have the declaration of `strerror_r', and to 0 if you don't. */ #undef HAVE_DECL_STRERROR_R /* Define to 1 if you have the declaration of `_strtoi64', and to 0 if you don't. */ #undef HAVE_DECL__STRTOI64 /* Define to 1 if you have the declaration of `_strtoui64', and to 0 if you don't. */ #undef HAVE_DECL__STRTOUI64 /* Define to 1 if you have the header file. */ #undef HAVE_DIRECT_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the `fchmod' function. */ #undef HAVE_FCHMOD /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `fdopendir' function. */ #undef HAVE_FDOPENDIR /* Define to 1 if you have the header file. */ #undef HAVE_FLAC_ALL_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `fpathconf' function. */ #undef HAVE_FPATHCONF /* Define to 1 if you have the `fseeko' function. */ #undef HAVE_FSEEKO /* Define to 1 if you have the `fseeko64' function. */ #undef HAVE_FSEEKO64 /* Define to 1 if you have the `fstat64' function. */ #undef HAVE_FSTAT64 /* Define to 1 if you have the `fstatat' function. */ #undef HAVE_FSTATAT /* Define to 1 if you have the `fstatat64' function. */ #undef HAVE_FSTATAT64 /* Define to 1 if you have the `fsync' function. */ #undef HAVE_FSYNC /* Define to 1 if you have the `ftello' function. */ #undef HAVE_FTELLO /* Define to 1 if you have the `ftello64' function. */ #undef HAVE_FTELLO64 /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define to 1 if you have the `ftruncate64' function. */ #undef HAVE_FTRUNCATE64 /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getdelim' function. */ #undef HAVE_GETDELIM /* Define to 1 if you have the `gmtime_r' function. */ #undef HAVE_GMTIME_R /* Define to 1 if you have the `gzseek64' function. */ #undef HAVE_GZSEEK64 /* Define to 1 if you have the `gztell64' function. */ #undef HAVE_GZTELL64 /* Define to 1 if you have the header file. */ #undef HAVE_IDL_EXPORT_H /* 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 `isnan' function. */ #undef HAVE_ISNAN /* Define to 1 if you have the `bz2' library (-lbz2). */ #undef HAVE_LIBBZ2 /* Define to 1 if you have the `FLAC' library (-lFLAC). */ #undef HAVE_LIBFLAC /* Define to 1 if you have the header file. */ #undef HAVE_LIBGEN_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBKERN_OSBYTEORDER_H /* Define to 1 if you have the `lzma' library (-llzma). */ #undef HAVE_LIBLZMA /* Define to 1 if you have the `slim' library (-lslim). */ #undef HAVE_LIBSLIM /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ /* Define to 1 if you have the `zzip' library (-lzzip). */ #undef HAVE_LIBZZIP /* Define to 1 if you have the `lseek64' function. */ #undef HAVE_LSEEK64 /* Define to 1 if you have the `lstat' function. */ #undef HAVE_LSTAT /* Define to 1 if you have the `lstat64' function. */ #undef HAVE_LSTAT64 /* Define to 1 if you have the header file. */ #undef HAVE_LTDL_H /* Define to 1 if you have the header file. */ #undef HAVE_LZMA_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkfifo' function. */ #undef HAVE_MKFIFO /* Define to 1 if you have the `nan' function. */ #undef HAVE_NAN /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NUMPY_ARRAYOBJECT_H /* Define to 1 if the system has the type `off64_t'. */ #undef HAVE_OFF64_T /* Define to 1 if you have the `openat' function. */ #undef HAVE_OPENAT /* Define to 1 if you have the `pathconf' function. */ #undef HAVE_PATHCONF /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `readdir_r' function. */ #undef HAVE_READDIR_R /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK /* Define to 1 if you have the `renameat' function. */ #undef HAVE_RENAMEAT /* Define to 1 if you have the `setrlimit' function. */ #undef HAVE_SETRLIMIT /* Define to 1 if you have the `slimdopen' function. */ #undef HAVE_SLIMDOPEN /* Define to 1 if you have the `slimdrawsize' function. */ #undef HAVE_SLIMDRAWSIZE /* Define to 1 if you have the header file. */ #undef HAVE_SLIMLIB_H /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Define to 1 if you have the `stat64' function. */ #undef HAVE_STAT64 /* 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_STDLIB_H /* Define to 1 if you have the `strerror_r' function. */ #undef HAVE_STRERROR_R /* 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 `strtoll' function. */ #undef HAVE_STRTOLL /* Define to 1 if you have the `strtoq' function. */ #undef HAVE_STRTOQ /* Define to 1 if you have the `strtoull' function. */ #undef HAVE_STRTOULL /* Define to 1 if you have the `strtouq' function. */ #undef HAVE_STRTOUQ /* Define to 1 if the system has the type `struct stat64'. */ #undef HAVE_STRUCT_STAT64 /* Define to 1 if the system has the type `struct _stat64'. */ #undef HAVE_STRUCT__STAT64 /* Define to 1 if the system has the type `struct __stat64'. */ #undef HAVE_STRUCT___STAT64 /* Define to 1 if you have the `symlink' function. */ #undef HAVE_SYMLINK /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_ENDIAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_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 header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `unlinkat' function. */ #undef HAVE_UNLINKAT /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_ZZIP_LIB_H /* Define to 1 if you have the `_chsize' function. */ #undef HAVE__CHSIZE /* Define to 1 if you have the `_chsize_s' function. */ #undef HAVE__CHSIZE_S /* Define to 1 if you have the `_commit' function. */ #undef HAVE__COMMIT /* Define to 1 if the system has the type `_Complex double'. */ #undef HAVE__COMPLEX_DOUBLE /* Define to 1 if the system has the type `_Complex float'. */ #undef HAVE__COMPLEX_FLOAT /* Define to 1 if you have the `_fdopen' function. */ #undef HAVE__FDOPEN /* Define to 1 if you have the `_finite' function. */ #undef HAVE__FINITE /* Define to 1 if you have the `_fstat' function. */ #undef HAVE__FSTAT /* Define to 1 if you have the `_fstat64' function. */ #undef HAVE__FSTAT64 /* Define to 1 if you have the `_getcwd' function. */ #undef HAVE__GETCWD /* Define to 1 if you have the `_isnan' function. */ #undef HAVE__ISNAN /* Define to 1 if you have the `_lseeki64' function. */ #undef HAVE__LSEEKI64 /* Define to 1 if you have the `_mkdir' function. */ #undef HAVE__MKDIR /* Define to 1 if you have the `_open' function. */ #undef HAVE__OPEN /* Define to 1 if you have the `_read' function. */ #undef HAVE__READ /* Define to 1 if you have the `_rmdir' function. */ #undef HAVE__RMDIR /* Define to 1 if you have the `_snprintf' function. */ #undef HAVE__SNPRINTF /* Define to 1 if you have the `_stat64' function. */ #undef HAVE__STAT64 /* Define to 1 if you have the `_strtoi64' function. */ #undef HAVE__STRTOI64 /* Define to 1 if you have the `_strtoui64' function. */ #undef HAVE__STRTOUI64 /* Define to 1 if you have the `_unlink' function. */ #undef HAVE__UNLINK /* Define to 1 if you have the `_write' function. */ #undef HAVE__WRITE /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if the `mkdir' function takes only one argument. */ #undef MKDIR_NO_MODE /* Define to the full Win32 path to the `sh.exe' binary */ #undef MSYS_SHELL /* Define to disable assertions */ #undef NDEBUG /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* 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 /* The size of `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of `long int', as computed by sizeof. */ #undef SIZEOF_LONG_INT /* The size of `long long int', as computed by sizeof. */ #undef SIZEOF_LONG_LONG_INT /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T /* The size of `short int', as computed by sizeof. */ #undef SIZEOF_SHORT_INT /* The size of `size_t', as computed by sizeof. */ #undef SIZEOF_SIZE_T /* The size of `unsigned int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_INT /* The size of `unsigned long int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_INT /* The size of `unsigned long long int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_LONG_LONG_INT /* The size of `unsigned short int', as computed by sizeof. */ #undef SIZEOF_UNSIGNED_SHORT_INT /* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define to the full path to the `slimdata' binary */ #undef SLIMDATA /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if strerror_r returns char *. */ #undef STRERROR_R_CHAR_P /* Define to enable bzip2 tests */ #undef TEST_BZIP2 /* Define to enable flac tests */ #undef TEST_FLAC /* Define to enable gzip tests */ #undef TEST_GZIP /* Define to enable lzma tests */ #undef TEST_LZMA /* Define to enable slim tests */ #undef TEST_SLIM /* Define to enable zzip tests */ #undef TEST_ZZIP /* Define to 1 if the platform supports fast unaligned memory access */ #undef UNALIGNED_ACCESS_OK /* Define to the full path to the `unslim' binary */ #undef UNSLIM /* Define to the full path to the `unzip' binary */ #undef UNZIP /* Define to enable bzip2 support */ #undef USE_BZIP2 /* Define to enable flac support */ #undef USE_FLAC /* Define to enable gzip support */ #undef USE_GZIP /* Define to enable lzma support */ #undef USE_LZMA /* Define if building with modules */ #undef USE_MODULES /* Define if you have a POSIX compliant thread library */ #undef USE_PTHREAD /* Define to enable slim support */ #undef USE_SLIM /* Enable extensions on AIX 3, Interix. */ #ifndef _ALL_SOURCE # undef _ALL_SOURCE #endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif /* Enable threading extensions on Solaris. */ #ifndef _POSIX_PTHREAD_SEMANTICS # undef _POSIX_PTHREAD_SEMANTICS #endif /* Enable extensions on HP NonStop. */ #ifndef _TANDEM_SOURCE # undef _TANDEM_SOURCE #endif /* Enable general extensions on Solaris. */ #ifndef __EXTENSIONS__ # undef __EXTENSIONS__ #endif /* Define to enable zzip support */ #undef USE_ZZIP /* Define to enable zzslim support */ #undef USE_ZZSLIM /* 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 the full path to the `xz' binary */ #undef XZ /* Define to the full path to the `zip' binary */ #undef ZIP /* Define to 1 if on MINIX. */ #undef _MINIX /* Define to 2 if the system does not provide POSIX.1 features except with this defined. */ #undef _POSIX_1_SOURCE /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint64_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT64_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* If compiling aginst the MSVCRT, define to 0x601 */ #undef __MSVCRT_VERSION__ /* 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 the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to the type of a signed integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef int8_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long int' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to the equivalent of the C99 'restrict' keyword, or to nothing if this is not supported. Do not define if restrict is supported directly. */ #undef restrict /* Work around a bug in Sun C++: it does not support _Restrict or __restrict__, even though the corresponding Sun C compiler ends up with "#define restrict _Restrict" or "#define restrict __restrict__" in the previous line. Perhaps some future version of Sun C++ will work with restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ #if defined __SUNPRO_CC && !defined __RESTRICT # define _Restrict # define __restrict__ #endif /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef uint64_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define as `fork' if `vfork' does not work. */ #undef vfork libgetdata-0.9.0/src/del.c0000640000175000017500000003465212614323564015515 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static void _GD_ClearDerived(DIRFILE *restrict D, gd_entry_t *restrict E, const gd_entry_t *restrict C, int check) { int i; dtrace("%p, %p, %p, %i", D, E, C, check); switch(E->field_type) { case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) if (strcmp(E->in_fields[i], C->field) == 0) { if (check) _GD_SetError(D, GD_E_DELETE, GD_E_DEL_DERIVED, E->field, 0, C->field); else E->e->entry[i] = NULL; } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (strcmp(E->in_fields[1], C->field) == 0) { if (check) _GD_SetError(D, GD_E_DELETE, GD_E_DEL_DERIVED, E->field, 0, C->field); else E->e->entry[1] = NULL; } break; /* Fallthrough */ case GD_RECIP_ENTRY: case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: if (strcmp(E->in_fields[0], C->field) == 0) { if (check) _GD_SetError(D, GD_E_DELETE, GD_E_DEL_DERIVED, E->field, 0, C->field); else E->e->entry[0] = NULL; } break; case GD_NO_ENTRY: case GD_RAW_ENTRY: case GD_INDEX_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: break; case GD_ALIAS_ENTRY: if (E->e->entry[0] == C) { if (check) _GD_SetError(D, GD_E_DELETE, GD_E_DEL_ALIAS, E->field, 0, C->field); else E->e->entry[0] = NULL; } } dreturnvoid(); } static int _GD_DeReferenceOne(DIRFILE *restrict D, gd_entry_t *restrict E, gd_entry_t *restrict C, int check, int i, gd_type_t type, void *restrict data) { int repr; char *field_code; dtrace("%p, %p, %p, %i, %i, 0x%03x, %p", D, E, C, check, i, type, data); if (E->scalar[i] != NULL) { repr = _GD_GetRepr(D, E->scalar[i], &field_code, 1); if (D->error) { dreturn("%i", 1); return 1; } if (strcmp(C->field, field_code) == 0) { if (field_code != E->scalar[i]) free(field_code); if (check) { _GD_SetError(D, GD_E_DELETE, GD_E_DEL_CONST, E->field, 0, C->field); dreturn("%i", 1); return 1; } else { _GD_DoField(D, C, repr, (C->field_type == GD_CONST_ENTRY) ? 0 : E->scalar_ind[i], 1, type, data); free(E->scalar[i]); E->scalar[i] = NULL; } } else if (field_code != E->scalar[i]) free(field_code); } dreturn("%i", 0); return 0; } static void _GD_DeReference(DIRFILE *restrict D, gd_entry_t *restrict E, gd_entry_t *restrict C, int check) { int i; dtrace("%p, %p, %p, %i", D, E, C, check); switch(E->field_type) { case GD_RAW_ENTRY: _GD_DeReferenceOne(D, E, C, check, 0, GD_UINT_TYPE, &E->EN(raw,spf)); break; case GD_POLYNOM_ENTRY: for (i = 0; i <= E->EN(polynom,poly_ord); ++i) { if (_GD_DeReferenceOne(D, E, C, check, i, GD_COMPLEX128, &E->EN(polynom,ca)[i])) break; if (!check) E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]); } break; case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) { if (_GD_DeReferenceOne(D, E, C, check, i, GD_COMPLEX128, &E->EN(lincom,cm)[i])) break; if (!check) E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]); if (_GD_DeReferenceOne(D, E, C, check, i + GD_MAX_LINCOM, GD_COMPLEX128, &E->EN(lincom,cb)[i])) break; if (!check) E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]); } break; case GD_RECIP_ENTRY: _GD_DeReferenceOne(D, E, C, check, 0, GD_COMPLEX128, &E->EN(recip,cdividend)); if (!check) E->EN(recip,dividend) = creal(E->EN(recip,cdividend)); break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: if (_GD_DeReferenceOne(D, E, C, check, 0, GD_INT_TYPE, &E->EN(bit,bitnum))) break; _GD_DeReferenceOne(D, E, C, check, 1, GD_INT_TYPE, &E->EN(bit,numbits)); break; case GD_PHASE_ENTRY: _GD_DeReferenceOne(D, E, C, check, 0, GD_INT64, &E->EN(phase,shift)); break; case GD_WINDOW_ENTRY: switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: _GD_DeReferenceOne(D, E, C, check, 0, GD_INT64, &E->EN(window,threshold.i)); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: _GD_DeReferenceOne(D, E, C, check, 0, GD_UINT64, &E->EN(window,threshold.u)); break; default: _GD_DeReferenceOne(D, E, C, check, 0, GD_FLOAT64, &E->EN(window,threshold.r)); break; } break; case GD_MPLEX_ENTRY: _GD_DeReferenceOne(D, E, C, check, 0, GD_INT_TYPE, &E->EN(mplex,count_val)); _GD_DeReferenceOne(D, E, C, check, 1, GD_INT_TYPE, &E->EN(mplex,period)); break; case GD_NO_ENTRY: case GD_LINTERP_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_STRING_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_INDEX_ENTRY: case GD_ALIAS_ENTRY: break; } dreturnvoid(); } static int _GD_Delete(DIRFILE *restrict D, gd_entry_t *restrict E, unsigned int index, unsigned int flags) { unsigned int first, last = 0; int n_del, i, len; unsigned int j; char **new_ref = NULL; gd_entry_t *reference = NULL; gd_entry_t **del_list; dtrace("%p, %p, %u, 0x%X", D, E, index, flags); if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } len = strlen(E->field); /* check protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", -1); return -1; } /* If this field has metafields, and we weren't asked to delete those too, * complain */ if (E->e->n_meta > 0 && ~flags & GD_DEL_META) { _GD_SetError(D, GD_E_DELETE, GD_E_DEL_META, NULL, 0, E->field); dreturn("%i", -1); return -1; } else if (E->e->n_meta > 0) { /* find one of the meta fields -- it's not true that metafields are * necessarily sorted directly after their parent */ if (_GD_FindField(D, E->e->p.meta_entry[0]->field, D->entry, D->n_entries, 0, &first) == NULL) { _GD_InternalError(D); dreturn("%i", -1); return -1; } last = first; /* The remaining meta fields will be contiguous with this one, so just * search linearly in both directions until we find something that isn't a * meta field of our parent */ while (first > 0) if (strncmp(D->entry[first - 1]->field, E->field, len) == 0 && D->entry[first - 1]->field[len] == '/') first--; else break; while (last < D->n_entries - 1) if (strncmp(D->entry[last + 1]->field, E->field, len) == 0 && D->entry[last + 1]->field[len] == '/') last++; else break; } /* gather a list of fields */ del_list = _GD_Malloc(D, sizeof(*del_list) * (((E->e->n_meta == -1) ? 0 : E->e->n_meta) + 1)); if (del_list == NULL) { dreturn("%i", -1); return -1; } del_list[0] = E; n_del = 1; for (i = 0; i < E->e->n_meta; ++i) del_list[n_del++] = E->e->p.meta_entry[i]; /* Check for clients, derived fields, and inbound aliases */ if (~flags & GD_DEL_FORCE) for (j = 0; j < D->n_entries; ++j) for (i = 0; i < n_del; ++i) { if ((del_list[i]->field_type == GD_CONST_ENTRY || del_list[i]->field_type == GD_CARRAY_ENTRY) && ~flags & GD_DEL_DEREF) { _GD_DeReference(D, D->entry[j], del_list[i], 1); } if (!D->error) _GD_ClearDerived(D, D->entry[j], del_list[i], 1); if (D->error) { free(del_list); dreturn("%i", -1); return -1; } } /* If this is a raw field, and we were asked to delete the data, do so */ if (E->field_type == GD_RAW_ENTRY) { /* close data file, if open */ if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD)) { free(del_list); dreturn("%i", -1); return -1; } if (flags & GD_DEL_DATA) { /* check protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[E->fragment_index].cname); free(del_list); dreturn("%i", -1); return -1; } if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_UNLINK)) { free(del_list); dreturn("%i", -1); return -1; } if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D, (const char*)D->fragment[E->fragment_index].enc_data, E->e->u.raw.file, E->e->u.raw.filebase, 0, 0)) { free(del_list); dreturn("%i", -1); return -1; } if ((*_GD_ef[E->e->u.raw.file[0].subenc].unlink)( D->fragment[E->fragment_index].dirfd, E->e->u.raw.file)) { if (errno != ENOENT) { _GD_SetEncIOError(D, GD_E_IO_UNLINK, E->e->u.raw.file + 0); free(del_list); dreturn("%i", -1); return -1; } } } } /* Fix up reference fields */ if (E->field_type == GD_RAW_ENTRY) { new_ref = _GD_Malloc(D, sizeof(*new_ref) * D->n_fragment); if (new_ref == NULL) { free(del_list); dreturn("%i", -1); return -1; } memset(new_ref, 0, sizeof(char*) * D->n_fragment); for (i = 0; i < D->n_fragment; ++i) if (D->fragment[i].ref_name != NULL && strcmp(D->fragment[i].ref_name, E->field) == 0) { /* Flag for replacement */ new_ref[i] = (char *)E; /* Search for a replacement */ for (j = 0; j < D->n_entries; ++j) if (j != index && D->entry[j]->field_type == GD_RAW_ENTRY) { /* Is this field in scope? */ int in_scope = 0; int f; for (f = D->entry[j]->fragment_index; f != -1; f = D->fragment[f].parent) if (f == i) { in_scope = 1; break; } if (in_scope) { new_ref[i] = _GD_Strdup(D, D->entry[j]->field); if (new_ref[i] == NULL) { for (f = 0; f < i; ++f) free(new_ref[f]); free(new_ref); free(del_list); dreturn("%i", -1); return -1; } if (i == 0) reference = D->entry[j]; break; } } } } /* Nothing from now on may fail */ /* Fix up reference fields */ if (reference != NULL) D->reference_field = reference; if (new_ref != NULL) { for (i = 0; i < D->n_fragment; ++i) if (new_ref[i] != NULL) { free(D->fragment[i].ref_name); D->fragment[i].ref_name = (new_ref[i] == (char *)E) ? NULL : new_ref[i]; } free(new_ref); } /* Clear clients and derived fields */ for (j = 0; j < D->n_entries; ++j) for (i = 0; i < n_del; ++i) if ((del_list[i]->field_type == GD_CONST_ENTRY || del_list[i]->field_type == GD_CARRAY_ENTRY) && flags & GD_DEL_DEREF) _GD_DeReference(D, D->entry[j], del_list[i], 0); else if (del_list[i]->field_type != GD_STRING_ENTRY) _GD_ClearDerived(D, D->entry[j], del_list[i], 0); free(del_list); /* Remove meta fields, if present */ if (E->e->n_meta >= 0) { if (E->e->n_meta > 0) { /* Remove all meta fields -- there are no RAW fields here */ for (j = first; j <= last; ++j) _GD_FreeE(D, D->entry[j], 1); memmove(D->entry + first, D->entry + last + 1, sizeof(gd_entry_t*) * (D->n_entries - last - 1)); D->n_entries -= last - first + 1; } /* Invalidate the field lists */ D->entry_list_validity = 0; D->value_list_validity = 0; } else { /* If this is a metafield, update its parent's lists */ struct gd_private_entry_ *Pe = E->e->p.parent->e; /* search and destroy */ for (i = 0; i < Pe->n_meta; ++i) if (Pe->p.meta_entry[i] == E) { Pe->p.meta_entry[i] = Pe->p.meta_entry[Pe->n_meta - 1]; break; } /* Decrement entry count */ Pe->n_meta--; /* Invalidate the field lists */ Pe->entry_list_validity = 0; Pe->value_list_validity = 0; } /* Remove the entry from the list -- we need not worry about the way we've * already modified D->entry, since E is guaranteed to be before the stuff * we've already removed */ D->fragment[E->fragment_index].modified = 1; _GD_FreeE(D, E, 1); memmove(D->entry + index, D->entry + index + 1, sizeof(gd_entry_t *) * (D->n_entries - index - 1)); D->n_entries--; dreturn("%i", 0); return 0; } int gd_delete(DIRFILE *D, const char *field_code, unsigned int flags) { unsigned index; int ret; gd_entry_t *E; dtrace("%p, \"%s\", 0x%X", D, field_code, flags); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, &index); if (D->error) { dreturn("%i", -1); return -1; } ret = _GD_Delete(D, E, index, flags); dreturn("%i", ret); return ret; } libgetdata-0.9.0/src/sie.c0000640000175000017500000004105412614323564015523 0ustar alastairalastair/* Copyright (C) 2011-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* define to debug this unit */ #undef DEBUG_SIE #ifdef DEBUG_SIE #define dprintf_sie dprintf #else #define dprintf_sie(...) #endif #define DPRINTF dprintf_sie("F r:%zi p:0x%llX s:%i,0x%llX " \ "d:0x%llX,0x%llX l:%i/0x%llX,0x%llX @%li", f->r, f->p, f->bof, f->s, \ f->d[0], f->d[1], f->have_l, f->l[0], f->l[1], ftell(f->fp)); struct gd_siedata { int swap; /* byte swapping required */ FILE *fp; /* stream */ ssize_t r; /* current record number */ int64_t p; /* I/O pointer in samples */ int64_t s; /* record ending sample */ int64_t d[3]; /* the raw record: d[0] is the sample number in storage order d[1] and d[2] are space for the data */ int64_t l[3]; /* the previous record */ int have_l; /* a flag to indicate that l is initialised */ int bof; /* this is the first record */ }; /* correct for byte sex */ #define FIXSEX(swap,v) ((swap) ? (int64_t)gd_swap64(v) : (v)) static int _GD_SampIndDoOpen(int fdin, struct gd_raw_file_ *file, struct gd_siedata *f, int swap, unsigned int mode) { int fd; FILE *stream; dtrace("%i, %p, %i, 0x%X", fdin, file, swap, mode); if (!(mode & GD_FILE_TEMP)) { fd = gd_OpenAt(file->D, fdin, file->name, ((mode & GD_FILE_WRITE) ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666); } else { fd = _GD_MakeTempFile(file->D, fdin, file->name); } if (fd < 0) { dreturn("%i", -1); return -1; } stream = fdopen(fd, (mode & GD_FILE_WRITE) ? "rb+" : "rb"); if (stream == NULL) { close(fd); dreturn("%i", -1); return -1; } memset(f, 0, sizeof(struct gd_siedata)); f->r = f->s = f->p = f->d[0] = -1; f->fp = stream; f->swap = swap; dreturn("%i", fd); return fd; } int _GD_SampIndOpen(int fd, struct gd_raw_file_ *file, gd_type_t data_type gd_unused_, int swap, unsigned int mode) { dtrace("%i, %p, , %i, 0x%X", fd, file, swap, mode); if (file->mode & mode) { dreturn("%i", 0); return 0; } else if (file->edata) fclose(((struct gd_siedata *)(file->edata))->fp); else file->edata = malloc(sizeof(struct gd_siedata)); if (file->edata == NULL) { dreturn("%i", -1); return -1; } file->idata = _GD_SampIndDoOpen(fd, file, (struct gd_siedata*)file->edata, swap, mode); if (file->idata < 0) { free(file->edata); dreturn("%i", -1); return -1; } file->mode = mode; file->pos = 0; dreturn("%i", 0); return 0; } /* advance one record, with byte swapping and error checking; returns -1 on EOF, * -2 on error */ static int _GD_Advance(struct gd_siedata *f, size_t size) { size_t n; int64_t p = f->s + 1; int64_t l[3]; dtrace("%p, %" PRNsize_t, f, size); /* save the current record */ if (p > 0) memcpy(l, f->d, size); /* read the next record */ n = fread(f->d, size, 1, f->fp); if (n != 1) { if (ferror(f->fp)) { dreturn("%i", -2); return -2; } else { /* we're past the end of the last record */ f->p = f->s + 1; dreturn("%i", -1); return -1; } } /* handle newly read record */ f->s = FIXSEX(f->swap, f->d[0]); f->p = p; f->r++; if (p > 0) { memcpy(f->l, l, size); f->have_l = 1; f->bof = 0; } else { f->have_l = 0; f->bof = 1; } dreturn("%i", 0); return 0; } off64_t _GD_SampIndSeek(struct gd_raw_file_ *file, off64_t sample, gd_type_t data_type, unsigned int mode) { int r; const size_t size = sizeof(int64_t) + GD_SIZE(data_type); struct gd_siedata *f = (struct gd_siedata*)(file->edata); dtrace("%p, 0x%llx, 0x%X, 0x%X", file, (long long)sample, data_type, mode); if (file->pos == sample && f->p >= 0) { dreturn("0x%llX", (long long)sample); return sample; } if (sample < f->p) { /* seek backwards -- reading a file backwards doesn't necessarily work * that well. So, let's just rewind to the beginning and try again. */ rewind(f->fp); file->idata = 0; f->r = f->s = f->p = f->d[0] = -1; f->bof = 1; f->have_l = 0; } while (sample > f->s) { DPRINTF; /* seek ahead ... */ r = _GD_Advance(f, size); if (r == -2) { dreturn("%i", -1); return -1; } else if (r == -1) break; } DPRINTF; if ((mode & GD_FILE_WRITE) && sample > f->s && sample > 0) { char zero[16]; memset(zero, 0, 16); /* does the last record have a value of zero? */ if (memcmp(f->d + 1, &zero, GD_SIZE(data_type)) == 0 && ftell(f->fp) > 0) { /* in this case, just increase the current record's end */ f->s = sample; f->d[0] = FIXSEX(f->swap, sample); /* back up and update the file */ if (fseek(f->fp, -size, SEEK_CUR) || fwrite(f->d, size, 1, f->fp) < 1) { dreturn("%i", -1); return -1; } /* The MSVCRT's stdio seems to screw up without the following: */ fflush(f->fp); DPRINTF; } else { /* add a new record */ f->r++; f->bof = 0; f->s = sample; memcpy(f->l, f->d, size); f->have_l = 1; f->d[0] = FIXSEX(f->swap, sample); f->d[1] = f->d[2] = 0; if (fwrite(f->d, size, 1, f->fp) < 1) { dreturn("%i", -1); return -1; } fflush(f->fp); DPRINTF; } } file->pos = f->p = sample; DPRINTF; dreturn("0x%llX", (unsigned long long)sample); return (off64_t)(sample); } /* store n copies of s, which is of length l, in d */ static void *_GD_Duplicate(void *restrict d, const void *restrict s, size_t l, int64_t n) { int64_t i; dtrace("%p, %p, %" PRNsize_t ", 0x%llx", d, s, l, (long long)n); if (n > 0) { if (l == 1) { memset(d, *(char*)s, (size_t)n); d = (char*)d + n; } else if (l == 2) { uint16_t v = *(uint16_t*)s; uint16_t *p = (uint16_t*)d; for (i = 0; i < n; ++i) *(p++) = v; d = p; } else if (l == 4) { uint32_t v = *(uint32_t*)s; uint32_t *p = (uint32_t*)d; for (i = 0; i < n; ++i) *(p++) = v; d = p; } else if (l == 8) { uint64_t v = *(uint64_t*)s; uint64_t *p = (uint64_t*)d; for (i = 0; i < n; ++i) *(p++) = v; d = p; } else if (l == 16) { #ifndef GD_NO_C99_API double complex v = *(double complex*)s; double complex *p = (double complex*)d; for (i = 0; i < n; ++i) *(p++) = v; #else double v[2]; double *p = (double *)d; v[0] = ((double*)s)[0]; v[1] = ((double*)s)[1]; for (i = 0; i < n; ++i) { *(p++) = v[0]; *(p++) = v[1]; } #endif d = p; } } dreturn("%p", d); return d; } ssize_t _GD_SampIndRead(struct gd_raw_file_ *restrict file, void *restrict ptr, gd_type_t data_type, size_t nelem) { int r; ssize_t count = 0; struct gd_siedata *f = (struct gd_siedata*)(file->edata); void *cur = ptr; dtrace("%p, %p, 0x%03x, %" PRNsize_t, file, ptr, data_type, nelem); /* not enough data in the current run */ while (f->s - f->p < (int64_t)(nelem - count)) { /* copy what we've got */ cur = _GD_Duplicate(cur, f->d + 1, GD_SIZE(data_type), f->s - f->p + 1); count += f->s - f->p + 1; DPRINTF; /* advance */ r = _GD_Advance(f, sizeof(int64_t) + GD_SIZE(data_type)); if (r == -2) { dreturn("%i", -1); return -1; } else if (r == -1) break; } DPRINTF; /* copy the remnant */ if (f->s - f->p >= (int64_t)(nelem - count)) { _GD_Duplicate(cur, f->d + 1, GD_SIZE(data_type), nelem - count); f->p += nelem - count; count = nelem; } else { _GD_Duplicate(cur, f->d + 1, GD_SIZE(data_type), f->s - f->p + 1); count += f->s - f->p + 1; f->p = f->s + 1; } DPRINTF; file->pos = f->p; dreturn("%lli", (long long)count); return count; } /* return the number of records in the file */ static ssize_t _GD_GetNRec(struct gd_siedata *f, size_t size) { gd_stat64_t statbuf; dtrace("%p, %" PRNsize_t, f, size); if (gd_fstat64(fileno(f->fp), &statbuf)) { dreturn("%i", -1); return -1; } dreturn("%" PRNssize_t, (ssize_t)(statbuf.st_size / size)); return (ssize_t)(statbuf.st_size / size); } ssize_t _GD_SampIndWrite(struct gd_raw_file_ *restrict file, const void *restrict ptr, gd_type_t data_type, size_t nelem) { ssize_t nrec; void *p; size_t i; ssize_t rin = 0, rout = 0, plen = 10; int64_t fr; int r; int64_t *cur_end; int64_t end; void *cur_datum, *buffer; struct gd_siedata *f = (struct gd_siedata*)(file->edata); const size_t dlen = GD_SIZE(data_type); const size_t size = sizeof(int64_t) + dlen; dtrace("%p, %p, 0x%03x, %" PRNsize_t, file, ptr, data_type, nelem); if ((nrec = _GD_GetNRec(f, size)) < 0) { dreturn("%i", -1); return -1; } /* compress the data in core first, including the current record. */ p = malloc(plen * size); memcpy(p, f->d, size); cur_end = (int64_t*)p; cur_datum = ((int64_t*)p) + 1; DPRINTF; if ((f->r == -1 || f->bof) && f->p == 0) { /* we're overwriting everything from the start */ memcpy(cur_datum, ptr, dlen); } else if (!f->bof) { int64_t ls; int need_advance = 0; /* need to check the previous record to see if we're overwriting this whole * record and we need to combine with the previous one */ if (!f->have_l) { /* forced to back up to read the previous record */ if (fseek(f->fp, -2 * size, SEEK_CUR) || (fread(f->l, size, 1, f->fp) < 1)) { free(p); dreturn("%i", -1); return -1; } need_advance = 1; DPRINTF; } /* the ending sample of the previous record */ ls = FIXSEX(f->swap, f->l[0]); /* if we're not at the start of the current record, we don't need to * do anything fancy */ if (f->p == ls + 1) { /* we're completely overwriting the current record, so update the value */ memcpy(cur_datum, ptr, dlen); /* then check whether that's the same as the value of the old record; if * it is, combine them */ if (memcmp(f->l + 1, ptr, dlen) == 0) { dprintf_sie("combine: 0x%llX", f->l[1]); /* the new value is the same as the value of the previous record, so * back up a record and combine */ /* rewind if we haven't already done so */ if (f->have_l) { if (fseek(f->fp, -size, SEEK_CUR)) { free(p); dreturn("%i", -1); return -1; } } need_advance = 0; f->r--; memcpy(f->d, f->l, size); memcpy(p, f->d, size); f->s = FIXSEX(f->swap, f->l[0]); f->have_l = 0; } } /* reset the file pointer if we didn't have to rewind but were forced to */ if (need_advance) { if (fseek(f->fp, size, SEEK_CUR)) { free(p); dreturn("%i", -1); return -1; } f->have_l = 1; } DPRINTF; } for (i = 0; i < nelem; ++i) { if (memcmp(((const char*)ptr) + i * dlen, cur_datum, dlen)) { dprintf_sie("mismatch on sample %zu:", i); if (++rin == plen) { void *p2; plen *= 2; p2 = realloc(p, plen * size); if (p2 == NULL) { free(p); dreturn("%i", -1); return -1; } p = p2; cur_end = (int64_t*)((char*)p + size * (rin - 1)); } end = f->p + i - 1; dprintf_sie("*cur_end: %llX -> %llX", FIXSEX(f->swap, *cur_end), end); gd_put_unaligned64(FIXSEX(f->swap, end), cur_end); dprintf_sie(" cur_end: %p -> %p", cur_end, (char*)p + size * rin); cur_end = (int64_t*)((char*)p + size * rin); dprintf_sie(" cur_datum: %p -> %p", cur_datum, cur_end + 1); cur_datum = cur_end + 1; dprintf_sie("*cur_datum: %X -> %X", *((char*)cur_datum), *(((const char*)ptr) + i * dlen)); memcpy(cur_datum, ((const char*)ptr) + i * dlen, dlen); } } end = f->p + nelem - 1; dprintf_sie("*cur_end: %llX -> %llX", FIXSEX(f->swap, *cur_end), end); gd_put_unaligned64(FIXSEX(f->swap, end), cur_end); rin++; for (i = 0; i < (size_t)rin; ++i) { dprintf_sie("%zu: 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X 0x%X", i, ((char*)p)[size * i + 0], ((char*)p)[size * i + 1], ((char*)p)[size * i + 2], ((char*)p)[size * i + 3], ((char*)p)[size * i + 4], ((char*)p)[size * i + 5], ((char*)p)[size * i + 6], ((char*)p)[size * i + 7], ((char*)p)[size * i + 8]); } /* determine how many records we have to replace */ fr = f->r; if (fr < 0) { fr = 0; rout--; } while (f->s <= end) { ++rout; DPRINTF; r = _GD_Advance(f, sizeof(int64_t) + GD_SIZE(data_type)); if (r == -2) { free(p); dreturn("%i", -1); return -1; } else if (r == -1) break; } DPRINTF; dprintf_sie("nrec:%zi rin:%zi rout:%zi fr:%lli", nrec, rin, rout, fr); /* now, do some moving: first, move the trailing records, forward by * (rin - rout) records */ if (nrec - (fr + rout) > 0) { buffer = malloc((nrec - (fr + rout)) * size); if (buffer == NULL) { free(p); dreturn("%i", -1); return -1; } if (fseek(f->fp, (fr + rout) * size, SEEK_SET) || (fread(buffer, size, nrec - (fr + rout), f->fp) < (size_t)(nrec - (fr + rout)))) { free(buffer); free(p); dreturn("%i", -1); return -1; } if (fseek(f->fp, (fr + rin) * size, SEEK_SET) || (fwrite(buffer, size, nrec - (fr + rout), f->fp) < (size_t)(nrec - (fr + rout)))) { free(buffer); free(p); dreturn("%i", -1); return -1; } free(buffer); } /* now insert the new records */ if (fseek(f->fp, fr * size, SEEK_SET) || (fwrite(p, size, rin, f->fp) < (size_t)rin)) { free(p); dreturn("%i", -1); return -1; } /* truncate the file if necessary */ if (rin < rout) { if (fflush(f->fp)) { free(p); dreturn("%i", -1); return -1; } if (gd_truncate(fileno(f->fp), (nrec - rout + rin) * size)) { free(p); dreturn("%i", -1); return -1; } } /* update the current record */ memcpy(f->d, (char *)p + (rin - 1) * size, size); if (rin > 1) f->bof = 0; else f->bof = 1; f->p = f->s = FIXSEX(f->swap, f->d[0]); f->r = fr + rin - 1; f->have_l = 0; DPRINTF; free(p); file->pos = f->p; dreturn("%llu", (unsigned long long)nelem); return nelem; } int _GD_SampIndSync(struct gd_raw_file_ *file) { int ret; struct gd_siedata *f = (struct gd_siedata*)(file->edata); dtrace("%p", file); ret = fflush(f->fp); if (!ret) ret = fsync(fileno(f->fp)); dreturn("%i", ret); return ret; } int _GD_SampIndClose(struct gd_raw_file_* file) { int ret; struct gd_siedata *f = (struct gd_siedata*)(file->edata); dtrace("%p", file); ret = fclose(f->fp); if (ret != EOF) { file->mode = 0; file->idata = -1; free(file->edata); file->edata = NULL; dreturn("%i", 0); return 0; } dreturn("%i", 1); return 1; } off64_t _GD_SampIndSize(int dirfd, struct gd_raw_file_* file, gd_type_t data_type, int swap) { struct gd_siedata f; ssize_t last_rec; int64_t n; const size_t size = sizeof(int64_t) + GD_SIZE(data_type); dtrace("%i, %p, 0x%03x, %i", dirfd, file, data_type, swap); /* open */ if (_GD_SampIndDoOpen(dirfd, file, &f, swap, GD_FILE_READ) < 0) { dreturn("%i", -1); return -1; } /* find the last record */ last_rec = _GD_GetNRec(&f, size) - 1; /* seek to this record */ if (fseeko64(f.fp, last_rec * size, SEEK_SET)) { fclose(f.fp); dreturn("%i", -1); return -1; } /* read the sample index */ if (fread(&n, sizeof(uint64_t), 1, f.fp) != 1) { fclose(f.fp); dreturn("%i", -1); return -1; } if (swap) n = gd_swap64(n); fclose(f.fp); dreturn("%llx", (long long unsigned)n + 1); return (off64_t)n + 1; } libgetdata-0.9.0/src/endian.c0000640000175000017500000002212412614323564016176 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static void _GD_ByteSwapFragment(DIRFILE* D, unsigned long byte_sex, int fragment, int move) { unsigned int i, n_raw = 0; dtrace("%p, %lx, %i, %i", D, (unsigned long)byte_sex, fragment, move); byte_sex = ( #ifdef WORDS_BIGENDIAN (byte_sex & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN #else (byte_sex & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN #endif ) | (byte_sex & GD_ARM_FLAG); /* check protection */ if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[fragment].cname); dreturnvoid(); return; } if (move && byte_sex != D->fragment[fragment].byte_sex) { gd_entry_t **raw_entry = (gd_entry_t **)_GD_Malloc(D, sizeof(gd_entry_t*) * D->n_entries); if (raw_entry == NULL) { dreturnvoid(); return; } /* Because it may fail, the move must occur out-of-place and then be copied * back over the affected files once success is assured */ for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->fragment_index == fragment && D->entry[i]->field_type == GD_RAW_ENTRY) { /* determine encoding scheme */ if (!_GD_Supports(D, D->entry[i], 0)) break; /* if the field's data type is one byte long, and no in-framework * byte-swapping is performed, do nothing */ if (D->entry[i]->e->u.raw.size == 1 && !(_GD_ef[D->entry[i]->e->u.raw.file[0].subenc].flags & GD_EF_SWAP)) continue; /* add this raw field to the list */ raw_entry[n_raw++] = D->entry[i]; if (_GD_MogrifyFile(D, D->entry[i], D->fragment[D->entry[i]->fragment_index].encoding, byte_sex, D->fragment[D->entry[i]->fragment_index].frame_offset, 0, -1, NULL)) break; } /* If successful, move the temporary file over the old file, otherwise * remove the temporary files */ if (D->error) { for (i = 0; i < n_raw; ++i) _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD | GD_FINIRAW_CLOTEMP); } else { for (i = 0; i < n_raw; ++i) _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP); } free(raw_entry); if (D->error) { dreturnvoid(); return; } } D->fragment[fragment].byte_sex = byte_sex; D->fragment[fragment].modified = 1; D->flags &= ~GD_HAVE_VERSION; dreturnvoid(); } int gd_alter_endianness(DIRFILE* D, unsigned long byte_sex, int fragment, int move) { int i; dtrace("%p, %lx, %i, %i", D, (unsigned long)byte_sex, fragment, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (byte_sex != GD_BIG_ENDIAN && byte_sex != GD_LITTLE_ENDIAN) { _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_ENDIANNESS, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); if (fragment == GD_ALL_FRAGMENTS) { for (i = 0; i < D->n_fragment; ++i) { _GD_ByteSwapFragment(D, byte_sex, i, move); if (D->error) break; } } else _GD_ByteSwapFragment(D, byte_sex, fragment, move); dreturn("%i", (D->error) ? -1 : 0); return (D->error) ? -1 : 0; } unsigned long gd_endianness(DIRFILE* D, int fragment) gd_nothrow { dtrace("%p, %i", D, fragment); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } if (fragment < 0 || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } _GD_ClearError(D); dreturn("0x%lx", (unsigned long)D->fragment[fragment].byte_sex); return D->fragment[fragment].byte_sex; } static void _GD_ArmEndianise(uint64_t* databuffer, size_t ns) { uint64_t *p; dtrace("%p, %zi", databuffer, ns); for (p = databuffer; p < databuffer + ns; ++p) *p = ((*p & 0xffffffff) << 32) | ((*p & 0xffffffff00000000ULL) >> 32); dreturnvoid(); } /* determine byte sex flags for the machine endianness */ #ifdef FLOATS_BIGENDIAN #define GD_FLOAT_SEX GD_BIG_ENDIAN #else #define GD_FLOAT_SEX GD_LITTLE_ENDIAN #endif #ifdef WORDS_BIGENDIAN #define GD_INT_SEX GD_BIG_ENDIAN #else #define GD_INT_SEX GD_LITTLE_ENDIAN #endif /* returns non-zero if sex1 and sex2 imply byte sex correction is required, and * sets *arm_fix if middle-ended double correction is needed; returns */ int _GD_CheckByteSex(gd_type_t type, unsigned sex1, unsigned sex2, int skip_bytes, int *restrict arm_fix) { int endian_fix = 0; dtrace("0x%X, 0x%X, 0x%X, %p", type, sex1, sex2, arm_fix); /* the trivial case */ if (GD_SIZE(type) < 1 || (skip_bytes && GD_SIZE(type) == 1)) { if (arm_fix) *arm_fix = 0; dreturn("%i/%i", 0, 0); return 0; } /* ensure we have exactly one of GD_BIG_ENDIAN or GD_LITTLE_ENDIAN set in * both bitfields */ if (type & (GD_IEEE754 | GD_COMPLEX)) { /* arm check */ if (arm_fix) { if (type == GD_FLOAT64 || type == GD_COMPLEX128) *arm_fix = ((sex1 & GD_ARM_FLAG) != (sex2 & GD_ARM_FLAG)); else *arm_fix = 0; } switch (sex1 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) { case 0: sex1 |= GD_FLOAT_SEX; break; case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN: sex1 &= ~GD_FLOAT_SEX; break; default: break; /* bits are okay */ } switch (sex2 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) { case 0: sex2 |= GD_FLOAT_SEX; break; case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN: sex2 &= ~GD_FLOAT_SEX; break; default: break; /* bits are okay */ } } else { if (arm_fix) *arm_fix = 0; switch (sex1 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) { case 0: sex1 |= GD_INT_SEX; break; case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN: sex1 &= ~GD_INT_SEX; break; default: break; /* bits are okay */ } switch (sex2 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) { case 0: sex2 |= GD_INT_SEX; break; case GD_LITTLE_ENDIAN | GD_BIG_ENDIAN: sex2 &= ~GD_INT_SEX; break; default: break; /* bits are okay */ } } /* endianness check */ endian_fix = ((sex1 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) != (sex2 & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN))); dreturn("%i/%i", endian_fix, arm_fix ? *arm_fix : -1); return endian_fix; } /* returns non-zero if the byte sex of RAW entry E is different than the native * machine endianness */ int _GD_FileSwapBytes(const DIRFILE *restrict D, const gd_entry_t *restrict E) { int swap; dtrace("%p, %p", D, E); swap = _GD_CheckByteSex(E->EN(raw,data_type), D->fragment[E->fragment_index].byte_sex, 0, 0, NULL); dreturn("%i", swap); return swap; } void _GD_FixEndianness(void* databuffer, size_t ns, gd_type_t type, unsigned old_sex, unsigned new_sex) { size_t i; int endian_fix, arm_fix; dtrace("%p, %" PRNsize_t ", 0x%X, 0x%X, 0x%X", databuffer, ns, type, old_sex, new_sex); /* compare byte sexes */ endian_fix = _GD_CheckByteSex(type, old_sex, new_sex, 1, &arm_fix); /* complex data - treat as twice as many floating point */ if (type & GD_COMPLEX) { ns *= 2; type = (GD_SIZE(type) >> 1) | GD_IEEE754; } if (arm_fix) _GD_ArmEndianise(databuffer, ns); if (endian_fix) switch (GD_SIZE(type)) { case 2: for (i = 0; i < ns; ++i) ((uint16_t*)databuffer)[i] = gd_swap16(((uint16_t*)databuffer)[i]); break; case 4: for (i = 0; i < ns; ++i) ((uint32_t*)databuffer)[i] = gd_swap32(((uint32_t*)databuffer)[i]); break; case 8: for (i = 0; i < ns; ++i) ((uint64_t*)databuffer)[i] = gd_swap64(((uint64_t*)databuffer)[i]); break; } dreturnvoid(); } libgetdata-0.9.0/src/zzslim.c0000640000175000017500000000352312614323564016272 0ustar alastairalastair/* Copyright (C) 2012-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" int _GD_ZzslimName(DIRFILE *restrict D, const char *restrict enc_data, struct gd_raw_file_ *restrict file, const char *restrict base, int temp gd_unused_, int resolv) { size_t enc_len; dtrace("%p, \"%s\", %p, \"%s\", , %i", D, enc_data, file, base, resolv); if (enc_data == NULL) enc_data = "raw"; enc_len = strlen(enc_data); /* Resolution is degenerate with the zzip encoding; so skip it for now */ if (resolv) { dreturn("%i", 1); return 1; } if (file->name == NULL) { file->D = D; file->name = (char *)malloc(strlen(base) + strlen(enc_data) + 6); if (file->name == NULL) { _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } strcpy(file->name, enc_data); file->name[enc_len] = '/'; sprintf(file->name + enc_len + 1, "%s.slm", base); } dreturn("%i (%s)", 0, file->name); return 0; } #define ZZSLIM #include "slim.c" libgetdata-0.9.0/src/getdata.h.in0000640000175000017500000012742712614323564016777 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2003-2005 Theodore Kisner * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ /* GETDATA.H -- GetData Library public API definition * -------------------------------------------------- * * Several preprocessor symbols may be defined before including this file to * modify it's use: * * - defining GD_NO_LEGACY_API will prevent the Legacy API declarations in * getdata_legacy.h from being declared. If the Legacy API was omitted from * the library when it was built, this symbol does nothing. * * - defining GD_C89_API will prevent declarations herein from using the C99 * keyword `_Complex'. Affected declarations will instead use a two-element * array of doubles in place of the complex types. This symbol permits * including these declarations using a non-C99 conforming compiler. * * - defining GD_64BIT_API will expose the declaration of versions of funtions * using an explicitly 64-bit off_t type, regardless of the actual size of * off_t itself. These functions have "64" appended to their name (e.g. * gd_getdata64()). It will also define th gd_off64_t type, which is used in * these exposed definitions as a replacement for off_t. This symbol is * automatically defined if _LARGEFILE64_SOURCE has been defined before * including this file, and may also be defined on certain platforms where * off_t is 64-bits. * * - defining GD_FUNCTION_ALIASES will result in a number of function aliases * which map the version 0.7 function names to the names used in GetData-0.6. * This feature is provided only to ease transistion, and will be removed in * some unpecified future release. */ #ifndef GETDATA_H #define GETDATA_H #ifdef __cplusplus extern "C" { #endif /* The most recent standards version supported by this library */ #define GD_DIRFILE_STANDARDS_VERSION 9 #include #include /* If this symbol is defined here, the C99-API is not present in the library */ @DEFINE_GD_NO_C99_API@ #if defined(GD_NO_C99_API) && ! defined(GD_C89_API) # define GD_C89_API #endif /* MSVC build system defines GD_C89_API */ #if defined(GD_C89_API) # define GD_NO_C99_API #endif /* define function attributes */ #if defined __GNUC__ && defined __GNUC_MINOR__ # define gd_gnu_enough ((__GNUC__ * 100 + __GNUC_MINOR__) >= 303) #else # define gd_gnu_enough 0 #endif #ifdef __attribute_deprecated__ # define gd_deprecated __attribute_deprecated__ #elif gd_gnu_enough # define gd_deprecated __attribute__ ((__deprecated__)) #else # define gd_deprecated /**/ #endif #ifdef __THROW # define gd_nothrow __THROW #elif !defined __cplusplus && gd_gnu_enough # define gd_nothrow __attribute__ ((__nothrow__)) #else # define gd_nothrow /**/ #endif /* ICC complains that it ignores the __nonnull__ attribute */ #ifdef __INTEL_COMPILER # define gd_nonnull(...) /**/ #elif gd_gnu_enough # define gd_nonnull(...) __attribute__ ((__nonnull__ __VA_ARGS__)) #else # define gd_nonnull(...) /**/ #endif /* formerly, this was the maximum length of a format file line. We keep it * around for legacy reasons. (The actual maximum length of a format file * line is the maximum value of ssize_t, i.e. 2**(n-1)-1 on a n-bit system.) */ #define GD_MAX_LINE_LENGTH 4096 /* error codes */ #define GD_E_OK 0 /* this MUST be zero */ /* unused 1 */ #define GD_E_FORMAT 2 /* unused 3 */ #define GD_E_CREAT 4 #define GD_E_BAD_CODE 5 #define GD_E_BAD_TYPE 6 #define GD_E_IO 7 /* unused 8 */ #define GD_E_INTERNAL_ERROR 9 #define GD_E_ALLOC 10 #define GD_E_RANGE 11 #define GD_E_LUT 12 #define GD_E_RECURSE_LEVEL 13 #define GD_E_BAD_DIRFILE 14 #define GD_E_BAD_FIELD_TYPE 15 #define GD_E_ACCMODE 16 #define GD_E_UNSUPPORTED 17 #define GD_E_UNKNOWN_ENCODING 18 #define GD_E_BAD_ENTRY 19 #define GD_E_DUPLICATE 20 #define GD_E_DIMENSION 21 #define GD_E_BAD_INDEX 22 #define GD_E_BAD_SCALAR 23 #define GD_E_BAD_REFERENCE 24 #define GD_E_PROTECTED 25 #define GD_E_DELETE 26 #define GD_E_ARGUMENT 27 #define GD_E_CALLBACK 28 #define GD_E_EXISTS 29 #define GD_E_UNCLEAN_DB 30 #define GD_E_DOMAIN 31 /* unused 32, 33, 34 */ #define GD_E_BOUNDS 35 #define GD_E_LINE_TOO_LONG 36 #define GD_N_ERROR_CODES 37 /* including unused codes */ /* Deprecated error codes */ #define GD_E_BAD_ENDIANNESS GD_E_ARGUMENT #define GD_E_BAD_PROTECTION GD_E_ARGUMENT #define GD_E_BAD_VERSION GD_E_ARGUMENT #define GD_E_BAD_REPR GD_E_BAD_CODE #define GD_E_OPEN_LINFILE GD_E_LUT #define GD_E_FLUSH GD_E_IO #define GD_E_OPEN GD_E_IO #define GD_E_OPEN_FRAGMENT GD_E_IO #define GD_E_OPEN_INCLUDE GD_E_IO #define GD_E_RAW_IO GD_E_IO #define GD_E_TRUNC GD_E_IO /* the maximum number of input vectors in a LINCOM */ #define GD_MAX_LINCOM 3 /* the following MUST be at least one less than twice GD_MAX_LINCOM */ #define GD_MAX_POLYORD (GD_MAX_LINCOM * 2 - 1) /* syntax suberrors */ #define GD_E_FORMAT_BAD_SPF 1 #define GD_E_FORMAT_N_FIELDS 2 #define GD_E_FORMAT_N_TOK 3 #define GD_E_FORMAT_NUMBITS 4 #define GD_E_FORMAT_BITNUM 5 #define GD_E_FORMAT_BITSIZE 6 #define GD_E_FORMAT_CHARACTER 7 #define GD_E_FORMAT_BAD_LINE 8 #define GD_E_FORMAT_RES_NAME 9 #define GD_E_FORMAT_ENDIAN 10 #define GD_E_FORMAT_BAD_TYPE 11 #define GD_E_FORMAT_BAD_NAME 12 #define GD_E_FORMAT_UNTERM 13 #define GD_E_FORMAT_METARAW 14 #define GD_E_FORMAT_NO_FIELD 15 #define GD_E_FORMAT_DUPLICATE 16 #define GD_E_FORMAT_LOCATION 17 #define GD_E_FORMAT_PROTECT 18 #define GD_E_FORMAT_LITERAL 19 #define GD_E_FORMAT_WINDOP 20 #define GD_E_FORMAT_META_META 21 #define GD_E_FORMAT_ALIAS 22 #define GD_E_FORMAT_MPLEXVAL 23 /* deprecated syntax suberrors */ #define GD_E_FORMAT_NO_PARENT GD_E_FORMAT_NO_FIELD /* parser callback return values */ #define GD_SYNTAX_ABORT 0 #define GD_SYNTAX_RESCAN 1 #define GD_SYNTAX_IGNORE 2 #define GD_SYNTAX_CONTINUE 3 /* Protection levels */ #define GD_PROTECT_NONE 00 #define GD_PROTECT_FORMAT 01 #define GD_PROTECT_DATA 02 #define GD_PROTECT_ALL ( GD_PROTECT_DATA | GD_PROTECT_FORMAT ) /* Standards specifiers */ #define GD_VERSION_CURRENT (-1) #define GD_VERSION_LATEST (-2) #define GD_VERSION_EARLIEST (-3) /* this MUST be one less than the lowest allowed fragment index */ #define GD_ALL_FRAGMENTS (-1) #define GD_SCALAR_ENTRY_BIT 0x10 #define GD_SPECIAL_ENTRY_BIT 0x20 /* field types */ typedef enum { GD_NO_ENTRY = 0x00, GD_RAW_ENTRY = 0x01, GD_LINCOM_ENTRY = 0x02, GD_LINTERP_ENTRY = 0x03, GD_BIT_ENTRY = 0x04, GD_MULTIPLY_ENTRY = 0x05, GD_PHASE_ENTRY = 0x06, GD_INDEX_ENTRY = 0x07, GD_POLYNOM_ENTRY = 0x08, GD_SBIT_ENTRY = 0x09, GD_DIVIDE_ENTRY = 0x0A, GD_RECIP_ENTRY = 0x0B, GD_WINDOW_ENTRY = 0x0C, GD_MPLEX_ENTRY = 0x0D, GD_CONST_ENTRY = GD_SCALAR_ENTRY_BIT | 0x00, GD_STRING_ENTRY = GD_SCALAR_ENTRY_BIT | 0x01, GD_CARRAY_ENTRY = GD_SCALAR_ENTRY_BIT | 0x02, /* not a real entry type, but it's convenient to put this here */ GD_ALIAS_ENTRY = -1 } gd_entype_t; /* GD_NO_ENTRY and GD_ALIAS_ENTRY are not part of this count */ #define GD_N_ENTYPES 16 /* Special types for gd_nentries(3) and gd_entry_list(3) */ #define GD_ALL_ENTRIES 0 #define GD_VECTOR_ENTRIES (GD_SPECIAL_ENTRY_BIT | 0x01) #define GD_SCALAR_ENTRIES (GD_SPECIAL_ENTRY_BIT | 0x02) #define GD_ALIAS_ENTRIES GD_ALIAS_ENTRY /* gd_nentries(3) and gd_entry_list(3) flags */ #define GD_ENTRIES_HIDDEN 0x1 #define GD_ENTRIES_NOALIAS 0x2 /* the current location of the I/O pointer */ #define GD_HERE (-1) /* MPLEX lookback defines */ #define GD_DEFAULT_LOOKBACK 10 #define GD_LOOKBACK_ALL (-1) /* C data types */ #if ! defined GD_C89_API # include # define gd_int64_t int64_t # define gd_uint64_t uint64_t # define GD_DCOMPLEXM(v) double _Complex v # define GD_DCOMPLEXP(v) double _Complex *v typedef int64_t gd_shift_t; #else @DEFINE_gd_int64_t@ @DEFINE_gd_uint64_t@ # define GD_DCOMPLEXM(v) double v[2] # define GD_DCOMPLEXP(v) double *v typedef gd_int64_t gd_shift_t; #endif /* Deprecated types */ typedef int gd_bit_t; typedef unsigned int gd_spf_t; /* Data types -- No valid type may set 0x40 */ #define GD_SIZE8 0x001 #define GD_SIZE16 0x002 #define GD_SIZE32 0x004 #define GD_SIZE64 0x008 #define GD_SIZE128 0x010 #define GD_SIZE(x) ((x) & 0x01f) #define GD_SIGNED 0x020 #define GD_IEEE754 0x080 #define GD_COMPLEX 0x100 #define GD_CHAR 0x200 typedef enum { GD_NULL = 0, GD_UNKNOWN = 0xfa0, /* GD_SIZE(GD_UNKNOWN) MUST evaluate to zero */ GD_UINT8 = GD_SIZE8, GD_INT8 = GD_SIZE8 | GD_SIGNED, GD_UINT16 = GD_SIZE16, GD_INT16 = GD_SIZE16 | GD_SIGNED, GD_UINT32 = GD_SIZE32, GD_INT32 = GD_SIZE32 | GD_SIGNED, GD_UINT64 = GD_SIZE64, GD_INT64 = GD_SIZE64 | GD_SIGNED, GD_FLOAT32 = GD_SIZE32 | GD_IEEE754, GD_FLOAT64 = GD_SIZE64 | GD_IEEE754, GD_COMPLEX64 = GD_SIZE64 | GD_COMPLEX, GD_COMPLEX128 = GD_SIZE128 | GD_COMPLEX, } gd_type_t; /* deprecated type aliases */ #define GD_FLOAT GD_FLOAT32 #define GD_DOUBLE GD_FLOAT64 /* Window operations */ typedef enum { GD_WINDOP_UNK, GD_WINDOP_EQ, GD_WINDOP_GE, GD_WINDOP_GT, GD_WINDOP_LE, GD_WINDOP_LT, GD_WINDOP_NE, GD_WINDOP_SET, GD_WINDOP_CLR } gd_windop_t; struct gd_private_entry_; typedef union { gd_int64_t i; gd_uint64_t u; double r; } gd_triplet_t; /* Entry object flags */ #define GD_EN_COMPSCAL 0x1 /* entry has complex scalar parameters */ #define GD_EN_CALC 0x2 /* scalar field codes have been resolved */ #define GD_EN_HIDDEN 0x4 /* entry is hidden */ #define GD_EN_DOTTED 0x8 /* the field's name contains a dot (.) (i.e. Standards Version 5 or earlier) */ /* ANSI C does not permit anonymous structs/unions */ #ifdef GD_C89_API # define GD_ANON(x) x #else # define GD_ANON(x) #endif /* Unified entry struct */ struct gd_unified_entry_ { char *field; gd_entype_t field_type; char *in_fields[GD_MAX_LINCOM]; char *scalar[GD_MAX_POLYORD + 1]; int scalar_ind[GD_MAX_POLYORD + 1]; int fragment_index; unsigned flags; union { struct { /* RAW */ unsigned int spf; gd_type_t data_type; } GD_ANON(raw); struct { /* LINCOM */ int n_fields; double m[GD_MAX_LINCOM]; GD_DCOMPLEXM(cm[GD_MAX_LINCOM]); double b[GD_MAX_LINCOM]; GD_DCOMPLEXM(cb[GD_MAX_LINCOM]); } GD_ANON(lincom); struct { /* BIT and SBIT */ int bitnum; int numbits; } GD_ANON(bit); struct { /* POLYNOM */ int poly_ord; double a[GD_MAX_POLYORD + 1]; GD_DCOMPLEXM(ca[GD_MAX_POLYORD + 1]); } GD_ANON(polynom); struct { /* RECIP */ double dividend; GD_DCOMPLEXM(cdividend); } GD_ANON(recip); struct { /* LINTERP */ char *table; } GD_ANON(linterp); struct { /* PHASE */ gd_shift_t shift; } GD_ANON(phase); struct { /* WINDOW */ gd_windop_t windop; gd_triplet_t threshold; } GD_ANON(window); struct { /* MPLEX */ int count_val; int period; } GD_ANON(mplex); struct { /* CONST */ gd_type_t const_type; size_t array_len; } GD_ANON(scalar); } GD_ANON(u); struct gd_private_entry_ *e; }; typedef struct gd_unified_entry_ gd_entry_t; /* The dirfile object */ typedef struct gd_dirfile_ DIRFILE; /* Parser callback objects */ struct gd_callback_data_ { const DIRFILE *dirfile; int suberror; int linenum; const char *filename; char *line; size_t buflen; }; /* the carray list object */ struct gd_carray_data_ { size_t n; void *d; }; typedef struct gd_carray_data_ gd_carray_t; typedef struct gd_callback_data_ gd_parser_data_t; typedef int (*gd_parser_callback_t)(gd_parser_data_t*, void*); /* dirfile_flags --- 0xF0000000 are reserved */ #define GD_ACCMODE 0x00000001 /* mask */ #define GD_RDONLY 0x00000000 /* open read only */ #define GD_RDWR 0x00000001 /* open read/write */ #define GD_FORCE_ENDIAN 0x00000002 /* override endianness */ #define GD_BIG_ENDIAN 0x00000004 /* assume big-endian raw data */ #define GD_LITTLE_ENDIAN 0x00000008 /* assume litte-endian raw data */ #define GD_CREAT 0x00000010 /* create dirfile if it doesn't exist */ #define GD_EXCL 0x00000020 /* force creation: fail on existence */ #define GD_TRUNC 0x00000040 /* truncate dirfile (scary!) */ #define GD_PEDANTIC 0x00000080 /* be pedantic */ #define GD_FORCE_ENCODING 0x00000100 /* override encoding scheme */ #define GD_VERBOSE 0x00000200 /* be verbose */ #define GD_IGNORE_DUPS 0x00000400 /* ignore duplicate fields */ #define GD_IGNORE_REFS 0x00000800 /* ignore REFERENCE directives -- dirfile_include only */ #define GD_PRETTY_PRINT 0x00001000 /* make a nicer looking format file */ #if (defined __arm__ && !(defined __VFP_FP__ || defined __MAVERICK__)) # define GD_ARM_ENDIAN 0x00000000 /* ARM-endian doubles */ # define GD_NOT_ARM_ENDIAN 0x00002000 /* "normal"-endian doubles */ #else # define GD_ARM_ENDIAN 0x00002000 /* ARM-endian doubles */ # define GD_NOT_ARM_ENDIAN 0x00000000 /* "normal"-endian doubles */ #endif #define GD_PERMISSIVE 0x00004000 /* be permissive */ #define GD_TRUNCSUB 0x00008000 /* truncate subdirectories */ #define GD_ENCODING 0x0F000000 /* mask */ #define GD_AUTO_ENCODED 0x00000000 /* Encoding scheme unknown */ #define GD_UNENCODED 0x01000000 /* Data are not encoded */ #define GD_TEXT_ENCODED 0x02000000 /* Data are text encoded */ #define GD_SLIM_ENCODED 0x03000000 /* Data are slimlib encoded */ #define GD_GZIP_ENCODED 0x04000000 /* Data are gzip encoded */ #define GD_BZIP2_ENCODED 0x05000000 /* Data are bzip2 encoded */ #define GD_LZMA_ENCODED 0x06000000 /* Data are xz encoded */ #define GD_SIE_ENCODED 0x07000000 /* Data are sample index encoded */ #define GD_ZZIP_ENCODED 0x08000000 /* Data are zzip encoded */ #define GD_ZZSLIM_ENCODED 0x09000000 /* Data are zzslim encoded */ #define GD_FLAC_ENCODED 0x0A000000 /* Data are flac encoded */ #define GD_ENC_UNSUPPORTED GD_ENCODING /* Encoding unsupported */ /* delete flags */ #define GD_DEL_META 0x1 #define GD_DEL_DATA 0x2 #define GD_DEL_DEREF 0x4 #define GD_DEL_FORCE 0x8 /* move/rename flags */ #define GD_REN_DATA 0x1 #define GD_REN_UPDB 0x2 #define GD_REN_DANGLE 0x4 #define GD_REN_FORCE 0x8 /* seek flags */ #define GD_SEEK_SET 0x0 #define GD_SEEK_CUR 0x1 #define GD_SEEK_END 0x2 #define GD_SEEK_WRITE 0x4 /* desync flags */ #define GD_DESYNC_PATHCHECK 0x1 #define GD_DESYNC_REOPEN 0x2 extern int gd_add_alias(DIRFILE *dirfile, const char *alias_name, const char *target_code, int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_add_bit(DIRFILE *dirfile, const char *field_code, const char *in_field, int bitnum, int numbits, int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_add_clincom(DIRFILE *dirfile, const char *field_code, int n_fields, const char **in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb), int fragment_index) gd_nothrow gd_nonnull ((1,2,4,5,6)); extern int gd_add_carray(DIRFILE *dirfile, const char *field_code, gd_type_t const_type, size_t array_len, gd_type_t data_type, const void *values, int fragment_index) gd_nothrow gd_nonnull((1,2,6)); extern int gd_add_const(DIRFILE *dirfile, const char *field_code, gd_type_t const_type, gd_type_t data_type, const void *value, int fragment_index) gd_nothrow gd_nonnull ((1,2,5)); extern int gd_add_cpolynom(DIRFILE *dirfile, const char *field_code, int poly_ord, const char *in_field, const GD_DCOMPLEXP(ca), int fragment_index) gd_nothrow gd_nonnull ((1,2,4)); /* The native gd_add_crecip cannot be used in C89 mode */ #if ! defined GD_C89_API extern int gd_add_crecip(DIRFILE *dirfile, const char *field_code, const char *in_field, _Complex double cdividend, int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); #else #define gd_add_crecip gd_add_crecip89 #endif extern int gd_add_crecip89(DIRFILE *dirfile, const char *field_code, const char *in_field, const double cdividend[2], int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_add_divide(DIRFILE *dirfile, const char *field_code, const char *in_field1, const char *in_field2, int fragment_index) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_add_lincom(DIRFILE *dirfile, const char *field_code, int n_fields, const char **in_fields, const double *m, const double *b, int fragment_index) gd_nothrow gd_nonnull ((1,2,4,5,6)); extern int gd_add_linterp(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *table, int fragment_index) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_add_mplex(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *count_field, int count_val, int period, int fragment_index) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_add_multiply(DIRFILE *dirfile, const char *field_code, const char *in_field1, const char *in_field2, int fragment_index) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_add_phase(DIRFILE *dirfile, const char *field_code, const char *in_field, gd_shift_t shift, int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_add_polynom(DIRFILE *dirfile, const char *field_code, int poly_ord, const char *in_field, const double *a, int fragment_index) gd_nothrow gd_nonnull ((1,2,4)); extern int gd_add_recip(DIRFILE *dirfile, const char *field_code, const char *in_field, double dividend, int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_add_sbit(DIRFILE *dirfile, const char *field_code, const char *in_field, int bitnum, int numbits, int fragment_index) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_add_string(DIRFILE *dirfile, const char *field_code, const char *value, int fragment_index) gd_nothrow gd_nonnull((1,2,3)); extern int gd_add_window(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold, int fragment_index) gd_nothrow gd_nonnull ((1,2,3,4)); extern const char *gd_alias_target(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern const char **gd_aliases(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern int gd_alter_affixes(DIRFILE *dirfile, int index, const char *prefix, const char *suffix) gd_nothrow gd_nonnull ((1)); extern int gd_alter_bit(DIRFILE *dirfile, const char *field_code, const char *in_field, int bitnum, int numbits) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_carray(DIRFILE *dirfile, const char *field_code, gd_type_t const_type, size_t array_len) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_clincom(DIRFILE *dirfile, const char *field_code, int n_fields, const char **in_fields, const GD_DCOMPLEXP(m), const GD_DCOMPLEXP(b)) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_const(DIRFILE *dirfile, const char *field_code, gd_type_t const_type) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_cpolynom(DIRFILE *dirfile, const char *field_code, int poly_ord, const char *in_field, const GD_DCOMPLEXP(a)) gd_nothrow gd_nonnull((1,2)); #if ! defined GD_C89_API extern int gd_alter_crecip(DIRFILE *dirfile, const char *field_code, const char *in_field, _Complex double cdividend) gd_nothrow gd_nonnull((1,2)); #else #define gd_alter_crecip gd_alter_crecip89 #endif extern int gd_alter_crecip89(DIRFILE *dirfile, const char *field_code, const char *in_field, const double cdividend[2]) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_divide(DIRFILE *dirfile, const char *field_code, const char *in_field1, const char *in_field2) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_lincom(DIRFILE *dirfile, const char *field_code, int n_fields, const char **in_fields, const double *m, const double *b) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_mplex(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *count_field, int count_val, int period) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_multiply(DIRFILE *dirfile, const char *field_code, const char *in_field1, const char *in_field2) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_phase(DIRFILE *dirfile, const char *field_code, const char *in_field, gd_shift_t shift) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_polynom(DIRFILE *dirfile, const char *field_code, int poly_ord, const char *in_field, const double *a) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_recip(DIRFILE *dirfile, const char *field_code, const char *in_field, double cdividend) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_sbit(DIRFILE *dirfile, const char *field_code, const char *in_field, int bitnum, int numbits) gd_nothrow gd_nonnull((1,2)); extern int gd_alter_window(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold) gd_nothrow gd_nonnull((1,2)); extern size_t gd_array_len(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull((1,2)); extern size_t gd_carray_len(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull((1,2)) gd_deprecated; extern int gd_get_carray(DIRFILE *dirfile, const char *field_code, gd_type_t return_type, void *data_out) gd_nothrow gd_nonnull((1,2)); extern int gd_get_carray_slice(DIRFILE *dirfile, const char *field_code, unsigned long start, size_t n, gd_type_t return_type, void *data_out) gd_nothrow gd_nonnull((1,2)); extern int gd_put_carray(DIRFILE *dirfile, const char *field_code, gd_type_t data_type, const void *data_in) gd_nothrow gd_nonnull((1,2,4)); extern int gd_put_carray_slice(DIRFILE *dirfile, const char *field_code, unsigned long first, size_t n, gd_type_t data_type, const void *data_in) gd_nothrow gd_nonnull((1,2,6)); extern int gd_get_constant(DIRFILE *dirfile, const char *field_code, gd_type_t return_type, void *data) gd_nothrow gd_nonnull ((1, 2)); extern int gd_put_constant(DIRFILE *dirfile, const char *field_code, gd_type_t data_type, const void *data) gd_nothrow gd_nonnull ((1, 2, 4)); extern const void *gd_constants(DIRFILE *dirfile, gd_type_t return_type) gd_nothrow gd_nonnull ((1)); extern const gd_carray_t *gd_carrays(DIRFILE *dirfile, gd_type_t return_type) gd_nothrow gd_nonnull ((1)); extern unsigned long int gd_encoding(DIRFILE *dirfile, int fragment) gd_nothrow gd_nonnull ((1)); extern int gd_encoding_support(unsigned long encoding) gd_nothrow; extern unsigned long int gd_endianness(DIRFILE *dirfile, int fragment) gd_nothrow gd_nonnull((1)); extern int gd_entry(DIRFILE *dirfile, const char *field_code, gd_entry_t *entry) gd_nothrow gd_nonnull ((1, 2)); extern const char **gd_entry_list(DIRFILE *dirfile, const char *parent, int type, unsigned int flags) gd_nothrow gd_nonnull ((1)); extern gd_entype_t gd_entry_type(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1)); extern int gd_error(const DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern int gd_error_count(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern char *gd_error_string(const DIRFILE *dirfile, char *buffer, size_t buflen) gd_nothrow gd_nonnull ((1)); extern const char **gd_field_list(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern const char **gd_field_list_by_type(DIRFILE *dirfile, gd_entype_t type) gd_nothrow gd_nonnull ((1)); extern unsigned long gd_flags(DIRFILE *D, unsigned long set, unsigned long resest) gd_nothrow gd_nonnull ((1)); extern int gd_fragment_affixes(DIRFILE *dirfile, int index, char **prefix, char **suffix) gd_nothrow gd_nonnull ((1,3,4)); extern int gd_fragment_index(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1)); extern const char *gd_fragmentname(DIRFILE *dirfile, int index) gd_nothrow gd_nonnull ((1)); extern gd_entry_t *gd_free_entry_strings(gd_entry_t *entry) gd_nothrow; extern int gd_hidden(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern int gd_hide(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern DIRFILE *gd_invalid_dirfile(void) gd_nothrow; extern char *gd_linterp_tablename(DIRFILE *D, const char *field_code) gd_nothrow gd_nonnull ((1, 2)); extern int gd_madd(DIRFILE *dirfile, const gd_entry_t *entry, const char *parent) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_madd_alias(DIRFILE *dirfile, const char *parent, const char *alias_name, const char *target_code) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_bit(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, int bitnum, int numbits) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_carray(DIRFILE *dirfile, const char *parent, const char *field_code, gd_type_t const_type, size_t array_len, gd_type_t data_type, const void *values) gd_nothrow gd_nonnull((1,2,3,7)); extern int gd_madd_clincom(DIRFILE *dirfile, const char *parent, const char *field_code, int n_fields, const char **in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb)) gd_nothrow gd_nonnull((1,2,3,5,6,7)); extern int gd_madd_const(DIRFILE *dirfile, const char *parent, const char *field_code, gd_type_t const_type, gd_type_t data_type, const void *value) gd_nothrow gd_nonnull ((1,2,3,6)); extern int gd_madd_cpolynom(DIRFILE *dirfile, const char *parent, const char *field_code, int poly_ord, const char *in_field, const GD_DCOMPLEXP(ca)) gd_nothrow gd_nonnull ((1,2,3,5)); #if ! defined GD_C89_API extern int gd_madd_crecip(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, _Complex double cdividend) gd_nothrow gd_nonnull ((1,2,3,4)); #else #define gd_madd_crecip gd_madd_crecip89 #endif extern int gd_madd_crecip89(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const double cdividend[2]) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_divide(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field1, const char *in_field2) gd_nothrow gd_nonnull ((1,2,3,4,5)); extern int gd_madd_lincom(DIRFILE *dirfile, const char *parent, const char *field_code, int n_fields, const char **in_fields, const double *m, const double *b) gd_nothrow gd_nonnull((1,2,3,5,6,7)); extern int gd_madd_linterp(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const char *table) gd_nothrow gd_nonnull ((1,2,3,4,5)); extern int gd_madd_mplex(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const char *count_field, int count_val, int period) gd_nothrow gd_nonnull ((1,2,3,4,5)); extern int gd_madd_multiply(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field1, const char *in_field2) gd_nothrow gd_nonnull ((1,2,3,4,5)); extern int gd_madd_phase(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, gd_shift_t shift) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_polynom(DIRFILE *dirfile, const char *parent, const char *field_code, int poly_ord, const char *in_field, const double *a) gd_nothrow gd_nonnull ((1,2,3,5)); extern int gd_madd_recip(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, double dividend) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_sbit(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, int bitnum, int numbits) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_spec(DIRFILE *dirfile, const char *line, const char *parent) gd_nothrow gd_nonnull ((1,2,3)); extern int gd_madd_string(DIRFILE *dirfile, const char *parent, const char *field_code, const char *value) gd_nothrow gd_nonnull ((1,2,3,4)); extern int gd_madd_window(DIRFILE *dirfile, const char *parent, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold) gd_nothrow gd_nonnull ((1,2,3,4,5)); extern int gd_dirfile_standards(DIRFILE *dirfile, int vers) gd_nothrow gd_nonnull ((1)); extern const void *gd_mconstants(DIRFILE *dirfile, const char *parent, gd_type_t return_type) gd_nothrow gd_nonnull((1,2)); extern const gd_carray_t *gd_mcarrays(DIRFILE *dirfile, const char *parent, gd_type_t return_type) gd_nothrow; extern const char **gd_mfield_list(DIRFILE *dirfile, const char *parent) gd_nothrow gd_nonnull((1,2)); extern const char **gd_mfield_list_by_type(DIRFILE *dirfile, const char *parent, gd_entype_t type) gd_nothrow gd_nonnull((1,2)); extern void gd_mplex_lookback(DIRFILE *dirfile, int lookback) gd_nothrow gd_nonnull((1)); extern const char **gd_mstrings(DIRFILE *dirfile, const char *parent) gd_nothrow gd_nonnull((1,2)); extern const char **gd_mvector_list(DIRFILE *dirfile, const char *parent) gd_nothrow gd_nonnull((1,2)); extern const char *gd_dirfilename(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern unsigned int gd_naliases(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern gd_type_t gd_native_type(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern unsigned int gd_nentries(DIRFILE *D, const char *parent, int type, unsigned int flags) gd_nothrow gd_nonnull ((1)); extern unsigned int gd_nfields(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern unsigned int gd_nfields_by_type(DIRFILE *dirfile, gd_entype_t type) gd_nothrow gd_nonnull ((1)); extern int gd_nfragments(DIRFILE *dirfile) gd_nothrow gd_nonnull((1)); extern unsigned int gd_nmfields(DIRFILE *dirfile, const char *parent) gd_nothrow gd_nonnull((1,2)); extern unsigned int gd_nmfields_by_type(DIRFILE *dirfile, const char *parent, gd_entype_t type) gd_nothrow gd_nonnull((1,2)); extern unsigned int gd_nmvectors(DIRFILE *dirfile, const char *parent) gd_nothrow gd_nonnull((1,2)); extern unsigned int gd_nvectors(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern int gd_parent_fragment(DIRFILE *dirfile, int fragment_index) gd_nothrow gd_nonnull ((1)); extern void gd_parser_callback(DIRFILE *dirfile, gd_parser_callback_t sehandler, void*) gd_nothrow gd_nonnull ((1)); extern int gd_alter_protection(DIRFILE *dirfile, int protection_level, int fragment_index) gd_nothrow gd_nonnull ((1)); extern int gd_protection(DIRFILE *dirfile, int fragment_index) gd_nothrow gd_nonnull ((1)); extern char *gd_raw_filename(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1, 2)); extern const char *gd_reference(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1)); extern unsigned int gd_spf(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1, 2)); extern size_t gd_get_string(DIRFILE *dirfile, const char *field_code, size_t len, char *data) gd_nothrow gd_nonnull ((1, 2)); extern size_t gd_put_string(DIRFILE *dirfile, const char *field_code, const char *data) gd_nothrow gd_nonnull ((1, 2, 3)); extern const char **gd_strings(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); extern char *gd_strtok(DIRFILE *D, const char *string) gd_nothrow gd_nonnull ((1)); extern int gd_unhide(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern int gd_validate(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull((1,2)); extern int gd_verbose_prefix(DIRFILE *D, const char *prefix) gd_nothrow gd_nonnull ((1)); extern const char **gd_vector_list(DIRFILE *dirfile) gd_nothrow gd_nonnull((1)); /* The following functions contain calls to I/O functions, making them * cancellation points. As a result we cannot mark them with gd_nothrow. */ extern int gd_add(DIRFILE *dirfile, const gd_entry_t *entry) gd_nonnull((1,2)); extern int gd_add_raw(DIRFILE *dirfile, const char *field_code, gd_type_t data_type, unsigned int spf, int fragment_index) gd_nonnull((1,2)); extern int gd_add_spec(DIRFILE *dirfile, const char *line, int fragment_index) gd_nonnull ((1,2)); extern int gd_alter_encoding(DIRFILE *dirfile, unsigned long int encoding, int fragment, int recode) gd_nonnull ((1)); extern int gd_alter_endianness(DIRFILE *dirfile, unsigned long int byte_sex, int fragment, int recode) gd_nonnull ((1)); extern int gd_alter_entry(DIRFILE *dirfile, const char *field_code, const gd_entry_t *entry, int recode) gd_nonnull ((1,2)); extern int gd_alter_linterp(DIRFILE *dirfile, const char *field_code, const char *in_field, const char *table, int recode) gd_nonnull ((1,2)); extern int gd_alter_raw(DIRFILE *dirfile, const char *field_code, gd_type_t data_type, unsigned int spf, int recode) gd_nonnull ((1,2)); extern int gd_alter_spec(DIRFILE *dirfile, const char *line, int recode) gd_nonnull ((1,2)); extern DIRFILE *gd_cbopen(const char *dirfilename, unsigned long int flags, gd_parser_callback_t sehandler, void *extra) gd_nonnull ((1)); extern int gd_close(DIRFILE *dirfile); extern int gd_delete(DIRFILE *dirfile, const char *field_code, unsigned int flags) gd_nonnull ((1,2)); extern int gd_desync(DIRFILE *dirfile, unsigned int flags); extern int gd_discard(DIRFILE *dirfile); extern int gd_flush(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1)); extern int gd_include(DIRFILE *dirfile, const char *file, int fragment_index, unsigned long int flags) gd_nonnull ((1,2)); extern int gd_include_affix(DIRFILE *dirfile, const char *file, int fragment_index, const char *prefix, const char *suffix, unsigned long int flags) gd_nonnull ((1,2)); extern double gd_framenum(DIRFILE *dirfile, const char *field_code, double value) gd_nonnull ((1,2)); extern int gd_malter_spec(DIRFILE *dirfile, const char *line, const char *parent, int recode) gd_nonnull ((1,2,3)); extern int gd_metaflush(DIRFILE *dirfile) gd_nonnull ((1)); extern int gd_move(DIRFILE *dirfile, const char *field_code, int new_fragment, unsigned flags) gd_nonnull ((1,2)); extern DIRFILE *gd_open(const char *dirfilename, unsigned long int flags) gd_nonnull ((1)); extern int gd_raw_close(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1)); extern int gd_rename(DIRFILE *dirfile, const char *old_code, const char *new_name, unsigned flags) gd_nonnull ((1,2,3)); extern int gd_rewrite_fragment(DIRFILE *dirfile, int fragment) gd_nonnull ((1)); extern int gd_sync(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1)); extern int gd_uninclude(DIRFILE *dirfile, int fragment_index, int del) gd_nonnull ((1)); #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64 /* Expose the 64-bit API */ #ifndef GD_64BIT_API #define GD_64BIT_API #endif /* Force the use of the 64-bit API */ #define gd_alter_frameoffset gd_alter_frameoffset64 #define gd_getdata gd_getdata64 #define gd_putdata gd_putdata64 #define gd_framenum_subset gd_framenum_subset64 #define gd_frameoffset gd_frameoffset64 #define gd_nframes gd_nframes64 #define gd_bof gd_bof64 #define gd_eof gd_eof64 #define gd_seek gd_seek64 #define gd_tell gd_tell64 #else /* the following functions are _FILE_OFFSET_BITS sensitive. */ extern int gd_alter_frameoffset(DIRFILE *dirfile, off_t offset, int fragment, int recode) gd_nonnull ((1)); extern size_t gd_getdata(DIRFILE *dirfile, const char *field_code, off_t first_frame, off_t first_sample, size_t num_frames, size_t num_samples, gd_type_t return_type, void *data) gd_nonnull ((1, 2)); extern size_t gd_putdata(DIRFILE *dirfile, const char *field_code, off_t first_frame, off_t first_sample, size_t num_frames, size_t num_samples, gd_type_t data_type, const void *data) gd_nonnull ((1, 2)); extern double gd_framenum_subset(DIRFILE *dirfile, const char *field_code, double value, off_t field_start, off_t field_end) gd_nonnull ((1,2)); extern off_t gd_frameoffset(DIRFILE *dirfile, int fragment) gd_nothrow gd_nonnull ((1)); extern off_t gd_nframes(DIRFILE *dirfile) gd_nonnull ((1)); extern off_t gd_bof(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern off_t gd_eof(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1,2)); extern off_t gd_seek(DIRFILE *dirfile, const char *field_code, off_t frame_num, off_t sample_num, int whence) gd_nonnull ((1,2)); extern off_t gd_tell(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); #endif #ifdef _LARGEFILE64_SOURCE #ifndef GD_64BIT_API #define GD_64BIT_API #endif #endif /* This is the explicitly 64-bit API */ #ifdef GD_64BIT_API #ifdef __off64_t_defined typedef __off64_t gd_off64_t; #elif (defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64) typedef off_t gd_off64_t; #else typedef gd_int64_t gd_off64_t; #endif extern int gd_alter_frameoffset64(DIRFILE *dirfile, gd_off64_t offset, int fragment, int recode) gd_nonnull ((1)); extern size_t gd_getdata64(DIRFILE *dirfile, const char *field_code, gd_off64_t first_frame, gd_off64_t first_samp, size_t num_frames, size_t num_samp, gd_type_t return_type, void *data) gd_nonnull ((1, 2)); extern size_t gd_putdata64(DIRFILE *dirfile, const char *field_code, gd_off64_t first_frame, gd_off64_t first_sample, size_t num_frames, size_t num_samples, gd_type_t data_type, const void *data) gd_nonnull ((1, 2)); extern gd_off64_t gd_frameoffset64(DIRFILE *dirfile, int fragment) gd_nonnull((1)); extern double gd_framenum_subset64(DIRFILE *dirfile, const char *field_code, double value, gd_off64_t field_start, gd_off64_t field_end) gd_nonnull ((1,2)); extern gd_off64_t gd_nframes64(DIRFILE *dirfile) gd_nonnull ((1)); extern gd_off64_t gd_bof64(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); extern gd_off64_t gd_eof64(DIRFILE *dirfile, const char *field_code) gd_nonnull ((1,2)); extern gd_off64_t gd_seek64(DIRFILE *dirfile, const char *field_code, gd_off64_t frame_num, gd_off64_t sample_num, int whence) gd_nonnull ((1,2)); extern gd_off64_t gd_tell64(DIRFILE *dirfile, const char *field_code) gd_nothrow gd_nonnull ((1,2)); #endif #ifdef __cplusplus } #endif /* If this symbol is defined here, the legacy API is present in the library */ @DEFINE_GD_LEGACY_API@ /* The caller can disable the legacy API by defining GD_NO_LEGACY_API * before including getdata.h */ #ifndef GD_NO_LEGACY_API /* include the legacy api, if present */ # ifdef GD_LEGACY_API # include # endif #endif /* Library version information */ @DEFINE_GD_GETDATA_VERSION@ /* This is (major * 10000) + (minor * 100) + revision */ @DEFINE_GD_GETDATA_INT_VERSION@ /* function aliases */ #ifdef GD_FUNCTION_ALIASES # warning "Using deprecated function aliases." # define dirfile_add gd_add # define dirfile_add_bit gd_add_bit # define dirfile_add_clincom gd_add_clincom # define dirfile_add_const gd_add_const # define dirfile_add_cpolynom gd_add_cpolynom # define dirfile_add_lincom gd_add_lincom # define dirfile_add_linterp gd_add_linterp # define dirfile_add_multiply gd_add_multiply # define dirfile_add_phase gd_add_phase # define dirfile_add_polynom gd_add_polynom # define dirfile_add_raw gd_add_raw # define dirfile_add_sbit gd_add_sbit # define dirfile_add_spec gd_add_spec # define dirfile_add_string gd_add_string # define dirfile_alter_bit gd_alter_bit # define dirfile_alter_clincom gd_alter_clincom # define dirfile_alter_const gd_alter_const # define dirfile_alter_cpolynom gd_alter_cpolynom # define dirfile_alter_encoding gd_alter_encoding # define dirfile_alter_endianness gd_alter_endianness # define dirfile_alter_entry gd_alter_entry # define dirfile_alter_frameoffset gd_alter_frameoffset # define dirfile_alter_frameoffset64 gd_alter_frameoffset64 # define dirfile_alter_lincom gd_alter_lincom # define dirfile_alter_linterp gd_alter_linterp # define dirfile_alter_multiply gd_alter_multiply # define dirfile_alter_phase gd_alter_phase # define dirfile_alter_polynom gd_alter_polynom # define dirfile_alter_raw gd_alter_raw # define dirfile_alter_sbit gd_alter_sbit # define dirfile_alter_spec gd_alter_spec # define dirfile_cbopen gd_cbopen # define dirfile_close gd_close # define get_constant gd_get_constant # define put_constant gd_put_constant # define get_constants gd_constants # define getdata gd_getdata # define putdata gd_putdata # define getdata64 gd_getdata64 # define putdata64 gd_putdata64 # define dirfile_delete gd_delete # define dirfile_discard gd_discard # define get_encoding gd_encoding # define get_endianness gd_endianness # define get_entry gd_entry # define get_entry_type gd_entry_type # define get_error gd_error # define get_error_string gd_error_string # define get_field_list gd_field_list # define get_field_list_by_type gd_field_list_by_type # define dirfile_flush gd_flush # define get_fragment_index gd_fragment_index # define get_fragmentname gd_fragmentname # define get_framenum_subset gd_framenum_subset # define get_framenum_subset64 gd_framenum_subset64 # define get_frameoffset gd_frameoffset # define get_frameoffset64 gd_frameoffset64 # define dirfile_free_entry_strings gd_free_entry_strings # define dirfile_include gd_include # define dirfile_madd gd_madd # define dirfile_madd_bit gd_madd_bit # define dirfile_madd_clincom gd_madd_clincom # define dirfile_madd_const gd_madd_const # define dirfile_madd_cpolynom gd_madd_cpolynom # define dirfile_madd_lincom gd_madd_lincom # define dirfile_madd_linterp gd_madd_linterp # define dirfile_madd_multiply gd_madd_multiply # define dirfile_madd_phase gd_madd_phase # define dirfile_madd_polynom gd_madd_polynom # define dirfile_madd_sbit gd_madd_sbit # define dirfile_madd_spec gd_madd_spec # define dirfile_madd_string gd_madd_string # define dirfile_malter_spec gd_malter_spec # define get_mconstants gd_mconstants # define dirfile_metaflush gd_metaflush # define get_mfield_list gd_mfield_list # define get_mfield_list_by_type gd_mfield_list_by_type # define dirfile_move gd_move # define get_mstrings gd_mstrings # define get_mvector_list gd_mvector_list # define dirfilename gd_dirfilename # define get_native_type gd_native_type # define get_nfields gd_nfields # define get_nfields_by_type gd_nfields_by_type # define get_nfragments gd_nfragments # define get_nframes gd_nframes # define get_nframes64 gd_nframes64 # define get_nmfields gd_nmfields # define get_nmfields_by_type gd_nmfields_by_type # define get_nmvectors gd_nmvectors # define get_nvectors gd_nvectors # define dirfile_open gd_open # define get_parent_fragment gd_parent_fragment # define dirfile_parser_callback gd_parser_callback # define dirfile_protect gd_alter_protection # define get_protection gd_protection # define get_raw_filename gd_raw_filename # define dirfile_reference gd_reference # define get_reference(D) gd_reference(D,NULL) # define dirfile_rename gd_rename # define get_spf gd_spf # define dirfile_standards gd_dirfile_standards # define get_string gd_get_string # define put_string gd_put_string # define get_strings gd_strings # define dirfile_uninclude gd_uninclude # define dirfile_validate gd_validate # define get_vector_list gd_vector_list #endif #endif libgetdata-0.9.0/src/close.c0000640000175000017500000000577412614323564016061 0ustar alastairalastair/* Copyright (C) 2008, 2010, 2012, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* _GD_FreeD: free the DIRFILE and its subordinates */ static void _GD_FreeD(DIRFILE *D, int keep_dirfile) { unsigned int i; int j; dtrace("%p, %i", D, keep_dirfile); for (i = 0; i < D->n_entries; ++i) _GD_FreeE(D, D->entry[i], 1); for (j = 0; j < D->n_fragment; ++j) { free(D->fragment[j].enc_data); free(D->fragment[j].prefix); free(D->fragment[j].suffix); free(D->fragment[j].bname); free(D->fragment[j].cname); free(D->fragment[j].ename); free(D->fragment[j].sname); free(D->fragment[j].ref_name); } free(D->entry); free(D->tok_base); free(D->dot_list); free(D->error_prefix); free(D->error_string); free(D->error_file); for (j = 0; j < GD_N_ENTRY_LISTS; ++j) free(D->entry_list[j]); free(D->string_value_list); free(D->const_value_list); if (D->carray_value_list) { for (i = 0; D->carray_value_list[i].n != 0; ++i) free(D->carray_value_list[i].d); free(D->carray_value_list); } free(D->fragment); free(D->name); for (i = 0; i < D->ndir; ++i) free(D->dir[i].path); free(D->dir); if (!keep_dirfile) free(D); dreturnvoid(); } int _GD_ShutdownDirfile(DIRFILE* D, int flush_meta, int keep_dirfile) { unsigned int i; dtrace("%p, %i, %i", D, flush_meta, keep_dirfile); if (D == NULL) { dreturn("%i", 0); return 0; } _GD_ClearError(D); /* Flush */ if (flush_meta) _GD_FlushMeta(D, GD_ALL_FRAGMENTS, 0); for(i = 0; i < D->n_entries; ++i) if (D->entry[i]->field_type == GD_RAW_ENTRY) _GD_Flush(D, D->entry[i], 0, 1); if (D->error) { dreturn("%i", 1); return -1; } #ifndef GD_NO_DIR_OPEN /* close the directory */ for (i = 0; i < (unsigned int)D->ndir; ++i) close(D->dir[i].fd); #endif _GD_FreeD(D, keep_dirfile); dreturn("%i", 0); return 0; } int gd_close(DIRFILE *D) { int ret; dtrace("%p", D); ret = _GD_ShutdownDirfile(D, 1, 0); dreturn("%i", ret); return ret; } int gd_discard(DIRFILE* D) { int ret; dtrace("%p", D); ret = _GD_ShutdownDirfile(D, 0, 0); dreturn("%i", ret); return ret; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/native.c0000640000175000017500000001151012614323564016223 0ustar alastairalastair/* Copyright (C) 2009-2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" gd_type_t _GD_NativeType(DIRFILE *restrict D, gd_entry_t *restrict E, int repr) { gd_type_t type = GD_UNKNOWN; int i; dtrace("%p, %p, %i", D, E, repr); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%u", type); return type; } switch(E->field_type) { case GD_RAW_ENTRY: type = E->EN(raw,data_type); break; case GD_LINCOM_ENTRY: if (!(E->flags & GD_EN_CALC)) _GD_CalculateEntry(D, E, 1); if (E->flags & GD_EN_COMPSCAL) { type = GD_COMPLEX128; break; } type = GD_FLOAT64; for (i = 0; i < E->EN(lincom,n_fields); ++i) { if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) break; if (_GD_NativeType(D, E->e->entry[i], E->e->repr[i]) & GD_COMPLEX) { type = GD_COMPLEX128; break; } } break; case GD_LINTERP_ENTRY: /* initialise the table, if necessary */ if (E->e->u.linterp.table_len < 0) { _GD_ReadLinterpFile(D, E); if (D->error != GD_E_OK) break; } type = E->e->u.linterp.complex_table ? GD_COMPLEX128 : GD_FLOAT64; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) || _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { break; } type = (_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX || _GD_NativeType(D, E->e->entry[1], E->e->repr[1]) & GD_COMPLEX) ? GD_COMPLEX128 : GD_FLOAT64; break; case GD_RECIP_ENTRY: if (!(E->flags & GD_EN_CALC)) _GD_CalculateEntry(D, E, 1); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; type = ((_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX) || (E->flags & GD_EN_COMPSCAL)) ? GD_COMPLEX128 : GD_FLOAT64; break; case GD_BIT_ENTRY: case GD_INDEX_ENTRY: type = GD_UINT64; break; case GD_PHASE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; type = _GD_NativeType(D, E->e->entry[0], E->e->repr[0]); break; case GD_POLYNOM_ENTRY: if (!(E->flags & GD_EN_CALC)) _GD_CalculateEntry(D, E, 1); if (E->flags & GD_EN_COMPSCAL) { type = GD_COMPLEX128; break; } if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; type = (_GD_NativeType(D, E->e->entry[0], E->e->repr[0]) & GD_COMPLEX) ? GD_COMPLEX128 : GD_FLOAT64; break; case GD_SBIT_ENTRY: type = GD_INT64; break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: type = _GD_ConstType(D, E->EN(scalar,const_type)); break; case GD_STRING_ENTRY: type = GD_NULL; break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: _GD_InternalError(D); } /* representation */ if (repr != GD_REPR_NONE) { if (type == GD_COMPLEX128) type = GD_FLOAT64; else if (type == GD_COMPLEX64) type = GD_FLOAT32; } /* catch errors */ if (D->error) type = GD_UNKNOWN; D->recurse_level--; dreturn("0x%02x", type); return type; } gd_type_t gd_native_type(DIRFILE* D, const char* field_code_in) gd_nothrow { gd_type_t type = GD_UNKNOWN; gd_entry_t* entry; int repr; char* field_code; dtrace("%p, \"%s\"", D, field_code_in); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("0x%x", GD_UNKNOWN); return GD_UNKNOWN; } _GD_ClearError(D); entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("0x%x", GD_UNKNOWN); return GD_UNKNOWN; } type = _GD_NativeType(D, entry, repr); if (field_code != field_code_in) free(field_code); dreturn("0x%x", type); return type; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/field_list.c0000640000175000017500000003603312614323564017062 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* zero length lists */ static const char* zero_list[1] = { NULL }; static const gd_carray_t zero_carrays[1] = { {0, NULL} }; gd_static_inline_ int _GD_EntryIndex(unsigned int t) { int i; dtrace("%u", t); switch(t) { case GD_RAW_ENTRY: i = 0; break; case GD_LINCOM_ENTRY: i = 1; break; case GD_LINTERP_ENTRY: i = 2; break; case GD_BIT_ENTRY: i = 3; break; case GD_MULTIPLY_ENTRY: i = 4; break; case GD_PHASE_ENTRY: i = 5; break; case GD_INDEX_ENTRY: i = 6; break; case GD_POLYNOM_ENTRY: i = 7; break; case GD_SBIT_ENTRY: i = 8; break; case GD_DIVIDE_ENTRY: i = 9; break; case GD_RECIP_ENTRY: i = 10; break; case GD_WINDOW_ENTRY: i = 11; break; case GD_MPLEX_ENTRY: i = 12; break; case GD_CONST_ENTRY: i = 13; break; case GD_CARRAY_ENTRY: i = 14; break; case GD_STRING_ENTRY: i = 15; break; case GD_VECTOR_ENTRIES: i = 16; break; case GD_SCALAR_ENTRIES: i = 17; break; case GD_ALIAS_ENTRY: i = 18; break; case GD_ALL_ENTRIES: i = 19; break; default: i = -1; break; } dreturn("%i", i); return i; } /* returns true if E a member of the given list */ int _GD_ListEntry(const gd_entry_t *E, int meta, int hidden, int noalias, int special, gd_entype_t type) { dtrace("%p{%s}, %i, %i, %i, %i, 0x%X", E, E->field, meta, hidden, noalias, special, type); /* check hidden */ if (!hidden && (E->flags & GD_EN_HIDDEN)) { dreturn("%i (hidden)", 0); return 0; } /* check meta */ if (!meta && E->e->n_meta == -1) { dreturn("%i (meta)", 0); return 0; } /* aliases */ if (E->field_type == GD_ALIAS_ENTRY) { int ret = 0; if (noalias) { dreturn("%i (alias)", 0); return 0; } /* that's right: GD_ALIAS_ENTRY + noalias gets you what you deserve */ if (special == GD_ALIAS_ENTRIES) { dreturn("%i (aliases)", 1); return 1; } if (E->e->entry[0]) ret = _GD_ListEntry(E->e->entry[0], meta, hidden, 0, special, type); dreturn("%i", ret); return ret; } /* type check */ if (special == GD_VECTOR_ENTRIES && (E->field_type & GD_SCALAR_ENTRY_BIT)) { dreturn("%i (vector)", 0); return 0; } else if (special == GD_SCALAR_ENTRIES && !(E->field_type & GD_SCALAR_ENTRY_BIT)) { dreturn("%i (scalar)", 0); return 0; } else if (special == GD_ALIAS_ENTRIES) { /* we weeded out aliases earlier */ dreturn("%i (aliases)", 0); return 0; } else if (type && E->field_type != type) { dreturn("%i (type)", 0); return 0; } dreturn("%i", 1); return 1; } static const char **_GD_EntryList(DIRFILE *D, struct gd_private_entry_ *p, size_t offs, int type, unsigned int flags) gd_nothrow { char** el; int i, index; unsigned int u, n = 0; const int special = (type & GD_SPECIAL_ENTRY_BIT) ? type : 0; const gd_entype_t ctype = (type & GD_SPECIAL_ENTRY_BIT) ? GD_NO_ENTRY : (gd_entype_t)type; const int hidden = (flags & GD_ENTRIES_HIDDEN); const int noalias = (flags & GD_ENTRIES_NOALIAS); dtrace("%p, %p, %" PRNsize_t ", 0x%X, 0x%X", D, p, offs, type, flags); index = _GD_EntryIndex(type); if (index < 0) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, NULL, type, NULL); dreturn("%p", NULL); return NULL; } if (p) { if (p->entry_list_validity & (1 << index) && p->entry_list_flags[index] == flags) { /* list already made */ dreturn("%p", p->entry_list[index]); return p->entry_list[index]; } } else if (D->entry_list_validity & (1 << index) && D->entry_list_flags[index] == flags) { /* list already made */ dreturn("%p", D->entry_list[index]); return D->entry_list[index]; } n = _GD_NEntries(D, p, type, flags); if (D->error) { dreturn("%p", NULL); return NULL; } if (n == 0) { dreturn("%p", zero_list); return zero_list; } el = _GD_Malloc(D, sizeof(*el) * (n + 1)); if (el == NULL) { dreturn("%p", NULL); return NULL; } n = 0; if (p) { for (i = 0; i < p->n_meta; ++i) if (_GD_ListEntry(p->p.meta_entry[i], 1, hidden, noalias, special, ctype)) el[n++] = p->p.meta_entry[i]->field + offs; free(p->entry_list[index]); p->entry_list[index] = (const char **)el; p->entry_list_flags[index] = flags; p->entry_list_validity |= 1 << index; } else { for (u = 0; u < D->n_entries; ++u) if (_GD_ListEntry(D->entry[u], 0, hidden, noalias, special, ctype)) el[n++] = D->entry[u]->field; free(D->entry_list[index]); D->entry_list[index] = (const char **)el; D->entry_list_flags[index] = flags; D->entry_list_validity |= 1 << index; } el[n] = NULL; dreturn("%p", (const char **)el); return (const char **)el; } const char **gd_entry_list(DIRFILE* D, const char *parent, int type, unsigned int flags) gd_nothrow { const char **el; size_t offs = 0; struct gd_private_entry_ *p = NULL; dtrace("%p, \"%s\", %i, %u", D, parent, type, flags); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%u", 0); return 0; } if (parent) { gd_entry_t *P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL || P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%u", 0); return 0; } p = P->e; offs = strlen(P->field) + 1; } _GD_ClearError(D); el = _GD_EntryList(D, p, offs, type, flags); dreturn("%p", el); return el; } const void *gd_constants(DIRFILE* D, gd_type_t return_type) gd_nothrow { unsigned int i, n; char* fl; dtrace("%p, 0x%x", D, return_type); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); if ((n = _GD_NEntries(D, NULL, GD_CONST_ENTRY, 0)) == 0) { dreturn("%p", NULL); return NULL; } fl = (char *)_GD_Alloc(D, return_type, n); if (fl == NULL) { dreturn("%p", NULL); return NULL; } for (i = n = 0; i < D->n_entries; ++i) { if (_GD_ListEntry(D->entry[i], 0, 0, 0, 0, GD_CONST_ENTRY)) if (_GD_DoField(D, D->entry[i], 0, 0, 1, return_type, fl + n++ * GD_SIZE(return_type)) != 1) break; } free(D->const_value_list); D->const_value_list = fl; dreturn("%p", D->error ? NULL : D->const_value_list); return D->error ? NULL : D->const_value_list; } const gd_carray_t *gd_carrays(DIRFILE* D, gd_type_t return_type) gd_nothrow { unsigned int i, n; gd_carray_t* fl; dtrace("%p, 0x%x", D, return_type); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); if ((n = _GD_NEntries(D, NULL, GD_CARRAY_ENTRY, 0)) == 0) { dreturn("%p", zero_carrays); return zero_carrays; } fl = _GD_Malloc(D, sizeof(*fl) * (n + 1)); if (fl == NULL) { dreturn("%p", NULL); return NULL; } memset(fl, 0, sizeof(gd_carray_t) * (n + 1)); for (i = n = 0; i < D->n_entries; ++i) { if (_GD_ListEntry(D->entry[i], 0, 0, 0, 0, GD_CARRAY_ENTRY)) { fl[n].n = D->entry[i]->EN(scalar,array_len); fl[n].d = _GD_Alloc(D, return_type, fl[n].n); if (D->error || _GD_DoField(D, D->entry[i], 0, 0, fl[n].n, return_type, fl[n].d) < 1) break; n++; } } fl[n].n = 0; if (D->carray_value_list) for (i = 0; D->carray_value_list[i].n != 0; ++i) free(D->carray_value_list[i].d); free(D->carray_value_list); D->carray_value_list = fl; dreturn("%p", D->error ? NULL : fl); return D->error ? NULL : fl; } const char **gd_strings(DIRFILE* D) gd_nothrow { unsigned int i, n; char** fl; dtrace("%p", D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); if ((n = _GD_NEntries(D, NULL, GD_STRING_ENTRY, 0)) == 0) { dreturn("%p", zero_list); return zero_list; } if (D->value_list_validity & GD_LIST_VALID_STRING_VALUE) { /* list already made */ dreturn("%p", D->string_value_list); return D->string_value_list; } fl = _GD_Malloc(D, sizeof(*fl) * (n + 1)); if (fl == NULL) { dreturn("%p", NULL); return NULL; } for (i = n = 0; i < D->n_entries; ++i) { if (_GD_ListEntry(D->entry[i], 0, 0, 0, 0, GD_STRING_ENTRY)) fl[n++] = D->entry[i]->e->u.string; } fl[n] = NULL; free(D->string_value_list); D->string_value_list = (const char **)fl; D->value_list_validity |= GD_LIST_VALID_STRING_VALUE; dreturn("%p", D->string_value_list); return D->string_value_list; } const char **gd_field_list_by_type(DIRFILE* D, gd_entype_t type) gd_nothrow { const char** el; dtrace("%p, 0x%X", D, type); el = gd_entry_list(D, NULL, type, 0); dreturn("%p", el); return el; } const char **gd_vector_list(DIRFILE* D) gd_nothrow { const char **el; dtrace("%p", D); el = gd_entry_list(D, NULL, GD_VECTOR_ENTRIES, 0); dreturn("%p", el); return el; } const char **gd_field_list(DIRFILE* D) gd_nothrow { const char **el; dtrace("%p", D); el = gd_entry_list(D, NULL, GD_ALL_ENTRIES, 0); dreturn("%p", el); return el; } const void *gd_mconstants(DIRFILE* D, const char* parent, gd_type_t return_type) gd_nothrow { int i, n; char* fl; gd_entry_t *P; struct gd_private_entry_ *e; dtrace("%p, \"%s\", 0x%x", D, parent, return_type); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL || P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%p", NULL); return NULL; } e = P->e; if ((n = gd_nmfields_by_type(D, parent, GD_CONST_ENTRY)) == 0) { dreturn("%p", NULL); return NULL; } fl = (char *)_GD_Alloc(D, return_type, n); if (fl == NULL) { dreturn("%p", NULL); return NULL; } /* DoField will implicitly choose GD_REPR_AUTO for complex data being returned * as purely real */ for (i = n = 0; i < e->n_meta; ++i) { if (_GD_ListEntry(e->p.meta_entry[i], 1, 0, 0, 0, GD_CONST_ENTRY)) if (_GD_DoField(D, e->p.meta_entry[i], 0, 0, 1, return_type, fl + n++ * GD_SIZE(return_type)) != 1) break; } free(e->const_value_list); e->const_value_list = fl; dreturn("%p", e->const_value_list); return e->const_value_list; } const gd_carray_t *gd_mcarrays(DIRFILE* D, const char* parent, gd_type_t return_type) gd_nothrow { int i, n; gd_carray_t *fl; gd_entry_t *P; struct gd_private_entry_ *e; dtrace("%p, \"%s\", 0x%x", D, parent, return_type); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL || P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%p", NULL); return NULL; } e = P->e; if ((n = gd_nmfields_by_type(D, parent, GD_CARRAY_ENTRY)) == 0) { dreturn("%p", zero_carrays); return zero_carrays; } fl = _GD_Malloc(D, sizeof(*fl) * (n + 1)); if (fl == NULL) { dreturn("%p", NULL); return NULL; } /* DoField will implicitly choose GD_REPR_AUTO for complex data being returned * as purely real */ for (i = n = 0; i < e->n_meta; ++i) { if (_GD_ListEntry(e->p.meta_entry[i], 1, 0, 0, 0, GD_CARRAY_ENTRY)) { fl[n].n = e->p.meta_entry[i]->EN(scalar,array_len); fl[n].d = _GD_Alloc(D, return_type, fl[n].n); if (D->error || _GD_DoField(D, e->p.meta_entry[i], 0, 0, fl[n].n, return_type, fl[n].d) < 1) break; n++; } } fl[n].n = 0; if (e->carray_value_list) for (i = 0; e->carray_value_list[i].n != 0; ++i) free(e->carray_value_list[i].d); free(e->carray_value_list); e->carray_value_list = fl; dreturn("%p", D->error ? NULL : fl); return D->error ? NULL : fl; } const char **gd_mstrings(DIRFILE* D, const char* parent) gd_nothrow { int i, n; char** fl; gd_entry_t *P; struct gd_private_entry_ *e; dtrace("%p, \"%s\"", D, parent); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL || P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%p", NULL); return NULL; } e = P->e; if ((n = gd_nmfields_by_type(D, parent, GD_STRING_ENTRY)) == 0) { dreturn("%p", zero_list); return zero_list; } fl = _GD_Malloc(D, sizeof(*fl) * (n + 1)); if (fl == NULL) { dreturn("%p", NULL); return NULL; } for (i = n = 0; i < e->n_meta; ++i) if (_GD_ListEntry(e->p.meta_entry[i], 1, 0, 0, 0, GD_STRING_ENTRY)) fl[n++] = e->p.meta_entry[i]->e->u.string; fl[n] = NULL; free(e->string_value_list); e->string_value_list = (const char **)fl; dreturn("%p", e->string_value_list); return e->string_value_list; } const char **gd_mfield_list_by_type(DIRFILE* D, const char* parent, gd_entype_t type) gd_nothrow { const char **el; dtrace("%p, \"%s\", 0x%X", D, parent, type); el = gd_entry_list(D, parent, type, 0); dreturn("%p", el); return el; } const char **gd_mvector_list(DIRFILE* D, const char* parent) gd_nothrow { const char **el; dtrace("%p, \"%s\"", D, parent); el = gd_entry_list(D, parent, GD_VECTOR_ENTRIES, 0); dreturn("%p", el); return el; } const char **gd_mfield_list(DIRFILE* D, const char* parent) gd_nothrow { const char **el; dtrace("%p, \"%s\"", D, parent); el = gd_entry_list(D, parent, GD_ALL_ENTRIES, 0); dreturn("%p", el); return el; } libgetdata-0.9.0/src/nfields.c0000640000175000017500000000736612614323564016377 0ustar alastairalastair/* Copyright (C) 2008, 2010, 2012, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" unsigned int _GD_NEntries(DIRFILE *D, struct gd_private_entry_ *p, int type, unsigned int flags) { int i; unsigned int u, n = 0; const int special = (type & GD_SPECIAL_ENTRY_BIT) ? type : 0; const gd_entype_t ctype = (type & GD_SPECIAL_ENTRY_BIT) ? GD_NO_ENTRY : (gd_entype_t)type; const int hidden = (flags & GD_ENTRIES_HIDDEN); const int noalias = (flags & GD_ENTRIES_NOALIAS); dtrace("%p, %p, 0x%X, 0x%X", D, p, type, flags); /* check for invalid type */ if (ctype && _GD_InvalidEntype(ctype)) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, NULL, type, NULL); dreturn("%u", 0); return 0; } if (p) { for (i = 0; i < p->n_meta; ++i) if (_GD_ListEntry(p->p.meta_entry[i], 1, hidden, noalias, special, ctype)) n++; } else { for (u = 0; u < D->n_entries; ++u) if (_GD_ListEntry(D->entry[u], 0, hidden, noalias, special, ctype)) n++; } dreturn("%u", n); return n; } unsigned int gd_nentries(DIRFILE *D, const char *parent, int type, unsigned int flags) gd_nothrow { unsigned int n; struct gd_private_entry_ *p = NULL; dtrace("%p, \"%s\", 0x%X, 0x%X", D, parent, type, flags); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%u", 0); return 0; } if (parent) { gd_entry_t *P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL || P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, P ? GD_E_CODE_INVALID : GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%u", 0); return 0; } p = P->e; } _GD_ClearError(D); n = _GD_NEntries(D, p, type, flags); dreturn("%u", n); return n; } unsigned int gd_nfields(DIRFILE* D) gd_nothrow { unsigned int n; dtrace("%p", D); n = gd_nentries(D, NULL, 0, 0); dreturn("%u", n); return n; } unsigned int gd_nvectors(DIRFILE* D) gd_nothrow { unsigned int n; dtrace("%p", D); n = gd_nentries(D, NULL, GD_VECTOR_ENTRIES, 0); dreturn("%u", n); return n; } unsigned int gd_nfields_by_type(DIRFILE* D, gd_entype_t type) gd_nothrow { unsigned int n; dtrace("%p, 0x%X", D, type); n = gd_nentries(D, NULL, type, 0); dreturn("%u", n); return n; } unsigned int gd_nmfields(DIRFILE* D, const char* parent) gd_nothrow { unsigned int n; dtrace("%p, \"%s\"", D, parent); n = gd_nentries(D, parent, 0, 0); dreturn("%u", n); return n; } unsigned int gd_nmvectors(DIRFILE* D, const char* parent) gd_nothrow { unsigned int n; dtrace("%p, \"%s\"", D, parent); n = gd_nentries(D, parent, GD_VECTOR_ENTRIES, 0); dreturn("%u", n); return n; } unsigned int gd_nmfields_by_type(DIRFILE* D, const char* parent, gd_entype_t type) gd_nothrow { unsigned int n; dtrace("%p, \"%s\", %i", D, parent, type); n = gd_nentries(D, parent, type, 0); dreturn("%u", n); return n; } libgetdata-0.9.0/src/nframes.c0000640000175000017500000000532512614323564016377 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2009, 2011-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #undef gd_nframes64 off64_t gd_nframes64(DIRFILE* D) { off64_t nf; dtrace("%p", D); _GD_ClearError(D); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } if (D->reference_field == NULL) { dreturn("%i", 0); return 0; } if (!_GD_Supports(D, D->reference_field, GD_EF_NAME | GD_EF_SIZE)) { dreturn("%i", 0); return 0; } if ((*_GD_ef[D->reference_field->e->u.raw.file[0].subenc].name)(D, (const char*)D->fragment[D->reference_field->fragment_index].enc_data, D->reference_field->e->u.raw.file, D->reference_field->e->u.raw.filebase, 0, 0)) { dreturn("%i", 0); return 0; } /* If the reference field is open for writing, close it first to flush the * data */ if (D->reference_field->e->u.raw.file[0].mode & GD_FILE_WRITE) { _GD_FiniRawIO(D, D->reference_field, D->reference_field->fragment_index, GD_FINIRAW_KEEP); if (D->error) { dreturn("%i", 0); return 0; } } nf = (*_GD_ef[D->reference_field->e->u.raw.file[0].subenc].size)( D->fragment[D->reference_field->fragment_index].dirfd, D->reference_field->e->u.raw.file, D->reference_field->EN(raw,data_type), _GD_FileSwapBytes(D, D->reference_field)); if (nf < 0) { _GD_SetEncIOError(D, GD_E_IO_READ, D->reference_field->e->u.raw.file); dreturn("%lli", 0LL); return 0; } nf /= D->reference_field->EN(raw,spf); nf += D->fragment[D->reference_field->fragment_index].frame_offset; dreturn("%lli", (unsigned long long)nf); return nf; } /* 32(ish)-bit wrapper for the 64-bit version, when needed */ off_t gd_nframes(DIRFILE* D) { return (off_t)gd_nframes64(D); } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/getdata_legacy.h0000640000175000017500000000706612614323564017712 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2003-2005 Theodore Kisner * Copyright (C) 2005-2010 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GETDATA_LEGACY_H #define GETDATA_LEGACY_H /* Sanity check */ #ifndef GETDATA_H #error "Never use directly; include instead." #endif extern const char *GD_ERROR_CODES[GD_N_ERROR_CODES] gd_deprecated; struct RawEntryType { const char* field; char type; int size; int samples_per_frame; }; struct LincomEntryType { const char *field; int n_fields; const char *in_fields[GD_MAX_LINCOM]; double m[GD_MAX_LINCOM], b[GD_MAX_LINCOM]; }; struct LinterpEntryType { const char *field, *raw_field, *linterp_file; int n_interp; double *x, *y; }; struct MultiplyEntryType { const char *field; const char *in_fields[2]; }; struct MPlexEntryType { const char *field, *cnt_field, *data_field; int i; int max_i; }; struct BitEntryType { const char *field, *raw_field; int bitnum, numbits; }; struct PhaseEntryType { const char *field, *raw_field; int shift; }; /* The old Format type */ struct FormatType { const char* FileDirName; int frame_offset; struct RawEntryType first_field; struct RawEntryType *rawEntries; int n_raw; struct LincomEntryType *lincomEntries; int n_lincom; struct LinterpEntryType *linterpEntries; int n_linterp; struct MultiplyEntryType *multiplyEntries; int n_multiply; struct MPlexEntryType *mplexEntries; int n_mplex; struct BitEntryType *bitEntries; int n_bit; struct PhaseEntryType *phaseEntries; int n_phase; }; #ifdef __cplusplus extern "C" { #endif extern struct FormatType *GetFormat(const char *filedir, int *error_code) gd_nothrow gd_nonnull ((1,2)) gd_deprecated; /* legacy API for get_error_string() */ extern char* GetDataErrorString(char* buffer, size_t buflen) gd_nothrow gd_nonnull ((1)) gd_deprecated; /* legacy API for getdata() */ extern int GetData(const char *dirfilename, const char *field_code, int first_frame, int first_samp, int num_frames, int num_samp, char return_type, void *data_out, int *error_code) gd_nonnull ((1,2,9)) gd_deprecated; /* legacy API for get_nframes() */ extern int GetNFrames(const char *dirfilename, int *error_code, const void *unused) gd_nonnull ((1,2)) gd_deprecated; /* legacy API for get_spf() */ extern int GetSamplesPerFrame(const char *dirfilename, const char *field_code, int *error_code) gd_nothrow gd_nonnull ((1,2,3)) gd_deprecated; /* legacy API for putdata() */ extern int PutData(const char *filename_in, const char *field_code, int first_frame, int first_samp, int num_frames, int num_samp, char data_type, const void *data_in, int *error_code) gd_nonnull ((1,2,9)) gd_deprecated; #ifdef __cplusplus } #endif #endif libgetdata-0.9.0/src/string.c0000640000175000017500000001235512614323564016253 0ustar alastairalastair/* Copyright (C) 2008, 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static int gd_get_sarray_slice(DIRFILE *D, const char *field_code, unsigned long start, size_t n, const char **data_out) gd_nothrow { gd_entry_t *E; dtrace("%p, \"%s\", %lu, %" PRNsize_t ", %p", D, field_code, start, n, data_out); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (E->field_type != GD_STRING_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); dreturn("%i", -1); return -1; } else if (start + n > ((E->field_type == GD_STRING_ENTRY) ? 1 : E->EN(scalar,array_len))) { _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* nothing to do */ if (n == 0) { dreturn("%i", 0); return 0; } if (E->field_type == GD_STRING_ENTRY) data_out[0] = E->e->u.string; else memcpy(data_out, ((const char **)E->e->u.scalar.d) + start, n * sizeof(const char*)); dreturn("%i", 0); return 0; } size_t gd_get_string(DIRFILE *D, const char *field_code, size_t len, char *data_out) gd_nothrow { size_t n_read; const char *ptr; dtrace("%p, \"%s\", %" PRNsize_t ", %p", D, field_code, len, data_out); /* get string */ if (gd_get_sarray_slice(D, field_code, 0, 1, &ptr)) { dreturn("%i", 0); return 0; } /* copy into user buffer */ if (len > 0 && data_out != NULL) strncpy(data_out, ptr, len); n_read = strlen(ptr) + 1; dreturn("%" PRNsize_t, n_read); return n_read; } static size_t _GD_PutSarraySlice(DIRFILE *restrict D, gd_entry_t *restrict E, unsigned long first, size_t n, const char **data_in) { size_t len; dtrace("%p, %p, %lu, %" PRNsize_t ", %p", D, E, first, n, data_in); if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", 0); return 0; } if (first + n > ((E->field_type == GD_STRING_ENTRY) ? 1 : E->EN(scalar,array_len))) { _GD_SetError(D, GD_E_BOUNDS, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } if (n == 0) { /* succesfully did nothing. */ dreturn("%i", 1); return 1; } if (E->field_type == GD_STRING_ENTRY) { char *ptr = E->e->u.string; E->e->u.string = _GD_Strdup(D, *data_in); if (E->e->u.string == NULL) { E->e->u.string = ptr; dreturn("%i", 0); return 0; } free(ptr); } else { /* copy */ size_t i; char **new_data = _GD_Malloc(D, n * sizeof(char*)); if (new_data == NULL) { dreturn("%i", 0); return 0; } memset(new_data, 0, n * sizeof(char*)); for (i = 0; i < n; ++i) new_data[i] = _GD_Strdup(D, data_in[i]); if (D->error) { for (i = 0; i < n; ++i) free(new_data[i]); free(new_data); dreturn("%i", 0); return 0; } /* replace elements */ for (i = 0; i < n; ++i) { free(((char**)E->e->u.scalar.d)[i + first]); ((char**)E->e->u.scalar.d)[i + first] = new_data[i]; } free(new_data); } D->fragment[E->fragment_index].modified = 1; len = strlen(data_in[0]) + 1; dreturn("%" PRNsize_t, len); return len; } size_t gd_put_string(DIRFILE *D, const char *field_code, const char *data_in) gd_nothrow { size_t n_wrote = 0; gd_entry_t *E; dtrace("%p, \"%s\", \"%s\"", D, field_code, data_in); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); else if (E->field_type != GD_STRING_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); } else n_wrote = _GD_PutSarraySlice(D, E, 0, 1, &data_in); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/compat.c0000640000175000017500000002740012614323564016225 0ustar alastairalastair/* Copyright (C) 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* The MSVCRT gmtime() is threadsafe */ #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t *restrict timep, struct tm *restrict result) { struct tm *ptr; dtrace("%p, %p", timep, result); ptr = gmtime(timep); if (!ptr) return NULL; memcpy(result, ptr, sizeof(struct tm)); dreturn("%p", result); return result; } #endif /* ...at() functions for platforms lacking them. These are originally Solaris * extensions which have subsequently been included in POSIX.1-2008. */ #ifndef HAVE_OPENAT int gd_OpenAt(const DIRFILE *D, int dirfd, const char *name, int flags, mode_t mode) { int ret; char *path; dtrace("%p, %i, \"%s\", 0x%X, 0%o", D, dirfd, name, flags, mode); path = _GD_MakeFullPathOnly(D, dirfd, name); ret = open(path, flags | O_BINARY, mode); free(path); dreturn("%i", ret); return ret; } #endif #ifndef HAVE_RENAMEAT int gd_RenameAt(const DIRFILE *D, int olddirfd, const char *oldname, int newdirfd, const char *newname) { int ret; char *oldpath, *newpath; dtrace("%p, %i, \"%s\", %i, \"%s\"", D, olddirfd, oldname, newdirfd, newname); newpath = _GD_MakeFullPathOnly(D, newdirfd, newname); #ifdef __MSVCRT__ if (unlink(newpath)) { if (errno != ENOENT) { free(newpath); dreturn("%i", -1); return -1; } } #endif oldpath = _GD_MakeFullPathOnly(D, olddirfd, oldname); ret = rename(oldpath, newpath); free(newpath); free(oldpath); dreturn("%i", ret); return ret; } #endif #ifndef HAVE_FSTATAT #ifndef AT_SYMLINK_NOFOLLOW #define AT_SYMLINK_NOFOLLOW 0 /* will never match */ #endif int gd_StatAt(const DIRFILE* D, int dirfd, const char* name, struct stat* buf, int flags) { int ret; char *path; dtrace("%p, %i, \"%s\", %p, 0x%X", D, dirfd, name, buf, flags); path = _GD_MakeFullPathOnly(D, dirfd, name); #ifdef HAVE_LSTAT if (flags & AT_SYMLINK_NOFOLLOW) ret = lstat(path, buf); else #endif ret = stat(path, buf); free(path); dreturn("%i", ret); return ret; } #endif #if !defined HAVE_FSTATAT64 && !defined GD_NO_64BIT_STAT int gd_StatAt64(const DIRFILE* D, int dirfd, const char* name, gd_stat64_t* buf, int flags gd_unused_) { int ret; char *path; dtrace("%p, %i, \"%s\", %p, ", D, dirfd, name, buf); path = _GD_MakeFullPathOnly(D, dirfd, name); ret = gd_stat64(path, buf); free(path); dreturn("%i", ret); return ret; } #endif #ifndef HAVE_UNLINKAT int gd_UnlinkAt(const DIRFILE *D, int dirfd, const char *name, int flags gd_unused_) { int ret; char *path; dtrace("%p, %i, \"%s\", ", D, dirfd, name); path = _GD_MakeFullPathOnly(D, dirfd, name); ret = unlink(path); free(path); dreturn("%i", ret); return ret; } #endif /* Non-threadsafe version of strerror_r */ #ifndef HAVE_STRERROR_R int strerror_r(int errnum, char *buf, size_t buflen) { char *ptr; dtrace("%i, %p, %" PRNsize_t, errnum, buf, buflen); ptr = strerror(errnum); strncpy(buf, ptr, buflen); dreturn("%i", 0); return 0; } #endif /* A getdelim() for platforms lacking it. getdelim was originally a GNU * extension and has subsequently been POSIXised in POSIX.1-2008. */ #ifndef HAVE_GETDELIM ssize_t getdelim(char **lineptr, size_t *n, int delim, FILE *stream) { size_t nread; ssize_t count = 0; char *p, *q; size_t len, new_len; off64_t pos; dtrace("%p, %p, '\\x%02x', %p", lineptr, n, (char)delim, stream); /* create a new buffer, if necessary */ if (*lineptr == NULL || *n == 0) { *lineptr = (char *)malloc(*n = 100); if (*lineptr == NULL) { dreturn("%i", -1); return -1; } } p = *lineptr; len = *n; /* apparently getdelim returns -1 if encountering EOF at the start of * a read, so try reading some text before beginning the main loop */ pos = ftello64(stream); nread = fread(p, 1, len, stream); if (nread == 0) { /* this is an error or EOF with no data read */ dreturn("%i", -1); return -1; } for (;;) { /* look for delim */ q = (char *)memchr(p, delim, nread); if (q) { #ifdef __MSVCRT__ int r; off64_t new_pos; #endif /* found delim */ count += (q - p) + 1; /* make sure we have room for a terminating NUL */ new_len = count; /* rewind */ pos += (q - p); #ifndef __MSVCRT__ pos++; #endif fseeko64(stream, pos, SEEK_SET); #ifdef __MSVCRT__ /* Even when we open a text file in binary mode, fseek/ftell seem able * to screw up. So, do things the hard way. */ r = fgetc(stream); new_pos = ftello64(stream); while (r != EOF && (new_pos <= pos || r != '\n')) { r = fgetc(stream); new_pos = ftello64(stream); } #endif } else { /* no delim, increase the buffer size */ count += nread; p += nread; if (count == GD_SSIZE_T_MAX) { /* out of ssize_t room */ errno = EOVERFLOW; dreturn("%i", -1); return -1; } else if (count >= GD_SSIZE_T_MAX / 2) new_len = GD_SSIZE_T_MAX; else new_len = count * 2; len = new_len - count; } /* realloc, if necessary */ if (*n < new_len) { char *ptr = (char *)realloc(*lineptr, new_len); if (!ptr) { dreturn("%i", -1); return -1; } *n = new_len; p = ptr + (p - *lineptr); *lineptr = ptr; } /* quit if there's no need to read more */ if (q) break; if (feof(stream)) { q = p - 1; break; } /* read some more */ pos = ftello64(stream); nread = fread(p, 1, len, stream); } *(q + 1) = '\0'; dreturn("%li %li (\"%s\")", (long int)count, (long int)*n, *lineptr); return count; } #endif #ifndef HAVE_BASENAME char *basename(char *path) { char *last_elem, *ptr; last_elem = path; for (ptr = path; *ptr; ++ptr) if ((*ptr == '/' || *ptr == GD_DIRSEP) && *(ptr + 1)) last_elem = ptr + 1; return last_elem; } #endif /* emulate readdir_r(3) with non-threadsafe readdir(3) */ #ifndef HAVE_READDIR_R int _GD_ReadDir(DIR *dirp, struct dirent *entry, struct dirent **result) { struct dirent *local_entry; dtrace("%p, %p, %p", dirp, entry, result); errno = 0; local_entry = readdir(dirp); if (local_entry == NULL) { *result = NULL; if (errno) { dreturn("%i", errno); return errno; } dreturn("%i", 0); return 0; } *result = entry; memcpy(entry, local_entry, sizeof(struct dirent)); dreturn("%i", 0); return 0; } #endif /* the MSVCRT's strtod isn't POSIX compliant */ #ifdef __MSVCRT__ double gd_strtod(const char *nptr, char **endptr) { const char *ptr = nptr; double r = 0; int sign = 0; dtrace("\"%s\", %p", nptr, endptr); /* the basic problem here is that MSVCRT's strtod() doesn't properly covert * hexadecimal numbers, nor does it do the special values "INF" and "NAN". */ /* skip sign */ if (*ptr == '+' || *ptr == '-') { if (*ptr == '-') sign = 0x80; ptr++; } /* check for hex, either integer or floating point */ if (*ptr == '0' && (*(ptr + 1) | 0x20) == 'x') { double fact = 1.; /* we store the mantissa in r */ for (ptr += 2; *ptr; ++ptr) { if ((*ptr >= '0' && *ptr <= '9') || ((*ptr | 0x20) >= 'a' && (*ptr | 0x20) <= 'f')) { if (fact == 1.) r *= 16; else if (fact == 0.) fact = 1./16; else fact /= 16; if (*ptr >= '0' && *ptr <= '9') r += fact * (*ptr - '0'); else r += fact * ((*ptr | 0x20) - 'a' + 10); } else if (*ptr == '.' && fact == 1.) fact = 0.; else if ((*ptr | 0x20) == 'p') { /* use strtol to get exponent, which is in decimal */ long exp = strtol(ptr + 1, endptr, 10); r *= pow(2., exp); /* to avoid setting it again */ endptr = NULL; break; } else break; } if (endptr) *endptr = (char*)ptr; if (sign) r = -r; dreturn("%g (%c)", r, endptr ? **endptr : '-'); return r; } else if ((*ptr | 0x20) == 'n') { if (((*(ptr + 1) | 0x20) == 'a') && ((*(ptr + 2) | 0x20) == 'n')) { /* an IEEE-754 double-precision quiet NaN: * * 1111 1111 1111 1111 1111 1111 1111 1111 * 1111 1111 1111 1111 1111 1111 1111 1111 * = 0xFFFFFFFFFFFFFFFF * * (a signalling NaN doesn't set the MSB of the mantissa) * * There are several of these; this one is nice because it's byte-sex * independent, unlike INF below. */ const union { unsigned char x[8]; double d; } nan_punning = {{ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }}; if (endptr) { *endptr = (char*)(ptr += 3); /* a NaN may end with something in parentheses */ if (*ptr == '(') { while (*++ptr) { if (*ptr == ')') { *endptr = (char*)(ptr + 1); break; } } } } /* return NaN */ dreturn("%g (%c)", nan_punning.d, endptr ? **endptr : '-'); return nan_punning.d; } } else if ((*ptr | 0x20) == 'i') { if (((*(ptr + 1) | 0x20) == 'n') && ((*(ptr + 2) | 0x20) == 'f')) { /* an IEEE-754 double-precision infinity (s is the sign bit): * * s111 1111 1111 1000 0000 0000 0000 0000 * 0000 0000 0000 0000 0000 0000 0000 0000 * = 0x7FF0000000000000 (+INF), or * 0xFFF0000000000000 (-INF) */ const union { unsigned char x[8]; double d; } inf_punning = {{ #ifdef ARM_ENDIAN_DOUBLES 0x00, 0x00, 0xF0, 0x7F | sign, 0x00, 0x00, 0x00, 0x00 #elif defined(FLOATS_BIGENDIAN) 0x7F | sign, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 #else 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x7F | sign #endif }}; if (endptr) { *endptr = (char*)(ptr += 3); /* INF may also be INFINITY, disregarding case */ if ( ((*ptr | 0x20) == 'i') && ((*(ptr + 1) | 0x20) == 'n') && ((*(ptr + 2) | 0x20) == 'i') && ((*(ptr + 3) | 0x20) == 't') && ((*(ptr + 4) | 0x20) == 'y')) { *endptr += 5; } } /* return signed infinity */ dreturn("%g (%c)", inf_punning.d, endptr ? **endptr : '-'); return inf_punning.d; } } /* otherwise, just run strtod */ r = strtod(nptr, endptr); dreturn("%g (%c)", r, endptr ? **endptr : '-'); return r; } #endif /* There are two versions of this function: one deals with no strerror_r, * the other with GNU's non XSI-conforming strerror_r */ #if !defined HAVE_STRERROR_R || defined STRERROR_R_CHAR_P int gd_strerror(int errnum, char *buf, size_t buflen) { char *ptr; dtrace("%i, %p, %" PRNsize_t, errnum, buf, buflen); #ifdef STRERROR_R_CHAR_P ptr = strerror_r(errnum, buf, buflen); if (ptr != buf) #else ptr = strerror(errnum); #endif { strncpy(buf, ptr, buflen); buf[buflen - 1] = 0; } dreturn("%i", 0); return 0; } #endif libgetdata-0.9.0/src/legacy.c0000640000175000017500000004057512614323564016216 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2003-2005 Theodore Kisner * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static struct { unsigned int n; DIRFILE** D; } _GD_Dirfiles = {0, NULL}; /* Error-reporting kludge for deprecated API */ static DIRFILE _GD_GlobalErrors = { #ifndef GD_NO_C99_API .error = 0, .suberror = 0, .error_string = NULL, .error_file = NULL, .error_line = 0, .stdlib_errno = 0, .flags = GD_INVALID, #else 0, 0, NULL, NULL, 0, 0, GD_INVALID #endif }; /* old error strings */ const char *GD_ERROR_CODES[GD_N_ERROR_CODES] = { "Success", /* GD_E_OK */ NULL, /* unused */ "Error in Format file", /* GD_E_FORMAT */ NULL, /* unused */ NULL, /* GD_E_CREAT */ "Bad field code", /* GD_E_BAD_CODE */ "Bad data type", /* GD_E_BAD_TYPE */ "I/O error", /* GD_E_IO */ NULL, /* unused */ "Internal error", /* GD_E_INTERNAL_ERROR */ "Memory allocation failed", /* GD_E_ALLOC */ "Request out-of-range", /* GD_E_RANGE */ "Bad LINTERP table", /* GD_E_LINTERP */ "Too many levels of recursion", /* GD_E_RECURSE_LEVEL */ "Bad dirfile", /* GD_E_BAD_DIRFILE */ "Bad field type", /* GD_E_BAD_FIELD_TYPE */ "Read-only dirfile", /* GD_E_ACC_MODE */ "Operation not supported by current encoding scheme", /* GD_E_UNSUPPORTED */ "Unknown encoding scheme", /* GD_E_UNKNOWN_ENCODING */ NULL, /* GD_E_BAD_ENTRY */ NULL, /* GD_E_DUPLICATE */ "Scalar field found where vector field expected", /* GD_E_DIMENSION */ NULL, /* GD_E_BAD_INDEX */ "Scalar field code not found", /* GD_E_BAD_SCALAR */ "Bad REFERENCE field", /* GD_E_BAD_REFERENCE */ "Operation prohibited by protection level", /* GD_E_PROTECTED */ NULL, /* GD_E_DELETE */ "Bad argument", /* GD_E_ARGUMENT */ NULL, /* GD_E_CALLBACK */ NULL, /* GD_E_EXISTS */ NULL, /* GD_E_UNCLEAN_DB */ "Improper domain", /* GD_E_DOMAIN */ "Bad representation", /* GD_E_BAD_REPR */ NULL, /* unused */ NULL, /* unused */ NULL, /* GD_E_BOUNDS */ "Line too long", /* GD_E_LINE_TOO_LONG */ }; static struct FormatType Format; /* _GD_CopyGlobalError: Copy the last error message to the global error buffer. */ static int _GD_CopyGlobalError(DIRFILE* D) { dtrace("%p", D); _GD_GlobalErrors.suberror = D->suberror; _GD_GlobalErrors.error_line = D->error_line; free(_GD_GlobalErrors.error_file); _GD_GlobalErrors.error_file = (D->error_file) ? strdup(D->error_file) : NULL; free(_GD_GlobalErrors.error_string); _GD_GlobalErrors.error_string = (D->error_string) ? strdup(D->error_string) : NULL; dreturn("%i", D->error); return _GD_GlobalErrors.error = D->error; } /* legacy wrapper for gd_error_string() */ char *GetDataErrorString(char* buffer, size_t buflen) gd_nothrow { return gd_error_string(&_GD_GlobalErrors, buffer, buflen); } /* _GD_GetDirfile: Locate the legacy DIRFILE given the filespec. This started * life as GetFormat... */ static DIRFILE *_GD_GetDirfile(const char *filename_in, int mode, int *error_code) { unsigned int i_dirfile; void *ptr; char *filedir; dtrace("\"%s\", %x", filename_in, mode); filedir = strdup(filename_in); if (!filedir) { *error_code = GD_E_ALLOC; dreturn("%p", NULL); return NULL; } if (filedir[strlen(filedir) - 1] == '/') filedir[strlen(filedir) - 1] = '\0'; /* first check to see if we have already read it */ for (i_dirfile = 0; i_dirfile < _GD_Dirfiles.n; i_dirfile++) { if (strcmp(filedir, _GD_Dirfiles.D[i_dirfile]->name) == 0) { /* if the dirfile was previously opened read-only, close it so we can * re-open it read-write */ if ((mode & GD_RDWR) && (_GD_Dirfiles.D[i_dirfile]->flags & GD_ACCMODE) == GD_RDONLY) { /* close it */ gd_discard(_GD_Dirfiles.D[i_dirfile]); /* copy the last dirfile in the list over top of this one and decrement * the counter -- next realloc will do nothing */ _GD_Dirfiles.D[i_dirfile] = _GD_Dirfiles.D[--_GD_Dirfiles.n]; } else { free(filedir); _GD_ClearError(_GD_Dirfiles.D[i_dirfile]); dreturn("%p", _GD_Dirfiles.D[i_dirfile]); return _GD_Dirfiles.D[i_dirfile]; } } } /* if we get here, the file has not yet been read */ /* Allocate the memory, then fill. If we have an error, */ /* we will have to free the memory... */ ptr = realloc(_GD_Dirfiles.D, (_GD_Dirfiles.n + 1) * sizeof(*_GD_Dirfiles.D)); if (ptr == NULL) { *error_code = _GD_GlobalErrors.error = GD_E_ALLOC; free(filedir); dreturn("%p", NULL); return NULL; } _GD_Dirfiles.D = ptr; /* Open a dirfile */ _GD_Dirfiles.D[_GD_Dirfiles.n] = gd_open(filedir, mode); free(filedir); /* Error encountered -- clean up */ if (_GD_Dirfiles.D[_GD_Dirfiles.n]->error != GD_E_OK) { *error_code = _GD_CopyGlobalError(_GD_Dirfiles.D[_GD_Dirfiles.n]); gd_discard(_GD_Dirfiles.D[_GD_Dirfiles.n]); dreturn("%p", NULL); return NULL; } dreturn("%p", _GD_Dirfiles.D[_GD_Dirfiles.n]); return _GD_Dirfiles.D[_GD_Dirfiles.n++]; } static void CopyRawEntry(struct RawEntryType* R, gd_entry_t* E) { dtrace("%p, %p", R, E); if (E == NULL) { dreturnvoid(); return; } R->field = E->field; switch(E->EN(raw,data_type)) { case GD_UINT8: R->type = 'c'; break; case GD_UINT16: R->type = 'u'; break; case GD_INT16: R->type = 's'; break; case GD_UINT32: R->type = 'U'; break; case GD_INT32: R->type = 'S'; break; case GD_FLOAT32: R->type = 'f'; break; case GD_FLOAT64: R->type = 'd'; break; default: /* Well, this isn't right, but it's the best we can do. */ R->type = 'n'; break; } R->size = (int)E->e->u.raw.size; R->samples_per_frame = (int)E->EN(raw,spf); dreturnvoid(); } /* We operate under the myth that POLYNOMs are actually LINCOMs. We report them * to have one input field, and discard non-linear terms */ static void CopyPolynomEntry(struct LincomEntryType* L, gd_entry_t* E) { dtrace("%p, %p", L, E); if (E == NULL) { dreturnvoid(); return; } L->field = E->field; L->n_fields = 1; L->in_fields[0] = E->in_fields[0]; L->m[0] = E->EN(polynom,a)[1]; L->b[0] = E->EN(polynom,a)[0]; dreturnvoid(); } static void CopyLincomEntry(struct LincomEntryType* L, gd_entry_t* E) { int i; dtrace("%p, %p", L, E); if (E == NULL) { dreturnvoid(); return; } L->field = E->field; L->n_fields = E->EN(lincom,n_fields); for (i = 0; i < E->EN(lincom,n_fields); ++i) { L->in_fields[i] = E->in_fields[i]; L->m[i] = E->EN(lincom,m)[i]; L->b[i] = E->EN(lincom,b)[i]; } dreturnvoid(); } static void CopyLinterpEntry(struct LinterpEntryType* L, gd_entry_t* E) { dtrace("%p, %p", L, E); if (E == NULL) { dreturnvoid(); return; } L->field = E->field; L->raw_field = E->in_fields[0]; L->linterp_file = E->EN(linterp,table); dreturnvoid(); } static void CopyBitEntry(struct BitEntryType* B, gd_entry_t* E) { dtrace("%p, %p", B, E); if (E == NULL) { dreturnvoid(); return; } B->field = E->field; B->raw_field = E->in_fields[0]; B->bitnum = E->EN(bit,bitnum); B->numbits = E->EN(bit,numbits); dreturnvoid(); } static void CopyMultDivEntry(struct MultiplyEntryType* M, gd_entry_t* E) { dtrace("%p, %p", M, E); if (E == NULL) { dreturnvoid(); return; } M->field = E->field; M->in_fields[0] = E->in_fields[0]; M->in_fields[1] = E->in_fields[1]; dreturnvoid(); } static void CopyReciprocalEntry(struct LincomEntryType* L, gd_entry_t* E) { dtrace("%p, %p", L, E); if (E == NULL) { dreturnvoid(); return; } L->field = E->field; L->n_fields = 1; L->in_fields[0] = E->in_fields[0]; L->m[0] = E->EN(recip,dividend); L->b[0] = 0; dreturnvoid(); } static void CopyPhaseEntry(struct PhaseEntryType* P, gd_entry_t* E) { dtrace("%p, %p", P, E); if (E == NULL) { dreturnvoid(); return; } P->field = E->field; P->raw_field = E->in_fields[0]; P->shift = E->EN(phase,shift); dreturnvoid(); } static void CopyWindowEntry(struct MPlexEntryType* M, gd_entry_t* E) { dtrace("%p, %p", M, E); if (E == NULL) { dreturnvoid(); return; } M->field = E->field; M->data_field = E->in_fields[0]; M->cnt_field = E->in_fields[1]; M->i = (int)E->EN(window,windop); M->max_i = (int)E->EN(window,threshold.i); dreturnvoid(); } static void CopyMplexEntry(struct MPlexEntryType* M, gd_entry_t* E) { dtrace("%p, %p", M, E); if (E == NULL) { dreturnvoid(); return; } M->field = E->field; M->data_field = E->in_fields[0]; M->cnt_field = E->in_fields[1]; M->i = (int)E->EN(mplex,count_val); M->max_i = (int)E->EN(mplex,period); dreturnvoid(); } /* Okay, reconstruct the old FormatType. This is painful. */ struct FormatType *GetFormat(const char *filedir, int *error_code) gd_nothrow { unsigned int i; int nraw = 0; int nlincom = 0; int nlinterp = 0; int nmultiply = 0; int nbit = 0; int nphase = 0; int nmplex = 0; DIRFILE *D; dtrace("\"%s\", %p", filedir, error_code); D = _GD_GetDirfile(filedir, GD_RDONLY, error_code); if (!D) { dreturn("%p", NULL); return NULL; } memset(&Format, 0, sizeof(Format)); /* fill the structure -- like everything about the legacy API, this is * not thread-safe */ Format.FileDirName = filedir; Format.frame_offset = (int)D->fragment[0].frame_offset; CopyRawEntry(&Format.first_field, D->reference_field); /* Pass one: run through the entry list and count the number of different * types */ for (i = 0; i < D->n_entries; ++i) switch(D->entry[i]->field_type) { case GD_RAW_ENTRY: Format.n_raw++; break; case GD_LINCOM_ENTRY: case GD_POLYNOM_ENTRY: case GD_RECIP_ENTRY: Format.n_lincom++; break; case GD_LINTERP_ENTRY: Format.n_linterp++; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: Format.n_bit++; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: Format.n_multiply++; break; case GD_PHASE_ENTRY: Format.n_phase++; break; case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: Format.n_mplex++; break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_INDEX_ENTRY: case GD_STRING_ENTRY: break; } /* Now reallocate the Entry arrays */ free(Format.rawEntries); free(Format.lincomEntries); free(Format.linterpEntries); free(Format.mplexEntries); free(Format.multiplyEntries); free(Format.bitEntries); free(Format.phaseEntries); Format.rawEntries = malloc(Format.n_raw * sizeof(*Format.rawEntries)); Format.lincomEntries = malloc(Format.n_lincom * sizeof(*Format.lincomEntries)); Format.linterpEntries = malloc(Format.n_linterp * sizeof(*Format.linterpEntries)); Format.mplexEntries = malloc(Format.n_mplex * sizeof(*Format.mplexEntries)); Format.multiplyEntries = malloc(Format.n_multiply * sizeof(*Format.multiplyEntries)); Format.bitEntries = malloc(Format.n_bit * sizeof(*Format.bitEntries)); Format.phaseEntries = malloc(Format.n_phase * sizeof(*Format.phaseEntries)); if (Format.rawEntries == NULL || Format.lincomEntries == NULL || Format.linterpEntries == NULL || Format.mplexEntries == NULL || Format.multiplyEntries == NULL || Format.bitEntries == NULL || Format.phaseEntries == NULL) { D->error = GD_E_ALLOC; *error_code = _GD_CopyGlobalError(D); dreturn("%p", NULL); return NULL; } /* Pass 2: Fill the Entry structs */ for (i = 0; i < D->n_entries; ++i) switch(D->entry[i]->field_type) { case GD_RAW_ENTRY: CopyRawEntry(&Format.rawEntries[nraw++], D->entry[i]); break; case GD_POLYNOM_ENTRY: CopyPolynomEntry(&Format.lincomEntries[nlincom++], D->entry[i]); break; case GD_LINCOM_ENTRY: CopyLincomEntry(&Format.lincomEntries[nlincom++], D->entry[i]); break; case GD_LINTERP_ENTRY: CopyLinterpEntry(&Format.linterpEntries[nlinterp++], D->entry[i]); break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: CopyBitEntry(&Format.bitEntries[nbit++], D->entry[i]); break; case GD_RECIP_ENTRY: CopyReciprocalEntry(&Format.lincomEntries[nlincom++], D->entry[i]); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: CopyMultDivEntry(&Format.multiplyEntries[nmultiply++], D->entry[i]); break; case GD_PHASE_ENTRY: CopyPhaseEntry(&Format.phaseEntries[nphase++], D->entry[i]); break; case GD_WINDOW_ENTRY: CopyWindowEntry(&Format.mplexEntries[nmplex++], D->entry[i]); break; case GD_MPLEX_ENTRY: CopyMplexEntry(&Format.mplexEntries[nmplex++], D->entry[i]); break; case GD_STRING_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_INDEX_ENTRY: case GD_ALIAS_ENTRY: case GD_NO_ENTRY: break; } dreturn("%p", &Format); return &Format; } /* legacy interface to getdata() */ int GetData(const char *filename, const char *field_code, int first_frame, int first_samp, int num_frames, int num_samp, char return_type, void *data_out, int *error_code) { DIRFILE* D; int nread; dtrace("\"%s\", \"%s\", %i, %i, %i, %i, '%c', %p, %p", filename, field_code, first_frame, first_samp, num_frames, num_samp, return_type, data_out, error_code); D = _GD_GetDirfile(filename, GD_RDONLY, error_code); if (!D) { dreturn("%i", 0); return 0; } nread = (int)gd_getdata64(D, field_code, (off64_t)first_frame, (off64_t)first_samp, (size_t)num_frames, (size_t)num_samp, _GD_LegacyType(return_type), data_out); *error_code = _GD_CopyGlobalError(D); dreturn("%i", nread); return nread; } /* legacy interface to get_nframes() --- the third argument to this function * has been ignored since at least 2005 (and why does it come after * error_code?) */ int GetNFrames(const char *filename, int *error_code, const void *unused gd_unused_) { DIRFILE* D; int nf; dtrace("\"%s\", %p, ", filename, error_code); D = _GD_GetDirfile(filename, GD_RDONLY, error_code); if (!D) { dreturn("%i", 0); return 0; } nf = (int)gd_nframes(D); *error_code = _GD_CopyGlobalError(D); dreturn("%i", nf); return nf; } /* legacy interface to get_spf() */ int GetSamplesPerFrame(const char *filename, const char *field_code, int *error_code) gd_nothrow { DIRFILE* D; int spf; dtrace("\"%s\", \"%s\", %p", filename, field_code, error_code); D = _GD_GetDirfile(filename, GD_RDONLY, error_code); if (!D) { dreturn("%i", 0); return 0; } spf = (int)gd_spf(D, field_code); *error_code = _GD_CopyGlobalError(D); dreturn("%i", spf); return spf; } /* legacy interface to putdata() */ int PutData(const char *filename, const char *field_code, int first_frame, int first_samp, int num_frames, int num_samp, char data_type, const void *data_in, int *error_code) { DIRFILE* D; int n_write = 0; dtrace("\"%s\", \"%s\", %i, %i, %i, %i, '%c', %p, %p", filename, field_code, first_frame, first_samp, num_frames, num_samp, data_type, data_in, error_code); D = _GD_GetDirfile(filename, GD_RDWR | GD_UNENCODED, error_code); if (!D) { dreturn("%i", 0); return 0; } n_write = (int)gd_putdata64(D, field_code, (off64_t)first_frame, (off64_t)first_samp, (size_t)num_frames, (size_t)num_samp, _GD_LegacyType(data_type), data_in); *error_code = _GD_CopyGlobalError(D); dreturn("%i", n_write); return n_write; } /* vim: ts=2 sw=2 et */ libgetdata-0.9.0/src/slim.c0000640000175000017500000001247412614323564015713 0ustar alastairalastair/* Copyright (C) 2008, 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef ZZSLIM #define GD_SLIM(x) _GD_Zzslim ## x #else #define GD_SLIM(x) _GD_Slim ## x #include "internal.h" #endif #ifdef HAVE_SLIMLIB_H #include #endif struct gd_slimdata { SLIMFILE *f; char *filepath; }; static struct gd_slimdata *GD_SLIM(DoOpen)(int dirfd, struct gd_raw_file_* file) { struct gd_slimdata *gdsl; dtrace("%i, %p", dirfd, file); /* slimdopen in slimlib-2.6.7 and earlier contains a bug resulting in a SEGV, * so disable this for now */ #if 0 /* #ifdef HAVE_SLIMDOPEN */ { int fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666); if (fd < 0) { dreturn("%i", -1); return -1; } file->edata = slimdopen(fd, "r"); if (file->edata == NULL) { close(fd); dreturn("%i", 1); return 1; } } #else { gdsl = malloc(sizeof *gdsl); if (gdsl == NULL) { file->error = ENOMEM; dreturn("%p", NULL); return NULL; } /* this is easily broken, but the best we can do in this case */ gdsl->filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name); if (gdsl->filepath == NULL) { file->error = errno; free(gdsl); dreturn("%p", NULL); return NULL; } gdsl->f = slimopen(gdsl->filepath, "r"); } #endif if (gdsl->f == NULL) { free(gdsl->filepath); free(gdsl); dreturn("%p", NULL); return NULL; } dreturn("%p", gdsl); return gdsl; } int GD_SLIM(Open)(int dirfd, struct gd_raw_file_* file, gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode gd_unused_) { dtrace("%i, %p, , , ", dirfd, file); file->edata = GD_SLIM(DoOpen)(dirfd, file); if (file->edata == NULL) { dreturn("%i", 1); return 1; } file->mode = GD_RDONLY; file->idata = 0; dreturn("%i", 0); return 0; } off64_t GD_SLIM(Seek)(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode gd_unused_) { struct gd_slimdata *gdsl = file->edata; dtrace("%p, %lli, 0x%X, ", file, (long long)count, data_type); /* slimlib appears to do a rewind before every SEEK_SET ! */ if (slimseek(gdsl->f, (long)count * GD_SIZE(data_type), SEEK_SET)) { /* Handle seeks past the EOF */ off64_t size = slimrawsize(gdsl->filepath) / GD_SIZE(data_type); if (count < size || slimseek(gdsl->f, size, SEEK_SET)) { dreturn("%i", -1); return -1; } count = size; } file->pos = count; dreturn("%lli", (long long)count); return count; } ssize_t GD_SLIM(Read)(struct gd_raw_file_ *restrict file, void *restrict ptr, gd_type_t data_type, size_t nmemb) { ssize_t n; struct gd_slimdata *gdsl = file->edata; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); n = slimread(ptr, GD_SIZE(data_type), nmemb, gdsl->f); dreturn("%" PRNsize_t, n); return n; } int GD_SLIM(Close)(struct gd_raw_file_ *file) { int ret; struct gd_slimdata *gdsl = file->edata; dtrace("%p", file); ret = slimclose(gdsl->f); if (!ret) { file->idata = -1; free(gdsl->filepath); free(file->edata); file->edata = NULL; file->mode = 0; } dreturn("%i", ret); return ret; } off64_t GD_SLIM(Size)(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { off64_t size; dtrace("%i, %p, 0x%X", dirfd, file, data_type); /* slimdrawsize in slimlib-2.6.7 and earlier contains a bug resulting in a * SEGV, so disable this for now */ #if 0 /* #ifdef HAVE_SLIMDRAWSIZE */ { int fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666); if (fd < 0) { dreturn("%i", -1); return -1; } size = slimdrawsize(fd); close(fd); } #else { /* this is easily broken, but the best we can do in this case */ char *filepath = gd_MakeFullPathOnly(file->D, dirfd, file->name); if (filepath == NULL) { dreturn("%i", -1); return -1; } size = slimrawsize(filepath); free(filepath); } #endif if (size < 0) { dreturn("%i", -1); return -1; } size /= GD_SIZE(data_type); dreturn("%lli", (long long)size); return size; } int GD_SLIM(Strerr)(const struct gd_raw_file_ *file, char *buf, size_t buflen) { int r = 0; dtrace("%p, %p, %" PRNsize_t, file, buf, buflen); if (file->error) r = gd_strerror(file->error, buf, buflen); else /* the slimlib C API has no error reporting */ strncpy(buf, "SLIMLIB: Unspecified error", buflen); dreturn("%i", r); return r; } libgetdata-0.9.0/src/debug.c0000640000175000017500000000273312614323564016032 0ustar alastairalastair/* Copyright (C) 2008, 2010, 2011, 2013, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" extern char gd_debug_col[GD_COL_SIZE + 1]; extern int gd_col_count; const char* gd_colnil(void) { return gd_debug_col; } const char* gd_coladd(void) { if (gd_col_count < GD_COL_SIZE) { gd_debug_col[gd_col_count++] = ':'; gd_debug_col[gd_col_count] = '\0'; } return gd_colnil(); } const char* gd_colsub(void) { static char buffer[GD_COL_SIZE + 1]; strcpy(buffer, gd_debug_col); if (gd_col_count > 0) gd_debug_col[--gd_col_count] = '\0'; return buffer; } void gd_colclear(void) { gd_col_count = 0; gd_debug_col[0] = '\0'; } libgetdata-0.9.0/src/zzip.c0000640000175000017500000001417612614323564015744 0ustar alastairalastair/* Copyright (C) 2011, 2012, 2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef HAVE_ZZIP_LIB_H #include #endif struct gd_zzipdata { ZZIP_DIR *dir; ZZIP_FILE *file; zzip_error_t err; }; /* A ZZip "name" looks like this: * * .zip\0 */ int _GD_ZzipName(DIRFILE *restrict D gd_unused_, const char *restrict enc_data, struct gd_raw_file_ *restrict file, const char *restrict base, int temp gd_unused_, int resolv gd_unused_) { size_t enc_len; dtrace("%p, \"%s\", %p, \"%s\", , ", D, enc_data, file, base); if (file->name == NULL) { if (enc_data == NULL) enc_data = "raw"; enc_len = strlen(enc_data); file->name = (char*)malloc(enc_len + 5 + strlen(base) + 1); if (file->name == NULL) { dreturn("%i", -1); return -1; } sprintf(file->name, "%s.zip_%s", enc_data, base); /* Now replace the '_' with a NUL */ file->name[enc_len + 4] = '\0'; } dreturn("%i (%s\\0%s)", 0, file->name, file->name + enc_len + 5); return 0; } /* This function opens both a ZZIP_DIR (the containing archive) and a ZZIP_FILE, * the target data file */ static struct gd_zzipdata *_GD_ZzipDoOpen(int dirfd, struct gd_raw_file_* file) { struct gd_zzipdata *gdzz; int fd; dtrace("%i, %p", dirfd, file); /* open the zip file. */ if ((fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY)) < 0) { file->error = -1; dreturn("%p", NULL); return NULL; } if ((gdzz = malloc(sizeof *gdzz)) == NULL) { close(fd); file->error = ENOMEM; dreturn("%p", NULL); return NULL; } /* Pass file to libzzip. */ if ((gdzz->dir = zzip_dir_fdopen(fd, &gdzz->err)) == NULL) { file->error = gdzz->err; close(fd); free(gdzz); dreturn("%p", NULL); return NULL; } /* Now open the data file inside the archive, it's name is at the tail end of * file->name after the NUL */ if ((gdzz->file = zzip_file_open(gdzz->dir, file->name + strlen(file->name) + 1, O_RDONLY)) == NULL) { file->error = gdzz->err; zzip_dir_close(gdzz->dir); free(gdzz); dreturn("%p", NULL); return NULL; } dreturn("%p", gdzz); return gdzz; } int _GD_ZzipOpen(int dirfd, struct gd_raw_file_* file, gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode gd_unused_) { dtrace("%i, %p, , , ", dirfd, file); file->edata = _GD_ZzipDoOpen(dirfd, file); if (file->edata == NULL) { file->idata = -1; dreturn("%i", 1); return 1; } file->idata = 0; file->mode = GD_FILE_READ; dreturn("%i", 0); return 0; } off64_t _GD_ZzipSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode gd_unused_) { off64_t n; struct gd_zzipdata *gdzz = file->edata; dtrace("%p, %lli, 0x%X, ", file, (long long)count, data_type); n = (off64_t)zzip_seek(gdzz->file, (zzip_off_t)(count * GD_SIZE(data_type)), SEEK_SET); if (n < 0) { /* Maybe we tried to seek past the EOF? */ n = (off64_t)zzip_seek(gdzz->file, 0, SEEK_END); if (n > count * GD_SIZE(data_type)) { /* we didn't: there was just an error; try again */ n = (off64_t)zzip_seek(gdzz->file, (zzip_off_t)(count * GD_SIZE(data_type)), SEEK_SET); } } if (n < 0) file->error = gdzz->err; else n /= GD_SIZE(data_type); file->pos = n; dreturn("%lli", (long long)n); return n; } ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict file, void *restrict data, gd_type_t data_type, size_t nmemb) { ssize_t n; struct gd_zzipdata *gdzz = file->edata; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); n = zzip_read(gdzz->file, data, GD_SIZE(data_type) * nmemb); if (n < 0) file->error = gdzz->err; else n /= GD_SIZE(data_type); file->pos += n; dreturn("%lli", (long long)n); return n; } int _GD_ZzipClose(struct gd_raw_file_ *file) { struct gd_zzipdata *gdzz = file->edata; dtrace("%p", file); if (zzip_file_close(gdzz->file) || zzip_dir_close(gdzz->dir)) { file->error = gdzz->err; dreturn("%i", 1); return 1; } file->idata = -1; free(file->edata); file->edata = NULL; dreturn("%i", 0); return 0; } off64_t _GD_ZzipSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { off64_t size = 0; struct gd_zzipdata *gdzz; dtrace("%i, %p, 0x%X, ", dirfd, file, data_type); gdzz = _GD_ZzipDoOpen(dirfd, file); if (gdzz == NULL) { dreturn("%i", -1); return -1; } if ((size = (off64_t)zzip_seek(gdzz->file, 0, SEEK_END)) == -1) file->error = gdzz->err; else size /= GD_SIZE(data_type); zzip_file_close(gdzz->file); zzip_dir_close(gdzz->dir); dreturn("%lli", (long long)size); return size; } int _GD_ZzipStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen) { int r = 0; dtrace("%p, %p, %" PRNsize_t, file, buf, buflen); switch (file->error) { case ZZIP_OUTOFMEM: strncpy(buf, "ZZIP: Out of memory", buflen); break; case ZZIP_DIR_OPEN: case ZZIP_DIR_STAT: case ZZIP_DIR_SEEK: case ZZIP_DIR_READ: case -1: r = gd_strerror(errno, buf, buflen); break; default: snprintf(buf, buflen, "ZZIP: Unkown error 0x%X", file->error); break; } dreturn("%i", r); return r; } libgetdata-0.9.0/src/lzma.c0000640000175000017500000003166112614323564015711 0ustar alastairalastair/* Copyright (C) 2009-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef HAVE_LZMA_H #include #endif #if SIZEOF_INT < 4 #define GD_LZMA_DATA_OUT 32767 #else #define GD_LZMA_DATA_OUT 1000000 #endif #define GD_LZMA_DATA_IN 4096 #define GD_LZMA_LOOKBACK 4096 struct gd_lzmadata { lzma_stream xz; FILE* stream; int stream_end; int input_eof; int offset; uint8_t data_in[GD_LZMA_DATA_IN]; uint8_t data_out[GD_LZMA_DATA_OUT]; }; /* total bytes in the output buffer */ #define NOUT(p) (GD_LZMA_DATA_OUT - (p).xz.avail_out) /* byte position of the start of the output buffer */ #define BASE(p) ((p).xz.total_out - NOUT(p)) /* bytes of unused data in output buffer */ #define READY(p) (NOUT(p) - (p).offset) /* At EOF */ #define LZEOF(p) ((p).stream_end || (p).input_eof) /* The lzma encoding scheme uses edata as a gd_lzmadata pointer. If a file is * open, idata = 0 otherwise idata = -1. */ static struct gd_lzmadata *_GD_LzmaDoOpen(int dirfd, struct gd_raw_file_* file, unsigned int mode) { struct gd_lzmadata *lzd; int fd; lzma_ret e; const char *fdmode = "rb"; FILE *stream; const lzma_stream stream_init = LZMA_STREAM_INIT; dtrace("%i, %p, %i", dirfd, file, mode); if (mode & GD_FILE_READ) { fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666); } else if (mode & GD_FILE_TEMP) { fd = _GD_MakeTempFile(file->D, dirfd, file->name); fdmode = "wb"; } else { /* internal error */ errno = EINVAL; /* I guess ... ? */ dreturn("%p", NULL); return NULL; } if (fd < 0) { dreturn("%p", NULL); return NULL; } if ((stream = fdopen(fd, fdmode)) == NULL) { close(fd); dreturn("%p", NULL); return NULL; } if ((lzd = (struct gd_lzmadata *)malloc(sizeof(struct gd_lzmadata))) == NULL) { dreturn("%p", NULL); return NULL; } memset(lzd, 0, sizeof(*lzd)); lzd->xz = stream_init; lzd->stream = stream; lzd->xz.next_in = lzd->data_in; lzd->xz.next_out = lzd->data_out; lzd->xz.avail_out = GD_LZMA_DATA_OUT; if (mode & GD_FILE_READ) e = lzma_auto_decoder(&lzd->xz, UINT64_MAX, 0); else { e = lzma_easy_encoder(&lzd->xz, 9, LZMA_CHECK_CRC64); memset(lzd->data_in, 0, GD_LZMA_DATA_IN); } if (e != LZMA_OK) { file->error = e; fclose(lzd->stream); free(lzd); dreturn("%p", NULL); return NULL; } dreturn("%p", lzd); return lzd; } int _GD_LzmaOpen(int dirfd, struct gd_raw_file_* file, gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode) { dtrace("%i, %p, , , 0x%X", dirfd, file, mode); file->edata = _GD_LzmaDoOpen(dirfd, file, mode); if (file->edata == NULL) { dreturn("%i", 1); return 1; } file->mode = mode; file->pos = 0; file->idata = 0; dreturn("%i", 0); return 0; } /* Read and decode until the there's enough data ready in the output buffer, or * it's full, or we hit EOF. Returns -1 on error, data ready size otherwise. * * This doesn't update next_out, so we don't have to worry about updating * offset. */ static int _GD_LzmaReady(struct gd_lzmadata *lzd, size_t nreq, int *errnum) { lzma_ret e; int ready = READY(*lzd); dtrace("%p, %" PRNsize_t " %p", lzd, nreq, errnum); /* already have enough data, or no more data to read */ if (LZEOF(*lzd) || (size_t)ready >= nreq) { dreturn("%i", ready); return ready; } /* coding loop */ while (lzd->xz.avail_out > 0 && (size_t)ready < nreq) { /* No input data, so read some */ if (lzd->xz.avail_in == 0) { size_t n = fread(lzd->data_in, 1, GD_LZMA_DATA_IN, lzd->stream); if (n == 0) { if (ferror(lzd->stream)) { dreturn("%i", -1); return -1; } /* end of input */ lzd->input_eof = 1; break; } lzd->xz.avail_in = n; lzd->xz.next_in = lzd->data_in; } /* code */ e = lzma_code(&lzd->xz, LZMA_RUN); if (e != LZMA_OK && e != LZMA_STREAM_END) { *errnum = e; dreturn("%i", -1); return -1; } ready = READY(*lzd); if (e == LZMA_STREAM_END) { lzd->stream_end = 1; break; } } dreturn("%i", ready); return ready; } /* clear the output buffer, retaining a bit of data for lookback purposes */ static void _GD_LzmaClear(struct gd_lzmadata *lzd) { int n; dtrace("%p", lzd); /* amount of data to keep */ n = NOUT(*lzd); if (n > GD_LZMA_LOOKBACK) n = GD_LZMA_LOOKBACK; memmove(lzd->data_out, lzd->xz.next_out - n, n); lzd->xz.next_out = lzd->data_out + n; lzd->xz.avail_out = GD_LZMA_DATA_OUT - n; dreturnvoid(); } /* flush the output buffer to the stream */ static int _GD_LzmaFlush(struct gd_lzmadata *lzd) { uint8_t *ptr; dtrace("%p", lzd); ptr = lzd->data_out; while (NOUT(*lzd) > 0) { ssize_t nw = fwrite(ptr, 1, NOUT(*lzd), lzd->stream); if (nw == 0 && ferror(lzd->stream)) { dreturn("%i", 1); return 1; } ptr += nw; lzd->xz.avail_out += nw; } /* reset output buffer */ lzd->xz.next_out = lzd->data_out; dreturn("%i", 0); return 0; } ssize_t _GD_LzmaWrite(struct gd_raw_file_ *file, const void *data, gd_type_t data_type, size_t nmemb) { lzma_ret e; size_t n; struct gd_lzmadata *lzd = (struct gd_lzmadata *)file->edata; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); n = nmemb * GD_SIZE(data_type); /* We let liblzma read directly from the caller's buffer */ lzd->xz.next_in = data; lzd->xz.avail_in = n; /* code */ while (lzd->xz.avail_in > 0) { e = lzma_code(&lzd->xz, LZMA_RUN); if (e != LZMA_OK) { file->error = e; dreturn("%i", -1); return -1; } if (_GD_LzmaFlush(lzd)) { dreturn("%i", -1); return -1; } } /* we always write all the input, if successful */ dreturn("%" PRNssize_t, (ssize_t)nmemb); return nmemb; } off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode) { struct gd_lzmadata *lzd; lzma_ret e; uint64_t bcount; dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode); bcount = count * GD_SIZE(data_type); if (mode == GD_FILE_WRITE) lzd = (struct gd_lzmadata *)file[1].edata; else lzd = (struct gd_lzmadata *)file[0].edata; /* the easy case -- position is somewhere within our current output buffer */ if (bcount < lzd->xz.total_out && bcount >= BASE(*lzd)) { lzd->offset = bcount - BASE(*lzd); file->pos = count; dreturn("%lli", (long long)(file->pos)); return file->pos; } if (mode != GD_FILE_WRITE) { if (BASE(*lzd) > bcount) { /* a backwards seek -- rewind to the beginning */ lzd->xz.avail_in = 0; lzd->xz.avail_out = GD_LZMA_DATA_OUT; lzd->xz.total_in = lzd->xz.total_out = 0; lzd->xz.next_in = lzd->data_in; lzd->xz.next_out = lzd->data_out; e = lzma_auto_decoder(&lzd->xz, UINT64_MAX, 0); if (e != LZMA_OK) { file->error = e; file->idata = -1; free(lzd); file->edata = NULL; fclose(lzd->stream); dreturn("%i", 1); return 1; } rewind(lzd->stream); lzd->input_eof = lzd->stream_end = 0; } /* seek forward the slow way */ while (lzd->xz.total_out < bcount) { /* discard output */ _GD_LzmaClear(lzd); if (_GD_LzmaReady(lzd, lzd->xz.avail_out, &file->error) < 0) { dreturn("%i", -1); return -1; } /* eof */ if (LZEOF(*lzd)) break; } if (lzd->xz.total_out < bcount) { /* ran out of data */ lzd->offset = NOUT(*lzd); file->pos = lzd->xz.total_out / GD_SIZE(data_type); } else { lzd->offset = bcount - BASE(*lzd); file->pos = count; } } else { /* we only get here when we need to pad */ while (lzd->xz.total_in < bcount) { int n = bcount - lzd->xz.total_in; if (n > GD_LZMA_DATA_IN) n = GD_LZMA_DATA_IN; _GD_LzmaWrite(file + 1, lzd->data_in, GD_UINT8, n); } lzd->offset = 0; file->pos = lzd->xz.total_in / GD_SIZE(data_type); } dreturn("%lli", (long long)(file->pos)); return file->pos; } ssize_t _GD_LzmaRead(struct gd_raw_file_ *file, void *data, gd_type_t data_type, size_t nmemb) { uint64_t bcount; struct gd_lzmadata *lzd = (struct gd_lzmadata *)file->edata; ssize_t nread = 0; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); if (nmemb > GD_SSIZE_T_MAX / GD_SIZE(data_type)) nmemb = GD_SSIZE_T_MAX / GD_SIZE(data_type); bcount = nmemb * GD_SIZE(data_type); /* decoding loop */ while (bcount > 0) { int bready, nready; /* clear the output buffer if it's full */ if (lzd->xz.avail_out == 0) _GD_LzmaClear(lzd); bready = _GD_LzmaReady(lzd, bcount, &file->error); if (bready < 0) { dreturn("%i", -1); return -1; } /* copy whole samples */ nready = bready / GD_SIZE(data_type); if (nready > (ssize_t)nmemb) nready = nmemb; bready = nready * GD_SIZE(data_type); memcpy(data, lzd->data_out + lzd->offset, bready); lzd->offset += bready; bcount -= bready; data += bready; nread += nready; if (LZEOF(*lzd)) break; } dreturn("%" PRNssize_t, nread); return nread; } int _GD_LzmaClose(struct gd_raw_file_ *file) { lzma_ret e; struct gd_lzmadata *lzd = (struct gd_lzmadata *)file->edata; dtrace("%p", file); /* finialise */ if (!(file->mode & GD_FILE_READ)) { /* ensure we don't read any more data */ lzd->xz.avail_in = 0; for (;;) { e = lzma_code(&lzd->xz, LZMA_FINISH); if (e != LZMA_OK && e != LZMA_STREAM_END) { file->error = e; dreturn("%i", 1); return 1; } if (_GD_LzmaFlush(lzd)) { dreturn("%i", 1); return 1; } if (e == LZMA_STREAM_END) break; } } /* shutdown */ lzma_end(&lzd->xz); if (fclose(lzd->stream)) { dreturn("%i", 1); return 1; } file->idata = -1; free(file->edata); file->edata = NULL; dreturn("%i", 0); return 0; } /* We don't flush the encoder since it may degrade compression, but we can * flush the stdio buffer */ int _GD_LzmaSync(struct gd_raw_file_ *file) { int r = 0; dtrace("%p", file); if (file->mode & GD_FILE_WRITE) { struct gd_lzmadata *lzd = (struct gd_lzmadata *)file[1].edata; r = fflush(lzd->stream); } dreturn("%i", r); return r; } off64_t _GD_LzmaSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { struct gd_lzmadata *lzd; off64_t n; dtrace("%i, %p, 0x%X, ", dirfd, file, data_type); lzd = _GD_LzmaDoOpen(dirfd, file, GD_FILE_READ); if (lzd == NULL) { dreturn("%i", -1); return -1; } /* read until EOF */ while (!LZEOF(*lzd)) { if (_GD_LzmaReady(lzd, GD_LZMA_DATA_OUT, &file->error) < 0) { dreturn("%i", -1); return -1; } /* discard output */ lzd->xz.next_out = lzd->data_out; lzd->xz.avail_out = GD_LZMA_DATA_OUT; } /* liblzma very graciously does the bookkeeping for us */ n = lzd->xz.total_out / GD_SIZE(data_type); lzma_end(&lzd->xz); fclose(lzd->stream); free(lzd); dreturn("%lli", (long long)n); return n; } int _GD_LzmaStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen) { int r = 0; dtrace("%p, %p, %" PRNsize_t, file, buf, buflen); switch(file->error) { case LZMA_OK: r = gd_strerror(errno, buf, buflen); break; case LZMA_MEM_ERROR: case LZMA_MEMLIMIT_ERROR: strncpy(buf, "LZMA: Out of memory", buflen); break; case LZMA_FORMAT_ERROR: strncpy(buf, "LZMA: File format not recognized", buflen); break; case LZMA_OPTIONS_ERROR: strncpy(buf, "LZMA: Invalid or unsupported options", buflen); break; case LZMA_DATA_ERROR: strncpy(buf, "LZMA: Data is corrupt", buflen); break; case LZMA_BUF_ERROR: strncpy(buf, "LZMA: No progress is possible", buflen); break; case LZMA_PROG_ERROR: /* this indicate bugs in the code */ strncpy(buf, "Internal error in LZMA encoding", buflen); break; default: snprintf(buf, buflen, "LZMA: Unkown error %i", file->error); break; } dreturn("%i", r); return r; } libgetdata-0.9.0/src/mod.c0000640000175000017500000014611012614323564015521 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static unsigned int gd_max_(unsigned int A, unsigned int B) { return (A > B) ? A : B; } #define GD_AS_FREE_SCALAR 1 #define GD_AS_NEED_RECALC 2 #define GD_AS_ERROR 4 #define GD_AS_MODIFIED 8 /* inputs: * sin - old scalar name ( == NULL means remove; == "" means keep as-is ) * iin - old scalar index * lin - old literal value * * outputs: * sout - new scalar name * iout - new scalar index * lout - new literal value * * sin sout alit * 0a N N0 0 -> do nothing () * 1 N N0 1 -> set lout () * 2 Na a 01 -> set sout (free scalar; need recalc) * 3 a N 0 -> recalc, set sout (free scalar) * 4 a N 1 -> set sout, set lout (free scalar) * 0b a 0 01 -> do nothing () */ static int _GD_AlterScalar(DIRFILE* D, int alter_literal, gd_type_t type, void *lout, const void *lin, char **sout, int *iout, const char *sin, int iin, int calculated, int fragment_index) { int r = 0; int set_lout = 0; dtrace("%p, %i, 0x%X, %p, %p, %p, %p, %p, %i, %i, %i", D, alter_literal, type, lout, lin, sout, iout, sin, iin, calculated, fragment_index); if (sin == NULL) { if (*sout != NULL) { if (alter_literal) { /* 4: replace a CONST field with a literal scalar */ r = GD_AS_FREE_SCALAR | GD_AS_MODIFIED; *sout = NULL; set_lout = 1; } else { /* 3: derefencing a CONST field to turn it into a literal scalar * lout is not set from lin, but kept as-is, after calculation; * this may throw GD_E_BAD_CODE or GD_E_BAD_FIELD_TYPE, via * get_constant. */ r = GD_AS_FREE_SCALAR | GD_AS_MODIFIED; if (!calculated) gd_get_constant(D, *sout, GD_INT64, lout); *sout = NULL; } } else if (alter_literal) { /* 1: set lout from lin */ set_lout = 1; } /* otherwise 0a: do nothing */ } else if (sin[0] == '\0') { if (*sout == NULL && alter_literal) { /* 1: set lout from lin */ set_lout = 1; } /* otherwise 0b: do nothing */ } else { /* 2: set a new CONST field from sout; if this is a RAW field, and we've * been asked to move the raw file, _GD_Change is going to need to * recalculate the entry; no need to change lout: it's ignored. */ if (_GD_CheckCodeAffixes(D, sin, fragment_index, 1)) ; /* reject codes with bad affixes */ else if (iin == -1 && !(D->flags & GD_NOSTANDARD) && D->standards <= 7 && _GD_TokToNum(sin, D->standards, 1, NULL, NULL, NULL, NULL) != -1) { /* when using early Standards, reject ambiguous field codes */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_AMBIGUOUS, NULL, 0, sin); } else { r = GD_AS_FREE_SCALAR | GD_AS_NEED_RECALC | GD_AS_MODIFIED; *sout = _GD_Strdup(D, sin); *iout = iin; } } if (!D->error && set_lout) { r |= GD_AS_MODIFIED; if (type == GD_INT64) *(int64_t *)lout = *(int64_t *)lin; else if (type == GD_COMPLEX128) memcpy(lout, lin, 2 * sizeof(double)); else if (type == GD_FLOAT64) *(double *)lout = *(double *)lin; else if (type == GD_INT16) *(int16_t *)lout = *(int16_t *)lin; else if (type == GD_UINT16) *(uint16_t *)lout = *(uint16_t *)lin; else if (type == GD_INT32) *(int32_t *)lout = *(int32_t *)lin; else if (type == GD_UINT32) *(uint32_t *)lout = *(uint32_t *)lin; else if (type == GD_UINT64) *(uint64_t *)lout = *(uint64_t *)lin; else _GD_InternalError(D); } if (D->error) r |= GD_AS_ERROR; dreturn("0x%X", r); return r; } /* _GD_SPFConvert: this is the no-longer used AddData, cut down for use by * _GD_Change. NB: Don't precompute (spfB / spfA) here: the order of operations * is important to get proper integer trucation. */ static void _GD_SPFConvert(DIRFILE* D, void *A, unsigned int spfA, void *B, unsigned int spfB, gd_type_t type, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n); switch (type) { case GD_NULL: /* null read */ break; case GD_INT8: for (i = 0; i < n; i++) ((int8_t *)A)[i] = ((int8_t *)B)[i * spfB / spfA]; break; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *)A)[i] = ((uint8_t *)B)[i * spfB / spfA]; break; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)A)[i] = ((int16_t *)B)[i * spfB / spfA]; break; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)A)[i] = ((uint16_t *)B)[i * spfB / spfA]; break; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)A)[i] = ((int32_t *)B)[i * spfB / spfA]; break; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)A)[i] = ((uint32_t *)B)[i * spfB / spfA]; break; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)A)[i] = ((int64_t *)B)[i * spfB / spfA]; break; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)A)[i] = ((uint64_t *)B)[i * spfB / spfA]; break; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)A)[i] = ((float *)B)[i * spfB / spfA]; break; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)A)[i] = ((double *)B)[i * spfB / spfA]; break; case GD_COMPLEX64: for (i = 0; i < n; i++) memcpy((float *)A + 2 * i, (float *)B + 2 * (i * spfB / spfA), 2 * sizeof(float)); break; case GD_COMPLEX128: for (i = 0; i < n; i++) memcpy((double *)A + 2 * i, (double *)B + 2 * (i * spfB / spfA), 2 * sizeof(double)); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } /* returns -1 on error, 1 if modified, 0 if no change */ static int _GD_AlterInField(DIRFILE *D, int i, char **Q, char *const *N, char *const *E, int fragment_index, int force) { dtrace("%p, %i, %p, %p, %p, %i, %i", D, i, Q, N, E, fragment_index, force); if (force || (N[i] != NULL && strcmp(E[i], N[i]))) { if (_GD_CheckCodeAffixes(D, N[i], fragment_index, 1)) { dreturn("%i", -1); return -1; } else if ((Q[i] = _GD_Strdup(D, N[i])) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 1); return 1; } dreturn("%i", 0); return 0; } /* N is the new entry, supplied by the user * E is the old entry, stored in the database * Q is our workspace; in the end, Q is a sanitised N which replaces E */ static int _GD_Change(DIRFILE *D, const char *field_code, const gd_entry_t *N, int flags) { int i, j; int field_free = 0; int scalar_free = 0; int modified = 0; size_t n; gd_type_t type; void *ptr; gd_entry_t *E = NULL; gd_entry_t Q; struct gd_private_entry_ Qe; dtrace("%p, \"%s\", %p, %i", D, field_code, N, flags); if ((D->flags & GD_ACCMODE) != GD_RDWR) _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); else if ((E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL)) == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); } else if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); else if (E->field_type != N->field_type) _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_MATCH, NULL, 0, field_code); if (D->error) { dreturn("%i", -1); return -1; } memcpy(&Qe, E->e, sizeof(struct gd_private_entry_)); memcpy(&Q, E, sizeof(gd_entry_t)); /* hiddenness can be changed here */ if (N->flags & GD_EN_HIDDEN) Q.flags |= GD_EN_HIDDEN; else Q.flags &= ~GD_EN_HIDDEN; if ((Q.flags & GD_EN_HIDDEN) != (E->flags & GD_EN_HIDDEN)) modified = 1; switch(E->field_type) { case GD_RAW_ENTRY: j = _GD_AlterScalar(D, N->EN(raw,spf) && N->EN(raw,spf) != E->EN(raw,spf), GD_UINT_TYPE, &Q.EN(raw,spf), &N->EN(raw,spf), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; Q.EN(raw,data_type) = (N->EN(raw,data_type) == GD_NULL) ? E->EN(raw,data_type) : N->EN(raw,data_type); /* nothing to do */ if (Q.EN(raw,spf) == E->EN(raw,spf) && Q.EN(raw,data_type) == E->EN(raw,data_type) && Q.scalar[0] == E->scalar[0]) break; modified = 1; if (Q.EN(raw,data_type) & 0x40 || (Qe.u.raw.size = GD_SIZE(Q.EN(raw,data_type))) == 0) { _GD_SetError(D, GD_E_BAD_TYPE, Q.EN(raw,data_type), NULL, 0, NULL); dreturn("%i", -1); return -1; } if (flags) { ssize_t nread, nwrote; off64_t ns_out, nf; void *buffer1; void *buffer2; struct encoding_t *enc; if (!(Q.flags & GD_EN_CALC)) if (gd_get_constant(D, Q.scalar[0], GD_UINT_TYPE, &Q.EN(raw,spf))) break; if (!(E->flags & GD_EN_CALC)) if (!_GD_CalculateEntry(D, E, 1)) break; nf = GD_BUFFER_SIZE / gd_max_(E->e->u.raw.size, GD_SIZE(Q.EN(raw,data_type))) / gd_max_(E->EN(raw,spf), Q.EN(raw,spf)); if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[E->fragment_index].cname); else _GD_Supports(D, E, GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_WRITE | GD_EF_SYNC | GD_EF_UNLINK); if (D->error) break; enc = _GD_ef + E->e->u.raw.file[0].subenc; /* open the old file */ if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_READ, _GD_FileSwapBytes(D, E))) { break; } else if ((*enc->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type), GD_FILE_READ) == -1) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); } if (D->error) break; /* Create a temporary file and open it */ if (_GD_InitRawIO(D, E, NULL, -1, enc, 0, GD_FILE_WRITE | GD_FILE_TEMP, _GD_FileSwapBytes(D, E))) break; else if (_GD_DoSeek(D, E, enc, 0, GD_FILE_WRITE | GD_FILE_TEMP) == -1) { _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD | GD_FINIRAW_CLOTEMP); break; } buffer1 = _GD_Malloc(D, GD_BUFFER_SIZE); buffer2 = _GD_Malloc(D, GD_BUFFER_SIZE); if (D->error) { free(buffer1); break; } /* Now copy the old file to the new file */ for (;;) { nread = (*enc->read)(E->e->u.raw.file, buffer1, E->EN(raw,data_type), nf * E->EN(raw,spf)); if (nread < 0) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 1); break; } if (nread == 0) break; ns_out = nread * Q.EN(raw,spf) / E->EN(raw,spf); /* spf convert */ if (Q.EN(raw,spf) != E->EN(raw,spf)) _GD_SPFConvert(D, buffer2, Q.EN(raw,spf), buffer1, E->EN(raw,spf), E->EN(raw,data_type), ns_out); else { ptr = buffer1; buffer1 = buffer2; buffer2 = ptr; } /* type convert */ if (Q.EN(raw,data_type) != E->EN(raw,data_type)) _GD_ConvertType(D, buffer2, E->EN(raw,data_type), buffer1, Q.EN(raw,data_type), ns_out); else { ptr = buffer1; buffer1 = buffer2; buffer2 = ptr; } nwrote = _GD_WriteOut(E, enc, buffer1, Q.EN(raw,data_type), ns_out, 1); if (nwrote < ns_out) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 1); break; } } free(buffer1); free(buffer2); if (D->error) /* An error occurred, delete the temporary file (the old * file can stay open) */ _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_CLOTEMP | GD_FINIRAW_DISCARD); else { /* discard the old file and move the temporary file into place */ if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD) == 0) _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP); } } memcpy(Qe.u.raw.file, E->e->u.raw.file, sizeof(struct gd_raw_file_)); break; case GD_LINCOM_ENTRY: Q.EN(lincom,n_fields) = (N->EN(lincom,n_fields) == 0) ? E->EN(lincom,n_fields) : N->EN(lincom,n_fields); if (Q.EN(lincom,n_fields) < 1 || Q.EN(lincom,n_fields) > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, E->EN(lincom,n_fields), NULL); break; } if (Q.EN(lincom,n_fields) != E->EN(lincom,n_fields)) { modified = 1; if (Q.EN(lincom,n_fields) < E->EN(lincom,n_fields)) for (i = Q.EN(lincom,n_fields); i < E->EN(lincom,n_fields); ++i) { field_free |= 1 << i; scalar_free |= 1 << i; scalar_free |= 1 << (i + GD_MAX_LINCOM); } } Q.flags &= ~GD_EN_COMPSCAL; for (i = 0; i < Q.EN(lincom,n_fields); ++i) { if (flags & 0x1) { j = _GD_AlterInField(D, i, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, E->EN(lincom,n_fields) <= i); if (j < 0) break; else if (j) { modified = 1; field_free |= 1 << i; } } if (flags & 0x2) { if (N->flags & GD_EN_COMPSCAL) { j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(lincom,cm)[i], N->EN(lincom,cm)[i]), GD_COMPLEX128, Q.EN(lincom,cm) + i, N->EN(lincom,cm) + i, Q.scalar + i, Q.scalar_ind + i, N->scalar[i], N->scalar_ind[i], E->flags & GD_EN_CALC, E->fragment_index); Q.EN(lincom,m)[i] = creal(Q.EN(lincom,cm)[i]); } else { j = _GD_AlterScalar(D, E->EN(lincom,m)[i] != N->EN(lincom,m)[i], GD_FLOAT64, Q.EN(lincom,m) + i, N->EN(lincom,m) + i, Q.scalar + i, Q.scalar_ind + i, N->scalar[i], N->scalar_ind[i], E->flags & GD_EN_CALC, E->fragment_index); gd_rs2cs_(Q.EN(lincom,cm)[i], Q.EN(lincom,m)[i]); } if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 1 << i; if (j & GD_AS_MODIFIED) modified = 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; } if (flags & 0x4) { if (N->flags & GD_EN_COMPSCAL) { j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(lincom,cb)[i], N->EN(lincom,cb)[i]), GD_COMPLEX128, Q.EN(lincom,cb) + i, N->EN(lincom,cb) + i, Q.scalar + i + GD_MAX_LINCOM, Q.scalar_ind + i + GD_MAX_LINCOM, N->scalar[i + GD_MAX_LINCOM], N->scalar_ind[i + GD_MAX_LINCOM], E->flags & GD_EN_CALC, E->fragment_index); Q.EN(lincom,b)[i] = creal(Q.EN(lincom,cb)[i]); } else { j = _GD_AlterScalar(D, E->EN(lincom,b)[i] != N->EN(lincom,b)[i], GD_FLOAT64, Q.EN(lincom,b) + i, N->EN(lincom,b) + i, Q.scalar + i + GD_MAX_LINCOM, Q.scalar_ind + i + GD_MAX_LINCOM, N->scalar[i + GD_MAX_LINCOM], N->scalar_ind[i + GD_MAX_LINCOM], E->flags & GD_EN_CALC, E->fragment_index); gd_rs2cs_(Q.EN(lincom,cb)[i], Q.EN(lincom,b)[i]); } if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 1 << (i + GD_MAX_LINCOM); if (j & GD_AS_MODIFIED) modified = 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; } if (cimag(Q.EN(lincom,cm)[i]) || cimag(Q.EN(lincom,cb)[i])) Q.flags |= GD_EN_COMPSCAL; } if ((Q.flags & GD_EN_COMPSCAL) != (E->flags & GD_EN_COMPSCAL)) modified = 1; break; case GD_LINTERP_ENTRY: j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free = 1; } if (N->EN(linterp,table) != NULL && strcmp(E->EN(linterp,table), N->EN(linterp,table))) { Q.EN(linterp,table) = _GD_Strdup(D, N->EN(linterp,table)); Qe.u.linterp.table_file = NULL; Qe.u.linterp.table_len = -1; /* not read yet */ if (Q.EN(linterp,table) == NULL) break; if (flags) { if (E->e->u.linterp.table_file == NULL) if (_GD_SetTablePath(D, E, E->e)) break; if (Qe.u.linterp.table_file == NULL) if (_GD_SetTablePath(D, &Q, &Qe)) break; if (gd_RenameAt(D, E->e->u.linterp.table_dirfd, E->e->u.linterp.table_file, Qe.u.linterp.table_dirfd, Qe.u.linterp.table_file)) { _GD_ReleaseDir(D, Qe.u.linterp.table_dirfd); _GD_SetError(D, GD_E_IO, GD_E_IO_RENAME, E->EN(linterp,table), 0, NULL); break; } } modified = 1; free(E->EN(linterp,table)); free(E->e->u.linterp.table_file); if (E->e->u.linterp.table_dirfd > 0) _GD_ReleaseDir(D, E->e->u.linterp.table_dirfd); free(E->e->u.linterp.lut); } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: j = _GD_AlterScalar(D, N->EN(bit,numbits) >= 1 && E->EN(bit,numbits) != N->EN(bit,numbits), GD_INT_TYPE, &Q.EN(bit,numbits), &N->EN(bit,numbits), Q.scalar + 1, Q.scalar_ind + 1, N->scalar[1], N->scalar_ind[1], E->flags & GD_EN_CALC, E->fragment_index); if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 2; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; j = _GD_AlterScalar(D, N->EN(bit,bitnum) >= 0 && E->EN(bit,bitnum) != N->EN(bit,bitnum), GD_INT_TYPE, &Q.EN(bit,bitnum), &N->EN(bit,bitnum), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free = 1; } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free = 1; } j = _GD_AlterInField(D, 1, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free |= 2; } break; case GD_RECIP_ENTRY: j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free = 1; } Q.flags &= ~GD_EN_COMPSCAL; if (N->flags & GD_EN_COMPSCAL) { j = _GD_AlterScalar(D, cabs(N->EN(recip,cdividend)) != 0 && !gd_ccmpc_(E->EN(recip,cdividend), N->EN(recip,cdividend)), GD_COMPLEX128, &Q.EN(recip,cdividend), &(N->EN(recip,cdividend)), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); Q.EN(recip,dividend) = creal(Q.EN(recip,cdividend)); if (cimag(Q.EN(recip,cdividend)) != 0) Q.flags |= GD_EN_COMPSCAL; } else { j = _GD_AlterScalar(D, N->EN(recip,dividend) != 0 && E->EN(recip,dividend) != N->EN(recip,dividend), GD_FLOAT64, &Q.EN(recip,dividend), &(N->EN(recip,dividend)), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); gd_rs2cs_(Q.EN(recip,cdividend), Q.EN(recip,dividend)); } if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free = 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; if ((Q.flags & GD_EN_COMPSCAL) != (E->flags & GD_EN_COMPSCAL)) modified = 1; break; case GD_PHASE_ENTRY: j = _GD_AlterScalar(D, E->EN(phase,shift) != N->EN(phase,shift), GD_INT64, &Q.EN(phase,shift), &N->EN(phase,shift), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 2; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free = 1; } break; case GD_POLYNOM_ENTRY: j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free = 1; } Q.EN(polynom,poly_ord) = (N->EN(polynom,poly_ord) == 0) ? E->EN(polynom,poly_ord) : N->EN(polynom,poly_ord); if (Q.EN(polynom,poly_ord) != E->EN(polynom,poly_ord)) modified = 1; if (flags & 0x1) { Q.flags &= ~GD_EN_COMPSCAL; for (i = 0; i <= Q.EN(polynom,poly_ord); ++i) { if (N->flags & GD_EN_COMPSCAL) { j = _GD_AlterScalar(D, !gd_ccmpc_(E->EN(polynom,ca)[i], N->EN(polynom,ca)[i]), GD_COMPLEX128, Q.EN(polynom,ca) + i, N->EN(polynom,ca) + i, Q.scalar + i, Q.scalar_ind + i, N->scalar[i], N->scalar_ind[i], E->flags & GD_EN_CALC, E->fragment_index); Q.EN(polynom,a)[i] = creal(Q.EN(polynom,ca)[i]); } else { j = _GD_AlterScalar(D, E->EN(polynom,a)[i] != N->EN(polynom,a)[i], GD_FLOAT64, Q.EN(polynom,a) + i, N->EN(polynom,a) + i, Q.scalar + i, Q.scalar_ind + i, N->scalar[i], N->scalar_ind[i], E->flags & GD_EN_CALC, E->fragment_index); gd_rs2cs_(Q.EN(polynom,ca)[i], Q.EN(polynom,a)[i]); } if (j & GD_AS_FREE_SCALAR) scalar_free |= 1 << i; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; if (cimag(Q.EN(polynom,ca)[i])) Q.flags |= GD_EN_COMPSCAL; } if ((Q.flags & GD_EN_COMPSCAL) != (E->flags & GD_EN_COMPSCAL)) modified = 1; } break; case GD_WINDOW_ENTRY: if (N->EN(window,windop) == GD_WINDOP_UNK) Q.EN(window,windop) = E->EN(window,windop); else { Q.EN(window,windop) = N->EN(window,windop); modified = 1; } switch (Q.EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: j = _GD_AlterScalar(D, E->EN(window,threshold.i) != N->EN(window,threshold.i), GD_INT64, &Q.EN(window,threshold.i), &N->EN(window,threshold.i), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: j = _GD_AlterScalar(D, E->EN(window,threshold.u) != N->EN(window,threshold.u), GD_UINT64, &Q.EN(window,threshold.u), &N->EN(window,threshold.u), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); break; default: j = _GD_AlterScalar(D, E->EN(window,threshold.r) != N->EN(window,threshold.r), GD_FLOAT64, &Q.EN(window,threshold.r), &N->EN(window,threshold.r), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); break; } if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free |= 1; } j = _GD_AlterInField(D, 1, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free |= 2; } break; case GD_MPLEX_ENTRY: j = _GD_AlterScalar(D, N->EN(mplex,period) != -1 && E->EN(mplex,period) != N->EN(mplex,period), GD_INT_TYPE, &Q.EN(mplex,period), &N->EN(mplex,period), Q.scalar + 1, Q.scalar_ind + 1, N->scalar[1], N->scalar_ind[1], E->flags & GD_EN_CALC, E->fragment_index); if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 2; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; j = _GD_AlterScalar(D, E->EN(mplex,count_val) != N->EN(mplex,count_val), GD_INT_TYPE, &Q.EN(mplex,count_val), &N->EN(mplex,count_val), Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->flags & GD_EN_CALC, E->fragment_index); if (j & GD_AS_ERROR) break; if (j & GD_AS_FREE_SCALAR) scalar_free |= 1; if (j & GD_AS_NEED_RECALC) Q.flags &= ~GD_EN_CALC; if (j & GD_AS_MODIFIED) modified = 1; j = _GD_AlterInField(D, 0, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free |= 1; } j = _GD_AlterInField(D, 1, Q.in_fields, N->in_fields, E->in_fields, E->fragment_index, 0); if (j < 0) break; else if (j) { modified = 1; field_free |= 2; } break; case GD_CONST_ENTRY: Q.EN(scalar,const_type) = (N->EN(scalar,const_type) == GD_NULL) ? E->EN(scalar,const_type) : N->EN(scalar,const_type); if (Q.EN(scalar,const_type) & 0x40 || GD_SIZE(Q.EN(scalar,const_type)) == 0) { _GD_SetError(D, GD_E_BAD_TYPE, Q.EN(scalar,const_type), NULL, 0, NULL); dreturn("%i", -1); return -1; } type = _GD_ConstType(D, Q.EN(scalar,const_type)); if (Q.EN(scalar,const_type) != E->EN(scalar,const_type)) modified = 1; if (type == _GD_ConstType(D, E->EN(scalar,const_type))) Qe.u.scalar.d = E->e->u.scalar.d; else { /* type convert */ Qe.u.scalar.d = _GD_Malloc(D, GD_SIZE(type)); if (Qe.u.scalar.d == NULL) { dreturn("%i", -1); return -1; } if (type == GD_COMPLEX128) { *(double*)Qe.u.scalar.d = (E->EN(scalar,const_type) & GD_IEEE754) ? *(double*)E->e->u.scalar.d : (E->EN(scalar,const_type) & GD_SIGNED) ? (double)*(int64_t*)E->e->u.scalar.d : (double)*(uint64_t*)E->e->u.scalar.d; ((double*)Qe.u.scalar.d)[1] = 0; } else if (type == GD_FLOAT64) *(double*)Qe.u.scalar.d = (E->EN(scalar,const_type) & GD_COMPLEX) ? *(double*)E->e->u.scalar.d : (E->EN(scalar,const_type) & GD_SIGNED) ? (double)*(int64_t*)E->e->u.scalar.d : (double)*(uint64_t*)E->e->u.scalar.d; else if (type == GD_INT64) *(int64_t*)Qe.u.scalar.d = (E->EN(scalar,const_type) & (GD_COMPLEX | GD_IEEE754)) ? (int64_t)*(double*)E->e->u.scalar.d : (int64_t)*(uint64_t*)E->e->u.scalar.d; else *(uint64_t*)Qe.u.scalar.d = (E->EN(scalar,const_type) & (GD_COMPLEX | GD_IEEE754)) ? (uint64_t)*(double*)E->e->u.scalar.d : (uint64_t)*(int64_t*)E->e->u.scalar.d; free(E->e->u.scalar.d); } break; case GD_CARRAY_ENTRY: Q.EN(scalar,array_len) = (N->EN(scalar,array_len) == 0) ? E->EN(scalar,array_len) : N->EN(scalar,array_len); Q.EN(scalar,const_type) = (N->EN(scalar,const_type) == GD_NULL) ? E->EN(scalar,const_type) : N->EN(scalar,const_type); if (Q.EN(scalar,const_type) != E->EN(scalar,const_type) || Q.EN(scalar,array_len) != E->EN(scalar,array_len)) { modified = 1; if (Q.EN(scalar,const_type) & 0x40 || GD_SIZE(Q.EN(scalar,const_type)) == 0) { _GD_SetError(D, GD_E_BAD_TYPE, Q.EN(scalar,const_type), NULL, 0, NULL); break; } type = _GD_ConstType(D, Q.EN(scalar,const_type)); Qe.u.scalar.d = _GD_Malloc(D, GD_SIZE(type) * Q.EN(scalar,array_len)); if (Qe.u.scalar.d == NULL) break; memset(Qe.u.scalar.d, 0, GD_SIZE(type) * Q.EN(scalar,array_len)); /* copy via type conversion, if array_len has increased, trailing * elements are uninitialised. */ n = E->EN(scalar,array_len); if (n > Q.EN(scalar,array_len)) n = Q.EN(scalar,array_len); _GD_ConvertType(D, E->e->u.scalar.d, _GD_ConstType(D, E->EN(scalar,const_type)), Qe.u.scalar.d, type, n); if (D->error) { free(Qe.u.scalar.d); break; } free(E->e->u.scalar.d); } else Qe.u.scalar.d = E->e->u.scalar.d; break; case GD_INDEX_ENTRY: /* INDEX may not be modified */ _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); case GD_NO_ENTRY: case GD_ALIAS_ENTRY: case GD_STRING_ENTRY: break; } if (D->error) { dreturn("%i", -1); return -1; } if (modified) { for (i = 0; i < GD_MAX_LINCOM; ++i) { if (field_free & (1 << i)) { Qe.entry[i] = NULL; free(E->in_fields[i]); } } for (i = 0; i <= GD_MAX_POLYORD; ++i) { if (scalar_free & (1 << i)) free(E->scalar[i]); } if (E->field_type == GD_LINTERP_ENTRY && flags) _GD_ReleaseDir(D, Qe.u.linterp.table_dirfd); memcpy(E->e, &Qe, sizeof(struct gd_private_entry_)); Q.e = E->e; memcpy(E, &Q, sizeof(gd_entry_t)); D->fragment[E->fragment_index].modified = 1; D->flags &= ~GD_HAVE_VERSION; } dreturn("%i", 0); return 0; } int gd_alter_entry(DIRFILE* D, const char* field_code, const gd_entry_t *entry, int move) { int ret; gd_entry_t N; dtrace("%p, \"%s\", %p, %i", D, field_code, entry, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); /* To ensure .e is NULLed */ memcpy(&N, entry, sizeof(gd_entry_t)); /* for these field types, move is a set of bitflags; we set them all */ if (N.field_type == GD_LINCOM_ENTRY || N.field_type == GD_POLYNOM_ENTRY) move = 7; ret = _GD_Change(D, field_code, &N, move); dreturn("%i", ret); return ret; } int gd_alter_raw(DIRFILE *D, const char *field_code, gd_type_t data_type, unsigned int spf, int move) { int ret; gd_entry_t N; dtrace("%p, \"%s\", %u, 0x%X, %i", D, field_code, spf, data_type, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_RAW_ENTRY; N.EN(raw,spf) = spf; N.EN(raw,data_type) = data_type; N.scalar[0] = (spf == 0) ? (char *)"" : NULL; ret = _GD_Change(D, field_code, &N, move); dreturn("%i", ret); return ret; } int gd_alter_lincom(DIRFILE* D, const char* field_code, int n_fields, const char** in_fields, const double* m, const double* b) gd_nothrow { gd_entry_t N; int i, ret; int flags = 0; dtrace("%p, \"%s\", %i, %p, %p, %p", D, field_code, n_fields, in_fields, m, b); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_LINCOM_ENTRY; if (n_fields > GD_MAX_LINCOM || n_fields < 0) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL); dreturn("%i", -1); return -1; } else if (n_fields != 0) N.EN(lincom,n_fields) = n_fields; else { gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } N.EN(lincom,n_fields) = E->EN(lincom,n_fields); } for (i = 0; i < N.EN(lincom,n_fields); ++i) { if (in_fields != NULL) { flags |= 1; N.in_fields[i] = (char *)in_fields[i]; } if (m != NULL) { flags |= 2; N.EN(lincom,m)[i] = m[i]; N.scalar[i] = NULL; } else N.scalar[i] = ""; if (b != NULL) { flags |= 4; N.EN(lincom,b)[i] = b[i]; N.scalar[i + GD_MAX_LINCOM] = NULL; } else N.scalar[i + GD_MAX_LINCOM] = ""; } ret = _GD_Change(D, field_code, &N, flags); dreturn("%i", ret); return ret; } int gd_alter_clincom(DIRFILE* D, const char* field_code, int n_fields, const char** in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb)) gd_nothrow { gd_entry_t N; int i, ret; int flags = 0; dtrace("%p, \"%s\", %i, %p, %p, %p", D, field_code, n_fields, in_fields, cm, cb); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_LINCOM_ENTRY; N.flags = GD_EN_COMPSCAL; if (n_fields > GD_MAX_LINCOM || n_fields < 0) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL); dreturn("%i", -1); return -1; } else if (n_fields != 0) N.EN(lincom,n_fields) = n_fields; else { gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } N.EN(lincom,n_fields) = E->EN(lincom,n_fields); } for (i = 0; i < N.EN(lincom,n_fields); ++i) { if (in_fields != NULL) { flags |= 1; N.in_fields[i] = (char *)in_fields[i]; } if (cm != NULL) { flags |= 2; gd_ca2cs_(N.EN(lincom,cm)[i], cm, i); N.scalar[i] = NULL; } else N.scalar[i] = ""; if (cb != NULL) { flags |= 4; gd_ca2cs_(N.EN(lincom,cb)[i], cb, i); N.scalar[i + GD_MAX_LINCOM] = NULL; } else N.scalar[i + GD_MAX_LINCOM] = ""; } ret = _GD_Change(D, field_code, &N, flags); dreturn("%i", ret); return ret; } int gd_alter_linterp(DIRFILE* D, const char* field_code, const char* in_field, const char* table, int move) { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field, table, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_LINTERP_ENTRY; N.in_fields[0] = (char *)in_field; N.EN(linterp,table) = (char *)table; ret = _GD_Change(D, field_code, &N, move); dreturn("%i", ret); return ret; } int gd_alter_bit(DIRFILE* D, const char* field_code, const char* in_field, int bitnum, int numbits) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", %i, %i", D, field_code, in_field, bitnum, numbits); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_BIT_ENTRY; N.in_fields[0] = (char *)in_field; N.EN(bit,bitnum) = bitnum; N.EN(bit,numbits) = numbits; N.scalar[0] = (bitnum == -1) ? (char *)"" : NULL; N.scalar[1] = (numbits == 0) ? (char *)"" : NULL; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_sbit(DIRFILE* D, const char* field_code, const char* in_field, int bitnum, int numbits) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", %i, %i", D, field_code, in_field, bitnum, numbits); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_SBIT_ENTRY; N.in_fields[0] = (char *)in_field; N.EN(bit,bitnum) = bitnum; N.EN(bit,numbits) = numbits; N.scalar[0] = (bitnum == -1) ? (char *)"" : NULL; N.scalar[1] = (numbits == 0) ? (char *)"" : NULL; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_recip(DIRFILE* D, const char* field_code, const char* in_field, double dividend) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", %g", D, field_code, in_field, dividend); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_RECIP_ENTRY; N.in_fields[0] = (char *)in_field; N.scalar[0] = (dividend == 0) ? (char *)"" : NULL; N.EN(recip,dividend) = dividend; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } #ifndef GD_NO_C99_API int gd_alter_crecip(DIRFILE* D, const char* field_code, const char* in_field, double complex cdividend) { int ret; dtrace("%p, \"%s\", \"%s\", %g;%g", D, field_code, in_field, creal(cdividend), cimag(cdividend)); ret = gd_alter_crecip89(D, field_code, in_field, (const double*)(&cdividend)); dreturn("%i", ret); return ret; } #endif int gd_alter_crecip89(DIRFILE* D, const char* field_code, const char* in_field, const double cdividend[2]) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", %p={%g, %g}", D, field_code, in_field, cdividend, (cdividend == NULL) ? 0 : cdividend[0], (cdividend == NULL) ? 0 : cdividend[1]); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_RECIP_ENTRY; N.in_fields[0] = (char *)in_field; if (cdividend == NULL) { N.scalar[0] = ""; gd_li2cs_(N.EN(recip,cdividend), 0, 0); } else { N.scalar[0] = (cdividend[0] == 0 && cdividend[1] == 0) ? (char *)"" : NULL; gd_ra2cs_(N.EN(recip,cdividend), cdividend); } N.scalar_ind[0] = 0; N.flags = GD_EN_COMPSCAL; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } static int _GD_AlterYoke(DIRFILE* D, gd_entype_t t, const char* field_code, const char* in_field1, const char* in_field2) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, 0x%X, \"%s\", \"%s\", \"%s\"", D, t, field_code, in_field1, in_field2); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = t; N.in_fields[0] = (char *)in_field1; N.in_fields[1] = (char *)in_field2; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_divide(DIRFILE* D, const char* field_code, const char* in_field1, const char* in_field2) gd_nothrow { return _GD_AlterYoke(D, GD_DIVIDE_ENTRY, field_code, in_field1, in_field2); } int gd_alter_multiply(DIRFILE* D, const char* field_code, const char* in_field1, const char* in_field2) gd_nothrow { return _GD_AlterYoke(D, GD_MULTIPLY_ENTRY, field_code, in_field1, in_field2); } int gd_alter_phase(DIRFILE* D, const char* field_code, const char* in_field, gd_shift_t shift) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", %lli", D, field_code, in_field, (long long)shift); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_PHASE_ENTRY; N.in_fields[0] = (char *)in_field; N.EN(phase,shift) = shift; N.scalar[0] = NULL; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_const(DIRFILE* D, const char* field_code, gd_type_t const_type) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", 0x%X", D, field_code, const_type); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_CONST_ENTRY; N.EN(scalar,const_type) = const_type; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_carray(DIRFILE* D, const char* field_code, gd_type_t const_type, size_t array_len) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", 0x%X, %" PRNsize_t, D, field_code, const_type, array_len); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_CARRAY_ENTRY; N.EN(scalar,const_type) = const_type; N.EN(scalar,array_len) = array_len; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_polynom(DIRFILE* D, const char* field_code, int poly_ord, const char* in_field, const double* a) gd_nothrow { gd_entry_t N; int i, ret; int flags = 0; dtrace("%p, \"%s\", %i, \"%s\", %p", D, field_code, poly_ord, in_field, a); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_POLYNOM_ENTRY; if (poly_ord > GD_MAX_POLYORD || poly_ord < 0) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL); dreturn("%i", -1); return -1; } else if (poly_ord != 0) N.EN(polynom,poly_ord) = poly_ord; else { gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } N.EN(polynom,poly_ord) = E->EN(polynom,poly_ord); } N.in_fields[0] = (char *)in_field; if (a != NULL) { flags |= 1; for (i = 0; i <= N.EN(polynom,poly_ord); ++i) { N.EN(polynom,a)[i] = a[i]; N.scalar[i] = NULL; } } else for (i = 0; i <= N.EN(polynom,poly_ord); ++i) N.scalar[i] = ""; ret = _GD_Change(D, field_code, &N, flags); dreturn("%i", ret); return ret; } int gd_alter_cpolynom(DIRFILE* D, const char* field_code, int poly_ord, const char* in_field, const GD_DCOMPLEXP(ca)) gd_nothrow { gd_entry_t N; int i, ret; int flags = 0; dtrace("%p, \"%s\", %i, \"%s\", %p", D, field_code, poly_ord, in_field, ca); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_POLYNOM_ENTRY; N.flags = GD_EN_COMPSCAL; if (poly_ord > GD_MAX_POLYORD || poly_ord < 0) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL); dreturn("%i", -1); return -1; } else if (poly_ord != 0) N.EN(polynom,poly_ord) = poly_ord; else { gd_entry_t *E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } N.EN(polynom,poly_ord) = E->EN(polynom,poly_ord); } N.in_fields[0] = (char *)in_field; if (ca != NULL) { flags |= 1; for (i = 0; i <= N.EN(polynom,poly_ord); ++i) { gd_ca2cs_(N.EN(polynom,ca)[i], ca, i); N.scalar[i] = NULL; } } else for (i = 0; i <= N.EN(polynom,poly_ord); ++i) N.scalar[i] = ""; ret = _GD_Change(D, field_code, &N, flags); dreturn("%i", ret); return ret; } int gd_alter_window(DIRFILE* D, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}", D, field_code, in_field, check_field, windop, threshold.r, (unsigned long long)threshold.u, (long long)threshold.i); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_WINDOW_ENTRY; N.in_fields[0] = (char *)in_field; N.in_fields[1] = (char *)check_field; N.EN(window,windop) = windop; N.EN(window,threshold) = threshold; N.scalar[0] = NULL; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_mplex(DIRFILE* D, const char *field_code, const char *in_field, const char *count_field, int count_val, int period) gd_nothrow { int ret; gd_entry_t N; dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %i", D, field_code, in_field, count_field, count_val, period); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&N, 0, sizeof(gd_entry_t)); N.field_type = GD_MPLEX_ENTRY; N.in_fields[0] = (char *)in_field; N.in_fields[1] = (char *)count_field; N.EN(mplex,count_val) = count_val; N.EN(mplex,period) = period; N.scalar[0] = NULL; ret = _GD_Change(D, field_code, &N, 0); dreturn("%i", ret); return ret; } int gd_alter_spec(DIRFILE* D, const char* line, int move) { const char *tok_pos = NULL; char *outstring = NULL, *new_code; char *in_cols[MAX_IN_COLS]; int n_cols, ret; gd_entry_t *N = NULL; struct parser_state p; dtrace("%p, \"%s\", %i", D, line, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); /* start parsing */ _GD_SimpleParserInit(D, "gd_alter_spec()", &p); n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols); if (D->error) { free(outstring); dreturn("%i", -1); /* tokeniser threw an error */ return -1; } /* Sanity check */ if (n_cols == 0) { free(outstring); _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, "dirfile_alter_spec()", 0, NULL); dreturn("%i", -1); return -1; } N = _GD_FindField(D, in_cols[0], D->entry, D->n_entries, 1, NULL); if (N == NULL) { free(outstring); _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, in_cols[0]); dreturn("%i", -1); return -1; } /* the parser will modifiy in_cols[0] if it contains a metafield code */ if ((new_code = _GD_Strdup(D, in_cols[0])) == NULL) { dreturn("%i", -1); return -1; } /* Let the parser compose the entry */ N = _GD_ParseFieldSpec(D, &p, n_cols, in_cols, NULL, N->fragment_index, 0, 0, &outstring, tok_pos); free(outstring); if (D->error) { free(new_code); dreturn("%i", -1); /* field spec parser threw an error */ return -1; } /* The parse will have re-applied the prefix and suffix, undo that */ free(N->field); N->field = new_code; if (N->field_type == GD_LINCOM_ENTRY || N->field_type == GD_POLYNOM_ENTRY) move = 7; /* Change the entry */ ret = _GD_Change(D, N->field, N, move); _GD_FreeE(D, N, 1); dreturn("%i", ret); return ret; } int gd_malter_spec(DIRFILE* D, const char* line, const char* parent, int move) { char *outstring = NULL; const char *tok_pos; char *in_cols[MAX_IN_COLS]; int n_cols, ret; gd_entry_t *N = NULL; struct parser_state p; dtrace("%p, \"%s\", \"%s\", %i", D, line, parent, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); N = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (N == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%i", -1); return -1; } /* start parsing */ _GD_SimpleParserInit(D, "gd_malter_spec()", &p); n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols); if (!D->error) { /* Let the parser compose the entry */ N = _GD_ParseFieldSpec(D, &p, n_cols, in_cols, N, N->fragment_index, 0, 0, &outstring, tok_pos); /* The parse will have re-applied the prefix and suffix, undo that */ free(N->field); if ((N->field = _GD_Malloc(D, strlen(parent) + strlen(in_cols[0]) + 2))) sprintf(N->field, "%s/%s", parent, in_cols[0]); } free(outstring); if (D->error) { dreturn("%i", -1); /* field spec parser threw an error */ return -1; } if (N->field_type == GD_LINCOM_ENTRY || N->field_type == GD_POLYNOM_ENTRY) move = 7; /* Change the entry */ ret = _GD_Change(D, N->field, N, move); _GD_FreeE(D, N, 1); dreturn("%i", ret); return ret; } libgetdata-0.9.0/src/ascii.c0000640000175000017500000002220012614323564016023 0ustar alastairalastair/* Copyright (C) 2008-2013, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* The ASCII encoding uses file->edata for the stream pointer */ int _GD_AsciiOpen(int fd, struct gd_raw_file_* file, gd_type_t type gd_unused_, int swap gd_unused_, unsigned int mode) { dtrace("%i, %p, , , %u", fd, file, mode); if (!(mode & GD_FILE_TEMP)) { if (file->mode & mode) { dreturn("%i", 0); return 0; } else if (file->edata != NULL) fclose((FILE*)file->edata); file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE) ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666); } else file->idata = _GD_MakeTempFile(file->D, fd, file->name); if (file->idata < 0) { dreturn("%i", -1); return -1; } file->edata = fdopen(file->idata, (mode & GD_FILE_WRITE) ? "rb+" : "rb"); if (file->edata == NULL) { close(file->idata); file->idata = -1; dreturn("%i", -1); return -1; } file->mode = mode | GD_FILE_READ; file->pos = 0; dreturn("%i", 0); return 0; } off64_t _GD_AsciiSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type gd_unused_, unsigned int mode) { char line[64]; dtrace("%p, %lli, , 0x%X", file, (long long)count, mode); if (count < file->pos) { rewind((FILE *)file->edata); file->pos = 0; } for (; count > file->pos; ++file->pos) if (fgets(line, 64, (FILE *)file->edata) == NULL) break; if (mode & GD_FILE_WRITE && count > file->pos) { strcpy(line, "0\n"); for (; count > file->pos; ++file->pos) fputs(line, (FILE *)file->edata); } dreturn("%lli", (long long)file->pos); return file->pos; } static void _GD_ScanFormat(char* fmt, gd_type_t data_type) { dtrace("%p, 0x%X", fmt, data_type); switch(data_type) { case GD_UINT8: #ifndef NO_8BIT_INT_PREFIX strcpy(fmt, "%" SCNu8); break; #endif case GD_UINT16: strcpy(fmt, "%" SCNu16); break; case GD_INT8: #ifndef NO_8BIT_INT_PREFIX strcpy(fmt, "%" SCNi8); break; #endif case GD_INT16: strcpy(fmt, "%" SCNi16); break; case GD_UINT32: strcpy(fmt, "%" SCNu32); break; case GD_INT32: strcpy(fmt, "%" SCNi32); break; case GD_UINT64: strcpy(fmt, "%" SCNu64); break; case GD_INT64: strcpy(fmt, "%" SCNi64); break; case GD_FLOAT32: strcpy(fmt, "%f"); break; case GD_FLOAT64: strcpy(fmt, "%lf"); break; case GD_COMPLEX64: strcpy(fmt, "%f;%f"); break; case GD_COMPLEX128: strcpy(fmt, "%lf;%lf"); break; default: fmt[0] = 0; break; } if (fmt[0]) strcat(fmt, "\n"); dreturn("[\"%s\"]", fmt); } ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict file, void *restrict ptr, gd_type_t data_type, size_t nmemb) { char fmt[50]; size_t n = 0; ssize_t ret = 0; #ifdef NO_8BIT_INT_PREFIX short int i16; #endif dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); _GD_ScanFormat(fmt, data_type); if (data_type & GD_COMPLEX) { for (n = 0; n < nmemb; ++n) { if (feof((FILE *)file->edata)) break; if (fscanf((FILE *)file->edata, fmt, (char *)ptr + GD_SIZE(data_type) * n, (char *)ptr + GD_SIZE(data_type) * n + GD_SIZE(data_type) / 2) < 2) { if (ferror((FILE *)file->edata)) ret = -1; break; } file->pos++; } } else { for (n = 0; n < nmemb; ++n) { if (ferror((FILE *)file->edata)) break; #ifdef NO_8BIT_INT_PREFIX if (GD_SIZE(data_type) == 1) { if (fscanf((FILE *)file->edata, fmt, &i16) < 1) { if (ferror((FILE *)file->edata)) ret = -1; break; } if (data_type & GD_SIGNED) *((int8_t *)ptr + GD_SIZE(data_type) * n) = (int8_t)i16; else *((uint8_t *)ptr + GD_SIZE(data_type) * n) = (uint8_t)i16; } else #endif { if (fscanf((FILE *)file->edata, fmt, (char *)ptr + GD_SIZE(data_type) * n) < 1) { if (ferror((FILE *)file->edata)) ret = -1; break; } } file->pos++; } } dreturn("%li", (ret) ? (long)ret : (long)n); return (ret) ? ret : (ssize_t)n; } ssize_t _GD_AsciiWrite(struct gd_raw_file_ *restrict file, const void *restrict ptr, gd_type_t data_type, size_t nmemb) { ssize_t ret = 0; size_t n = 0; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); switch(data_type) { case GD_UINT8: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIu8 "\n", ((uint8_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_INT8: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIi8 "\n", ((int8_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_UINT16: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIu16 "\n", ((uint16_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_INT16: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIi16 "\n", ((int16_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_UINT32: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIu32 "\n", ((uint32_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_INT32: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIi32 "\n", ((int32_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_UINT64: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIu64 "\n", ((uint64_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_INT64: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%" PRIi64 "\n", ((int64_t *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_FLOAT32: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%.7g\n", ((float *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_FLOAT64: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%.16lg\n", ((double *)ptr)[n]) < 0) { ret = -1; break; } break; case GD_COMPLEX64: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%.16g;%.16g\n", ((float *)ptr)[n * 2], (((float *)ptr)[n * 2 + 1])) < 0) { ret = -1; break; } break; case GD_COMPLEX128: for (n = 0; n < nmemb; ++n) if (fprintf((FILE *)file->edata, "%.16lg;%.16lg\n", ((double *)ptr)[n * 2], (((double *)ptr)[n * 2 + 1])) < 0) { ret = -1; break; } break; default: ret = -1; break; } dreturn("%li", (ret) ? (long)ret : (long)n); return (ret) ? ret : (ssize_t)n; } int _GD_AsciiSync(struct gd_raw_file_ *file) { int ret; dtrace("%p", file); ret = fflush((FILE *)file->edata); #ifndef __MSVCRT__ if (!ret) ret = fsync(fileno((FILE *)file->edata)); #endif dreturn("%i", ret); return ret; } int _GD_AsciiClose(struct gd_raw_file_* file) { int ret; dtrace("%p", file); ret = fclose((FILE *)file->edata); if (ret == EOF) { dreturn("%i", 1); return 1; } file->idata = -1; file->mode = 0; dreturn("%i", 0); return 0; } off64_t _GD_AsciiSize(int dirfd, struct gd_raw_file_* file, gd_type_t data_type gd_unused_, int swap gd_unused_) { FILE* stream; char *buffer = NULL; size_t len = 0; off64_t n = 0; int fd; dtrace("%i, %p, , ", dirfd, file); fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY, 0666); if (fd < 0) { dreturn("%i", -1); return -1; } stream = fdopen(fd, "rb"); if (stream == NULL) { dreturn("%i", -1); return -1; } while (getdelim(&buffer, &len, '\n', stream) != -1) n++; free(buffer); fclose(stream); dreturn("%lli", (long long)n); return n; } libgetdata-0.9.0/src/flush.c0000640000175000017500000012147712614323564016074 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #define GD_MAX_PRETTY_FIELD_WIDTH 80 void _GD_Flush(DIRFILE *D, gd_entry_t *E, int syn, int clo) { int i; dtrace("%p, %p, %i, %i", D, E, syn, clo); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturnvoid(); return; } switch(E->field_type) { case GD_RAW_ENTRY: if (E->e->u.raw.file[0].idata >= 0 || ((_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP) && (E->e->u.raw.file[1].idata >= 0))) { if (syn && (D->flags & GD_ACCMODE) == GD_RDWR && (E->e->u.raw.file[0].mode & GD_FILE_WRITE) && _GD_ef[E->e->u.raw.file[0].subenc].sync != NULL && (*_GD_ef[E->e->u.raw.file[0].subenc].sync)(E->e->u.raw.file)) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0); } else if (clo && _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) { ; /* error already set */ } } break; case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) { if (!_GD_BadInput(D, E, i, GD_NO_ENTRY, 0)) _GD_Flush(D, E->e->entry[i], syn, clo); } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (!_GD_BadInput(D, E, 1, GD_NO_ENTRY, 0)) _GD_Flush(D, E->e->entry[1], syn, clo); /* fallthrough */ case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: if (!_GD_BadInput(D, E, 0, GD_NO_ENTRY, 0)) _GD_Flush(D, E->e->entry[0], syn, clo); case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_INDEX_ENTRY: case GD_NO_ENTRY: case GD_ALIAS_ENTRY: break; } D->recurse_level--; dreturnvoid(); } static const char* _GD_TypeName(DIRFILE* D, gd_type_t data_type) { const char* ptr; dtrace("%p, 0x%X", D, data_type); switch(data_type) { case GD_UINT8: ptr = "UINT8"; break; case GD_INT8: ptr = "INT8"; break; case GD_UINT16: ptr = "UINT16"; break; case GD_INT16: ptr = "INT16"; break; case GD_UINT32: ptr = "UINT32"; break; case GD_INT32: ptr = "INT32"; break; case GD_UINT64: ptr = "UINT64"; break; case GD_INT64: ptr = "INT64"; break; case GD_FLOAT32: ptr = "FLOAT32"; break; case GD_FLOAT64: ptr = "FLOAT64"; break; case GD_COMPLEX64: ptr = "COMPLEX64"; break; case GD_COMPLEX128: ptr = "COMPLEX128"; break; default: _GD_InternalError(D); ptr = ""; break; } dreturn("\"%s\"", ptr); return ptr; } static const char* _GD_OldTypeName(DIRFILE* D, gd_type_t data_type) { const char* ptr; dtrace("%p, 0x%X", D, data_type); switch(data_type) { case GD_UINT8: ptr = "c"; break; case GD_UINT16: ptr = "u"; break; case GD_INT16: ptr = "s"; break; case GD_UINT32: ptr = "U"; break; case GD_INT32: ptr = "S"; break; case GD_FLOAT32: ptr = "f"; break; case GD_FLOAT64: ptr = "d"; break; default: _GD_InternalError(D); ptr = ""; break; } dreturn("\"%s\"", ptr); return ptr; } static const char *_GD_WindopName(DIRFILE *D, gd_windop_t op) { const char *ptr; dtrace("%p, %i", D, op); switch(op) { case GD_WINDOP_EQ: ptr = "EQ"; break; case GD_WINDOP_GE: ptr = "GE"; break; case GD_WINDOP_GT: ptr = "GT"; break; case GD_WINDOP_LE: ptr = "LE"; break; case GD_WINDOP_LT: ptr = "LT"; break; case GD_WINDOP_NE: ptr = "NE"; break; case GD_WINDOP_SET: ptr = "SET"; break; case GD_WINDOP_CLR: ptr = "CLR"; break; default: _GD_InternalError(D); ptr = ""; break; } dreturn("\"%s\"", ptr); return ptr; } static ssize_t _GD_StringEscapeise(FILE *stream, const char *in, int meta, int permissive, int standards) { const char* HexDigit = "0123456789ABCDEF"; ssize_t len = 0; dtrace("%p, \"%s\", %i, %i, %i", stream, in, meta, permissive, standards); if (in == NULL || in[0] == '\0') { if (stream) { if (fputs("\"\"", stream) == EOF) goto WRITE_ERR; } dreturn("%i", 2); return 2; } if (!permissive && standards < 6) { if (stream) if (fputs(in, stream) == EOF) goto WRITE_ERR; dreturn("%" PRNsize_t, strlen(in)); return strlen(in); } for (; *in != '\0'; ++in) { if (*in == '\\' || *in == '#' || *in == '"' || *in == ' ') { fputc('\\', stream); fputc(*in, stream); len += 2; } else if (*in < 0x20 #if CHAR_MIN != 0 && *in >= 0x00 #endif ) { if (stream) { if (fputs("\\x", stream) == EOF) goto WRITE_ERR; if (fputc(HexDigit[*in >> 4], stream) == EOF) goto WRITE_ERR; if (fputc(HexDigit[*in & 0xF], stream) == EOF) goto WRITE_ERR; } len += 4; } else if (meta && *in == '/') break; else { if (stream) if (fputc(*in, stream) == EOF) goto WRITE_ERR; len++; } } dreturn("%" PRNsize_t, len); return len; WRITE_ERR: dreturn("%i", -1); return -1; } /* write a field code, taking care of stripping off affixes; returns the length * written */ #define GD_WFC_SPACE 0x1 #define GD_WFC_SCALAR 0x2 static ssize_t _GD_WriteFieldCode(DIRFILE *D, FILE *stream, int me, const char *code, int index, int permissive, int standards, unsigned flags) { ssize_t len; char *ptr; const int scalar = flags & GD_WFC_SCALAR; const int space = flags & GD_WFC_SPACE; dtrace("%p, %p, %i, \"%s\", %i, %i, %i, 0x%X", D, stream, me, code, index, permissive, standards, flags); ptr = _GD_MungeCode(D, NULL, 0, D->fragment[me].prefix, D->fragment[me].suffix, NULL, NULL, code, NULL, NULL, GD_MC_RQ_PARTS); len = _GD_StringEscapeise(stream, ptr, 0, permissive, standards); /* If a scalar field code could be interpreted as a number, we must force * interpretation as a field code by appending a <0> scalar index, which is * valid for both CARRAY and CONST fields. */ if (len > 0 && scalar && index == -1) if (_GD_TokToNum(ptr, standards, !permissive, NULL, NULL, NULL, NULL) != -1) { if (permissive || standards >= 8) { if (fputs("<0>", stream) == EOF) len = -1; else len += 3; } else _GD_InternalError(D); } /* append a space */ if (space && len > 0) { if (fputc(' ', stream) == EOF) len = -1; else len++; } free(ptr); dreturn("%" PRNssize_t, len); return len; } /* write a field, padding to the specified length */ static ssize_t _GD_PadField(DIRFILE *D, FILE *stream, int me, const char *in, ssize_t len, int permissive, int standards) { ssize_t i; dtrace("%p, %p, %i, \"%s\", %" PRNsize_t ", %i, %i", D, stream, me, in, len, permissive, standards); i = _GD_WriteFieldCode(D, stream, me, in, 0, permissive, standards, 0); if (i >= 0) for (; i < len; ++i) if (fputc(' ', stream) == EOF) { i = -1; break; } dreturn("%" PRNssize_t, i); return i; } /* Write a litteral parameter or CONST name or CARRAY element */ static int _GD_WriteConst(DIRFILE *D, FILE *stream, int me, int permissive, int type, const void* value, const char *scalar, int index, const char *postamble) { int e; dtrace("%p, %p, %i, %i, 0x%X, %p, \"%s\", %i, \"%s\"", D, stream, me, permissive, type, value, scalar, index, postamble); if (scalar != NULL) { if (_GD_WriteFieldCode(D, stream, me, scalar, index, permissive, D->standards, GD_WFC_SCALAR) < 0) { dreturn("%i", -1); return -1; } if (index == -1) fprintf(stream, "%s", postamble); else fprintf(stream, "<%i>%s", index, postamble); } else if (type == GD_UINT64) fprintf(stream, "%" PRIu64 "%s", *(uint64_t *)value, postamble); else if (type == GD_INT64) fprintf(stream, "%" PRIi64 "%s", *(int64_t *)value, postamble); else if (type == GD_UINT32) fprintf(stream, "%" PRIu32 "%s", *(uint32_t *)value, postamble); else if (type == GD_INT32) fprintf(stream, "%" PRIi32 "%s", *(int32_t *)value, postamble); else if (type == GD_UINT16) fprintf(stream, "%" PRIu16 "%s", *(uint16_t *)value, postamble); else if (type == GD_INT16) fprintf(stream, "%" PRIi16 "%s", *(int16_t *)value, postamble); else if (type == GD_FLOAT64) fprintf(stream, "%.15g%s", *(double *)value, postamble); else if (type == GD_COMPLEX128) fprintf(stream, "%.15g;%.15g%s", *(double *)value, ((double *)value)[1], postamble); else { _GD_InternalError(D); dreturn("%i", -1); return -1; } e = ferror(stream); dreturn("%i", e); return e; } /* Write a field specification line */ static int _GD_FieldSpec(DIRFILE* D, FILE* stream, const gd_entry_t* E, int me, int meta, size_t max_len, int pretty, int permissive) { int i; char *ptr; ssize_t len, pos; char buffer[1000]; size_t z; dtrace("%p, %p, %p, %i, %i, %" PRNsize_t ", %i, %i", D, stream, E, me, meta, max_len, pretty, permissive); /* INDEX is implicit, and it is an error to define it in the format file */ if (E->field_type == GD_INDEX_ENTRY) { dreturn("%i", 0); return 0; } /* aliases */ if (E->field_type == GD_ALIAS_ENTRY) { if (fputs("/ALIAS ", stream) == EOF) goto WRITE_ERR; if (_GD_WriteFieldCode(D, stream, me, E->field, 0, permissive, D->standards, GD_WFC_SPACE) < 0) { goto WRITE_ERR; } if (_GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, 0) < 0) { goto WRITE_ERR; } if (fputc('\n', stream) == EOF) goto WRITE_ERR; } else { ptr = E->field; /* From Standards Version 7 and on, just use Barth-style */ if (meta && D->standards < 7) { if (fputs("META ", stream) == EOF) goto WRITE_ERR; if (_GD_StringEscapeise(stream, ptr, 1, permissive, D->standards) < 0) goto WRITE_ERR; if (fputc(' ', stream) == EOF) goto WRITE_ERR; ptr = strchr(E->field, '/') + 1; } /* field name */ if (_GD_PadField(D, stream, me, ptr, max_len, permissive, D->standards) < 0) goto WRITE_ERR; switch(E->field_type) { case GD_RAW_ENTRY: if (fprintf(stream, " RAW%s %s ", pretty ? " " : "", (permissive || D->standards >= 5) ? _GD_TypeName(D, E->EN(raw,data_type)) : _GD_OldTypeName(D, E->EN(raw,data_type))) < 0 || _GD_WriteConst(D, stream, me, permissive, GD_UINT_TYPE, &E->EN(raw,spf), E->scalar[0], E->scalar_ind[0], "") < 0) { goto WRITE_ERR; } break; case GD_LINCOM_ENTRY: if (fprintf(stream, " LINCOM%s %i ", pretty ? " " : "", E->EN(lincom,n_fields)) < 0) { goto WRITE_ERR; } for (i = 0; i < E->EN(lincom,n_fields); ++i) { if (_GD_WriteFieldCode(D, stream, me, E->in_fields[i], 0, permissive, D->standards, GD_WFC_SPACE) < 0) { goto WRITE_ERR; } if (E->flags & GD_EN_COMPSCAL) { if (_GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128, &E->EN(lincom,cm)[i], E->scalar[i], E->scalar_ind[i], " ") < 0 || _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128, &E->EN(lincom,cb)[i], E->scalar[i + GD_MAX_LINCOM], E->scalar_ind[i + GD_MAX_LINCOM], i == E->EN(lincom,n_fields) - 1 ? "" : " ") < 0) { goto WRITE_ERR; } } else { if (_GD_WriteConst(D, stream, me, permissive, GD_FLOAT64, &E->EN(lincom,m)[i], E->scalar[i], E->scalar_ind[i], " ") < 0 || _GD_WriteConst(D, stream, me, permissive, GD_FLOAT64, &E->EN(lincom,b)[i], E->scalar[i + GD_MAX_LINCOM], E->scalar_ind[i + GD_MAX_LINCOM], i == E->EN(lincom,n_fields) - 1 ? "" : " ") < 0) { goto WRITE_ERR; } } } break; case GD_LINTERP_ENTRY: if (fprintf(stream, " LINTERP%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_StringEscapeise(stream, E->EN(linterp,table), 0, permissive, D->standards) < 0) { goto WRITE_ERR; } break; case GD_BIT_ENTRY: if (fprintf(stream, " BIT%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(bit,bitnum), E->scalar[0], E->scalar_ind[0], " ") < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(bit,numbits), E->scalar[1], E->scalar_ind[1], "") < 0) { goto WRITE_ERR; } break; case GD_DIVIDE_ENTRY: if (fprintf(stream, " DIVIDE%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive, D->standards, 0) < 0) { goto WRITE_ERR; } break; case GD_RECIP_ENTRY: if (fprintf(stream, " RECIP%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128, &E->EN(recip,cdividend), E->scalar[0], E->scalar_ind[0], "") < 0) { goto WRITE_ERR; } break; case GD_MULTIPLY_ENTRY: if (fputs(" MULTIPLY ", stream) == EOF || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive, D->standards, 0) < 0) { goto WRITE_ERR; } break; case GD_PHASE_ENTRY: if (fprintf(stream, " PHASE%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT64, &E->EN(phase,shift), E->scalar[0], E->scalar_ind[0], "") < 0) { goto WRITE_ERR; } break; case GD_POLYNOM_ENTRY: if (fprintf(stream, " POLYNOM%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0) { goto WRITE_ERR; } for (i = 0; i <= E->EN(polynom,poly_ord); ++i) if (E->flags & GD_EN_COMPSCAL) { if (_GD_WriteConst(D, stream, me, permissive, GD_COMPLEX128, &E->EN(polynom,ca)[i], E->scalar[i], E->scalar_ind[i], (i == E->EN(polynom,poly_ord)) ? "" : " ") < 0) { goto WRITE_ERR; } } else { if (_GD_WriteConst(D, stream, me, permissive, GD_FLOAT64, &E->EN(polynom,a)[i], E->scalar[i], E->scalar_ind[i], (i == E->EN(polynom,poly_ord)) ? "" : " ") < 0) { goto WRITE_ERR; } } break; case GD_SBIT_ENTRY: if (fprintf(stream, " SBIT%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(bit,bitnum), E->scalar[0], E->scalar_ind[0], " ") < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(bit,numbits), E->scalar[1], E->scalar_ind[1], "") < 0) { goto WRITE_ERR; } break; case GD_WINDOW_ENTRY: if (fprintf(stream, " WINDOW%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive, D->standards, 0) < 0 || fprintf(stream, " %s ", _GD_WindopName(D, E->EN(window,windop))) < 0) { goto WRITE_ERR; } switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: if (_GD_WriteConst(D, stream, me, permissive, GD_INT64, &E->EN(window,threshold.i), E->scalar[0], E->scalar_ind[0], "") < 0) { goto WRITE_ERR; } break; case GD_WINDOP_SET: case GD_WINDOP_CLR: if (_GD_WriteConst(D, stream, me, permissive, GD_UINT64, &E->EN(window,threshold.u), E->scalar[0], E->scalar_ind[0], "") < 0) { goto WRITE_ERR; } break; default: if (_GD_WriteConst(D, stream, me, permissive, GD_FLOAT64, &E->EN(window,threshold.r), E->scalar[0], E->scalar_ind[0], "") < 0) { goto WRITE_ERR; } break; } break; case GD_MPLEX_ENTRY: if (fprintf(stream, " MPLEX%s ", pretty ? " " : "") < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[0], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteFieldCode(D, stream, me, E->in_fields[1], 0, permissive, D->standards, GD_WFC_SPACE) < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(mplex,count_val), E->scalar[0], E->scalar_ind[0], " ") < 0 || _GD_WriteConst(D, stream, me, permissive, GD_INT_TYPE, &E->EN(mplex,period), E->scalar[1], E->scalar_ind[1], "") < 0) { goto WRITE_ERR; } break; case GD_CONST_ENTRY: if (fprintf(stream, " CONST%s %s ", pretty ? " " : "", _GD_TypeName(D, E->EN(scalar,const_type))) < 0) { goto WRITE_ERR; } if (E->EN(scalar,const_type) & GD_SIGNED) { if (fprintf(stream, "%" PRIi64, *(int64_t*)E->e->u.scalar.d) < 0) goto WRITE_ERR; } else if (E->EN(scalar,const_type) & GD_IEEE754) { if (fprintf(stream, "%.15g", *(double*)E->e->u.scalar.d) < 0) goto WRITE_ERR; } else if (E->EN(scalar,const_type) & GD_COMPLEX) { if (fprintf(stream, "%.15g;%.15g", *(double*)E->e->u.scalar.d, *((double*)E->e->u.scalar.d + 1)) < 0) { goto WRITE_ERR; } } else if (fprintf(stream, "%" PRIu64, *(uint64_t*)E->e->u.scalar.d) < 0) goto WRITE_ERR; break; case GD_CARRAY_ENTRY: pos = fprintf(stream, " CARRAY%s %s", pretty ? " " : "", _GD_TypeName(D, E->EN(scalar,const_type))); if (pos < 0) goto WRITE_ERR; for (z = 0; z < E->EN(scalar,array_len); ++z) { if (E->EN(scalar,const_type) & GD_SIGNED) len = sprintf(buffer, " %" PRIi64, ((int64_t*)E->e->u.scalar.d)[z]); else if (E->EN(scalar,const_type) & GD_IEEE754) len = sprintf(buffer, " %.15g", ((double*)E->e->u.scalar.d)[z]); else if (E->EN(scalar,const_type) & GD_COMPLEX) len = sprintf(buffer, " %.15g;%.15g", ((double*)E->e->u.scalar.d)[2 * z], ((double*)E->e->u.scalar.d)[2 * z + 1]); else len = sprintf(buffer, " %" PRIu64, ((uint64_t*)E->e->u.scalar.d)[z]); /* don't write lines that are too long * also, add one to length for the trailing '\n' */ if (GD_SSIZE_T_MAX - (len + 1) <= pos) { _GD_SetError(D, GD_E_LINE_TOO_LONG, GD_E_LONG_FLUSH, E->field, 0, NULL); dreturn("%i", -1); return -1; } if (fputs(buffer, stream) == EOF) goto WRITE_ERR; } break; case GD_STRING_ENTRY: if (fprintf(stream, " STRING%s ", pretty ? " " : "") < 0) goto WRITE_ERR; if (_GD_StringEscapeise(stream, E->e->u.string, 0, permissive, D->standards) < 0) { goto WRITE_ERR; } break; case GD_INDEX_ENTRY: case GD_ALIAS_ENTRY: case GD_NO_ENTRY: _GD_InternalError(D); dreturn("%i", -1); return -1; } if (fputc('\n', stream) == EOF) goto WRITE_ERR; } if (!D->error && (E->flags & GD_EN_HIDDEN) && (permissive || D->standards >= 9)) { if (fputs("/HIDDEN ", stream) == EOF) goto WRITE_ERR; if (_GD_WriteFieldCode(D, stream, me, E->field, 0, permissive, D->standards, 0) < 0) { goto WRITE_ERR; } if (fputc('\n', stream) == EOF) goto WRITE_ERR; } dreturn("%i", 0); return 0; WRITE_ERR: if (!D->error) _GD_SetError(D, GD_E_IO, GD_E_IO_WRITE, NULL, 0, NULL); dreturn("%i", -1); return -1; } static void _GD_FlushFragment(DIRFILE* D, int i, int permissive) { int j; FILE* stream; char buffer[GD_MAX_LINE_LENGTH]; char temp_file[] = "format_XXXXXX"; char* ptr; struct tm now; int fd; int pretty = 0; ssize_t max_len = 0; unsigned int u; #ifdef HAVE_FCHMOD mode_t mode; #endif struct stat stat_buf; time_t t; int dirfd = D->fragment[i].dirfd; dtrace("%p, %i, %i", D, i, permissive); #ifdef HAVE_FCHMOD /* get the permissions of the old file */ if (stat(D->fragment[i].cname, &stat_buf)) mode = 0644; else mode = stat_buf.st_mode; #endif /* open a temporary file */ fd = _GD_MakeTempFile(D, dirfd, temp_file); if (fd == -1) { _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, NULL, 0, NULL); dreturnvoid(); return; } stream = fdopen(fd, "wb+"); if (stream == NULL) { _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, NULL, 0, NULL); dreturnvoid(); return; } if (D->flags & GD_PRETTY_PRINT) { size_t t = 0; ssize_t m = 0; int n = 0; pretty = 1; for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) { ssize_t l = strlen(D->entry[u]->field); if (m < l) m = l; t += l; n++; } max_len = (n == 0) ? 0: 2 * t / n; if (max_len > m) max_len = m; if (max_len > GD_MAX_PRETTY_FIELD_WIDTH) max_len = GD_MAX_PRETTY_FIELD_WIDTH; } /* Introit */ t = time(NULL); strftime(buffer, GD_MAX_LINE_LENGTH, "%c", gmtime_r(&t, &now)); if (fprintf(stream, "# This is a dirfile format file.\n" "# It was written using version %s of the GetData Library.\n" "# Written on %s UTC", PACKAGE_VERSION, buffer) < 0) { goto WRITE_ERR; } ptr = getenv("LOGNAME"); if (ptr == NULL) ptr = getenv("USER"); if (ptr != NULL) { if (fprintf(stream, " by %s", ptr) < 0) goto WRITE_ERR; if ((ptr = getenv("HOSTNAME")) != NULL) if (fprintf(stream, "@%s", ptr) < 0) goto WRITE_ERR; } if (fputs(".\n\n", stream) == EOF) goto WRITE_ERR; /* version */ if (permissive) { if (fprintf(stream, "# WARNING: This file may not conform to any " "Dirfile Standards Version.\n") < 0) { goto WRITE_ERR; } } else if (D->standards >= 5) { if (fprintf(stream, "/VERSION %i\n", D->standards) < 0) goto WRITE_ERR; } else if (fprintf(stream, "# This file conforms to Dirfile Standards Version %i.\n", D->standards) < 0) { goto WRITE_ERR; } /* Byte Sex */ if (permissive || D->standards >= 5) if (fprintf(stream, "/ENDIAN %s%s\n", (D->fragment[i].byte_sex & GD_LITTLE_ENDIAN) ? "little" : "big", ((permissive || D->standards >= 8) && (D->fragment[i].byte_sex & GD_ARM_FLAG) == GD_ARM_ENDIAN) ? " arm" : "") < 0) { goto WRITE_ERR; } /* Protection */ if (permissive || D->standards >= 6) { if (D->fragment[i].protection == GD_PROTECT_NONE) { if (fputs("/PROTECT none\n", stream) == EOF) goto WRITE_ERR; } else if (D->fragment[i].protection == GD_PROTECT_FORMAT) { if (fputs("/PROTECT format\n", stream) == EOF) goto WRITE_ERR; } else if (D->fragment[i].protection == GD_PROTECT_DATA) { if (fputs("/PROTECT data\n", stream) == EOF) goto WRITE_ERR; } else { if (fputs("/PROTECT all\n", stream) == EOF) goto WRITE_ERR; } } /* Frame offset */ if (permissive || D->standards >= 1) if (D->fragment[i].frame_offset != 0) if (fprintf(stream, "%sFRAMEOFFSET %llu\n", (D->standards >= 5) ? "/" : "", (unsigned long long)D->fragment[i].frame_offset) < 0) { goto WRITE_ERR; } /* Encoding */ if (permissive || D->standards >= 6) { const char *encoding = NULL; int use_encdat = 0; switch(D->fragment[i].encoding) { case GD_UNENCODED: encoding = "none"; break; case GD_BZIP2_ENCODED: encoding = "bzip2"; break; case GD_GZIP_ENCODED: encoding = "gzip"; break; case GD_LZMA_ENCODED: encoding = "lzma"; break; case GD_SLIM_ENCODED: encoding = "slim"; break; case GD_TEXT_ENCODED: encoding = "text"; break; case GD_SIE_ENCODED: encoding = "sie"; break; case GD_ZZIP_ENCODED: encoding = "zzip"; use_encdat = 1; break; case GD_ZZSLIM_ENCODED: encoding = "zzslim"; use_encdat = 1; break; case GD_FLAC_ENCODED: encoding = "flac"; break; case GD_AUTO_ENCODED: /* an unresolved, auto-encoded fragment */ break; default: if (fprintf(stream, "/ENCODING unknown # (%lx)\n", D->fragment[i].encoding) < 0) { goto WRITE_ERR; } break; } if (encoding != NULL) { if (use_encdat && D->fragment[i].enc_data) { if (fprintf(stream, "/ENCODING %s %s\n", encoding, (char*)D->fragment[i].enc_data) < 0) { goto WRITE_ERR; } } else { if (fprintf(stream, "/ENCODING %s\n", encoding) < 0) goto WRITE_ERR; } } } /* The includes */ if (permissive || D->standards >= 3) for (j = 0; j < D->n_fragment; ++j) if (D->fragment[j].parent == i) { char *prefix = _GD_MungeCode(D, NULL, 0, D->fragment[i].prefix, NULL, NULL, NULL, D->fragment[j].prefix, NULL, NULL, GD_MC_RQ_PARTS); char *suffix = _GD_MungeCode(D, NULL, 0, NULL, D->fragment[i].suffix, NULL, NULL, D->fragment[j].suffix, NULL, NULL, GD_MC_RQ_PARTS); if (fprintf(stream, "%sINCLUDE ", (D->standards >= 5) ? "/" : "") < 0 || _GD_StringEscapeise(stream, D->fragment[j].ename, 0, permissive, D->standards) < 0) { goto WRITE_ERR; } if (prefix || suffix) { if (fputc(' ', stream) == EOF || _GD_StringEscapeise(stream, prefix, 0, permissive, D->standards) < 0) { goto WRITE_ERR; } free(prefix); } if (suffix) { if (fputc(' ', stream) == EOF || _GD_StringEscapeise(stream, suffix, 0, permissive, D->standards) < 0) { goto WRITE_ERR; } free(suffix); } if (fputc('\n', stream) == EOF) goto WRITE_ERR; } /* The fields */ for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) { if (_GD_FieldSpec(D, stream, D->entry[u], i, 0, max_len, pretty, permissive) < 0) { goto WRITE_ERR; } if (permissive || D->standards >= 6) for (j = 0; j < D->entry[u]->e->n_meta; ++j) if (_GD_FieldSpec(D, stream, D->entry[u]->e->p.meta_entry[j], i, 1, 0, pretty, permissive) < 0) { goto WRITE_ERR; } } /* REFERENCE is written at the end, because its effect can propagate * upwards */ if (permissive || D->standards >= 6) if (D->fragment[i].ref_name != NULL) { if (fputs("/REFERENCE ", stream) == EOF || _GD_WriteFieldCode(D, stream, i, D->fragment[i].ref_name, 0, permissive, D->standards, 0) < 0 || fputc('\n', stream) == EOF) { goto WRITE_ERR; } } /* That's all */ #ifdef HAVE_FCHMOD if (fchmod(fd, mode)) goto WRITE_ERR; #endif /* if there's no error, try closing */ if (ferror(stream) || fclose(stream) == EOF) { WRITE_ERR: if (!D->error) _GD_SetError(D, GD_E_IO, GD_E_IO_WRITE, NULL, 0, NULL); fclose(stream); } /* If no error was encountered, move the temporary file over the * old format file, otherwise abort */ /* Only assume we've synced the file if the rename succeeds */ if (D->error != GD_E_OK) gd_UnlinkAt(D, dirfd, temp_file, 0); else if (gd_RenameAt(D, dirfd, temp_file, dirfd, D->fragment[i].bname)) { _GD_SetError(D, GD_E_IO, GD_E_IO_WRITE, NULL, 0, NULL); gd_UnlinkAt(D, dirfd, temp_file, 0); } else D->fragment[i].modified = 0; /* update mtime, if successful */ if (!D->error && gd_StatAt(D, dirfd, D->fragment[i].bname, &stat_buf, 0) == 0) D->fragment[i].mtime = stat_buf.st_mtime; dreturnvoid(); } void _GD_FlushMeta(DIRFILE* D, int fragment, int force) { int i; dtrace("%p, %i, %i", D, fragment, force); if (fragment == GD_ALL_FRAGMENTS) { for (i = 0; i < D->n_fragment; ++i) if (force || D->fragment[i].modified) _GD_FlushFragment(D, i, D->flags & GD_NOSTANDARD); } else if (force || D->fragment[fragment].modified) _GD_FlushFragment(D, fragment, D->flags & GD_NOSTANDARD); dreturnvoid(); } int gd_metaflush(DIRFILE* D) { dtrace("%p", D); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_FlushMeta(D, GD_ALL_FRAGMENTS, 0); dreturn("%i", (D->error == GD_E_OK) ? 0 : -1); return (D->error == GD_E_OK) ? 0 : -1; } int gd_rewrite_fragment(DIRFILE* D, int fragment) { dtrace("%p, %i", D, fragment); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 1); return -1; } if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_FlushMeta(D, fragment, 1); dreturn("%i", (D->error == GD_E_OK) ? 0 : -1); return (D->error == GD_E_OK) ? 0 : -1; } static int _GD_SyncOrClose(DIRFILE* D, const char* field_code, int syn, int clo) { unsigned int i; gd_entry_t *E; dtrace("%p, \"%s\", %i, %i", D, field_code, syn, clo); _GD_ClearError(D); if (D->flags & GD_INVALID) /* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); else if (field_code == NULL) { _GD_FlushMeta(D, GD_ALL_FRAGMENTS, 0); if (!D->error) for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->field_type == GD_RAW_ENTRY) _GD_Flush(D, D->entry[i], syn, clo); } else { E = _GD_FindEntry(D, field_code, NULL, 1, 1); if (!D->error) _GD_Flush(D, E, syn, clo); } dreturn("%i", (D->error == GD_E_OK) ? 0 : -1); return (D->error == GD_E_OK) ? 0 : -1; } int gd_sync(DIRFILE *D, const char *field_code) { int ret; dtrace("%p, \"%s\"", D, field_code); ret = _GD_SyncOrClose(D, field_code, 1, 0); dreturn("%i", ret); return ret; } int gd_raw_close(DIRFILE *D, const char *field_code) { int ret; dtrace("%p, \"%s\"", D, field_code); ret = _GD_SyncOrClose(D, field_code, 0, 1); dreturn("%i", ret); return ret; } int gd_flush(DIRFILE *D, const char *field_code) { int ret; dtrace("%p, \"%s\"", D, field_code); ret = _GD_SyncOrClose(D, field_code, 1, 1); dreturn("%i", ret); return ret; } #define GD_VERS_GE_1 0xFFFFFFFEUL #define GD_VERS_GE_2 0xFFFFFFFCUL #define GD_VERS_GE_3 0xFFFFFFF8UL #define GD_VERS_GE_4 0xFFFFFFF0UL #define GD_VERS_GE_5 0xFFFFFFE0UL #define GD_VERS_GE_6 0xFFFFFFC0UL #define GD_VERS_GE_7 0xFFFFFF80UL #define GD_VERS_GE_8 0xFFFFFF00UL #define GD_VERS_GE_9 0xFFFFFE00UL #define GD_VERS_LE_0 0x00000001UL #define GD_VERS_LE_1 0x00000003UL #define GD_VERS_LE_2 0x00000007UL #define GD_VERS_LE_3 0x0000000fUL #define GD_VERS_LE_4 0x0000001fUL #define GD_VERS_LE_5 0x0000003fUL #define GD_VERS_LE_6 0x0000007fUL #define GD_VERS_LE_7 0x000000ffUL #define GD_VERS_LE_8 0x000001ffUL #define GD_VERS_LE_9 0x000003ffUL uint64_t _GD_FindVersion(DIRFILE *D) { unsigned int i; char* ptr; dtrace("%p", D); D->av = (1 << (1 + GD_DIRFILE_STANDARDS_VERSION)) - 1; if (D->n_fragment > 1) D->av &= GD_VERS_GE_3; for (i = 0; D->av && i < (unsigned int)D->n_fragment; ++i) { if (D->fragment[i].prefix || D->fragment[i].suffix) D->av &= GD_VERS_GE_9; else if (D->fragment[i].byte_sex & GD_ARM_FLAG) /* on an arm-endian platform, the arm flag is set by /ENDIAN directives * missing an "arm" token, but it's absense might mean either an "arm" * token was present, or else there was no /ENDIAN directive at all */ #ifdef ARM_ENDIAN_DOUBLES D->av &= GD_VERS_GE_5; #else D->av &= GD_VERS_GE_8; else #endif if ((D->fragment[i].encoding != GD_UNENCODED && D->fragment[i].encoding != GD_AUTO_ENCODED) || D->fragment[i].protection) D->av &= GD_VERS_GE_6; else if (D->fragment[i].byte_sex & #ifdef WORDS_BIGENDIAN GD_LITTLE_ENDIAN #else GD_BIG_ENDIAN #endif ) D->av &= GD_VERS_GE_5; else if (D->fragment[i].frame_offset > 0) D->av &= GD_VERS_GE_1; } for (i = 0; D->av && i < D->n_entries; ++i) { if (D->entry[i]->flags & GD_EN_HIDDEN) D->av &= GD_VERS_GE_9; else switch (D->entry[i]->field_type) { case GD_RAW_ENTRY: switch (D->entry[i]->EN(raw,data_type)) { case GD_COMPLEX128: case GD_COMPLEX64: D->av &= GD_VERS_GE_7; break; case GD_INT8: case GD_INT64: case GD_UINT64: D->av &= GD_VERS_GE_5; break; default: break; } break; case GD_DIVIDE_ENTRY: case GD_RECIP_ENTRY: case GD_CARRAY_ENTRY: D->av &= GD_VERS_GE_8; break; case GD_MULTIPLY_ENTRY: D->av &= GD_VERS_GE_2; break; case GD_PHASE_ENTRY: D->av &= GD_VERS_GE_4; break; case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: D->av &= GD_VERS_GE_7; break; case GD_CONST_ENTRY: if (D->entry[i]->EN(scalar,const_type) & GD_COMPLEX128) D->av &= GD_VERS_GE_7; else D->av &= GD_VERS_GE_6; break; case GD_STRING_ENTRY: D->av &= GD_VERS_GE_6; break; case GD_BIT_ENTRY: if (D->entry[i]->EN(bit,numbits) > 1) D->av &= GD_VERS_GE_1; else if (D->entry[i]->EN(bit,bitnum) + D->entry[i]->EN(bit,numbits) - 1 > 32) { D->av &= GD_VERS_GE_5; } break; case GD_ALIAS_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: D->av &= GD_VERS_GE_9; break; case GD_LINTERP_ENTRY: case GD_LINCOM_ENTRY: case GD_INDEX_ENTRY: case GD_NO_ENTRY: break; } if (D->av & GD_VERS_GE_1 && strcmp(D->entry[i]->field, "FRAMEOFFSET") == 0) D->av &= (GD_VERS_LE_0 | GD_VERS_GE_8); else if (D->av & GD_VERS_GE_3 && strcmp(D->entry[i]->field, "INCLUDE") == 0) D->av &= (GD_VERS_LE_2 | GD_VERS_GE_8); else if (D->av & GD_VERS_GE_5 && (strcmp(D->entry[i]->field, "VERSION") == 0 || strcmp(D->entry[i]->field, "ENDIAN") == 0)) D->av &= (GD_VERS_LE_4 | GD_VERS_GE_8); else if (D->av & GD_VERS_GE_6 && (strcmp(D->entry[i]->field, "ENCODING") == 0 || strcmp(D->entry[i]->field, "META") == 0 || strcmp(D->entry[i]->field, "PROTECT") == 0 || strcmp(D->entry[i]->field, "REFERENCE") == 0)) D->av &= (GD_VERS_LE_5 | GD_VERS_GE_8); else if (D->av & GD_VERS_LE_5 && strcmp(D->entry[i]->field, "FILEFRAM") == 0) D->av &= GD_VERS_GE_6; for (ptr = D->entry[i]->field; *ptr != 0 && D->av; ++ptr) switch(*ptr) { case '/': /* a metafield */ case '#': case ' ': D->av &= GD_VERS_GE_6; break; case '.': if (D->entry[i]->flags & GD_EN_DOTTED) D->av &= GD_VERS_LE_5; break; case '&': case ';': case '<': case '>': case '\\': case '|': D->av &= GD_VERS_LE_4; break; } } D->flags |= GD_HAVE_VERSION; dreturn("0x%04" PRIx64, D->av); return D->av; } int gd_dirfile_standards(DIRFILE *D, int vers) gd_nothrow { /* log2(n) lut */ static const char ln2[] = { -1, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; /* some magic numbers */ static const char earliest_magic[] = {64, 0, 1, 39, 2, 15, 40, 23, 3, 12, 16, 59, 41, 19, 24, 54, 4, 0, 13, 10, 17, 62, 60, 28, 42, 30, 20, 51, 25, 44, 55, 47, 5, 32, 0, 38, 14, 22, 11, 58, 18, 53, 63, 9, 61, 27, 29, 50, 43, 46, 31, 37, 21, 57, 52, 8, 26, 49, 45, 36, 56, 7, 48, 35, 6, 34, 33}; dtrace("%p, %i", D, vers); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (~D->flags & GD_HAVE_VERSION) _GD_FindVersion(D); if (vers == GD_VERSION_CURRENT) vers = D->standards; else if (vers == GD_VERSION_LATEST) { uint32_t a, b; if ((b = D->av >> 16)) vers = (a = b >> 8) ? 24 + ln2[a] : 16 + ln2[b]; else vers = (a = D->av >> 8) ? 8 + ln2[a] : ln2[D->av]; } else if (vers == GD_VERSION_EARLIEST) vers = earliest_magic[(~(D->av - 1) & D->av) % 67]; if (vers < 0 || vers > GD_DIRFILE_STANDARDS_VERSION || ~D->av & (1ULL << vers)) { _GD_SetError(D, GD_E_ARGUMENT, (D->av == 0) ? GD_E_ARG_NO_VERS : GD_E_ARG_BAD_VERS, NULL, vers, NULL); dreturn("%i", -1); return -1; } D->standards = vers; dreturn("%i", vers); return vers; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/common.c0000640000175000017500000011626012614323564016235 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* This is defined on BSD */ #ifndef MAXSYMLINKS #define MAXSYMLINKS 20 #endif #ifdef GETDATA_DEBUG int gd_col_count = 0; char gd_debug_col[GD_COL_SIZE + 1] = ""; #endif int _GD_EntryCmp(const void *a, const void *b) { return strcmp((*(gd_entry_t**)a)->field, (*(gd_entry_t**)b)->field); } /* _GD_GetLine: read non-comment line from format file. The line is newly * malloc'd. Returns a pointer if successful, NULL if unsuccessful. * The length read is provided in *n. Increments *linenum as appropriate; */ char *_GD_GetLine(FILE *restrict fp, size_t *restrict n, int *restrict linenum) { ssize_t len; char *line = NULL; dtrace("%p, %p, %p", fp, n, linenum); do { errno = 0; len = getdelim(&line, n, '\n', fp); if (len == -1) break; (*linenum)++; } while (line[0] == '#' || line[0] == 0 || line[0] == '\n'); if (len != -1) { dreturn("\"%s\" (%" PRNsize_t ")", line, *n); return line; /* a line was read */ } free(line); dreturn("%p", NULL); return NULL; /* there were no valid lines */ } /* This function is needed outside the legacy API to handle old format files */ gd_type_t _GD_LegacyType(char c) { switch (c) { case 'n': return GD_NULL; case 'c': return GD_UINT8; case 'u': return GD_UINT16; case 's': return GD_INT16; case 'U': return GD_UINT32; case 'i': case 'S': return GD_INT32; case 'f': return GD_FLOAT32; case 'd': return GD_FLOAT64; } return GD_UNKNOWN; } /* Binary search to find the field */ gd_entry_t *_GD_FindField(const DIRFILE *restrict D, const char *restrict field_code, gd_entry_t *const *list, unsigned int u, int dealias, unsigned int *restrict index) { int c; char *ptr; gd_entry_t *E = NULL; unsigned int i, l = 0; const unsigned int ou = u; dtrace("%p, \"%s\", %p, %u, %i, %p", D, field_code, list, u, dealias, index); /* handle FILEFRAM */ if (D->standards < 6 && (D->flags & GD_PEDANTIC) && strcmp(field_code, "FILEFRAM") == 0) field_code = "INDEX"; while (l < u) { i = (l + u) / 2; c = strcmp(field_code, list[i]->field); if (c < 0) u = i; else if (c > 0) l = i + 1; else { E = list[i]; if (dealias && E && E->field_type == GD_ALIAS_ENTRY) E = E->e->entry[0]; if (index != NULL) *index = i; dreturn("%p", E); return E; } } if (index != NULL) *index = u; /* not found perhaps it's an subfield of an aliased field? */ if ((ptr = (char*)strchr(field_code, '/'))) { char *new_code = strdup(field_code); if (new_code) { new_code[ptr - field_code] = '\0'; E = _GD_FindField(D, new_code, list, ou, 0, NULL); free(new_code); if (E && E->field_type == GD_ALIAS_ENTRY && E->e->entry[0]) { size_t plen = strlen(E->e->entry[0]->field); new_code = (char*)malloc(plen + strlen(ptr) + 2); if (new_code) { strcpy(new_code, E->e->entry[0]->field); new_code[plen] = '/'; strcpy(new_code + plen + 1, ptr + 1); E = _GD_FindField(D, new_code, list, ou, 1, NULL); free(new_code); } } else E = NULL; } } dreturn("%p", E); return E; } /* Insertion sort the entry list */ void _GD_InsertSort(DIRFILE *restrict D, gd_entry_t *restrict E, int u) gd_nothrow { dtrace("%p, %p, %i", D, E, u); memmove(&D->entry[u + 1], &D->entry[u], sizeof(gd_entry_t*) * (D->n_entries - u)); D->entry[u] = E; dreturnvoid(); } /* _GD_Alloc: allocate a buffer of the right type & size */ void* _GD_Alloc(DIRFILE* D, gd_type_t type, size_t n) { void* ptr = NULL; dtrace("%p, 0x%x, %" PRNsize_t, D, type, n); if (n == 0) { _GD_InternalError(D); dreturn("%p", NULL); return NULL; } if (type == GD_NULL) { dreturn("%p", NULL); return NULL; } else if (GD_SIZE(type) == 0) { _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } ptr = _GD_Malloc(D, n * GD_SIZE(type)); dreturn("%p", ptr); return ptr; } /* compute LUT table path -- this is used by _GD_Change, so e may not be E->e */ int _GD_SetTablePath(DIRFILE *restrict D, const gd_entry_t *restrict E, struct gd_private_entry_ *restrict e) { char *temp_buffer; dtrace("%p, %p, %p", D, E, e); e->u.linterp.table_dirfd = _GD_GrabDir(D, D->fragment[E->fragment_index].dirfd, E->EN(linterp,table), 0); temp_buffer = _GD_Strdup(D, E->EN(linterp,table)); if (temp_buffer == NULL) { _GD_ReleaseDir(D, e->u.linterp.table_dirfd); dreturn("%i", 1); return 1; } e->u.linterp.table_file = _GD_Strdup(D, basename(temp_buffer)); if (e->u.linterp.table_file == NULL) { _GD_ReleaseDir(D, e->u.linterp.table_dirfd); free(temp_buffer); dreturn("%i", 1); return 1; } free(temp_buffer); dreturn("%i", 0); return 0; } /* LUT comparison function for qsort */ static int lutcmp(const void* a, const void* b) { double dx = ((struct gd_lut_ *)a)->x - ((struct gd_lut_ *)b)->x; return (dx < 0) ? -1 : (dx > 0) ? 1 : 0; } /* _GD_ReadLinterpFile: Read in the linterp data for this field */ void _GD_ReadLinterpFile(DIRFILE *restrict D, gd_entry_t *restrict E) { FILE *fp; struct gd_lut_ *ptr; int i, fd; int dir = -1; char *line = NULL; size_t n = 0; int linenum = 0; double yr, yi; int buf_len = GD_LUT_CHUNK; dtrace("%p, %p", D, E); if (E->e->u.linterp.table_file == NULL) if (_GD_SetTablePath(D, E, E->e)) { dreturnvoid(); return; } fd = gd_OpenAt(D, E->e->u.linterp.table_dirfd, E->e->u.linterp.table_file, O_RDONLY, 0666); if (fd == -1) { _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, E->EN(linterp,table), 0, NULL); dreturnvoid(); return; } fp = fdopen(fd, "rb"); if (fp == NULL) { _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, E->EN(linterp,table), 0, NULL); dreturnvoid(); return; } E->e->u.linterp.lut = _GD_Malloc(D, buf_len * sizeof(*E->e->u.linterp.lut)); if (E->e->u.linterp.lut == NULL) goto LUT_ERROR; /* read the first line to see whether the table is complex valued */ if ((line = _GD_GetLine(fp, &n, &linenum))) { char ystr[50]; if (sscanf(line, "%lg %49s", &yr, ystr) == 2) E->e->u.linterp.complex_table = (strchr(ystr, ';') == NULL) ? 0 : 1; else { _GD_SetError(D, GD_E_LUT, GD_E_LUT_SYNTAX, E->EN(linterp,table), linenum, NULL); goto LUT_ERROR; } } else { if (errno == EOVERFLOW) /* line too long */ _GD_SetError(D, GD_E_LINE_TOO_LONG, 0, E->EN(linterp,table), linenum, NULL); else /* no data in file! */ _GD_SetError(D, GD_E_LUT, GD_E_LUT_LENGTH, E->EN(linterp,table), 0, NULL); goto LUT_ERROR; } /* now read in the data -- we've already read line one */ i = 0; do { if (E->e->u.linterp.complex_table) { if (sscanf(line, "%lg %lg;%lg", &(E->e->u.linterp.lut[i].x), &yr, &yi) == 3) { gd_li2cs_(E->e->u.linterp.lut[i].y.c, yr, yi); } else { _GD_SetError(D, GD_E_LUT, GD_E_LUT_SYNTAX, E->EN(linterp,table), linenum, NULL); goto LUT_ERROR; } } else if (sscanf(line, "%lg %lg", &(E->e->u.linterp.lut[i].x), &(E->e->u.linterp.lut[i].y.r)) != 2) { _GD_SetError(D, GD_E_LUT, GD_E_LUT_SYNTAX, E->EN(linterp,table), linenum, NULL); goto LUT_ERROR; } if (dir > -2 && i > 0 && E->e->u.linterp.lut[i].x != E->e->u.linterp.lut[i - 1].x) { if (dir == -1) dir = (E->e->u.linterp.lut[i].x > E->e->u.linterp.lut[i - 1].x); else if (dir != (E->e->u.linterp.lut[i].x > E->e->u.linterp.lut[i - 1].x)) dir = -2; } i++; if (i >= buf_len) { buf_len += GD_LUT_CHUNK; ptr = _GD_Realloc(D, E->e->u.linterp.lut, buf_len * sizeof(*ptr)); if (ptr == NULL) goto LUT_ERROR; E->e->u.linterp.lut = ptr; } free(line); } while ((line = _GD_GetLine(fp, &n, &linenum))); if (i < 2) { _GD_SetError(D, GD_E_LUT, GD_E_LUT_LENGTH, NULL, 0, E->EN(linterp,table)); goto LUT_ERROR; } /* Free unused memory */ ptr = _GD_Realloc(D, E->e->u.linterp.lut, i * sizeof(*ptr)); if (ptr == NULL) goto LUT_ERROR; E->e->u.linterp.table_monotonic = -1; E->e->u.linterp.lut = ptr; E->e->u.linterp.table_len = i; /* sort the LUT */ if (dir == -2) qsort(E->e->u.linterp.lut, i, sizeof(struct gd_lut_), lutcmp); fclose(fp); dreturnvoid(); return; LUT_ERROR: free(E->e->u.linterp.lut); E->e->u.linterp.lut = NULL; free(line); fclose(fp); dreturnvoid(); } /* _GD_GetIndex: get LUT index. */ static size_t _GD_GetIndex(double x, const struct gd_lut_ *lut, size_t idx, size_t n) { dtrace("%g, %p, %" PRNsize_t ", %" PRNsize_t, x, lut, idx, n); /* Just linearly search - we're probably right to start */ /* increment until we are bigger */ while ((idx < n - 2) && (x > lut[idx].x)) idx++; /* decrement until we are smaller */ while ((idx > 0) && (x < lut[idx].x)) idx--; dreturn("%" PRNsize_t, idx); return idx; } #ifdef GD_NO_C99_API #define CLINTERP(t) \ do { \ for (i = 0; i < npts; i++) { \ x = data_in[i]; \ idx = _GD_GetIndex(x, lut, idx, n_ln); \ ((t *)data)[i] = (t)(lut[idx].y.c[0] + \ (lut[idx + 1].y.c[0] - lut[idx].y.c[0]) / \ (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \ } \ } while (0) #define LINTERPC(t) \ if (complex_table) CLINTERPC(t); else RLINTERPC(t) #else #define CLINTERP(t) \ do { \ for (i = 0; i < npts; i++) { \ x = data_in[i]; \ idx = _GD_GetIndex(x, lut, idx, n_ln); \ ((t *)data)[i] = (t)(lut[idx].y.c + (lut[idx + 1].y.c - lut[idx].y.c) / \ (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \ } \ } while (0) #define LINTERPC(t) LINTERP(complex t) #endif #define RLINTERP(t) \ do { \ for (i = 0; i < npts; i++) { \ x = data_in[i]; \ idx = _GD_GetIndex(x, lut, idx, n_ln); \ ((t *)data)[i] = (t)(lut[idx].y.r + (lut[idx + 1].y.r - lut[idx].y.r) / \ (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \ } \ } while (0) #define CLINTERPC(t) \ do { \ for (i = 0; i < npts; i++) { \ double tx, dx; \ x = data_in[i]; \ idx = _GD_GetIndex(x, lut, idx, n_ln); \ tx = lut[idx + 1].x - lut[idx].x; \ dx = x - lut[idx].x; \ ((t *)data)[2 * i] = (t)(lut[idx].y.c[0] + \ (lut[idx + 1].y.c[0] - lut[idx].y.c[0]) / tx * dx); \ ((t *)data)[2 * i + 1] = (t)(lut[idx].y.c[1] + \ (lut[idx + 1].y.c[1] - lut[idx].y.c[1]) / tx * dx); \ } \ } while (0) #define RLINTERPC(t) \ do { \ for (i = 0; i < npts; i++) { \ x = data_in[i]; \ idx = _GD_GetIndex(x, lut, idx, n_ln); \ ((t *)data)[2 * i] = (t)(lut[idx].y.r + \ (lut[idx + 1].y.r - lut[idx].y.r) / \ (lut[idx + 1].x - lut[idx].x) * (x - lut[idx].x)); \ ((t *)data)[2 * i + 1] = 0; \ } \ } while (0) #define LINTERP(t) \ if (complex_table) CLINTERP(t); else RLINTERP(t) /* _GD_LinterpData: calibrate data using lookup table lut */ void _GD_LinterpData(DIRFILE *restrict D, void *restrict data, gd_type_t type, int complex_table, const double *restrict data_in, size_t npts, const struct gd_lut_ *restrict lut, size_t n_ln) { int idx = 0; size_t i; double x; dtrace("%p, %p, 0x%x, %i, %p, %" PRNsize_t ", %p, %" PRNsize_t, D, data, type, complex_table, data_in, npts, lut, n_ln); switch (type) { case GD_NULL: break; case GD_INT8: LINTERP(int8_t ); break; case GD_UINT8: LINTERP(uint8_t ); break; case GD_INT16: LINTERP(int16_t ); break; case GD_UINT16: LINTERP(uint16_t); break; case GD_INT32: LINTERP(int32_t ); break; case GD_UINT32: LINTERP(uint32_t); break; case GD_INT64: LINTERP(int64_t ); break; case GD_UINT64: LINTERP(uint64_t); break; case GD_FLOAT32: LINTERP(float ); break; case GD_FLOAT64: LINTERP(double ); break; case GD_COMPLEX64: LINTERPC(float ); break; case GD_COMPLEX128: LINTERPC(double ); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); } dreturnvoid(); } /* macros to reduce tangly code */ #define LINCOM1(t) for (i = 0; i < n_read; i++) \ ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0] + b[0]) #define LINCOM2(t) for (i = 0; i < n_read; i++) \ ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0] + \ (data2[i * spf[1] / spf[0]] * m[1] + b[0] + b[1])) #define LINCOM3(t) for (i = 0; i < n_read; i++) \ ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0] + \ (data2[i * spf[1] / spf[0]] * m[1] + \ data3[i * spf[2] / spf[0]] * m[2] + \ b[0] + b[1] + b[2])) #ifdef GD_NO_C99_API #define LINCOMC1(t) \ do { \ for (i = 0; i < n_read; i++) { \ ((t *)data1)[2 * i] = (t)(((t *)data1)[i] * m[0] + b[0]); \ ((t *)data1)[2 * i + 1] = 0; \ } \ } while (0) #define LINCOMC2(t) \ do { \ for (i = 0; i < n_read; i++) { \ ((t *)data1)[2 * i] = (t)(((t *)data1)[i] * m[0] + \ (data2[i * spf[1] / spf[0]] * m[1] + b[0] + b[1])); \ ((t *)data1)[2 * i + 1] = 0; \ } \ } while (0) #define LINCOMC3(t) \ do { \ for (i = 0; i < n_read; i++) { \ ((t *)data1)[2 * i] = (t)(((t *)data1)[i] * m[0] + \ (data2[i * spf[1] / spf[0]] * m[1] + \ data3[i * spf[2] / spf[0]] * m[2] + \ b[0] + b[1] + b[2])); \ ((t *)data1)[2 * i + 1] = 0; \ } \ } while (0) #define LINCOMC(t) \ switch (n) { \ case 1: LINCOMC1(t); break; \ case 2: LINCOMC2(t); break; \ case 3: LINCOMC3(t); break; \ default: _GD_InternalError(D); \ } #else #define LINCOMC(t) LINCOM(complex t) #endif #define LINCOM(t) \ switch (n) { \ case 1: LINCOM1(t); break; \ case 2: LINCOM2(t); break; \ case 3: LINCOM3(t); break; \ default: _GD_InternalError(D); \ } /* Compute a lincom, all at once */ void _GD_LincomData(DIRFILE *restrict D, int n, void *restrict data1, gd_type_t return_type, const double *restrict data2, const double *restrict data3, const double *restrict m, const double *restrict b, const unsigned int *restrict spf, size_t n_read) { size_t i; dtrace("%p, %i, %p, 0x%x, %p, %p, %p, %p, %p, %" PRNsize_t, D, n, data1, return_type, data2, data3, m, b, spf, n_read); switch(return_type) { case GD_NULL: break; case GD_UINT8: LINCOM(uint8_t); break; case GD_INT8: LINCOM(int8_t); break; case GD_UINT16: LINCOM(uint16_t); break; case GD_INT16: LINCOM(int16_t); break; case GD_UINT32: LINCOM(uint32_t); break; case GD_INT32: LINCOM(int32_t); break; case GD_UINT64: LINCOM(uint64_t); break; case GD_INT64: LINCOM(int64_t); break; case GD_FLOAT32: LINCOM(float); break; case GD_FLOAT64: LINCOM(double); break; case GD_COMPLEX64: LINCOMC(float); break; case GD_COMPLEX128: LINCOMC(double); break; default: _GD_InternalError(D); } dreturnvoid(); } #ifdef GD_NO_C99_API /* These must all be redefined in the absense of complex math. */ #undef LINCOM1 #undef LINCOM2 #undef LINCOM3 #undef LINCOMC1 #undef LINCOMC2 #undef LINCOMC3 #define LINCOM1(t) for (i = 0; i < n_read; i++) \ ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0][0] + \ b[0][0]) #define LINCOM2(t) \ do { \ for (i = 0; i < n_read; i++) { \ const int i2 = 2 * (i * spf[1] / spf[0]); \ ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0][0] + \ (data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + b[0][0] + b[1][0])); \ } \ } while (0) #define LINCOM3(t) \ do { \ for (i = 0; i < n_read; i++) { \ const int i2 = 2 * (i * spf[1] / spf[0]); \ const int i3 = 2 * (i * spf[2] / spf[0]); \ ((t *)data1)[i] = (t)(((t *)data1)[i] * m[0][0] + \ (data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + \ data3[i3] * m[2][0] - data3[i3 + 1] * m[2][1] + \ b[0][0] + b[1][0] + b[2][0])); \ } \ } while (0) #define LINCOMC1(t) \ do { \ for (i = 0; i < n_read; i++) { \ const t x = ((t *)data1)[2 * i]; \ const t y = ((t *)data1)[2 * i + 1]; \ ((t *)data1)[2 * i] = (t)(x * m[0][0] - y * m[0][1] + b[0][0]); \ ((t *)data1)[2 * i + 1] = (t)(x * m[0][1] + y * m[0][0] + b[0][1]); \ } \ } while (0) #define LINCOMC2(t) \ do { \ for (i = 0; i < n_read; i++) { \ const int i2 = 2 * (i * spf[1] / spf[0]); \ const t x = ((t *)data1)[2 * i]; \ const t y = ((t *)data1)[2 * i + 1]; \ ((t *)data1)[2 * i] = (t)(x * m[0][0] - y * m[0][1] + \ data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + b[0][0] + b[1][0]); \ ((t *)data1)[2 * i + 1] = (t)(x * m[0][1] + y * m[0][0] + \ data2[i2] * m[1][1] + data2[i2 + 1] * m[1][0] + b[0][1] + b[1][1]); \ } \ } while (0) #define LINCOMC3(t) \ do { \ for (i = 0; i < n_read; i++) { \ const int i2 = 2 * (i * spf[1] / spf[0]); \ const int i3 = 2 * (i * spf[2] / spf[0]); \ const t x = ((t *)data1)[2 * i]; \ const t y = ((t *)data1)[2 * i + 1]; \ ((t *)data1)[2 * i] = (t)(x * m[0][0] - y * m[0][1] + \ data2[i2] * m[1][0] - data2[i2 + 1] * m[1][1] + \ data3[i3] * m[2][0] - data3[i3 + 1] * m[2][1] + \ b[0][0] + b[1][0] + b[2][0]); \ ((t *)data1)[2 * i + 1] = (t)(x * m[0][1] + y * m[0][0] + \ data2[i2] * m[1][1] + data2[i2 + 1] * m[1][0] + \ data3[i3] * m[2][1] + data3[i3 + 1] * m[2][0] + \ b[0][1] + b[1][1] + b[2][1]); \ } \ } while (0) #endif /* Compute a complex valued lincom, all at once */ void _GD_CLincomData(DIRFILE *restrict D, int n, void *restrict data1, gd_type_t return_type, const GD_DCOMPLEXP_t restrict data2, const GD_DCOMPLEXP_t restrict data3, GD_DCOMPLEXV(m), GD_DCOMPLEXV(b), const unsigned int *restrict spf, size_t n_read) { size_t i; dtrace("%p, %i, %p, 0x%x, %p, %p, %p, %p, %p, %" PRNsize_t, D, n, data1, return_type, data2, data3, m, b, spf, n_read); switch(return_type) { case GD_NULL: break; case GD_UINT8: LINCOM(uint8_t); break; case GD_INT8: LINCOM(int8_t); break; case GD_UINT16: LINCOM(uint16_t); break; case GD_INT16: LINCOM(int16_t); break; case GD_UINT32: LINCOM(uint32_t); break; case GD_INT32: LINCOM(int32_t); break; case GD_UINT64: LINCOM(uint64_t); break; case GD_INT64: LINCOM(int64_t); break; case GD_FLOAT32: LINCOM(float); break; case GD_FLOAT64: LINCOM(double); break; case GD_COMPLEX64: LINCOMC(float); break; case GD_COMPLEX128: LINCOMC(double); break; default: _GD_InternalError(D); } dreturnvoid(); } #ifdef GD_NO_C99_API #define INVERTC(t) \ do { \ for (i = 0; i < n_read; i++) { \ const t d = ((t *)data)[2 * i] * ((t *)data)[2 * i] + \ ((t *)data)[2 * i + 1] * ((t *)data)[2 * i + 1]; \ ((t *)data)[2 * i] = (t)(dividend * ((t *)data)[2 * i] / d); \ ((t *)data)[2 * i + 1] = (t)(-dividend * ((t *)data)[2 * i + 1] / d); \ } \ } while (0) #else #define INVERTC(t) INVERT(complex t) #endif #define INVERT(t) for (i = 0; i < n_read; i++) \ ((t *)data)[i] = (t)(dividend / ((t *)data)[i]) /* Invert a vector */ void _GD_InvertData(DIRFILE *restrict D, void *restrict data, gd_type_t return_type, double dividend, size_t n_read) { size_t i; dtrace("%p, %p, 0x%x, %g, %" PRNsize_t, D, data, return_type, dividend, n_read); switch(return_type) { case GD_NULL: break; case GD_UINT8: INVERT(uint8_t); break; case GD_INT8: INVERT(int8_t); break; case GD_UINT16: INVERT(uint16_t); break; case GD_INT16: INVERT(int16_t); break; case GD_UINT32: INVERT(uint32_t); break; case GD_INT32: INVERT(int32_t); break; case GD_UINT64: INVERT(uint64_t); break; case GD_INT64: INVERT(int64_t); break; case GD_FLOAT32: INVERT(float); break; case GD_FLOAT64: INVERT(double); break; case GD_COMPLEX64: INVERTC(float); break; case GD_COMPLEX128: INVERTC(double); break; default: _GD_InternalError(D); } dreturnvoid(); } #ifdef GD_NO_C99_API #undef INVERTC #undef INVERT #define INVERTC(t) \ do { \ for (i = 0; i < n_read; i++) { \ const t d = ((t *)data)[2 * i] * ((t *)data)[2 * i] + \ ((t *)data)[2 * i + 1] * ((t *)data)[2 * i + 1]; \ ((t *)data)[2 * i] = (t)((dividend[0] * ((t *)data)[2 * i] + \ dividend[1] * ((t *)data)[2 * i + 1]) / d); \ ((t *)data)[2 * i + 1] = (t)((dividend[1] * ((t *)data)[2 * i] - \ dividend[0] * ((t *)data)[2 * i]) / d); \ } \ } while (0) #define INVERT(t) \ do { \ for (i = 0; i < n_read; i++) { \ const t d = ((t *)data)[2 * i] * ((t *)data)[2 * i] + \ ((t *)data)[2 * i + 1] * ((t *)data)[2 * i + 1]; \ ((t *)data)[2 * i] = (t)((dividend[0] * ((t *)data)[2 * i] - \ dividend[1] * ((t *)data)[2 * i + 1]) / d); \ } \ } while (0) #endif /* Invert a vector */ void _GD_CInvertData(DIRFILE *restrict D, void *restrict data, gd_type_t return_type, GD_DCOMPLEXA(dividend), size_t n_read) { size_t i; dtrace("%p, %p, 0x%x, %g;%g, %" PRNsize_t, D, data, return_type, creal(dividend), cimag(dividend), n_read); switch(return_type) { case GD_NULL: break; case GD_UINT8: INVERT(uint8_t); break; case GD_INT8: INVERT(int8_t); break; case GD_UINT16: INVERT(uint16_t); break; case GD_INT16: INVERT(int16_t); break; case GD_UINT32: INVERT(uint32_t); break; case GD_INT32: INVERT(int32_t); break; case GD_UINT64: INVERT(uint64_t); break; case GD_INT64: INVERT(int64_t); break; case GD_FLOAT32: INVERT(float); break; case GD_FLOAT64: INVERT(double); break; case GD_COMPLEX64: INVERTC(float); break; case GD_COMPLEX128: INVERTC(double); break; default: _GD_InternalError(D); } dreturnvoid(); } int _GD_GetRepr(DIRFILE *restrict D, const char *restrict field_code_in, char **restrict field_code, int err) { int repr = GD_REPR_NONE; const int field_code_len = strlen(field_code_in); dtrace("%p, \"%s\", %p, %i", D, field_code_in, field_code, err); /* find the representation, if any */ if (field_code_len > 2 && field_code_in[field_code_len - 2] == '.') { switch (field_code_in[field_code_len - 1]) { case 'r': repr = GD_REPR_REAL; break; case 'i': repr = GD_REPR_IMAG; break; case 'm': repr = GD_REPR_MOD; break; case 'a': repr = GD_REPR_ARG; break; default: if (err) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, field_code_in); dreturn("%i", 0); return 0; } /* make a copy of the field code without the representation */ *field_code = _GD_Strdup(D, field_code_in); if (*field_code) (*field_code)[field_code_len - 2] = '\0'; } else *field_code = (char *)field_code_in; dreturn("%i", repr); return repr; } /* Ensure that an input field has been identified (with error checking) */ int _GD_BadInput(DIRFILE *D, const gd_entry_t *E, int i, gd_entype_t t, int err) { char *code; dtrace("%p, %p, %i, 0x%X, %i", D, E, i, t, err); if (E->e->entry[i] == NULL) { E->e->entry[i] = _GD_FindFieldAndRepr(D, E->in_fields[i], &code, &E->e->repr[i], NULL, 1, err); if (E->e->entry[i] == NULL) { dreturn("%i", 1); return 1; } if (code != E->in_fields[i]) free(code); } /* check field type */ if (t == GD_NO_ENTRY) { /* scalar entries not allowed */ if (E->e->entry[i]->field_type & GD_SCALAR_ENTRY_BIT) { _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, E->field, 0, E->e->entry[i]->field); dreturn("%i", 1); return 1; } } else if (E->e->entry[i]->field_type != t) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_FORMAT, E->field, 0, E->e->entry[i]->field); dreturn("%i", 1); return 1; } dreturn("%i", 0); return 0; } /* Find an entry without a representation */ gd_entry_t *_GD_FindEntry(DIRFILE *restrict D, const char *restrict field_code, unsigned int *restrict index, int set, int err) { gd_entry_t *E = NULL; dtrace("%p, \"%s\", %p, %i, %i", D, field_code, index, set, err); if (D->n_dot > 0) E = _GD_FindField(D, field_code, D->dot_list, D->n_dot, 1, NULL); if (E == NULL || index != NULL) E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, index); if (E == NULL && set) if (err) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%p", E); return E; } /* Find the entry and the representation */ gd_entry_t *_GD_FindFieldAndRepr(DIRFILE *restrict D, const char *restrict field_code_in, char **restrict field_code, int *restrict repr, unsigned int *restrict index, int set, int err) { gd_entry_t *E = NULL; dtrace("%p, \"%s\", %p, %p, %p, %i, %i", D, field_code_in, field_code, repr, index, set, err); if (D->n_dot > 0) E = _GD_FindField(D, field_code_in, D->dot_list, D->n_dot, 1, NULL); if (E == NULL) { *repr = _GD_GetRepr(D, field_code_in, field_code, err); if (D->error) { dreturn("%p", NULL); return NULL; } } else { *repr = GD_REPR_NONE; *field_code = (char *)field_code_in; } if (E == NULL || index != NULL) E = _GD_FindField(D, *field_code, D->entry, D->n_entries, 1, index); if (E == NULL && set) { if (err) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code_in); if (field_code_in != *field_code) free(*field_code); } dreturn("%p %i", E, *repr); return E; } const char *_GD_DirName(const DIRFILE *D, int dirfd) { #ifndef GD_NO_DIR_OPEN unsigned int i; #endif dtrace("%p, %i", D, dirfd); #ifdef GD_NO_DIR_OPEN /* in the non-POSIX case, dirfd is just the index in the dir list */ if (D->ndir > 0) { dreturn("\"%s\"", D->dir[dirfd].path); return D->dir[dirfd].path; } #else for (i = 0; i < D->ndir; ++i) if (dirfd == D->dir[i].fd) { dreturn("\"%s\"", D->dir[i].path); return D->dir[i].path; } #endif /* we only get here in the early stages of opening a dirfile */ dreturn("\"%s\"", D->name); return D->name; } /* This is mostly the POSIX.1 realpath(3) function, but with some * optimisation due to the fact that we know that the front part of the * path (car) has already been canonicalised */ char *_GD_CanonicalPath(const char *car, const char *cdr) { int last_element = 0; #if defined HAVE_READLINK && defined HAVE_LSTAT64 int loop_count = 0; #endif size_t res_len, res_root, res_size, len; char *res = NULL, *ptr, *work, *cur, *end; dtrace("\"%s\", \"%s\"", car, cdr); if (car && !_GD_AbsPath(cdr)) { if (!_GD_AbsPath(car)) { /* car is not abosulte -- don't bother trying to do anything fancy */ res = (char*)malloc(strlen(car) + strlen(cdr) + 2); if (res == NULL) { dreturn("%p", NULL); return NULL; } sprintf(res, "%s%c%s", car, GD_DIRSEP, cdr); dreturn("%s", res); return res; } /* car is nonnull and cdr is not absolute: copy car into res and * cdr into work */ res = strdup(car); if (res == NULL) { dreturn("%p", NULL); return NULL; } res_size = (res_len = strlen(car)) + 1; res_root = _GD_RootLen(res); cur = work = strdup(cdr); if (work == NULL) { free(res); dreturn("%p", NULL); return NULL; } } else if (_GD_AbsPath(cdr)) { /* cdr is absolute: make res "/" and copy cdr relative to / into work; * ignore car */ res = (char*)malloc(res_size = PATH_MAX); if (res == NULL) { dreturn("%p", NULL); return NULL; } _GD_Root(res, cdr, res_root); res_len = res_root; if (cdr[res_len] == '\0') { dreturn("\"%s\"", res); return res; } cur = work = strdup(cdr + res_len); if (work == NULL) { free(res); dreturn("%p", NULL); return NULL; } } else { /* car is not present and cdr is relative: try to get the CWD; and make * work CWD/cdr, relative to / if getcwd returned an absolute path. If * getcwd fails, just use cdr, and abandon hope of an absolute path. */ res = (char*)malloc(res_size = PATH_MAX); work = (char*)malloc(PATH_MAX); if (res == NULL || work == NULL) { free(res); dreturn("%p", NULL); return NULL; } if (gd_getcwd(work, PATH_MAX) == NULL) { /* if getcwd fails, we're stuck with a relative path, oh well. */ free(work); cur = work = strdup(cdr); if (work == NULL) { free(res); dreturn("%p", NULL); return NULL; } res[0] = '\0'; res_root = res_len = 0; } else { if ((len = strlen(work) + 2 + strlen(cdr)) < PATH_MAX) { ptr = (char*)realloc(work, len); if (ptr == NULL) { free(res); free(work); dreturn("%p", NULL); return NULL; } work = ptr; } ptr = work + strlen(work); *(ptr++) = GD_DIRSEP; strcpy(ptr, cdr); if (_GD_AbsPath(work)) { _GD_Root(res, work, res_root); res_len = res_root; cur = work + res_len; } else { res[0] = '\0'; res_root = res_len = 0; cur = work; } } } /* now step through work, building up res as appropriate */ for (end = cur ; !last_element; cur = end) { /* look for the next GD_DIRSEP or NUL */ for (; *end != '\0' && !_GD_IsDirSep(*end); ++end) ; /* end of string */ if (*end == '\0' && cur == end) break; else if (*end == '\0') last_element = 1; else *(end++) = '\0'; if (cur[0] == '\0') ; /* discard consecutive DIRSEPs */ else if (cur[0] == '.' && cur[1] == '\0') { /* discard . */ continue; } else if (cur[0] == '.' && cur[1] == '.' && cur[2] == '\0') { /* don't strip the leading GD_DIRSEP */ if (res_len > res_root) { /* find the last GD_DIRSEP, but don't strip the leading GD_DIRSEP */ for(ptr = res + res_len - 1; !_GD_IsDirSep(*ptr) && ptr > res + res_root; --ptr) ; /* strip the .. if possible, otherwise append it */ *ptr = '\0'; res_len = ptr - res; } } else { /* a path element, copy it to res */ len = strlen(cur) + 1; if (res_len + len >= res_size) { ptr = (char*)realloc(res, res_size += (len < 1000) ? 1000 : len); if (ptr == NULL) { free(res); free(work); dreturn("%p", NULL); return NULL; } res = ptr; } if (res_len > 1 && !_GD_IsDirSep(res[res_len - 1])) res[res_len++] = GD_DIRSEP; strcpy(res + res_len, cur); res_len += len - 1; #if defined HAVE_READLINK && defined HAVE_LSTAT64 { gd_stat64_t statbuf; /* check if it's a symlink */ if (lstat64(res, &statbuf)) { if (errno == ENOENT) { /* the thing doesn't exist. I guess that means we're done; * copy the rest of the work buffer onto the result and call it a * day. */ if (*end) { len = strlen(end) + 1; if (res_len + len >= res_size) { ptr = (char*)realloc(res, res_size += len); if (ptr == NULL) { free(res); free(work); dreturn("%p", NULL); return NULL; } res = ptr; } res[res_len++] = GD_DIRSEP; strcpy(res + res_len, end); res_len += len - 1; } goto _GD_CanonicalPath_DONE; } /* lstat error */ free(res); free(work); dreturn("%p", NULL); return NULL; } if (S_ISLNK(statbuf.st_mode)) { char target[PATH_MAX]; ssize_t slen; /* check for symlink loop */ if (loop_count++ > MAXSYMLINKS) { free(res); free(work); dreturn("%p", NULL); errno = ELOOP; return NULL; } /* get the link target */ slen = readlink(res, target, PATH_MAX - 1); if (slen == -1) { free(res); free(work); dreturn("%p", NULL); return NULL; } target[slen] = 0; /* now we have to start all over again */ ptr = target; if (_GD_AbsPath(ptr)) { _GD_Root(res, target, res_root); res_len = res_root; ptr += res_root; slen -= res_root; } else if (res_len > res_root) { /* strip the symlink name from res */ char *rptr; for (rptr = res + res_len - 1; !_GD_IsDirSep(*rptr); --rptr) ; /* don't strip the root /; but do strip a previous DIRSEP */ if ((size_t)(rptr - res) < res_root) { *(rptr + 1) = '\0'; res_len = (rptr - res) + 1; } else { *rptr = '\0'; res_len = rptr - res; } } /* now make a new work buffer of "target/remaining", asusming * remaining is non-null, otherwise, just use target */ if (*end == '\0') { last_element = 0; free(work); end = work = strdup(target); if (work == NULL) { free(res); dreturn("%p", NULL); return NULL; } } else { char *new_work, slash[2] = { GD_DIRSEP, 0 }; len = strlen(end) + slen + 2; if (_GD_IsDirSep(*(ptr + slen - 1))) { slash[0] = '\0'; len--; } new_work = (char*)malloc(len); if (new_work == NULL) { free(res); free(work); dreturn("%p", NULL); return NULL; } sprintf(new_work, "%s%s%s", ptr, slash, end); free(work); end = work = new_work; } } } #endif } } #if defined HAVE_READLINK && defined HAVE_LSTAT64 _GD_CanonicalPath_DONE: #endif free(work); /* trim */ ptr = (char*)realloc(res, res_len + 1); if (ptr) res = ptr; dreturn("\"%s\"", res); return res; } char *_GD_MakeFullPath(DIRFILE *D, int dirfd, const char *name, int seterr) { const char *dir; char *filepath; dtrace("%p, %i, \"%s\", %i", D, dirfd, name, seterr); if (dirfd >= 0) { dir = _GD_DirName(D, dirfd); if (dir == NULL) { dreturn("%p", NULL); return NULL; } } else dir = NULL; filepath = _GD_CanonicalPath(dir, name); if (seterr && filepath == NULL) { if (errno == ENOMEM) _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); else { /* a last ditch attempt */ if (dir) { filepath = _GD_Malloc(D, strlen(dir) + strlen(name) + 2); if (filepath) sprintf(filepath, "%s%c%s", dir, GD_DIRSEP, name); } else filepath = _GD_Strdup(D, name); } } dreturn("\"%s\"", filepath); return filepath; } char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name) { char *filepath; dtrace("%p, %i, \"%s\"", D, dirfd, name); /* although we cast away the constness, seterr=0 ensures nothing gets * modified */ filepath = _GD_MakeFullPath((DIRFILE*)D, dirfd, name, 0); dreturn("\"%s\"", filepath); return filepath; } int _GD_GrabDir(DIRFILE *D, int dirfd, const char *name, int canonical) { unsigned int i; char *path, *dir = NULL; void *ptr; dtrace("%p, %i, \"%s\", %i", D, dirfd, name, canonical); if (canonical) path = _GD_Strdup(D, name); else path = _GD_MakeFullPath(D, dirfd, name, 1); if (path == NULL) { dreturn("%i", -1); return -1; } dir = dirname(path); for (i = 0; i < D->ndir; ++i) if (strcmp(dir, D->dir[i].path) == 0) { D->dir[i].rc++; free(path); dreturn("%i", D->dir[i].fd); return D->dir[i].fd; } /* new one */ ptr = _GD_Realloc(D, D->dir, sizeof(D->dir[0]) * (D->ndir + 1)); if (ptr == NULL) { free(path); dreturn("%i", -1); return -1; } D->dir = ptr; D->dir[D->ndir].rc = 1; D->dir[D->ndir].path = _GD_Strdup(D, dir); if (D->dir[D->ndir].path == NULL) { free(path); dreturn("%i", -1); return -1; } #ifdef GD_NO_DIR_OPEN D->dir[D->ndir].fd = D->ndir; free(path); #else if (_GD_AbsPath(name)) { D->dir[D->ndir].fd = open(dir, O_RDONLY); } else { free(path); path = _GD_Strdup(D, name); if (path == NULL) { free(D->dir[D->ndir].path); dreturn("%i", -1); return -1; } D->dir[D->ndir].fd = gd_OpenAt(D, dirfd, dirname(path), O_RDONLY, 0666); } free(path); if (D->dir[D->ndir].fd == -1) { free(D->dir[D->ndir].path); dreturn("%i", -1); return -1; } #endif D->ndir++; dreturn("%i", D->dir[D->ndir - 1].fd); return D->dir[D->ndir - 1].fd; } void _GD_ReleaseDir(DIRFILE *D, int dirfd) { #ifndef GD_NO_DIR_OPEN unsigned int i; #endif dtrace("%p, %i", D, dirfd); #ifdef GD_NO_DIR_OPEN if (--D->dir[dirfd].rc == 0) { free(D->dir[dirfd].path); D->dir[dirfd] = D->dir[--D->ndir]; } #else for (i = 0; i < D->ndir; ++i) if (D->dir[i].fd == dirfd) { if (--D->dir[i].rc == 0) { free(D->dir[i].path); close(D->dir[i].fd); D->dir[i] = D->dir[--D->ndir]; } break; } #endif dreturnvoid(); } /* allocation boilerplates */ void *_GD_Malloc(DIRFILE *D, size_t size) { void *ptr = malloc(size); if (ptr == NULL) _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); return ptr; } void *_GD_Realloc(DIRFILE *restrict D, void *restrict old, size_t size) { void *ptr = realloc(old, size); if (ptr == NULL) _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); return ptr; } char *_GD_Strdup(DIRFILE *D, const char *s) { char *ptr = strdup(s); if (ptr == NULL) _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); return ptr; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/flac.c0000640000175000017500000004020312614323564015643 0ustar alastairalastair/* Copyright (C) 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef HAVE_FLAC_ALL_H #include #endif /* errors and error disambiguation */ #define GD_FLAC_E_IO 0 /* I/O (stdlib) error */ #define GD_FLAC_E_EOS 1 /* seek past eof */ #define GD_FLAC_E_CPS 2 /* bad channels per sample */ #define GD_FLAC_E_BPS 3 /* bad bits per sample */ #define GD_FLAC_E_MEM 4 /* alloc error */ #define GD_FLAC_E_SDS 0x10000 /* FLAC__StreamDecoderState */ #define GD_FLAC_E_SDIS 0x20000 /* FLAC__StreamDecoderInitStatus */ #define GD_FLAC_E_SDES 0x20000 /* FLAC__StreamDecoderErrorStatus */ #define GD_FLAC_E_SES 0x30000 /* FLAC__StreamEncoderState */ #define GD_FLAC_E_SEIS 0x40000 /* FLAC__StreamEncoderInitStatus */ struct gd_flacdata { union { FLAC__StreamDecoder *d; FLAC__StreamEncoder *e; } codec; FILE* stream; unsigned bps; /* bits per sample */ unsigned cps; /* channels per sample */ int stream_end; int error; /* error flag */ int *errnum; /* file->error */ char *data; /* Dechannelised frame of data */ unsigned dlen; /* Length in samples of data */ unsigned pos; /* offset into the frame data */ off64_t base; /* sample number of the start of the frame */ }; /* The flac encoding scheme uses edata as a gd_flacdata pointer. If a file is * open, idata = 0 otherwise idata = -1. */ /* The decoder callback */ static FLAC__StreamDecoderWriteStatus _GD_FlacWriteCallback( const FLAC__StreamDecoder *decoder gd_unused_, const FLAC__Frame *frame, const FLAC__int32 *const buffer[], void *client_data) { struct gd_flacdata *gdfl = client_data; unsigned u, c; int16_t *ptr; dtrace(", %p, %p, %p", frame, buffer, client_data); /* Advance base for previous frame */ gdfl->base += gdfl->dlen; /* Reset position */ gdfl->pos = 0; /* check bps and cps */ if (gdfl->cps != FLAC__stream_decoder_get_channels(gdfl->codec.d)) { gdfl->error = 1; *gdfl->errnum = GD_FLAC_E_CPS; dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT"); return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; } if (gdfl->bps != FLAC__stream_decoder_get_bits_per_sample(gdfl->codec.d)) { gdfl->error = 1; *gdfl->errnum = GD_FLAC_E_BPS; dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT"); return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; } if (gdfl->dlen != frame->header.blocksize) { /* Resize the data buffer to accommodate the new frame */ free(gdfl->data); gdfl->data = malloc(frame->header.blocksize * gdfl->bps * gdfl->cps / 8); if (gdfl->data == NULL) { gdfl->error = 1; *gdfl->errnum = GD_FLAC_E_MEM; dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_ABORT"); return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT; } gdfl->dlen = frame->header.blocksize; } ptr = (int16_t*)gdfl->data; /* Copy and dechannelise the decoded data to our local buffer */ if (gdfl->bps == 1) for (u = 0; u < frame->header.blocksize; ++u) /* there's only one channel in this case */ gdfl->data[u] = (int8_t)buffer[0][u]; else for (u = 0; u < frame->header.blocksize; ++u) for (c = 0; c < gdfl->cps; ++c) *(ptr++) = (int16_t)buffer[c][u]; dreturn("%s", "FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE"); return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } /* The decoder error callback */ static void _GD_FlacErrorCallback(const FLAC__StreamDecoder *decoder gd_unused_, FLAC__StreamDecoderErrorStatus status, void *client_data) { struct gd_flacdata *gdfl = client_data; dtrace(", %i, %p", (int)status, client_data); gdfl->error = 1; *gdfl->errnum = GD_FLAC_E_SDES | status; dreturnvoid(); return; } static struct gd_flacdata *_GD_FlacDoOpen(int dirfd, struct gd_raw_file_* file, gd_type_t data_type, unsigned int mode) { int fd, status; struct gd_flacdata *gdfl; FILE *stream; const char *fdmode = "rb"; dtrace("%i, %p, 0x%X, 0x%X", dirfd, file, data_type, mode); if (mode & GD_FILE_READ) { fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666); } else if (mode & GD_FILE_TEMP) { fd = _GD_MakeTempFile(file->D, dirfd, file->name); fdmode = "wb"; } else { /* internal error */ errno = EINVAL; /* I guess ... ? */ fd = -1; } if (fd < 0) { file->error = GD_FLAC_E_IO; dreturn("%p", NULL); return NULL; } if ((stream = fdopen(fd, fdmode)) == NULL) { close(fd); file->error = GD_FLAC_E_IO; dreturn("%p", NULL); return NULL; } if ((gdfl = malloc(sizeof *gdfl)) == NULL) { fclose(stream); file->error = GD_FLAC_E_MEM; dreturn("%p", NULL); return NULL; } memset(gdfl, 0, sizeof *gdfl); gdfl->stream = stream; gdfl->data = NULL; /* libFLAC only supports up to 24-bits per sample (which isn't a helpful * number for us). Except for 1-byte types, we use 16 bits-per-sample * and increase the number of channels to accomodate the data type. */ if (GD_SIZE(data_type) <= 2) { gdfl->bps = GD_SIZE(data_type) * 8; gdfl->cps = 1; } else { gdfl->bps = 16; gdfl->cps = GD_SIZE(data_type) / 2; } if (mode & GD_FILE_READ) { if ((gdfl->codec.d = FLAC__stream_decoder_new()) == NULL) { file->error = GD_FLAC_E_MEM; goto OPEN_ERROR; } status = FLAC__stream_decoder_init_FILE(gdfl->codec.d, stream, _GD_FlacWriteCallback, NULL, _GD_FlacErrorCallback, gdfl); if (status != FLAC__STREAM_DECODER_INIT_STATUS_OK) { file->error = GD_FLAC_E_SDIS | status; goto OPEN_ERROR; } /* Advance to the end of the metadata */ if (!FLAC__stream_decoder_process_until_end_of_metadata(gdfl->codec.d)) goto OPEN_ERROR; } else { if ((gdfl->codec.e = FLAC__stream_encoder_new()) == NULL) { file->error = GD_FLAC_E_MEM; goto OPEN_ERROR; } FLAC__stream_encoder_set_channels(gdfl->codec.e, gdfl->cps); FLAC__stream_encoder_set_bits_per_sample(gdfl->codec.e, gdfl->bps); FLAC__stream_encoder_set_sample_rate(gdfl->codec.e, 1); status = FLAC__stream_encoder_init_FILE(gdfl->codec.e, stream, NULL, NULL); if (status != FLAC__STREAM_ENCODER_INIT_STATUS_OK) { if (status == FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR) file->error = GD_FLAC_E_SES | FLAC__stream_encoder_get_state(gdfl->codec.e); else file->error = GD_FLAC_E_SEIS | status; goto OPEN_ERROR; } } file->pos = 0; dreturn("%p", gdfl); return gdfl; OPEN_ERROR: fclose(stream); free(gdfl); dreturn("%p", NULL); return NULL; } int _GD_FlacOpen(int dirfd, struct gd_raw_file_* file, gd_type_t data_type, int swap gd_unused_, unsigned int mode) { dtrace("%i, %p, 0x%X, , 0x%X", dirfd, file, data_type, mode); file->edata = _GD_FlacDoOpen(dirfd, file, data_type, mode); if (file->edata == NULL) { dreturn("%i", 1); return 1; } file->mode = mode; file->idata = 0; ((struct gd_flacdata*)file->edata)->errnum = &file->error; dreturn("%i", 0); return 0; } /* copy the decoded frame to the output */ static size_t _GD_FlacOutput(struct gd_flacdata *gdfl, gd_type_t data_type, char *output, size_t ns) { dtrace("%p, 0x%X, %p, %" PRNsize_t, gdfl, data_type, output, ns); if (ns > gdfl->dlen - gdfl->pos) ns = gdfl->dlen - gdfl->pos; memcpy(output, gdfl->data + gdfl->pos, ns * GD_SIZE(data_type)); gdfl->pos += ns; dreturn("%" PRNsize_t, ns); return ns; } ssize_t _GD_FlacRead(struct gd_raw_file_ *restrict file, void *restrict data, gd_type_t data_type, size_t nmemb) { struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata; void *output = data; size_t ns = nmemb; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); for (;;) { /* copy the currently loaded frame to the output */ ns -= _GD_FlacOutput(gdfl, data_type, output, ns); if (ns == 0) break; /* Decode one frame */ if (!FLAC__stream_decoder_process_single(gdfl->codec.d)) { dreturn("%i", -1); return -1; } if (gdfl->error) { dreturn("%i", -1); return -1; } /* out of data */ if (FLAC__stream_decoder_get_state(gdfl->codec.d) == FLAC__STREAM_DECODER_END_OF_STREAM) { gdfl->stream_end = 1; break; } } file->pos = gdfl->base + gdfl->pos; dreturn("%li", (long)(nmemb - ns)); return nmemb - ns; } ssize_t _GD_FlacWrite(struct gd_raw_file_ *file, const void *data, gd_type_t data_type, size_t nmemb) { struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata; ssize_t n = nmemb; const int size = GD_SIZE(data_type); size_t i, remaining; unsigned c; int32_t *buffer[8] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; const int8_t *i8 = data; const int16_t *i16 = data; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); if (nmemb > 0 && size) { /* Allocate buffers */ for (i = 0; i < gdfl->cps; ++i) if ((buffer[i] = malloc(nmemb * sizeof *buffer[i])) == NULL) { file->error = GD_FLAC_E_MEM; goto WRITE_ERROR; } /* Data marshalling -- split into 32-bit-wide channels of * 8- or 16-bit signed data */ if (gdfl->bps == 8) for (i = 0; i < nmemb; ++i) buffer[0][i] = *(i8++); else for (i = 0; i < nmemb; ++i) for (c = 0; c < gdfl->cps; ++c) buffer[c][i] = *(i16++); /* Write the data -- we have to loop here because libFLAC uses * unsigned int for sample count */ remaining = nmemb; while (remaining > 0) { unsigned ns = UINT_MAX; if (ns > remaining) ns = remaining; if (!FLAC__stream_encoder_process(gdfl->codec.e, (void*)buffer, ns)) { file->error = GD_FLAC_E_SES | FLAC__stream_encoder_get_state(gdfl->codec.e); goto WRITE_ERROR; } remaining -= ns; file->pos += ns; } } else if (0) { WRITE_ERROR: n = -1; } for (i = 0; i < gdfl->cps; ++i) free(buffer[i]); dreturn("%" PRNssize_t, n); return n; } off64_t _GD_FlacSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode) { struct gd_flacdata *gdfl; dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode); gdfl = (struct gd_flacdata *)(file[(mode == GD_FILE_WRITE) ? 1 : 0].edata); /* nothing to do */ if (gdfl->base + gdfl->pos == count) { dreturn("%lli", (long long)count); return count; } if (mode == GD_FILE_WRITE) { /* we only get here when we need to pad */ char *zero = malloc(GD_BUFFER_SIZE); if (zero == NULL) { *gdfl->errnum = GD_FLAC_E_MEM; dreturn("%i", -1); return -1; } memset(zero, 0, GD_BUFFER_SIZE); count -= file->pos; while (gdfl->base < count) { int n = GD_BUFFER_SIZE / GD_SIZE(data_type);; if (n > count) n = count; _GD_FlacWrite(file + 1, zero, GD_UINT8, n); if (file->error) { free(zero); dreturn("%i", -1); return -1; } count -= n; } free(zero); } else { int eof = 0; off64_t last = FLAC__stream_decoder_get_total_samples(gdfl->codec.d) - 1; if (last < 0) { /* no data -- fake it */ file->pos = 0; dreturn("%i", 0); return 0; } if (count > last) { count = last; eof = 1; } if (!FLAC__stream_decoder_seek_absolute(gdfl->codec.d, count)) { file->error = GD_FLAC_E_SDS | FLAC__stream_decoder_get_state(gdfl->codec.d); dreturn("%i", -1); return -1; } if (eof) { /* advance to EOF by reading the last frame */ if (!FLAC__stream_decoder_process_single(gdfl->codec.d)) { dreturn("%i", -1); return -1; } /* and "consume" it */ gdfl->pos = gdfl->dlen; gdfl->stream_end = 1; count++; } } file->pos = count; dreturn("%lli", (long long)file->pos); return file->pos; } /* This function does nothing */ int _GD_FlacSync(struct gd_raw_file_ *file gd_unused_) { dtrace(""); dreturn("%i", 0); return 0; } int _GD_FlacClose(struct gd_raw_file_ *file) { struct gd_flacdata *gdfl = (struct gd_flacdata *)file->edata; dtrace("%p", file); if (file->mode & GD_FILE_READ) { FLAC__stream_decoder_finish(gdfl->codec.d); FLAC__stream_decoder_delete(gdfl->codec.d); } else { FLAC__stream_encoder_finish(gdfl->codec.e); FLAC__stream_encoder_delete(gdfl->codec.e); } file->idata = -1; file->mode = 0; free(file->edata); dreturn("%i", 0); return 0; } off64_t _GD_FlacSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { struct gd_flacdata *gdfl; off_t n; dtrace("%i, %p, 0x%X, ", dirfd, file, data_type); gdfl = _GD_FlacDoOpen(dirfd, file, data_type, GD_FILE_READ); if (gdfl == NULL) { dreturn("%i", -1); return -1; } n = FLAC__stream_decoder_get_total_samples(gdfl->codec.d); free(gdfl); dreturn("%lli", (long long)n); return n; } int _GD_FlacStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen) { int r = 0; dtrace("%p, %p, %" PRNsize_t, file, buf, buflen); switch(file->error) { case GD_FLAC_E_EOS: strncpy(buf, "Cannot seek past end of stream", buflen); break; case GD_FLAC_E_CPS: strncpy(buf, "Invalid channels per sample in FLAC stream", buflen); break; case GD_FLAC_E_BPS: strncpy(buf, "Invalid bits per sample in FLAC stream", buflen); break; case GD_FLAC_E_IO: case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_IO_ERROR: r = gd_strerror(errno, buf, buflen); break; case GD_FLAC_E_MEM: case GD_FLAC_E_SDS | FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR: case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR: strncpy(buf, "FLAC: Out of memory", buflen); break; case GD_FLAC_E_SDS | FLAC__STREAM_DECODER_SEEK_ERROR: strncpy(buf, "FLAC: Seek error", buflen); break; case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_UNSUPPORTED_CONTAINER: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER: strncpy(buf, "FLAC: Unsupported container", buflen); break; case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_ALREADY_INITIALIZED: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED: case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_INVALID_CALLBACKS: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE: case GD_FLAC_E_SEIS | FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE: case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_UNINITIALIZED: case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_CLIENT_ERROR: /* these indicate bugs in our code */ snprintf(buf, buflen, "Internal error 0x%X in FLAC encoding", file->error); break; case GD_FLAC_E_SDIS | FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE: strncpy(buf, "FLAC: Error opening file", buflen); break; case GD_FLAC_E_SES | FLAC__STREAM_ENCODER_FRAMING_ERROR: strncpy(buf, "FLAC: Framing error", buflen); break; default: snprintf(buf, buflen, "FLAC: Unkown error 0x%X", file->error); break; } dreturn("%i", r); return r; } libgetdata-0.9.0/src/spf.c0000640000175000017500000000600212614323564015525 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* _GD_GetSPF: Get samples per frame for field */ unsigned int _GD_GetSPF(DIRFILE *D, gd_entry_t *E) { unsigned int spf = 0; dtrace("%p, %p", D, E); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); dreturn("%u", 0); D->recurse_level--; return 0; } switch(E->field_type) { case GD_RAW_ENTRY: if (!(E->flags & GD_EN_CALC)) _GD_CalculateEntry(D, E, 1); if (!D->error) spf = E->EN(raw,spf); break; case GD_LINCOM_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_RECIP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_LINTERP_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; spf = _GD_GetSPF(D, E->e->entry[0]); break; case GD_INDEX_ENTRY: spf = 1; break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_ALIAS_ENTRY: case GD_NO_ENTRY: _GD_InternalError(D); } D->recurse_level--; dreturn("%u", spf); return spf; } /* Get the number of samples for each frame for the given field */ unsigned int gd_spf(DIRFILE* D, const char *field_code) gd_nothrow { unsigned int spf = 0; gd_entry_t* entry; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%u", 0); return 0; } _GD_ClearError(D); /* the representation is unimportant: it doesn't change the SPF of the field, * yet we have to run the field code through here to potentially remove it */ entry = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%u", 0); return 0; } if (entry->field_type & GD_SCALAR_ENTRY_BIT) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code); else spf = _GD_GetSPF(D, entry); dreturn("%u", spf); return spf; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/name.c0000640000175000017500000006755412614323564015700 0ustar alastairalastair/* Copyright (C) 2008, 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* compose/modify a field code. This function takes care of adding and * removing affixes and namespaces */ char *_GD_MungeCode(DIRFILE *D, const char *ns, size_t len_newns, const char *old_prefix, const char *old_suffix, const char *new_prefix, const char *new_suffix, const char *code, char **nso, int *offset, unsigned flags) { size_t len, len_oldpx = 0, len_oldsx = 0, len_newpx, len_newsx; size_t len_sub = 0, len_oldns; const char *ptr, *slash, *old_ns; char *new_code, *nptr; dtrace("%p, \"%s\", %" PRNsize_t ", \"%s\", \"%s\", \"%s\", \"%s\", \"%s\", " "%p, 0x%X", D, ns, len_newns, old_prefix, old_suffix, new_prefix, new_suffix, code, nso, flags); if (code == NULL) { dreturn("%p", NULL); return NULL; } old_ns = code; len = strlen(code); /* Check for a required namespace. In this case, the supplied 'ns' is the * namespace to check for and is not later prepended */ if (flags & GD_MC_CHECK_NS && ns) { if (len <= len_newns || strncmp(ns, code, len_newns) || code[len_newns] != '.') { /* namespace missing */ if (flags & GD_MC_RQ_PARTS) { if (flags & GD_MC_ERROR_OK) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID_NS, NULL, 0, code); else _GD_InternalError(D); } dreturn("%p", NULL); return NULL; } /* don't re-add it if it's there already */ ns = NULL; } /* find the length of the current namespace tag */ if (flags & GD_MC_NO_NS) len_oldns = 0; else for (len_oldns = len; len_oldns > 0; --len_oldns) if (code[len_oldns - 1] == '.') break; code += len_oldns; len -= len_oldns; /* Verify the old prefix is present */ if (old_prefix) { len_oldpx = strlen(old_prefix); if (strncmp(old_prefix, code, len_oldpx)) { /* prefix missing */ if (flags & GD_MC_RQ_PARTS) { if (flags & GD_MC_ERROR_OK) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, code); else _GD_InternalError(D); } dreturn("%p", NULL); return NULL; } ptr = code + len_oldpx; len -= len_oldpx; } else { ptr = code; len_oldpx = 0; } /* look for a /, which could indicate this is a metafield code. If it is * just an illegal name with a / in it, mungeing will screw up, but * validation will catch the illegal name later anyways. */ if ((slash = (char*)memchr(ptr, '/', len))) { len_sub = len + (ptr - slash); len = slash - ptr; } /* Verify the suffix is present */ if (old_suffix) { len_oldsx = strlen(old_suffix); if (strncmp(old_suffix, ptr + len - len_oldsx, len_oldsx)) { /* suffix missing */ if (flags & GD_MC_RQ_PARTS) { if (flags & GD_MC_ERROR_OK) _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, code); else _GD_InternalError(D); } dreturn("%p", NULL); return NULL; } len -= len_oldsx; } else len_oldsx = 0; /* In this case, we're using MungeCode to verify affixes are present, so * nothing more to do, return input code */ if (flags & GD_MC_NO_ALLOC) { dreturn("%p", code); return (char*)code; } if (new_prefix) len_newpx = strlen(new_prefix); else len_newpx = 0; if (new_suffix) len_newsx = strlen(new_suffix); else len_newsx = 0; if (ns == NULL) len_newns = 0; /* for the '.' */ if (len_newns) len_newns++; if ((new_code = _GD_Malloc(D, len_newns + len_oldns + len_newpx + len + len_newsx + len_sub + 1)) == NULL) { dreturn("%p", NULL); return NULL; } /* compose the new code */ nptr = new_code; if (len_newns > 0) { strcpy(nptr, ns); nptr[len_newns - 1] = '.'; nptr += len_newns; } if (len_oldns > 0) { strncpy(nptr, old_ns, len_oldns); nptr += len_oldns; } if (len_newpx > 0) { strcpy(nptr, new_prefix); nptr += len_newpx; } strncpy(nptr, ptr, len); nptr += len; if (len_newsx > 0) { strcpy(nptr, new_suffix); nptr += len_newsx; } if (slash) { strcpy(nptr, slash); nptr += len_sub; } *nptr = '\0'; /* A field called "INDEX" can never take a namespace. We have to check this * late because the field name "INDEX" could be built up via /INCLUDE affixes * (as crazy as that may be) */ if (len_newns + len_oldns > 0 && strncmp(new_code + len_newns + len_oldns, "INDEX", 5) == 0 && (new_code[len_newns + len_oldns + 5] == '\0' || new_code[len_newns + len_oldns + 5] == '/')) { char *index = _GD_Strdup(D, new_code + len_newns + len_oldns); free(new_code); if (index == NULL) { dreturn("%p", NULL); return NULL; } new_code = index; } if (nso) *nso = new_code + len_newns + len_oldns; if (offset) *offset = len_newns + len_oldns; dreturn("\"%s\" (%i, %p)", new_code, offset ? *offset : -1, nso ? *nso : NULL); return new_code; } /* Return non-zero if the a field code doesn't contain the correct affixes or * namespace. */ int _GD_CheckCodeAffixes(DIRFILE *D, const char *field_code, int fragment, int set_error) { dtrace("%p, \"%s\", %i, %i", D, field_code, fragment, set_error); if (field_code == NULL) { dreturn("%i", 0); return 0; } if (_GD_MungeCode(D, D->fragment[fragment].ns, D->fragment[fragment].nsl, D->fragment[fragment].prefix, D->fragment[fragment].suffix, NULL, NULL, field_code, NULL, NULL, GD_MC_NO_ALLOC | GD_MC_CHECK_NS | (set_error ? (GD_MC_RQ_PARTS | GD_MC_ERROR_OK) : 0))) { /* success */ dreturn("%i", 0); return 0; } dreturn("%i", 1); return 1; } /* Check for a valid name -- returns 1 on error */ int _GD_ValidateField(const char* field_code, int standards, int strict, unsigned type, int* is_dot) { const size_t len = strlen(field_code); size_t i; int local_dot = 0, last_dot; dtrace("\"%s\", %i, %i, %u, %p", field_code, standards, strict, type, is_dot); /* field codes may not start with a dot */ last_dot = (type == GD_VF_CODE && (!strict || standards >= 10)) ? 1 : 0; if (is_dot) *is_dot = 0; if ((type == GD_VF_NAME) && (field_code[0] == '\0' || (strict && ((len > 50 && standards < 5) || (len > 16 && standards < 3))))) { dreturn("%i", 1); return 1; } for (i = 0; i < len; ++i) if (field_code[i] == '/' || field_code[i] < 0x20) { /* these characters are always forbidden */ dreturn("%i", 1); return 1; } else if (strict && ((standards >= 5 && (field_code[i] == '<' || field_code[i] == '>' || field_code[i] == ';' || field_code[i] == '|' || field_code[i] == '&')) || (standards == 5 && (field_code[i] == '\\' || field_code[i] == '#')))) { /* these characters are sometimes forbidden */ dreturn("%i", 1); return 1; } else if (field_code[i] == '.') { if (type == GD_VF_NS || (type == GD_VF_CODE && (!strict || standards >= 10))) { if (last_dot) { /* multiple consecutive dots are forbidden */ dreturn("%i", 1); return 1; } last_dot = 1; } else if (type == GD_VF_AFFIX || is_dot == NULL || (standards >= 6 && strict)) { dreturn("%i", 1); return 1; } else local_dot = 1; } else last_dot = 0; /* Field codes may not end in a dot */ if (type == GD_VF_CODE && last_dot) { dreturn("%i", 1); return 1; } /* forbidden field names */ if (type == GD_VF_NAME) { if (strict && standards < 8) if ((strcmp("FRAMEOFFSET", field_code) == 0 && standards >= 1) || (strcmp("ENCODING", field_code) == 0 && standards >= 6) || (strcmp("ENDIAN", field_code) == 0 && standards >= 5) || (strcmp("INCLUDE", field_code) == 0 && standards >= 3) || (strcmp("META", field_code) == 0 && standards >= 6) || (strcmp("VERSION", field_code) == 0 && standards >= 5) || (strcmp("PROTECT", field_code) == 0 && standards >= 6) || (strcmp("REFERENCE", field_code) == 0 && standards >= 6)) { dreturn("%i", 1); return 1; } } if (is_dot) *is_dot = local_dot; dreturn("%i (%i)", 0, local_dot); return 0; } /* Compare field codes candidate and code. Returns: * 0 if they're identical * '.' if they're the same code, but candidate has a representation suffix * '/' if candidate is a subfield of code * -1 otherwise */ static int _GD_MatchCode(const char *candidate, const char *code, size_t len, int meta_ok) { int c; dtrace("\"%s\", \"%s\", %" PRNsize_t ", %i", candidate, code, len, meta_ok); if (strncmp(candidate, code, len)) { /* field not matched */ dreturn("%i (m)", -1); return -1; } /* partial match only */ c = candidate[len]; if (c && c != '.' && (!meta_ok || c != '/')) { dreturn("%i (p)", -1); return -1; } dreturn("%i", c); return c; } int _GD_MakeNewCode(DIRFILE *D, const char *old_code, int frag, const gd_entry_t *E, int repr, int c, struct gd_rename_data_ *rdat) { char **ptr, *base_code; int ret = 0; dtrace("%p, \"%s\", %i, %p, %i, %i, %p", D, old_code, frag, E, repr, c, rdat); if ((ptr = _GD_Realloc(D, rdat->code_list, sizeof(*ptr) * (rdat->n_code + 1))) == NULL) { dreturn("%i", -1); return -1; } rdat->code_list = ptr; /* extract representation suffix, if necessary (if c is nil, we already * know there's no representation) */ if (E == NULL && (c == '.' || c == '/')) { repr = _GD_GetRepr(D, old_code, &base_code, 0); if (D->error) { dreturn("%i", -1); return -1; } } else base_code = (char*)old_code; if (c == '/') { /* a meta subfield of the field we're renaming */ size_t base_len = strlen(base_code); rdat->code_list[rdat->n_code] = (char*)_GD_Malloc(D, base_len + rdat->new_len - rdat->old_len + ((repr == GD_REPR_NONE) ? 1 : 3)); if (D->error) { ret = -1; goto DONE; } sprintf(rdat->code_list[rdat->n_code], "%s%s%s", rdat->new_code, base_code + rdat->old_len, (repr == GD_REPR_NONE) ? "" : (repr == GD_REPR_REAL) ? ".r" : (repr == GD_REPR_IMAG) ? ".i" : (repr == GD_REPR_MOD) ? ".m" : ".a"); } else { rdat->code_list[rdat->n_code] = (char*)_GD_Malloc(D, rdat->new_len + ((repr == GD_REPR_NONE) ? 1 : 3)); if (D->error) { ret = -1; goto DONE; } sprintf(rdat->code_list[rdat->n_code], "%s%s", rdat->new_code, (repr == GD_REPR_NONE) ? "" : (repr == GD_REPR_REAL) ? ".r" : (repr == GD_REPR_IMAG) ? ".i" : (repr == GD_REPR_MOD) ? ".m" : ".a"); } /* check that we haven't made a code that's invalid in the destination * fragment */ if (_GD_CheckCodeAffixes(D, rdat->code_list[rdat->n_code], frag, !(rdat->flags & GD_REN_FORCE))) { free(rdat->code_list[rdat->n_code]); if (rdat->flags & GD_REN_FORCE) { rdat->code_list[rdat->n_code] = NULL; rdat->n_code++; } else ret = -1; } else rdat->n_code++; DONE: /* clean up after GetRepr */ if (base_code != old_code) free(base_code); dreturn("%i", ret); return ret; } static void _GD_SetNewCode(DIRFILE *D, char **code, int frag, struct gd_rename_data_ *rdat) { dtrace("%p, %p, %i, %p", D, code, frag, rdat); /* a NULL here is a field we couldn't update but the rename was forced via * GD_REN_FORCE */ if (rdat->code_list[rdat->n_code]) { D->fragment[frag].modified = 1; free(*code); *code = rdat->code_list[rdat->n_code]; } rdat->n_code++; dreturnvoid(); } /* internal update flags */ #define GD_UPDI 0x1 /* initialise */ #define GD_UPDU 0x2 /* update */ #define GD_UP_DO_CL 0 #define GD_UP_IN_CL (GD_UPDI) #define GD_UP_DO_UP (GD_UPDU) #define GD_UP_IN_UP (GD_UPDI | GD_UPDU) static int _GD_UpdateScalar(DIRFILE *D, gd_entry_t *T, struct gd_rename_data_ *rdat, int n, int search_meta, unsigned mode) { int c; dtrace("%p, %p, %p, %i, %i, %u", D, T, rdat, n, search_meta, mode); /* nothing to do */ if (T->scalar[n] == NULL) { dreturn("%i (-)", 0); return 0; } c = _GD_MatchCode(T->scalar[n], rdat->old_code, rdat->old_len, search_meta); if (c < 0) { dreturn("%i", 0); return 0; } if (!(mode & GD_UPDI)) /* clear the cache */ T->flags &= ~GD_EN_CALC; if (mode == GD_UP_IN_UP) { /* create new field codes */ if (_GD_MakeNewCode(D, T->scalar[n], T->fragment_index, NULL, 0, c, rdat)) { dreturn("%i", -1); return -1; } } else if (mode == GD_UP_DO_UP) /* move the new field codes into place */ _GD_SetNewCode(D, T->scalar + n, T->fragment_index, rdat); dreturn("%i (%i)", 0, rdat->n_code); return 0; } static int _GD_UpdateInField(DIRFILE *D, gd_entry_t *T, struct gd_rename_data_ *rdat, int n, int search_meta, unsigned mode) { int c; dtrace("%p, %p, %p, %i, %i, %u", D, T, rdat, n, search_meta, mode); c = _GD_MatchCode(T->in_fields[n], rdat->old_code, rdat->old_len, search_meta); if (c < 0) { dreturn("%i", 0); return 0; } if (!(mode & GD_UPDI)) { /* clear the cache */ T->e->entry[n] = NULL; if (T->field_type == GD_ALIAS_ENTRY) T->e->entry[1] = NULL; } if (mode == GD_UP_IN_UP) { /* create new field codes */ if (_GD_MakeNewCode(D, T->in_fields[n], T->fragment_index, T->e->entry[n], T->e->repr[n], c, rdat)) { dreturn("%i", -1); return -1; } } else if (mode == GD_UP_DO_UP) /* move the new field codes into place */ _GD_SetNewCode(D, T->in_fields + n, T->fragment_index, rdat); dreturn("%i (%i)", 0, rdat->n_code); return 0; } /* search for and update field metadata to account for a renamed field -- this * is a combination of the old _GD_InvalidateVect and _GD_InvalidateConst */ static int _GD_UpdateInputs(DIRFILE *D, struct gd_rename_data_ *rdat, int perform) { unsigned u; int i; /* look for meta fields */ const int search_meta = (rdat->E->e->n_meta != -1); /* classes of things to update */ const int update_scalars = (search_meta || (rdat->E->field_type & GD_SCALAR_ENTRY_BIT)); const int update_vectors = (search_meta || !(rdat->E->field_type & GD_SCALAR_ENTRY_BIT)); const int update_aliases = !(rdat->flags & GD_REN_DANGLE); /* update mode for scalars and vectors */ const int mode = ((rdat->flags & GD_REN_UPDB) ? GD_UPDU : 0) | (perform ? 0 : GD_UPDI); /* update mode for aliases */ const int amode = (update_aliases ? GD_UPDU : 0) | (perform ? 0 : GD_UPDI); dtrace("%p, %p, %i", D, rdat, perform); /* reset the code count */ rdat->n_code = 0; for (u = 0; u < D->n_entries; ++u) { switch (D->entry[u]->field_type) { case GD_LINCOM_ENTRY: if (update_vectors) for (i = 0; i < D->entry[u]->EN(lincom,n_fields); ++i) { if (_GD_UpdateInField(D, D->entry[u], rdat, i, search_meta, mode)) { dreturn("%i", -1); return -1; } } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (update_vectors) if (_GD_UpdateInField(D, D->entry[u], rdat, 1, search_meta, mode)) { dreturn("%i", -1); return -1; } /* Fallthrough */ case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_PHASE_ENTRY: case GD_POLYNOM_ENTRY: case GD_RECIP_ENTRY: case GD_SBIT_ENTRY: if (update_vectors) if (_GD_UpdateInField(D, D->entry[u], rdat, 0, search_meta, mode)) { dreturn("%i", -1); return -1; } break; case GD_INDEX_ENTRY: case GD_RAW_ENTRY: case GD_NO_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: case GD_ALIAS_ENTRY: break; } if (update_scalars) switch (D->entry[u]->field_type) { case GD_LINCOM_ENTRY: for (i = 0; i < D->entry[u]->EN(lincom,n_fields); ++i) if (_GD_UpdateScalar(D, D->entry[u], rdat, i, search_meta, mode) || _GD_UpdateScalar(D, D->entry[u], rdat, i + GD_MAX_LINCOM, search_meta, mode)) { dreturn("%i", -1); return -1; } break; case GD_POLYNOM_ENTRY: for (i = 0; i <= D->entry[u]->EN(polynom,poly_ord); ++i) if (_GD_UpdateScalar(D, D->entry[u], rdat, i, search_meta, mode)) { dreturn("%i", -1); return -1; } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: case GD_MPLEX_ENTRY: if (_GD_UpdateScalar(D,D->entry[u], rdat, 1, search_meta, mode)) { dreturn("%i", -1); return -1; } /* Fallthrough */ case GD_PHASE_ENTRY: case GD_RAW_ENTRY: case GD_RECIP_ENTRY: case GD_WINDOW_ENTRY: if (_GD_UpdateScalar(D,D->entry[u], rdat, 0, search_meta, mode)) { dreturn("%i", -1); return -1; } break; case GD_NO_ENTRY: case GD_LINTERP_ENTRY: case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_INDEX_ENTRY: case GD_STRING_ENTRY: case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_ALIAS_ENTRY: break; } if (update_aliases && D->entry[u]->field_type == GD_ALIAS_ENTRY) if (_GD_UpdateInField(D, D->entry[u], rdat, 0, search_meta, amode)) { dreturn("%i", -1); return -1; } } dreturn("%i", 0); return 0; } /* delete rename data */ void _GD_CleanUpRename(struct gd_rename_data_ *rdat, int abort) { int i; dtrace("%p, %i", rdat, abort); if (rdat) { if (abort) { if (rdat->meta_name) for (i = 0; i < rdat->n_meta; ++i) free(rdat->meta_name[i]); if (rdat->code_list) for (i = 0; i < rdat->n_code; ++i) free(rdat->code_list[i]); } free(rdat->code_list); free(rdat->meta_name); free(rdat->old_code); free(rdat); } dreturnvoid(); } /* perform a database update due to a renamed field */ void _GD_PerformRename(DIRFILE *restrict D, struct gd_rename_data_ *restrict rdat) { int i; dtrace("%p, %p", D, rdat); if (rdat == NULL) { dreturnvoid(); return; } /* update meta field names */ for (i = 0; i < rdat->n_meta; ++i) { free(rdat->meta_entry[i]->field); rdat->meta_entry[i]->field = rdat->meta_name[i]; } /* rename the field */ free(rdat->E->field); rdat->E->field = rdat->new_code; /* update derived/client fields/aliases */ _GD_UpdateInputs(D, rdat, 1); /* Update the dot list */ if (rdat->old_dot && !rdat->new_dot) { memmove(D->dot_list + rdat->dot_ind, D->dot_list + rdat->dot_ind + 1, sizeof(gd_entry_t*) * (--D->n_dot - rdat->dot_ind)); rdat->E->flags &= ~GD_EN_DOTTED; } else if (rdat->new_dot && !rdat->old_dot) { D->dot_list[D->n_dot++] = rdat->E; rdat->E->flags |= GD_EN_DOTTED; } /* re-sort the lists */ qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp); if (D->dot_list && rdat->new_dot) qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp); /* Invalidate the field lists */ if (rdat->E->e->n_meta == -1) { rdat->E->e->p.parent->e->value_list_validity = 0; rdat->E->e->p.parent->e->entry_list_validity = 0; } else { D->value_list_validity = 0; D->entry_list_validity = 0; } /* rehash the aliases */ _GD_UpdateAliases(D, 1); /* done */ _GD_CleanUpRename(rdat, 0); dreturnvoid(); } /* prepare for a database update due to a renamed field */ struct gd_rename_data_ *_GD_PrepareRename(DIRFILE *restrict D, char *restrict new_code, gd_entry_t *restrict E, int old_dot, unsigned dot_ind, int new_dot, unsigned flags) { int i; struct gd_rename_data_ *rdat; dtrace("%p, \"%s\", %p, %i, %u, %i, 0x%X", D, new_code, E, old_dot, dot_ind, new_dot, flags); /* Resize the dot list; this must be done early in case it fails; it's * not a big deal if something else fails later: it will just be slightly too * big */ if (new_dot && !old_dot) { gd_entry_t** ptr = _GD_Realloc(D, D->dot_list, sizeof(*ptr) * (D->n_dot + 1)); if (ptr == NULL) { dreturn("%p", NULL); return NULL; } D->dot_list = ptr; } rdat = _GD_Malloc(D, sizeof(*rdat)); if (rdat == NULL) { dreturn("%p", NULL); return NULL; } memset(rdat, 0, sizeof(*rdat)); rdat->n_meta = E->e->n_meta; rdat->meta_entry = E->e->p.meta_entry; rdat->flags = flags; rdat->E = E; rdat->old_code = _GD_Strdup(D, E->field); rdat->old_len = strlen(E->field); rdat->new_code = new_code; rdat->new_len = strlen(new_code); rdat->new_dot = new_dot; rdat->old_dot = old_dot; rdat->dot_ind = dot_ind; /* resolve field type */ if (E->field_type == GD_ALIAS_ENTRY && E->e->entry[0]) rdat->type = E->e->entry[0]->field_type; else rdat->type = E->field_type; /* update other fields' metadata */ if (_GD_UpdateInputs(D, rdat, 0)) { _GD_CleanUpRename(rdat, 1); dreturn("%p", NULL); return NULL; } if (rdat->n_meta > 0) { /* compose all the new meta field names under a top-level field. We must do * this now in a temporary location in case it fails and/or subsequent stuff * fails */ rdat->meta_name = _GD_Malloc(D, sizeof(*rdat->meta_name) * rdat->n_meta); if (!rdat->meta_name) { _GD_CleanUpRename(rdat, 1); dreturn("%p", NULL); return NULL; } memset(rdat->meta_name, 0, sizeof(char *) * rdat->n_meta); for (i = 0; i < rdat->n_meta; ++i) { rdat->meta_name[i] = _GD_Malloc(D, strlen(rdat->meta_entry[i]->field) + rdat->new_len - rdat->old_len + 1); if (rdat->meta_name[i] == NULL) break; sprintf(rdat->meta_name[i], "%s/%s", new_code, rdat->meta_entry[i]->field + rdat->old_len + 1); } } if (D->error) { _GD_CleanUpRename(rdat, 1); dreturn("%p", NULL); return NULL; } dreturn("%p", rdat); return rdat; } static int _GD_Rename(DIRFILE *D, gd_entry_t *E, const char *new_name, int old_dot, unsigned dot_ind, unsigned flags) { gd_entry_t *Q; char *name; int new_dot; struct gd_rename_data_ *rdat = NULL; dtrace("%p, %p, \"%s\", %i, %u, 0x%X", D, E, new_name, old_dot, dot_ind, flags); if (_GD_ValidateField(new_name, D->standards, 1, GD_VF_CODE, &new_dot)) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, new_name); dreturn("%i", -1); return -1; } if (E->e->n_meta == -1) { name = _GD_Malloc(D, strlen(E->e->p.parent->field) + strlen(new_name) + 2); if (name == NULL) { dreturn("%i", -1); return -1; } sprintf(name, "%s/%s", E->e->p.parent->field, new_name); } else { /* Verify prefix and suffix */ if (_GD_CheckCodeAffixes(D, new_name, E->fragment_index, 1)) { dreturn("%i", -1); return -1; } name = _GD_Strdup(D, new_name); if (name == NULL) { dreturn("%i", -1); return -1; } } /* Duplicate check */ Q = _GD_FindField(D, name, D->entry, D->n_entries, 1, NULL); if (Q == E) { free(name); dreturn("%i", 0); return 0; } if (Q != NULL) { _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, name); free(name); dreturn("%i", -1); return -1; } /* prep for metadata update */ rdat = _GD_PrepareRename(D, name, E, old_dot, dot_ind, new_dot, flags); if (rdat == NULL) { free(name); dreturn("%i", -1); return -1; } if (E->field_type == GD_RAW_ENTRY) { /* Compose the new filename */ char *filebase = _GD_Strdup(D, new_name); if (filebase == NULL) { free(name); dreturn("%i", -1); return -1; } /* Close the old file */ if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) { free(name); free(filebase); dreturn("%i", -1); return -1; } if (flags & GD_REN_DATA) { struct gd_raw_file_ temp; /* check data protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[E->fragment_index].cname); free(name); free(filebase); dreturn("%i", -1); return -1; } if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_MOVE)) { free(name); free(filebase); dreturn("%i", -1); return -1; } memcpy(&temp, E->e->u.raw.file, sizeof(struct gd_raw_file_)); temp.name = NULL; if ((*_GD_ef[temp.subenc].name)(D, (const char*)D->fragment[E->fragment_index].enc_data, &temp, filebase, 0, 0)) { free(name); free(filebase); dreturn("%i", -1); return -1; } if ((*_GD_ef[temp.subenc].name)(D, (const char*)D->fragment[E->fragment_index].enc_data, E->e->u.raw.file, E->e->u.raw.filebase, 0, 0)) { free(name); free(filebase); dreturn("%i", -1); return -1; } if ((*_GD_ef[E->e->u.raw.file[0].subenc].move)( D->fragment[E->fragment_index].dirfd, E->e->u.raw.file, D->fragment[E->fragment_index].dirfd, temp.name)) { _GD_SetEncIOError(D, GD_E_IO_RENAME, E->e->u.raw.file + 0); free(filebase); dreturn("%i", -1); return -1; } /* Nothing may fail from now on */ } else { free(E->e->u.raw.file[0].name); E->e->u.raw.file[0].name = NULL; } free(E->e->u.raw.filebase); E->e->u.raw.filebase = filebase; } D->fragment[E->fragment_index].modified = 1; /* Update database metadata */ _GD_PerformRename(D, rdat); D->flags &= ~GD_HAVE_VERSION; dreturn("%i", 0); return 0; } int gd_rename(DIRFILE *D, const char *old_code, const char *new_name, unsigned flags) { gd_entry_t *E = NULL; int ret, old_dot = 0; unsigned dot_ind = 0; dtrace("%p, \"%s\", \"%s\", 0x%X", D, old_code, new_name, flags); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check for a dotted field name */ if (D->n_dot > 0) E = _GD_FindField(D, old_code, D->dot_list, D->n_dot, 0, &dot_ind); if (E) old_dot = 1; else E = _GD_FindField(D, old_code, D->entry, D->n_entries, 0, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, old_code); dreturn("%i", -1); return -1; } if (E->field_type == GD_INDEX_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, "INDEX"); dreturn("%i", -1); return -1; } /* check metadata protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", -1); return -1; } ret = _GD_Rename(D, E, new_name, old_dot, dot_ind, flags); dreturn("%i", ret); return ret; } libgetdata-0.9.0/src/flimits.c0000640000175000017500000003341312614323564016412 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static void _GD_ShiftFragment(DIRFILE* D, off64_t offset, int fragment, int move) { unsigned int i, n_raw = 0; dtrace("%p, %lli, %i, %i", D, (long long)offset, fragment, move); /* check protection */ if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[fragment].cname); dreturnvoid(); return; } if (move && offset != D->fragment[fragment].frame_offset) { gd_entry_t **raw_entry = _GD_Malloc(D, sizeof(*raw_entry) * D->n_entries); if (raw_entry == NULL) { dreturnvoid(); return; } /* Because it may fail, the move must occur out-of-place and then be copied * back over the affected files once success is assured */ for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->fragment_index == fragment && D->entry[i]->field_type == GD_RAW_ENTRY) { /* determine encoding scheme */ if (!_GD_Supports(D, D->entry[i], 0)) break; /* add this raw field to the list */ raw_entry[n_raw++] = D->entry[i]; if (_GD_MogrifyFile(D, D->entry[i], D->fragment[D->entry[i]->fragment_index].encoding, D->fragment[D->entry[i]->fragment_index].byte_sex, offset, 0, -1, NULL)) break; } /* If successful, move the temporary file over the old file, otherwise * remove the temporary files */ if (D->error) { for (i = 0; i < n_raw; ++i) _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD | GD_FINIRAW_CLOTEMP); } else { for (i = 0; i < n_raw; ++i) _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP); } free(raw_entry); if (D->error) { dreturnvoid(); return; } } D->fragment[fragment].frame_offset = offset; D->fragment[fragment].modified = 1; D->flags &= ~GD_HAVE_VERSION; dreturnvoid(); } int gd_alter_frameoffset64(DIRFILE* D, off64_t offset, int fragment, int move) { int i; dtrace("%p, %lli, %i, %i", D, (long long)offset, fragment, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (offset < 0) { _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); if (fragment == GD_ALL_FRAGMENTS) { for (i = 0; i < D->n_fragment; ++i) { _GD_ShiftFragment(D, offset, i, move); if (D->error) break; } } else _GD_ShiftFragment(D, offset, fragment, move); dreturn("%i", (D->error) ? -1 : 0); return (D->error) ? -1 : 0; } off64_t gd_frameoffset64(DIRFILE* D, int fragment) { dtrace("%p, %i", D, fragment); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment < 0 || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); dreturn("%lli", (long long)D->fragment[fragment].frame_offset); return D->fragment[fragment].frame_offset; } /* 32(ish)-bit wrappers for the 64-bit versions, when needed */ int gd_alter_frameoffset(DIRFILE* D, off_t offset, int fragment, int move) { return gd_alter_frameoffset64(D, offset, fragment, move); } off_t gd_frameoffset(DIRFILE* D, int fragment) gd_nothrow { return gd_frameoffset64(D, fragment); } off64_t _GD_GetEOF(DIRFILE *restrict D, const gd_entry_t *restrict E, const char *restrict parent, int *restrict is_index) { off64_t ns = -1, ns1; unsigned int spf0, spf1; int i, is_index1; dtrace("%p, %p, \"%s\", %p", D, E, parent, is_index); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%i ?", -1); return -1; } *is_index = 0; switch (E->field_type) { case GD_RAW_ENTRY: if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_SIZE)) break; if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D, (const char*)D->fragment[E->fragment_index].enc_data, E->e->u.raw.file, E->e->u.raw.filebase, 0, 0)) { break; } ns = (*_GD_ef[E->e->u.raw.file[0].subenc].size)( D->fragment[E->fragment_index].dirfd, E->e->u.raw.file, E->EN(raw,data_type), _GD_FileSwapBytes(D, E)); if (ns < 0) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); ns = -1; break; } ns += D->fragment[E->fragment_index].frame_offset * E->EN(raw,spf); break; case GD_BIT_ENTRY: case GD_LINTERP_ENTRY: case GD_SBIT_ENTRY: case GD_POLYNOM_ENTRY: case GD_RECIP_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index); break; case GD_DIVIDE_ENTRY: case GD_MULTIPLY_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) || _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { break; } ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index); if (D->error) break; spf0 = _GD_GetSPF(D, E->e->entry[0]); if (D->error) { ns = -1; break; } ns1 = _GD_GetEOF(D, E->e->entry[1], E->field, &is_index1); if (D->error) { ns = -1; break; } if (!is_index1) { spf1 = _GD_GetSPF(D, E->e->entry[1]); if (D->error) { ns = -1; break; } ns1 = ns1 * spf0 / spf1; if (*is_index || ns1 < ns) { *is_index = is_index1; ns = ns1; } } break; case GD_LINCOM_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index); if (D->error) { ns = -1; break; } if (E->EN(lincom,n_fields) == 1) break; spf0 = _GD_GetSPF(D, E->e->entry[0]); if (D->error) { ns = -1; break; } for (i = 1; i < E->EN(lincom,n_fields); ++i) { if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) { ns = -1; break; } ns1 = _GD_GetEOF(D, E->e->entry[i], E->field, &is_index1); if (D->error) { ns = -1; break; } if (!is_index1) { spf1 = _GD_GetSPF(D, E->e->entry[i]); if (D->error) { ns = -1; break; } ns1 = ns1 * spf0 / spf1; if (*is_index || ns1 < ns) { *is_index = is_index1; ns = ns1; } } } break; case GD_PHASE_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; ns = _GD_GetEOF(D, E->e->entry[0], E->field, is_index); if (!*is_index && !D->error) ns -= E->EN(phase,shift); /* The EOF may never be negative. */ if (ns < 0) ns = 0; break; case GD_INDEX_ENTRY: *is_index = 1; break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: if (parent) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, parent, 0, E->field); else _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, E->field); break; case GD_NO_ENTRY: _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, E->field); break; case GD_ALIAS_ENTRY: _GD_InternalError(D); break; } D->recurse_level--; dreturn("%lli %i", (unsigned long long)ns, *is_index); return ns; } off64_t gd_eof64(DIRFILE* D, const char *field_code) { off64_t ns; gd_entry_t *entry; int is_index; dtrace("%p, \"%s\"", D, field_code); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } entry = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%i", -1); return -1; } ns = _GD_GetEOF(D, entry, NULL, &is_index); if (is_index) _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); dreturn("%lli", (unsigned long long)ns); return ns; } /* 32(ish)-bit wrapper for the 64-bit version, when needed */ off_t gd_eof(DIRFILE* D, const char *field_code) { return (off_t)gd_eof64(D, field_code); } static off64_t _GD_GetBOF(DIRFILE *restrict D, const gd_entry_t *restrict E, const char *restrict parent, unsigned int *restrict spf, int64_t *restrict ds) { off64_t bof = -1, bof1; unsigned int spf1; int64_t ds1; int i; dtrace("%p, %p, \"%s\", %p, %p", D, E, parent, spf, ds); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%i", -1); return -1; } switch (E->field_type) { case GD_RAW_ENTRY: bof = D->fragment[E->fragment_index].frame_offset; *spf = E->EN(raw,spf); *ds = 0; break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: case GD_LINTERP_ENTRY: case GD_POLYNOM_ENTRY: case GD_RECIP_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds); break; case GD_PHASE_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds); if (!D->error) { *ds -= E->EN(phase,shift); /* remove whole frames from delta-samples */ while (*ds < 0) { *ds += *spf; bof--; } while (*ds >= *spf) { *ds -= *spf; bof++; } /* The beginning-of-frame may not be before frame zero */ if (bof < 0) bof = *ds = 0; } break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) || _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { break; } bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds); if (D->error) { bof = -1; break; } bof1 = _GD_GetBOF(D, E->e->entry[1], E->field, &spf1, &ds1); if (D->error) { bof = -1; break; } if (bof1 > bof || (bof1 == bof && (double)ds1 / spf1 > (double)*ds / *spf)) { bof = bof1; *ds = ds1 * *spf / spf1; } break; case GD_LINCOM_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; bof = _GD_GetBOF(D, E->e->entry[0], E->field, spf, ds); if (D->error) { bof = -1; break; } for (i = 1; i < E->EN(lincom,n_fields); ++i) { if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) { bof = -1; break; } bof1 = _GD_GetBOF(D, E->e->entry[i], E->field, &spf1, &ds1); if (D->error) { bof = -1; break; } if (bof1 > bof || (bof1 == bof && (double)ds1 / spf1 > (double)*ds / *spf)) { bof = bof1; *ds = ds1 * *spf / spf1; } } break; case GD_INDEX_ENTRY: bof = 0; *spf = 1; *ds = 0; break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: case GD_STRING_ENTRY: if (parent) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_FORMAT, parent, 0, E->field); else _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, E->field); break; case GD_NO_ENTRY: case GD_ALIAS_ENTRY: _GD_InternalError(D); break; } D->recurse_level--; dreturn("%llu %lu %lli", (unsigned long long)bof, (unsigned long)*spf, (long long)*ds); return bof; } off64_t gd_bof64(DIRFILE* D, const char *field_code) gd_nothrow { off64_t bof; gd_entry_t *entry; unsigned int spf; int64_t ds; dtrace("%p, \"%s\"", D, field_code); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } entry = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%i", -1); return -1; } bof = _GD_GetBOF(D, entry, NULL, &spf, &ds); if (bof != -1) bof = bof * spf + ds; dreturn("%lli", (unsigned long long)bof); return bof; } /* 32(ish)-bit wrapper for the 64-bit version, when needed */ off_t gd_bof(DIRFILE* D, const char *field_code) gd_nothrow { return (off_t)gd_bof64(D, field_code); } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/protect.c0000640000175000017500000000513712614323564016425 0ustar alastairalastair/* Copyright (C) 2008, 2010, 2011, 2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" int gd_protection(DIRFILE* D, int fragment_index) gd_nothrow { dtrace("%p, %i", D, fragment_index); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment_index < 0 || fragment_index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL); dreturn("%i", -1); return -1; } dreturn("%i", D->fragment[fragment_index].protection); return D->fragment[fragment_index].protection; } int gd_alter_protection(DIRFILE *D, int protection_level, int fragment_index) gd_nothrow { int i; dtrace("%p, %i, %i", D, protection_level, fragment_index); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment_index < GD_ALL_FRAGMENTS || fragment_index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL); dreturn("%i", -1); return -1; } if (protection_level != GD_PROTECT_NONE && protection_level != GD_PROTECT_FORMAT && protection_level != GD_PROTECT_DATA && protection_level != GD_PROTECT_ALL) { _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_PROTECTION, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment_index == GD_ALL_FRAGMENTS) for (i = 0; i < D->n_fragment; ++i) D->fragment[i].protection = protection_level; else D->fragment[fragment_index].protection = protection_level; dreturn("%i", 0); return 0; } libgetdata-0.9.0/src/add.c0000640000175000017500000016526512614323564015506 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" int _GD_InvalidEntype(gd_entype_t t) { dtrace("0x%X", t); if (t != GD_RAW_ENTRY && t != GD_LINCOM_ENTRY && t != GD_LINTERP_ENTRY && t != GD_BIT_ENTRY && t != GD_MULTIPLY_ENTRY && t != GD_PHASE_ENTRY && t != GD_CONST_ENTRY && t != GD_POLYNOM_ENTRY && t != GD_SBIT_ENTRY && t != GD_DIVIDE_ENTRY && t != GD_RECIP_ENTRY && t != GD_WINDOW_ENTRY && t != GD_MPLEX_ENTRY && t != GD_CARRAY_ENTRY && t != GD_STRING_ENTRY) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } static gd_entry_t *_GD_FixName(DIRFILE *restrict D, char **restrict buffer, const char *name, int frag, int *restrict offset) { gd_entry_t *P; char *ptr; struct parser_state p; dtrace("%p, %p, \"%s\", %i, %p", D, buffer, name, frag, offset); /* Check prefix and suffix */ if (_GD_CheckCodeAffixes(D, name, frag, 1)) { dreturn("%p", NULL); return NULL; } *buffer = ptr = _GD_Strdup(D, name); if (ptr == NULL) { free(ptr); dreturn("%p", NULL); return NULL; } _GD_SimpleParserInit(D, NULL, &p); P = _GD_CheckParent(D, &p, &ptr, -1); if (D->error) { free(*buffer); dreturn("%p", NULL); return NULL; } if (P) { char *temp2; /* make the new name -- this may be different because P may have been * dealiased */ *offset = strlen(P->field) + 1; temp2 = (char*)_GD_Malloc(D, *offset + strlen(ptr) + 1); if (temp2 == NULL) { free(*buffer); dreturn("%p", NULL); return NULL; } sprintf(temp2, "%s/%s", P->field, ptr); free(*buffer); *buffer = temp2; } else *offset = 0; dreturn("%p (\"%s\", %i)", P, *buffer, *offset); return P; } /* copy scalar entries from the user's entry; returns a mask of * initialised scalars */ static unsigned _GD_CopyScalars(DIRFILE *restrict D, gd_entry_t *restrict E, const gd_entry_t *restrict entry, unsigned mask) { unsigned mask_out = 0; int i; dtrace("%p, %p, %p, 0x%X", D, E, entry, mask); /* copy scalars */ for (i = 0; i <= GD_MAX_POLYORD; ++i) { if (!(mask & (1 << i)) || entry->scalar[i] == NULL || entry->scalar[i][0] == '\0') { E->scalar[i] = NULL; } else { /* check for correct affixes */ if (_GD_CheckCodeAffixes(D, entry->scalar[i], entry->fragment_index, 1)) break; /* when using early Standards, reject ambiguous field codes */ if (entry->scalar_ind[i] == -1 && !(D->flags & GD_NOSTANDARD) && D->standards <= 7) { if (_GD_TokToNum(entry->scalar[i], D->standards, 1, NULL, NULL, NULL, NULL) != -1) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_AMBIGUOUS, NULL, 0, entry->scalar[i]); break; } } E->scalar[i] = _GD_Strdup(D, entry->scalar[i]); E->scalar_ind[i] = entry->scalar_ind[i]; mask_out |= (1 << i); } } dreturn("0x%X", mask_out); return mask_out; } /* add an entry - returns the added entry on success. */ static gd_entry_t *_GD_Add(DIRFILE *restrict D, const gd_entry_t *restrict entry, const char *restrict parent) { char *temp_buffer; int i, is_dot, offset; void *new_list; void *new_ref = NULL; unsigned int u; unsigned mask; gd_entry_t *E; gd_entry_t *P = NULL; dtrace("%p, %p, \"%s\"", D, entry, parent); _GD_ClearError(D); /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } /* check for include index out of range */ if (parent == NULL && (entry->fragment_index < 0 || entry->fragment_index >= D->n_fragment)) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, entry->fragment_index, NULL); dreturn("%p", NULL); return NULL; } /* check parent */ if (parent != NULL) { P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%p", NULL); return NULL; } /* make sure it's not a meta field already */ if (P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, parent); dreturn("%p", NULL); return NULL; } /* make name */ offset = strlen(parent) + 1; temp_buffer = (char *)_GD_Malloc(D, offset + strlen(entry->field) + 1); if (temp_buffer == NULL) { dreturn("%p", NULL); return NULL; } strcpy(temp_buffer, parent); temp_buffer[offset - 1] = '/'; strcpy(temp_buffer + offset, entry->field); } else { /* this will check for affixes and take care of detecting Barth-style * metafield definitions */ P = _GD_FixName(D, &temp_buffer, entry->field, entry->fragment_index, &offset); if (D->error) { dreturn("%p", NULL); return NULL; } } /* check for duplicate field */ if (_GD_FindField(D, temp_buffer, D->entry, D->n_entries, 0, &u)) { _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, temp_buffer); free(temp_buffer); dreturn("%p", NULL); return NULL; } /* check for bad field type */ if (_GD_InvalidEntype(entry->field_type)) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, NULL, entry->field_type, NULL); free(temp_buffer); dreturn("%p", NULL); return NULL; } /* New entry */ E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { free(temp_buffer); dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); if (P) E->fragment_index = P->fragment_index; else E->fragment_index = entry->fragment_index; /* check protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); free(E); free(temp_buffer); dreturn("%p", NULL); return NULL; } E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); free(temp_buffer); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = entry->field_type; E->field = temp_buffer; E->flags = entry->flags & GD_EN_HIDDEN; /* it's possible to hide a newly added field this way */ /* Check */ if (_GD_ValidateField(E->field + offset, D->standards, 1, GD_VF_CODE, &is_dot)) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, entry->field); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } /* Set meta indices */ if (P != NULL) E->e->n_meta = -1; /* Validate entry and add auxiliary data */ switch(entry->field_type) { case GD_RAW_ENTRY: /* no METARAW fields allowed */ if (P != NULL) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_METARAW, NULL, entry->field_type, NULL); break; } /* check protection */ if (D->fragment[entry->fragment_index].protection & GD_PROTECT_DATA) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[entry->fragment_index].cname); break; } E->EN(raw,data_type) = entry->EN(raw,data_type); E->e->u.raw.file[0].idata = E->e->u.raw.file[1].idata = -1; E->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN; E->e->u.raw.filebase = _GD_MungeCode(D, NULL, 0, D->fragment[entry->fragment_index].prefix, D->fragment[entry->fragment_index].suffix, NULL, NULL, E->field, NULL, NULL, GD_MC_RQ_PARTS); if (D->error) break; mask = _GD_CopyScalars(D, E, entry, 0x1); if (!(mask & 1) && (E->EN(raw,spf) = entry->EN(raw,spf)) == 0) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_SPF, NULL, 0, NULL); else if (E->EN(raw,data_type) & 0x40 || (E->e->u.raw.size = GD_SIZE(E->EN(raw,data_type))) == 0) _GD_SetError(D, GD_E_BAD_TYPE, entry->EN(raw,data_type), NULL, 0, NULL); else if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_WRITE | GD_FILE_TOUCH, _GD_FileSwapBytes(D, E))) { ; } else if (D->fragment[E->fragment_index].ref_name == NULL) { /* This is the first raw field in this fragment */ new_ref = _GD_Strdup(D, E->field); } break; case GD_LINCOM_ENTRY: E->EN(lincom,n_fields) = entry->EN(lincom,n_fields); if (E->EN(lincom,n_fields) < 1 || E->EN(lincom,n_fields) > GD_MAX_LINCOM) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, E->EN(lincom,n_fields), NULL); for (i = 0; i < E->EN(lincom,n_fields); ++i) _GD_CheckCodeAffixes(D, entry->in_fields[i], entry->fragment_index, 1); if (D->error) break; _GD_CopyScalars(D, E, entry, 9 * ((1 << E->EN(lincom,n_fields)) - 1)); if (entry->flags & GD_EN_COMPSCAL) { unsigned cs = 0; memcpy(E->EN(lincom,cm), entry->EN(lincom,cm), sizeof(double) * 2 * E->EN(lincom,n_fields)); memcpy(E->EN(lincom,cb), entry->EN(lincom,cb), sizeof(double) * 2 * E->EN(lincom,n_fields)); for (i = 0; i < E->EN(lincom,n_fields); ++i) { E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]); E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]); if (cimag(E->EN(lincom,cm)[i]) || cimag(E->EN(lincom,cb)[i])) cs = GD_EN_COMPSCAL; } E->flags |= cs; } else { memcpy(E->EN(lincom,m), entry->EN(lincom,m), sizeof(double) * E->EN(lincom,n_fields)); memcpy(E->EN(lincom,b), entry->EN(lincom,b), sizeof(double) * E->EN(lincom,n_fields)); for (i = 0; i < E->EN(lincom,n_fields); ++i) { gd_rs2cs_(E->EN(lincom,cm)[i], E->EN(lincom,m)[i]); gd_rs2cs_(E->EN(lincom,cb)[i], E->EN(lincom,b)[i]); } } for (i = 0; i < E->EN(lincom,n_fields); ++i) E->in_fields[i] = _GD_Strdup(D, entry->in_fields[i]); break; case GD_LINTERP_ENTRY: E->e->u.linterp.table_len = -1; if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1)) { break; } E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); E->EN(linterp,table) = _GD_Strdup(D, entry->EN(linterp,table)); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1) || _GD_CheckCodeAffixes(D, entry->in_fields[1], entry->fragment_index, 1)) { break; } E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]); break; case GD_RECIP_ENTRY: if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1)) { break; } E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); _GD_CopyScalars(D, E, entry, 0x1); if (entry->flags & GD_EN_COMPSCAL) { gd_cs2cs_(E->EN(recip,cdividend), entry->EN(recip,cdividend)); E->EN(recip,dividend) = creal(E->EN(recip,cdividend)); if (cimag(E->EN(recip,cdividend)) != 0) E->flags |= GD_EN_COMPSCAL; } else { E->EN(recip,dividend) = entry->EN(recip,dividend); gd_rs2cs_(E->EN(recip,cdividend), E->EN(recip,dividend)); } break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: E->EN(bit,numbits) = entry->EN(bit,numbits); E->EN(bit,bitnum) = entry->EN(bit,bitnum); if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1)) { break; } E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); mask = _GD_CopyScalars(D, E, entry, 0x3); if (!(mask & 2) && E->EN(bit,numbits) < 1) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NUMBITS, NULL, entry->EN(bit,numbits), NULL); else if (!(mask & 1) && E->EN(bit,bitnum) < 0) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_BITNUM, NULL, entry->EN(bit,bitnum), NULL); else if (!(mask & 3) && E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_BITSIZE, NULL, E->EN(bit,bitnum) + E->EN(bit,numbits) - 1, NULL); break; case GD_PHASE_ENTRY: E->EN(phase,shift) = entry->EN(phase,shift); if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1)) { break; } _GD_CopyScalars(D, E, entry, 0x1); E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); break; case GD_WINDOW_ENTRY: E->EN(window,windop) = entry->EN(window,windop); E->EN(window,threshold) = entry->EN(window,threshold); if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1) || _GD_CheckCodeAffixes(D, entry->in_fields[1], entry->fragment_index, 1)) { break; } _GD_CopyScalars(D, E, entry, 0x1); E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]); if (_GD_BadWindop(E->EN(window,windop))) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_WINDOP, NULL, entry->EN(window,windop), NULL); break; case GD_MPLEX_ENTRY: E->EN(mplex,count_val) = entry->EN(mplex,count_val); E->EN(mplex,period) = entry->EN(mplex,period); if (_GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1) || _GD_CheckCodeAffixes(D, entry->in_fields[1], entry->fragment_index, 1)) { break; } E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); E->in_fields[1] = _GD_Strdup(D, entry->in_fields[1]); E->e->u.mplex.type = GD_NULL; mask = _GD_CopyScalars(D, E, entry, 0x3); if (!(mask & 2) && entry->EN(mplex,period) < 0) _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_PERIOD, NULL, entry->EN(mplex,period), NULL); break; case GD_CONST_ENTRY: E->EN(scalar,const_type) = entry->EN(scalar,const_type); E->EN(scalar,array_len) = -1; if (E->EN(scalar,const_type) & 0x40 || GD_SIZE(E->EN(scalar,const_type)) == 0) { _GD_SetError(D, GD_E_BAD_TYPE, E->EN(scalar,const_type), NULL, 0, NULL); } else { size_t size = GD_SIZE(_GD_ConstType(D, E->EN(scalar,const_type))); if (!D->error) E->e->u.scalar.d = _GD_Malloc(D, size); if (E->e->u.scalar.d) memset(E->e->u.scalar.d, 0, size); } break; case GD_CARRAY_ENTRY: E->EN(scalar,const_type) = entry->EN(scalar,const_type); E->EN(scalar,array_len) = entry->EN(scalar,array_len); if (E->EN(scalar,const_type) & 0x40 || GD_SIZE(E->EN(scalar,const_type)) == 0) { _GD_SetError(D, GD_E_BAD_TYPE, E->EN(scalar,const_type), NULL, 0, NULL); } else { size_t size = GD_SIZE(_GD_ConstType(D, E->EN(scalar,const_type))) * E->EN(scalar,array_len); if (!D->error) E->e->u.scalar.d = _GD_Malloc(D, size); if (E->e->u.scalar.d) memset(E->e->u.scalar.d, 0, size); } break; case GD_STRING_ENTRY: E->e->u.string = _GD_Strdup(D, ""); break; case GD_POLYNOM_ENTRY: E->EN(polynom,poly_ord) = entry->EN(polynom,poly_ord); if (E->EN(polynom,poly_ord) < 1 || E->EN(polynom,poly_ord) > GD_MAX_POLYORD) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, E->EN(polynom,poly_ord), NULL); } else { _GD_CheckCodeAffixes(D, entry->in_fields[0], entry->fragment_index, 1); _GD_CheckCodeAffixes(D, entry->in_fields[1], entry->fragment_index, 1); } if (D->error) break; _GD_CopyScalars(D, E, entry, (1 << (E->EN(polynom,poly_ord) + 1)) - 1); if (entry->flags & GD_EN_COMPSCAL) { unsigned cs = 0; memcpy(E->EN(polynom,ca), entry->EN(polynom,ca), sizeof(double) * 2 * (E->EN(polynom,poly_ord) + 1)); for (i = 0; i <= E->EN(polynom,poly_ord); ++i) { E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]); if (cimag(E->EN(polynom,ca)[i])) cs = GD_EN_COMPSCAL; } E->flags |= cs; } else { memcpy(E->EN(polynom,a), entry->EN(polynom,a), sizeof(double) * (E->EN(polynom,poly_ord) + 1)); for (i = 0; i <= E->EN(polynom,poly_ord); ++i) gd_rs2cs_(E->EN(polynom,ca)[i], E->EN(polynom,a)[i]); } E->in_fields[0] = _GD_Strdup(D, entry->in_fields[0]); break; case GD_ALIAS_ENTRY: case GD_INDEX_ENTRY: case GD_NO_ENTRY: _GD_InternalError(D); /* We've already verrified field_type is valid */ break; } if (D->error != GD_E_OK) { free(new_ref); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } new_list = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*)); if (new_list == NULL) { free(new_ref); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } D->entry = (gd_entry_t **)new_list; if (is_dot) { new_list = _GD_Realloc(D, D->dot_list, (D->n_dot + 1) * sizeof(gd_entry_t*)); if (new_list == NULL) { free(new_ref); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } E->flags |= GD_EN_DOTTED; D->dot_list = (gd_entry_t **)new_list; } if (P) { void *ptr = _GD_Realloc(D, P->e->p.meta_entry, (P->e->n_meta + 1) * sizeof(gd_entry_t*)); if (ptr == NULL) { free(new_ref); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } /* From here on, nothing may fail */ P->e->p.meta_entry = (gd_entry_t **)ptr; P->e->p.meta_entry[P->e->n_meta] = E; P->e->n_meta++; P->e->value_list_validity = 0; P->e->entry_list_validity = 0; } else { /* Invalidate the field lists */ D->value_list_validity = 0; D->entry_list_validity = 0; } if (E->field_type == GD_RAW_ENTRY) { if (new_ref != NULL) { /* This is the first raw field in this fragment; propagate it upwards */ for (i = E->fragment_index; i != -1; i = D->fragment[i].parent) { if (D->fragment[i].ref_name == NULL) { D->fragment[i].ref_name = (char *)strdup((const char*)new_ref); D->fragment[i].modified = 1; } else break; } if (D->reference_field == NULL) D->reference_field = E; free(new_ref); } } /* add the entry to the dot list, if needed */ if (is_dot) { D->dot_list[D->n_dot++] = E; qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp); } /* add the entry and resort the entry list */ _GD_InsertSort(D, E, u); D->n_entries++; D->fragment[E->fragment_index].modified = 1; D->flags &= ~GD_HAVE_VERSION; /* Update aliases - no reason to do a reset: all we did was add a field */ _GD_UpdateAliases(D, 0); dreturn("%p", E); return E; } /* add a META field by parsing a field spec */ int gd_madd_spec(DIRFILE* D, const char* line, const char* parent) gd_nothrow { char *outstring = NULL; char *in_cols[MAX_IN_COLS]; const char *tok_pos = NULL; int n_cols; int me; gd_entry_t* E = NULL; struct parser_state p; dtrace("%p, \"%s\", \"%s\"", D, line, parent); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); /* Find parent -- we don't do code mungeing here because we don't know * which fragment this is yet. */ E = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent); dreturn("%i", -1); return -1; } me = E->fragment_index; /* check protection */ if (D->fragment[me].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[me].cname); dreturn("%i", -1); return -1; } /* start parsing */ _GD_SimpleParserInit(D, "gd_madd_spec()", &p); n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols); /* Directive parsing is skipped -- The Field Spec parser will add the field */ if (!D->error) _GD_ParseFieldSpec(D, &p, n_cols, in_cols, E, me, 1, 1, &outstring, tok_pos); free(outstring); if (D->error) { dreturn("%i", -1); /* parser threw an error */ return -1; } /* Update aliases */ _GD_UpdateAliases(D, 0); D->fragment[me].modified = 1; D->flags &= ~GD_HAVE_VERSION; dreturn("%i", 0); return 0; } /* add a field by parsing a field spec */ int gd_add_spec(DIRFILE* D, const char* line, int fragment_index) { char *outstring; const char *tok_pos = NULL; char *in_cols[MAX_IN_COLS]; int n_cols; struct parser_state p; dtrace("%p, \"%s\", %i", D, line, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check for include index out of range */ if (fragment_index < 0 || fragment_index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL); dreturn("%i", -1); return -1; } /* check protection */ if (D->fragment[fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[fragment_index].cname); dreturn("%i", -1); return -1; } _GD_ClearError(D); if (~D->flags & GD_HAVE_VERSION) _GD_FindVersion(D); if (D->av) { p.standards = D->standards; p.pedantic = 1; } /* start parsing */ _GD_SimpleParserInit(D, "gd_add_spec()", &p); n_cols = _GD_Tokenise(D, &p, line, &outstring, &tok_pos, MAX_IN_COLS, in_cols); /* Directive parsing is skipped -- The Field Spec parser will add the field */ if (!D->error) _GD_ParseFieldSpec(D, &p, n_cols, in_cols, NULL, fragment_index, 1, 1, &outstring, tok_pos); free(outstring); if (D->error) { dreturn("%i", -1); /* parser threw an error */ return -1; } /* Update aliases */ _GD_UpdateAliases(D, 0); D->fragment[fragment_index].modified = 1; D->flags &= ~GD_HAVE_VERSION; dreturn("%i", 0); return 0; } int gd_add(DIRFILE* D, const gd_entry_t* entry) { int ret; dtrace("%p, %p", D, entry); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } ret = (_GD_Add(D, entry, NULL) == NULL) ? -1 : 0; dreturn("%i", ret); return ret; } /* add a RAW entry */ int gd_add_raw(DIRFILE* D, const char* field_code, gd_type_t data_type, unsigned int spf, int fragment_index) { gd_entry_t R; dtrace("%p, \"%s\", 0x%X, %i, %i", D, field_code, data_type, spf, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&R, 0, sizeof(gd_entry_t)); R.field = (char *)field_code; R.field_type = GD_RAW_ENTRY; R.EN(raw,spf) = spf; R.EN(raw,data_type) = data_type; R.fragment_index = fragment_index; if (_GD_Add(D, &R, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a LINCOM entry */ int gd_add_lincom(DIRFILE* D, const char* field_code, int n_fields, const char** in_fields, const double* m, const double* b, int fragment_index) gd_nothrow { int i; gd_entry_t L; dtrace("%p, \"%s\", %i, %p, %p, %p, %i", D, field_code, n_fields, in_fields, m, b, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (n_fields < 1 || n_fields > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL); dreturn("%i", -1); return -1; } memset(&L, 0, sizeof(gd_entry_t)); L.field = (char *)field_code; L.field_type = GD_LINCOM_ENTRY; L.EN(lincom,n_fields) = n_fields; L.fragment_index = fragment_index; for (i = 0; i < n_fields; ++i) { L.in_fields[i] = (char *)in_fields[i]; L.EN(lincom,m)[i] = m[i]; L.EN(lincom,b)[i] = b[i]; } if (_GD_Add(D, &L, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a LINCOM entry with complex scalars */ int gd_add_clincom(DIRFILE* D, const char* field_code, int n_fields, const char** in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb), int fragment_index) gd_nothrow { int i; gd_entry_t L; dtrace("%p, \"%s\", %i, %p, %p, %p, %i", D, field_code, n_fields, in_fields, cm, cb, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (n_fields < 1 || n_fields > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL); dreturn("%i", -1); return -1; } memset(&L, 0, sizeof(gd_entry_t)); L.field = (char *)field_code; L.field_type = GD_LINCOM_ENTRY; L.EN(lincom,n_fields) = n_fields; L.flags = GD_EN_COMPSCAL; L.fragment_index = fragment_index; for (i = 0; i < n_fields; ++i) { L.in_fields[i] = (char *)in_fields[i]; gd_ca2cs_(L.EN(lincom,cm)[i], cm, i); gd_ca2cs_(L.EN(lincom,cb)[i], cb, i); } if (_GD_Add(D, &L, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a LINTERP entry */ int gd_add_linterp(DIRFILE* D, const char* field_code, const char* in_field, const char* table, int fragment_index) gd_nothrow { gd_entry_t L; dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, field_code, in_field, table, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&L, 0, sizeof(gd_entry_t)); L.field = (char *)field_code; L.field_type = GD_LINTERP_ENTRY; L.in_fields[0] = (char *)in_field; L.EN(linterp,table) = (char *)table; L.fragment_index = fragment_index; if (_GD_Add(D, &L, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a BIT entry */ int gd_add_bit(DIRFILE* D, const char* field_code, const char* in_field, int bitnum, int numbits, int fragment_index) gd_nothrow { gd_entry_t B; dtrace("%p, \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, bitnum, numbits, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&B, 0, sizeof(gd_entry_t)); B.field = (char *)field_code; B.field_type = GD_BIT_ENTRY; B.in_fields[0] = (char *)in_field; B.EN(bit,bitnum) = bitnum; B.EN(bit,numbits) = numbits; B.fragment_index = fragment_index; if (_GD_Add(D, &B, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a SBIT entry */ int gd_add_sbit(DIRFILE* D, const char* field_code, const char* in_field, int bitnum, int numbits, int fragment_index) gd_nothrow { gd_entry_t B; dtrace("%p, \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, bitnum, numbits, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&B, 0, sizeof(gd_entry_t)); B.field = (char *)field_code; B.field_type = GD_SBIT_ENTRY; B.in_fields[0] = (char *)in_field; B.EN(bit,bitnum) = bitnum; B.EN(bit,numbits) = numbits; B.fragment_index = fragment_index; if (_GD_Add(D, &B, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } static int _GD_AddYoke(DIRFILE* D, gd_entype_t t, const char* field_code, const char* in_field1, const char* in_field2, int fragment_index) gd_nothrow { gd_entry_t M; dtrace("%p, 0x%X, \"%s\", \"%s\", \"%s\", %i", D, t, field_code, in_field1, in_field2, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&M, 0, sizeof(gd_entry_t)); M.field = (char *)field_code; M.field_type = t; M.in_fields[0] = (char *)in_field1; M.in_fields[1] = (char *)in_field2; M.fragment_index = fragment_index; if (_GD_Add(D, &M, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int gd_add_multiply(DIRFILE* D, const char* field_code, const char* in_field1, const char* in_field2, int fragment_index) gd_nothrow { return _GD_AddYoke(D, GD_MULTIPLY_ENTRY, field_code, in_field1, in_field2, fragment_index); } int gd_add_divide(DIRFILE* D, const char* field_code, const char* in_field1, const char* in_field2, int fragment_index) gd_nothrow { return _GD_AddYoke(D, GD_DIVIDE_ENTRY, field_code, in_field1, in_field2, fragment_index); } /* add a RECIP entry */ int gd_add_recip(DIRFILE* D, const char* field_code, const char* in_field, double dividend, int fragment_index) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", %g, %i", D, field_code, in_field, dividend, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_RECIP_ENTRY; E.EN(recip,dividend) = dividend; E.in_fields[0] = (char *)in_field; E.fragment_index = fragment_index; if (_GD_Add(D, &E, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } #ifndef GD_NO_C99_API int gd_add_crecip(DIRFILE* D, const char* field_code, const char* in_field, double complex cdividend, int fragment_index) gd_nothrow { int error; dtrace("%p, \"%s\", \"%s\", %g;%g, %i", D, field_code, in_field, creal(cdividend), cimag(cdividend), fragment_index); error = gd_add_crecip89(D, field_code, in_field, (const double*)(&cdividend), fragment_index); dreturn("%i", error); return error; } #endif int gd_add_crecip89(DIRFILE* D, const char* field_code, const char* in_field, const double cdividend[2], int fragment_index) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", {%g, %g}, %i", D, field_code, in_field, cdividend[0], cdividend[1], fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_RECIP_ENTRY; gd_ra2cs_(E.EN(recip,cdividend), cdividend); E.flags = GD_EN_COMPSCAL; E.in_fields[0] = (char *)in_field; E.fragment_index = fragment_index; if (_GD_Add(D, &E, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a POLYNOM entry */ int gd_add_polynom(DIRFILE* D, const char* field_code, int poly_ord, const char* in_field, const double* a, int fragment_index) gd_nothrow { int i; gd_entry_t E; dtrace("%p, \"%s\", %i, \"%s\", %p, %i", D, field_code, poly_ord, in_field, a, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (poly_ord < 1 || poly_ord > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_POLYNOM_ENTRY; E.EN(polynom,poly_ord) = poly_ord; E.fragment_index = fragment_index; E.in_fields[0] = (char *)in_field; for (i = 0; i <= poly_ord; ++i) E.EN(polynom,a)[i] = a[i]; if (_GD_Add(D, &E, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int gd_add_cpolynom(DIRFILE* D, const char* field_code, int poly_ord, const char* in_field, const GD_DCOMPLEXP(ca), int fragment_index) gd_nothrow { int i; gd_entry_t E; dtrace("%p, \"%s\", %i, \"%s\", %p, %i", D, field_code, poly_ord, in_field, ca, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (poly_ord < 1 || poly_ord > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_POLYNOM_ENTRY; E.EN(polynom,poly_ord) = poly_ord; E.fragment_index = fragment_index; E.flags = GD_EN_COMPSCAL; E.in_fields[0] = (char *)in_field; for (i = 0; i <= poly_ord; ++i) gd_ca2cs_(E.EN(polynom,ca)[i], ca, i); if (_GD_Add(D, &E, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a PHASE entry */ int gd_add_phase(DIRFILE* D, const char* field_code, const char* in_field, gd_shift_t shift, int fragment_index) gd_nothrow { gd_entry_t P; dtrace("%p, \"%s\", \"%s\", %lli, %i", D, field_code, in_field, (long long)shift, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&P, 0, sizeof(gd_entry_t)); P.field = (char *)field_code; P.field_type = GD_PHASE_ENTRY; P.in_fields[0] = (char *)in_field; P.EN(phase,shift) = shift; P.fragment_index = fragment_index; if (_GD_Add(D, &P, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a WINDOW entry */ int gd_add_window(DIRFILE *D, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold, int fragment_index) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}, %i", D, field_code, in_field, check_field, windop, threshold.r, (unsigned long long)threshold.u, (long long)threshold.i, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_WINDOW_ENTRY; E.EN(window,threshold) = threshold; E.EN(window,windop) = windop; E.in_fields[0] = (char *)in_field; E.in_fields[1] = (char *)check_field; E.fragment_index = fragment_index; if (_GD_Add(D, &E, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a MPLEX entry */ int gd_add_mplex(DIRFILE *D, const char *field_code, const char *in_field, const char *count_field, int count_val, int period, int fragment_index) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %i, %i", D, field_code, in_field, count_field, count_val, period, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_MPLEX_ENTRY; E.EN(mplex,count_val) = count_val; E.EN(mplex,period) = period; E.in_fields[0] = (char *)in_field; E.in_fields[1] = (char *)count_field; E.fragment_index = fragment_index; if (_GD_Add(D, &E, NULL) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a STRING entry */ int gd_add_string(DIRFILE* D, const char* field_code, const char* value, int fragment_index) gd_nothrow { gd_entry_t *entry; gd_entry_t S; char *ptr; dtrace("%p, \"%s\", \"%s\", %i", D, field_code, value, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&S, 0, sizeof(gd_entry_t)); S.field = (char *)field_code; S.field_type = GD_STRING_ENTRY; S.fragment_index = fragment_index; /* duplicate early, in case of failure */ ptr = _GD_Strdup(D, value); if (ptr == NULL) { dreturn("%i", -1); return -1; } entry = _GD_Add(D, &S, NULL); if (D->error) { free(ptr); dreturn("%i", -1); return -1; } entry->e->u.string = ptr; dreturn("%i", 0); return 0; } /* add a CONST entry */ int gd_add_const(DIRFILE* D, const char* field_code, gd_type_t const_type, gd_type_t data_type, const void* value, int fragment_index) gd_nothrow { gd_entry_t *entry; gd_entry_t C; dtrace("%p, \"%s\", 0x%X, 0x%X, %p, %i", D, field_code, const_type, data_type, value, fragment_index); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&C, 0, sizeof(gd_entry_t)); C.field = (char *)field_code; C.field_type = GD_CONST_ENTRY; C.EN(scalar,const_type) = const_type; C.fragment_index = fragment_index; entry = _GD_Add(D, &C, NULL); /* Actually store the constant, now */ if (entry) _GD_DoFieldOut(D, entry, 0, 1, data_type, value); dreturn("%i", D->error ? -1 : 0); return D->error ? -1 : 0; } /* add a CARRAY entry */ int gd_add_carray(DIRFILE* D, const char* field_code, gd_type_t const_type, size_t array_len, gd_type_t data_type, const void* values, int fragment_index) gd_nothrow { gd_entry_t *entry; gd_entry_t C; dtrace("%p, \"%s\", 0x%X, %" PRNsize_t ", 0x%X, %p, %i", D, field_code, const_type, array_len, data_type, values, fragment_index); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&C, 0, sizeof(gd_entry_t)); C.field = (char *)field_code; C.field_type = GD_CARRAY_ENTRY; C.EN(scalar,const_type) = const_type; C.EN(scalar,array_len) = array_len; C.fragment_index = fragment_index; entry = _GD_Add(D, &C, NULL); /* Actually store the carray, now */ if (entry) _GD_DoFieldOut(D, entry, 0, array_len, data_type, values); dreturn("%i", D->error ? -1 : 0); return D->error ? -1 : 0; } int gd_madd(DIRFILE* D, const gd_entry_t* entry, const char* parent) gd_nothrow { int ret; dtrace("%p, %p, \"%s\"", D, entry, parent); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } ret = (_GD_Add(D, entry, parent) == NULL) ? -1 : 0; dreturn("%i", ret); return ret; } /* add a META LINCOM entry */ int gd_madd_lincom(DIRFILE* D, const char* parent, const char* field_code, int n_fields, const char** in_fields, const double* m, const double* b) gd_nothrow { int i; gd_entry_t L; dtrace("%p, \"%s\", \"%s\", %i, %p, %p, %p", D, field_code, parent, n_fields, in_fields, m, b); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (n_fields < 1 || n_fields > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL); dreturn("%i", -1); return -1; } memset(&L, 0, sizeof(gd_entry_t)); L.field = (char *)field_code; L.field_type = GD_LINCOM_ENTRY; L.EN(lincom,n_fields) = n_fields; L.fragment_index = 0; for (i = 0; i < n_fields; ++i) { L.in_fields[i] = (char *)in_fields[i]; L.EN(lincom,m)[i] = m[i]; L.EN(lincom,b)[i] = b[i]; L.scalar[i] = NULL; L.scalar[i + GD_MAX_LINCOM] = NULL; } if (_GD_Add(D, &L, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META LINCOM entry, with complex scalaras */ int gd_madd_clincom(DIRFILE* D, const char* parent, const char* field_code, int n_fields, const char** in_fields, const GD_DCOMPLEXP(cm), const GD_DCOMPLEXP(cb)) gd_nothrow { int i; gd_entry_t L; dtrace("%p, \"%s\", \"%s\", %i, %p, %p, %p", D, field_code, parent, n_fields, in_fields, cm, cb); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (n_fields < 1 || n_fields > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, NULL, n_fields, NULL); dreturn("%i", -1); return -1; } memset(&L, 0, sizeof(gd_entry_t)); L.field = (char *)field_code; L.field_type = GD_LINCOM_ENTRY; L.EN(lincom,n_fields) = n_fields; L.flags = GD_EN_COMPSCAL; L.fragment_index = 0; for (i = 0; i < n_fields; ++i) { L.in_fields[i] = (char *)in_fields[i]; gd_ca2cs_(L.EN(lincom,cm)[i], cm, i); gd_ca2cs_(L.EN(lincom,cb)[i], cb, i); L.scalar[i] = NULL; L.scalar[i + GD_MAX_LINCOM] = NULL; } if (_GD_Add(D, &L, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META LINTERP entry */ int gd_madd_linterp(DIRFILE* D, const char* parent, const char* field_code, const char* in_field, const char* table) gd_nothrow { gd_entry_t L; dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\"", D, field_code, parent, in_field, table); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&L, 0, sizeof(gd_entry_t)); L.field = (char *)field_code; L.field_type = GD_LINTERP_ENTRY; L.in_fields[0] = (char *)in_field; L.EN(linterp,table) = (char *)table; L.fragment_index = 0; if (_GD_Add(D, &L, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META BIT entry */ int gd_madd_bit(DIRFILE* D, const char* parent, const char* field_code, const char* in_field, int bitnum, int numbits) gd_nothrow { gd_entry_t B; dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %in", D, field_code, parent, in_field, bitnum, numbits); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&B, 0, sizeof(gd_entry_t)); B.field = (char *)field_code; B.field_type = GD_BIT_ENTRY; B.in_fields[0] = (char *)in_field; B.EN(bit,bitnum) = bitnum; B.EN(bit,numbits) = numbits; B.fragment_index = 0; B.scalar[0] = B.scalar[1] = NULL; if (_GD_Add(D, &B, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META SBIT entry */ int gd_madd_sbit(DIRFILE* D, const char* parent, const char* field_code, const char* in_field, int bitnum, int numbits) gd_nothrow { gd_entry_t B; dtrace("%p, \"%s\", \"%s\", \"%s\", %i, %in", D, field_code, parent, in_field, bitnum, numbits); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&B, 0, sizeof(gd_entry_t)); B.field = (char *)field_code; B.field_type = GD_SBIT_ENTRY; B.in_fields[0] = (char *)in_field; B.EN(bit,bitnum) = bitnum; B.EN(bit,numbits) = numbits; B.fragment_index = 0; B.scalar[0] = B.scalar[1] = NULL; if (_GD_Add(D, &B, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } static int _GD_MAddYoke(DIRFILE* D, gd_entype_t t, const char* parent, const char* field_code, const char* in_field1, const char* in_field2) gd_nothrow { gd_entry_t M; dtrace("%p, 0x%X, \"%s\", \"%s\", \"%s\", \"%s\"", D, t, field_code, parent, in_field1, in_field2); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&M, 0, sizeof(gd_entry_t)); M.field = (char *)field_code; M.field_type = t; M.in_fields[0] = (char *)in_field1; M.in_fields[1] = (char *)in_field2; M.fragment_index = 0; if (_GD_Add(D, &M, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int gd_madd_multiply(DIRFILE* D, const char *parent, const char* field_code, const char* in_field1, const char* in_field2) gd_nothrow { return _GD_MAddYoke(D, GD_MULTIPLY_ENTRY, parent, field_code, in_field1, in_field2); } /* add a META PHASE entry */ int gd_madd_phase(DIRFILE* D, const char* parent, const char* field_code, const char* in_field, gd_shift_t shift) gd_nothrow { gd_entry_t P; dtrace("%p, \"%s\", \"%s\", \"%s\", %lli", D, field_code, parent, in_field, (long long)shift); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&P, 0, sizeof(gd_entry_t)); P.field = (char *)field_code; P.field_type = GD_PHASE_ENTRY; P.in_fields[0] = (char *)in_field; P.EN(phase,shift) = shift; P.fragment_index = 0; P.scalar[0] = NULL; if (_GD_Add(D, &P, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META POLYNOM entry */ int gd_madd_polynom(DIRFILE* D, const char* parent, const char* field_code, int poly_ord, const char* in_field, const double* a) gd_nothrow { int i; gd_entry_t E; dtrace("%p, \"%s\", \"%s\", %i, \"%s\", %p", D, field_code, parent, poly_ord, in_field, a); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (poly_ord < 1 || poly_ord > GD_MAX_POLYORD) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_POLYNOM_ENTRY; E.EN(polynom,poly_ord) = poly_ord; E.fragment_index = 0; E.in_fields[0] = (char *)in_field; for (i = 0; i <= poly_ord; ++i) { E.EN(polynom,a)[i] = a[i]; E.scalar[i] = NULL; } if (_GD_Add(D, &E, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META POLYNOM entry */ int gd_madd_cpolynom(DIRFILE* D, const char* parent, const char* field_code, int poly_ord, const char* in_field, const GD_DCOMPLEXP(ca)) gd_nothrow { int i; gd_entry_t E; dtrace("%p, \"%s\", \"%s\", %i, \"%s\", %p", D, field_code, parent, poly_ord, in_field, ca); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (poly_ord < 1 || poly_ord > GD_MAX_POLYORD) { _GD_SetError(D, GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, NULL, poly_ord, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_POLYNOM_ENTRY; E.EN(polynom,poly_ord) = poly_ord; E.fragment_index = 0; E.flags = GD_EN_COMPSCAL; E.in_fields[0] = (char *)in_field; for (i = 0; i <= poly_ord; ++i) { gd_ca2cs_(E.EN(polynom,ca)[i], ca, i); E.scalar[i] = NULL; } if (_GD_Add(D, &E, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int gd_madd_divide(DIRFILE* D, const char *parent, const char* field_code, const char* in_field1, const char* in_field2) gd_nothrow { return _GD_MAddYoke(D, GD_DIVIDE_ENTRY, parent, field_code, in_field1, in_field2); } /* add a RECIP entry */ int gd_madd_recip(DIRFILE* D, const char *parent, const char* field_code, const char* in_field, double dividend) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", \"%s\", %g", D, parent, field_code, in_field, dividend); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_RECIP_ENTRY; E.EN(recip,dividend) = dividend; E.in_fields[0] = (char *)in_field; if (_GD_Add(D, &E, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } #ifndef GD_NO_C99_API int gd_madd_crecip(DIRFILE* D, const char *parent, const char* field_code, const char* in_field, double complex cdividend) { int error; dtrace("%p, \"%s\", \"%s\", \"%s\", %g;%g", D, parent, field_code, in_field, creal(cdividend), cimag(cdividend)); error = gd_madd_crecip89(D, parent, field_code, in_field, (const double*)(&cdividend)); dreturn("%i", error); return error; } #endif int gd_madd_crecip89(DIRFILE* D, const char *parent, const char* field_code, const char* in_field, const double cdividend[2]) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", \"%s\", {%g, %g}", D, parent, field_code, in_field, cdividend[0], cdividend[1]); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_RECIP_ENTRY; gd_ra2cs_(E.EN(recip,cdividend), cdividend); E.flags = GD_EN_COMPSCAL; E.in_fields[0] = (char *)in_field; if (_GD_Add(D, &E, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META WINDOW entry */ int gd_madd_window(DIRFILE *D, const char *parent, const char *field_code, const char *in_field, const char *check_field, gd_windop_t windop, gd_triplet_t threshold) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\", %i, {%g,%llx,%lli}", D, parent, field_code, in_field, check_field, windop, threshold.r, (unsigned long long)threshold.u, (long long)threshold.i); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_WINDOW_ENTRY; E.EN(window,threshold) = threshold; E.EN(window,windop) = windop; E.in_fields[0] = (char *)in_field; E.in_fields[1] = (char *)check_field; if (_GD_Add(D, &E, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META MPLEX entry */ int gd_madd_mplex(DIRFILE *D, const char *parent, const char *field_code, const char *in_field, const char *count_field, int count_val, int period) gd_nothrow { gd_entry_t E; dtrace("%p, \"%s\", \"%s\", \"%s\", \"%s\", %i, %i", D, parent, field_code, in_field, count_field, count_val, period); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&E, 0, sizeof(gd_entry_t)); E.field = (char *)field_code; E.field_type = GD_MPLEX_ENTRY; E.EN(mplex,count_val) = count_val; E.EN(mplex,period) = period; E.in_fields[0] = (char *)in_field; E.in_fields[1] = (char *)count_field; if (_GD_Add(D, &E, parent) == NULL) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } /* add a META STRING entry */ int gd_madd_string(DIRFILE* D, const char* parent, const char* field_code, const char* value) gd_nothrow { gd_entry_t *entry; gd_entry_t S; char *ptr; dtrace("%p, \"%s\", \"%s\", \"%s\"", D, parent, field_code, value); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&S, 0, sizeof(gd_entry_t)); S.field = (char *)field_code; S.field_type = GD_STRING_ENTRY; S.fragment_index = 0; /* duplicate early, in case of failure */ ptr = _GD_Strdup(D, value); if (ptr == NULL) { dreturn("%i", -1); return -1; } entry = _GD_Add(D, &S, parent); if (D->error) { free(ptr); dreturn("%i", -1); return -1; } entry->e->u.string = ptr; dreturn("%i", 0); return 0; } /* add a META CONST entry */ int gd_madd_const(DIRFILE* D, const char* parent, const char* field_code, gd_type_t const_type, gd_type_t data_type, const void* value) gd_nothrow { gd_entry_t *entry; gd_entry_t C; dtrace("%p, \"%s\", \"%s\", 0x%X, 0x%X, %p", D, parent, field_code, const_type, data_type, value); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&C, 0, sizeof(gd_entry_t)); C.field = (char *)field_code; C.field_type = GD_CONST_ENTRY; C.EN(scalar,const_type) = const_type; C.fragment_index = 0; entry = _GD_Add(D, &C, parent); /* Actually store the constant, now */ if (entry) _GD_DoFieldOut(D, entry, 0, 1, data_type, value); dreturn("%i", D->error ? -1 : 0); return D->error ? -1 : 0; } /* add a META CARRAY entry */ int gd_madd_carray(DIRFILE* D, const char* parent, const char* field_code, gd_type_t const_type, size_t array_len, gd_type_t data_type, const void* values) gd_nothrow { gd_entry_t *entry; gd_entry_t C; dtrace("%p, \"%s\", \"%s\", 0x%X, %" PRNsize_t ", 0x%X, %p", D, parent, field_code, const_type, array_len, data_type, values); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } memset(&C, 0, sizeof(gd_entry_t)); C.field = (char *)field_code; C.field_type = GD_CARRAY_ENTRY; C.EN(scalar,const_type) = const_type; C.EN(scalar,array_len) = array_len; C.fragment_index = 0; entry = _GD_Add(D, &C, parent); /* Actually store the carray, now */ if (entry) _GD_DoFieldOut(D, entry, 0, array_len, data_type, values); dreturn("%i", D->error ? -1 : 0); return D->error ? -1 : 0; } /* add an alias */ static int _GD_AddAlias(DIRFILE *restrict D, const char *restrict parent, const char *restrict field_code, const char *restrict target, int fragment_index) { unsigned u; int offset; char *munged_code = NULL; void *ptr; gd_entry_t *E = NULL, *P = NULL; dtrace("%p, \"%s\", \"%s\", \"%s\", %i", D, parent, field_code, target, fragment_index); /* Early checks */ if (D->flags & GD_INVALID) _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); else if ((D->flags & GD_ACCMODE) == GD_RDONLY) _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); else if (fragment_index < 0 || fragment_index >= D->n_fragment) _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL); else if (D->fragment[fragment_index].protection & GD_PROTECT_FORMAT) _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[fragment_index].cname); if (D->error) { dreturn("%i", -1); return -1; } _GD_ClearError(D); if (parent != NULL) { /* look for parent */ P = _GD_FindField(D, parent, D->entry, D->n_entries, 1, NULL); if (P == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, parent); goto add_alias_error; } fragment_index = P->fragment_index; /* make sure it's not a meta field already */ if (P->e->n_meta == -1) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, parent); goto add_alias_error; } offset = strlen(parent) + 1; munged_code = (char *)_GD_Malloc(D, offset + strlen(field_code) + 1); if (munged_code == NULL) goto add_alias_error; strcpy(munged_code, parent); munged_code[offset - 1] = '/'; strcpy(munged_code + offset, field_code); } else { /* this will check for affixes and take care of detecting Barth-style * metafield definitions */ P = _GD_FixName(D, &munged_code, field_code, fragment_index, &offset); if (D->error) goto add_alias_error; } /* check alias name */ if (_GD_ValidateField(munged_code + offset, D->standards, 1, GD_VF_CODE, NULL)) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, field_code); } else if (_GD_FindField(D, munged_code, D->entry, D->n_entries, 0, &u)) _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, munged_code); else _GD_CheckCodeAffixes(D, target, fragment_index, 1); /* check target */ if (D->error) goto add_alias_error; ptr = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*)); if (ptr == NULL) goto add_alias_error; D->entry = (gd_entry_t **)ptr; /* create and store */ E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) goto add_alias_error; memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) goto add_alias_error; memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field = munged_code; E->fragment_index = fragment_index; E->in_fields[0] = _GD_Strdup(D, target); E->field_type = GD_ALIAS_ENTRY; E->flags |= GD_EN_CALC; if (D->error) { _GD_FreeE(D, E, 1); dreturn("%i", -1); return -1; } /* add the entry and resort the entry list */ _GD_InsertSort(D, E, u); D->n_entries++; D->fragment[fragment_index].modified = 1; D->flags &= ~GD_HAVE_VERSION; /* Invalidate the field lists */ if (P) { P->e->value_list_validity = 0; P->e->entry_list_validity = 0; } else { D->value_list_validity = 0; D->entry_list_validity = 0; } /* Update aliases */ _GD_UpdateAliases(D, 0); dreturn("%i", 0); return 0; add_alias_error: free(E); free(munged_code); dreturn("%i", -1); return -1; } int gd_add_alias(DIRFILE *D, const char *alias_name, const char *target_code, int fragment_index) gd_nothrow { int ret; dtrace("%p, \"%s\", \"%s\", %i", D, alias_name, target_code, fragment_index); _GD_ClearError(D); ret = _GD_AddAlias(D, NULL, alias_name, target_code, fragment_index); dreturn("%i", ret); return ret; } int gd_madd_alias(DIRFILE *D, const char *parent, const char *alias_name, const char *target_code) gd_nothrow { int ret; dtrace("%p, \"%s\", \"%s\", \"%s\"", D, parent, alias_name, target_code); _GD_ClearError(D); ret = _GD_AddAlias(D, parent, alias_name, target_code, 0); dreturn("%i", ret); return ret; } libgetdata-0.9.0/src/putdata.c0000640000175000017500000005656112614323564016416 0ustar alastairalastair/* Copyright (C) 2003-2005 C. Barth Netterfield * Copyright (C) 2003-2005 Theodore Kisner * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static size_t _GD_DoRawOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t s0, size_t ns, gd_type_t data_type, const void *restrict data_in) { ssize_t n_wrote; void *databuffer; /* check protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", 0); return 0; } dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)s0, ns, data_type, data_in); if (s0 < D->fragment[E->fragment_index].frame_offset * E->EN(raw,spf)) { _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL); dreturn("%i", 0); return 0; } s0 -= D->fragment[E->fragment_index].frame_offset * E->EN(raw,spf); if (!_GD_Supports(D, E, GD_EF_OPEN | GD_EF_SEEK | GD_EF_WRITE)) { dreturn("%i", 0); return 0; } databuffer = _GD_Alloc(D, E->EN(raw,data_type), ns); if (databuffer == NULL) { dreturn("%i", 0); return 0; } _GD_ConvertType(D, data_in, data_type, databuffer, E->EN(raw,data_type), ns); if (D->error) { /* bad input type */ free(databuffer); dreturn("%i", 0); return 0; } /* fix endianness, if necessary */ if (_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_ECOR) _GD_FixEndianness(databuffer, ns, E->EN(raw,data_type), 0, D->fragment[E->fragment_index].byte_sex); /* write data to file. */ if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_WRITE, _GD_FileSwapBytes(D, E))) { free(databuffer); dreturn("%i", 0); return 0; } if (_GD_DoSeek(D, E, _GD_ef + E->e->u.raw.file[0].subenc, s0, GD_FILE_WRITE) == -1) { free(databuffer); dreturn("%i", 0); return 0; } n_wrote = _GD_WriteOut(E, _GD_ef + E->e->u.raw.file[0].subenc, databuffer, E->EN(raw,data_type), ns, 0); if (n_wrote < 0) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0); n_wrote = 0; } free(databuffer); dreturn("%" PRNssize_t, n_wrote); return (size_t)n_wrote; } static size_t _GD_DoLinterpOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote; int dir = -1, i; double *tmpbuf; struct gd_lut_ *tmp_lut; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } /* if the table is complex valued, we can't invert it */ if (E->e->u.linterp.complex_table) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, NULL, 0, NULL); dreturn("%i", 0); return 0; } if (E->e->u.linterp.table_len < 0) { _GD_ReadLinterpFile(D, E); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } } /* Check whether the LUT is monotonic */ if (E->e->u.linterp.table_monotonic == -1) { E->e->u.linterp.table_monotonic = 1; for (i = 1; i < E->e->u.linterp.table_len; ++i) if (E->e->u.linterp.lut[i].y.r != E->e->u.linterp.lut[i - 1].y.r) { if (dir == -1) dir = (E->e->u.linterp.lut[i].y.r > E->e->u.linterp.lut[i - 1].y.r); else if (dir != (E->e->u.linterp.lut[i].y.r > E->e->u.linterp.lut[i - 1].y.r)) { E->e->u.linterp.table_monotonic = 0; break; } } } /* Can't invert a non-monotonic function */ if (E->e->u.linterp.table_monotonic == 0) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_ANTITONIC, NULL, 0, NULL); dreturn("%i", 0); return 0; } tmpbuf = _GD_Alloc(D, GD_FLOAT64, num_samp); if (tmpbuf == NULL) { free(tmpbuf); dreturn("%i", 0); return 0; } _GD_ConvertType(D, data_in, data_type, tmpbuf, GD_FLOAT64, num_samp); if (D->error) { free(tmpbuf); dreturn("%i", 0); return 0; } /* Make the reverse lut */ tmp_lut = _GD_Malloc(D, E->e->u.linterp.table_len * sizeof(*tmp_lut)); if (tmp_lut == NULL) { free(tmpbuf); dreturn("%i", 0); return 0; } for (i = 0; i < E->e->u.linterp.table_len; ++i) { tmp_lut[i].x = E->e->u.linterp.lut[i].y.r; tmp_lut[i].y.r = E->e->u.linterp.lut[i].x; } _GD_LinterpData(D, tmpbuf, GD_FLOAT64, 0, tmpbuf, num_samp, tmp_lut, E->e->u.linterp.table_len); free(tmp_lut); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, GD_FLOAT64, tmpbuf); free(tmpbuf); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } static size_t _GD_DoLincomOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote; void* tmpbuf; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); /* we cannot write to LINCOM fields that are a linear combination */ /* of more than one raw field (no way to know how to split data). */ if (E->EN(lincom,n_fields) > 1) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field); dreturn("%i", 0); return 0; } if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } /* writeable copy */ tmpbuf = _GD_Alloc(D, data_type, num_samp); if (tmpbuf == NULL) { dreturn("%i", 0); return 0; } memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type)); if (E->flags & GD_EN_COMPSCAL) { #ifdef GD_NO_C99_API double cm[1][2]; double cb[1][2]; const double d = E->EN(lincom,cm)[0][0] * E->EN(lincom,cm)[0][0] + E->EN(lincom,cm)[0][1] * E->EN(lincom,cm)[0][1]; cm[0][0] = E->EN(lincom,cm)[0][0] / d; cm[0][1] = -E->EN(lincom,cm)[0][1] / d; cb[0][0] = -(E->EN(lincom,cb)[0][0] * E->EN(lincom,cm)[0][0] + E->EN(lincom,cb)[0][1] * E->EN(lincom,cm)[0][1]) / d; cb[0][1] = -(E->EN(lincom,cb)[0][1] * E->EN(lincom,cm)[0][0] - E->EN(lincom,cb)[0][0] * E->EN(lincom,cm)[0][1]) / d; _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, cm, cb, NULL, num_samp); #else double complex cm = 1 / E->EN(lincom,cm)[0]; double complex cb = -E->EN(lincom,cb)[0] / E->EN(lincom,cm)[0]; _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, &cm, &cb, NULL, num_samp); #endif } else { double m = 1 / E->EN(lincom,m)[0]; double b = -E->EN(lincom,b)[0] / E->EN(lincom,m)[0]; _GD_LincomData(D, 1, tmpbuf, data_type, NULL, NULL, &m, &b, NULL, num_samp); } if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type, tmpbuf); free(tmpbuf); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } static size_t _GD_DoBitOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { uint64_t *tmpbuf; uint64_t *readbuf; size_t i, n_wrote; const uint64_t mask = (E->EN(bit,numbits) == 64) ? 0xffffffffffffffffULL : ((uint64_t)1 << E->EN(bit,numbits)) - 1; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } tmpbuf = _GD_Alloc(D, GD_UINT64, num_samp); readbuf = _GD_Alloc(D, GD_UINT64, num_samp); if (tmpbuf == NULL || readbuf == NULL) { free(tmpbuf); free(readbuf); dreturn("%i", 0); return 0; } memset(tmpbuf, 0, sizeof(uint64_t) * num_samp); memset(readbuf, 0, sizeof(uint64_t) * num_samp); _GD_ConvertType(D, data_in, data_type, (void*)tmpbuf, GD_UINT64, num_samp); /* first, READ the field in so that we can change the bits */ _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, GD_UINT64, readbuf); /* error encountered, abort */ if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* now go through and set the correct bits in each field value */ for (i = 0; i < num_samp; i++) readbuf[i] = (readbuf[i] & ~(mask << E->EN(bit,bitnum))) | (tmpbuf[i] & mask) << E->EN(bit,bitnum); /* write the modified data out */ n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, GD_UINT64, (void*)readbuf); free(readbuf); free(tmpbuf); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } static size_t _GD_DoPhaseOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp + E->EN(phase,shift), num_samp, data_type, data_in); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } static size_t _GD_DoRecipOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote; void* tmpbuf; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } /* writeable copy */ tmpbuf = _GD_Alloc(D, data_type, num_samp); if (tmpbuf == NULL) { dreturn("%i", 0); return 0; } memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type)); /* calculate x = a/y instead of y = a/x */ if (E->flags & GD_EN_COMPSCAL) _GD_CInvertData(D, tmpbuf, data_type, E->EN(recip,cdividend), num_samp); else _GD_InvertData(D, tmpbuf, data_type, E->EN(recip,dividend), num_samp); if (D->error) { free(tmpbuf); dreturn("%i", 0); return 0; } n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type, tmpbuf); free(tmpbuf); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } static size_t _GD_DoPolynomOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote; void* tmpbuf; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); /* we cannot write to POLYNOM fields that are quadradic or higher order */ if (E->EN(polynom,poly_ord) > 1) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field); dreturn("%i", 0); return 0; } if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } /* do the inverse scaling */ if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* writeable copy */ tmpbuf = _GD_Alloc(D, data_type, num_samp); if (tmpbuf == NULL) { dreturn("%i", 0); return 0; } memcpy(tmpbuf, data_in, num_samp * GD_SIZE(data_type)); if (E->flags & GD_EN_COMPSCAL) { #ifdef GD_NO_C99_API double cm[1][2]; double cb[1][2]; const double d = E->EN(polynom,ca)[1][0] * E->EN(polynom,ca)[1][0] + E->EN(polynom,ca)[1][1] * E->EN(polynom,ca)[1][1]; cm[0][0] = E->EN(polynom,ca)[1][0] / d; cm[0][1] = -E->EN(polynom,ca)[1][1] / d; cb[0][0] = -(E->EN(polynom,ca)[0][0] * E->EN(polynom,ca)[1][0] + E->EN(polynom,ca)[0][1] * E->EN(polynom,ca)[1][1]) / d; cb[0][1] = -(E->EN(polynom,ca)[0][1] * E->EN(polynom,ca)[1][0] - E->EN(polynom,ca)[0][0] * E->EN(polynom,ca)[1][1]) / d; _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, cm, cb, NULL, num_samp); #else double complex cm = 1 / E->EN(polynom,ca)[1]; double complex cb = -E->EN(polynom,ca)[0] / E->EN(polynom,ca)[1]; _GD_CLincomData(D, 1, tmpbuf, data_type, NULL, NULL, &cm, &cb, NULL, num_samp); #endif } else { double m = 1 / E->EN(polynom,a)[1]; double b = -E->EN(polynom,a)[0] / E->EN(polynom,a)[1]; _GD_LincomData(D, 1, tmpbuf, data_type, NULL, NULL, &m, &b, NULL, num_samp); } if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type, tmpbuf); free(tmpbuf); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } #define MPLEX(t) \ for (i = 0; i < n; i++) \ if (B[i] == val) \ ((t*)A)[i] = ((t*)C)[i * spfB / spfA]; #define MPLEXC(t) \ do { \ for (i = 0; i < n; i++) \ if (B[i] == val) { \ ((t*)A)[i * 2] = ((t*)C)[i * 2 * spfB / spfA]; \ ((t*)A)[i * 2 + 1] = ((t*)C)[i * 2 * spfB / spfA + 1]; \ } \ } while (0) static void _GD_MplexOutData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, const int *restrict B, unsigned int spfB, const void *restrict C, gd_type_t type, int val, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, %p, 0x%X %i, %" PRNsize_t, D, A, spfA, B, spfB, C, type, val, n); switch (type) { case GD_NULL: break; case GD_UINT8: MPLEX( uint8_t); break; case GD_INT8: MPLEX( int8_t); break; case GD_UINT16: MPLEX(uint16_t); break; case GD_INT16: MPLEX( int16_t); break; case GD_UINT32: MPLEX(uint32_t); break; case GD_INT32: MPLEX( int32_t); break; case GD_UINT64: MPLEX(uint64_t); break; case GD_INT64: MPLEX( int64_t); break; case GD_FLOAT32: MPLEX( float); break; case GD_FLOAT64: MPLEX( double); break; case GD_COMPLEX64: MPLEXC( float); break; case GD_COMPLEX128: MPLEXC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } static size_t _GD_DoMplexOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote = 0, num_samp2; void *tmpbuf; int *cntbuf; off64_t first_samp2; unsigned int spf1, spf2; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (E->e->repr[0] != GD_REPR_NONE) { /* can't write to representaions */ _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_REPR, NULL, 0, E->in_fields[0]); dreturn("%i", 0); return 0; } if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* read the data to be modified */ spf1 = _GD_GetSPF(D, E->e->entry[0]); spf2 = _GD_GetSPF(D, E->e->entry[1]); if (D->error) { dreturn("%i", 0); return 0; } num_samp2 = (int)ceil((double)num_samp * spf2 / spf1); first_samp2 = first_samp * spf2 / spf1; tmpbuf = _GD_Alloc(D, data_type, num_samp); cntbuf = _GD_Alloc(D, GD_INT_TYPE, num_samp2); if (tmpbuf == NULL || cntbuf == NULL) { free(cntbuf); free(tmpbuf); dreturn("%i", 0); return 0; } memset(tmpbuf, 0, num_samp * GD_SIZE(data_type)); memset(cntbuf, 0, num_samp2 * GD_SIZE(GD_INT_TYPE)); _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, data_type, tmpbuf); _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2, GD_INT_TYPE, cntbuf); if (D->error != GD_E_OK) { free(cntbuf); free(tmpbuf); dreturn("%i", 0); return 0; } /* enmultiplex the data */ _GD_MplexOutData(D, tmpbuf, spf1, cntbuf, spf2, data_in, data_type, E->EN(mplex,count_val), num_samp); free(cntbuf); /* and write it. */ if (!D->error) n_wrote = _GD_DoFieldOut(D, E->e->entry[0], first_samp, num_samp, data_type, tmpbuf); free(tmpbuf); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } static size_t _GD_DoConstOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first, size_t len, gd_type_t data_type, const void *restrict data_in) { dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first, len, data_type, data_in); /* check protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT) _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); else { gd_type_t type = _GD_ConstType(D, E->EN(scalar,const_type)); _GD_ConvertType(D, data_in, data_type, (char*)E->e->u.scalar.d + first * GD_SIZE(type), type, len); } if (D->error) { /* bad input type */ dreturn("%i", 0); return 0; } D->fragment[E->fragment_index].modified = 1; dreturn("%i", 1); return 1; } size_t _GD_DoFieldOut(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t data_type, const void *restrict data_in) { size_t n_wrote = 0; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, data_type, data_in); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%i", 0); return 0; } if (!(E->flags & GD_EN_CALC)) { _GD_CalculateEntry(D, E, 1); if (D->error) { D->recurse_level--; dreturn("%i", 0); return 0; } } /* this call will throw GD_E_DOMAIN if a problem arises; however, that only * happens in cases where the field has multiple inputs, which putdata will * reject anyways; so we ignore this error for a more relevant one later */ if (first_samp == GD_HERE) first_samp = _GD_GetFilePos(D, E, -1); switch (E->field_type) { case GD_RAW_ENTRY: n_wrote = _GD_DoRawOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_LINTERP_ENTRY: n_wrote = _GD_DoLinterpOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_LINCOM_ENTRY: n_wrote = _GD_DoLincomOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_BIT_ENTRY: case GD_SBIT_ENTRY: n_wrote = _GD_DoBitOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_MPLEX_ENTRY: n_wrote = _GD_DoMplexOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_RECIP_ENTRY: n_wrote = _GD_DoRecipOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_PHASE_ENTRY: n_wrote = _GD_DoPhaseOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_POLYNOM_ENTRY: n_wrote = _GD_DoPolynomOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: n_wrote = _GD_DoConstOut(D, E, first_samp, num_samp, data_type, data_in); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_INDEX_ENTRY: _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, NULL, 0, E->field); break; case GD_STRING_ENTRY: case GD_ALIAS_ENTRY: case GD_NO_ENTRY: _GD_InternalError(D); break; } D->recurse_level--; dreturn("%" PRNsize_t, n_wrote); return n_wrote; } /* this function is little more than a public boilerplate for _GD_DoFieldOut */ size_t gd_putdata64(DIRFILE* D, const char *field_code, off64_t first_frame, off64_t first_samp, size_t num_frames, size_t num_samp, gd_type_t data_type, const void *data_in) { size_t n_wrote = 0; gd_entry_t *entry; unsigned int spf = 0; dtrace("%p, \"%s\", %lli, %lli, %" PRNsize_t ", %" PRNsize_t ", 0x%X, %p", D, field_code, (long long)first_frame, (long long)first_samp, num_frames, num_samp, data_type, data_in); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } _GD_ClearError(D); entry = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (entry == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", 0); return 0; } if (entry->field_type & GD_SCALAR_ENTRY_BIT) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code); if (D->error) { dreturn("%i", 0); return 0; } if (first_frame == GD_HERE || first_samp == GD_HERE) { first_samp = GD_HERE; first_frame = 0; } if (num_frames > 0 || first_frame > 0) { /* get the samples per frame */ spf = _GD_GetSPF(D, entry); if (D->error) { dreturn("%i", 0); return 0; } first_samp += spf * first_frame; num_samp += spf * num_frames; } if (first_samp < 0 && (first_samp != GD_HERE || first_frame != 0)) { _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL); dreturn("%i", 0); return 0; } /* the easy case */ if (num_samp == 0) { dreturn("%u", 0); return 0; } n_wrote = _GD_DoFieldOut(D, entry, first_samp, num_samp, data_type, data_in); dreturn("%" PRNsize_t, n_wrote); return n_wrote; } /* 32(ish)-bit wrapper for the 64-bit version, when needed */ size_t gd_putdata(DIRFILE* D, const char *field_code, off_t first_frame, off_t first_samp, size_t num_frames, size_t num_samp, gd_type_t data_type, const void *data_in) { return gd_putdata64(D, field_code, first_frame, first_samp, num_frames, num_samp, data_type, data_in); } /* vim: ts=2 sw=2 et */ libgetdata-0.9.0/src/types.c0000640000175000017500000005354212614323564016114 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2010, 2012, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef GD_NO_C99_API #define TO_COMPLEX(ot,it) \ do { \ for (i = 0; i < n; i++) { \ ((ot *)data_out)[2 * i] = (ot)((it *)data_in)[i]; \ ((ot *)data_out)[2 * i + 1] = 0; \ } \ } while (0) #define FROM_COMPLEX(ot,it) \ do { \ for (i = 0; i < n; i++) { \ ((ot *)data_out)[i] = (ot)((it *)data_in)[2 * i]; \ } \ } while (0) #else #define TO_COMPLEX(ot,it) \ do { \ for (i = 0; i < n; i++) { \ ((complex ot *)data_out)[i] = (complex ot)((it *)data_in)[i]; \ } \ } while (0) #define FROM_COMPLEX(ot,it) \ do { \ for (i = 0; i < n; i++) { \ ((ot *)data_out)[i] = (ot)((complex it *)data_in)[i]; \ } \ } while (0) #endif /* _GD_ConvertType: copy data to output buffer while converting type. */ void _GD_ConvertType(DIRFILE *restrict D, const void *restrict data_in, gd_type_t in_type, void *restrict data_out, gd_type_t out_type, size_t n) gd_nothrow { size_t i; dtrace("%p, %p, 0x%x, %p, 0x%x, %" PRNsize_t, D, data_in, in_type, data_out, out_type, n); dreturnvoid(); if (out_type == GD_NULL) /* null return type: don't return data */ return; switch (in_type) { case GD_INT8: switch (out_type) { case GD_INT8: memcpy(data_out, data_in, n * sizeof(int8_t)); return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *)data_out)[i] = (uint8_t)((int8_t *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((int8_t *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((int8_t *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((int8_t *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((int8_t *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((int8_t *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((int8_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((int8_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((int8_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,int8_t); return; case GD_COMPLEX128: TO_COMPLEX(double,int8_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_UINT8: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *)data_out)[i] = (int8_t)((uint8_t *)data_in)[i]; return; case GD_UINT8: memcpy(data_out, data_in, n * sizeof(uint8_t)); return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((uint8_t *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((uint8_t *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((uint8_t *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((uint8_t *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((uint8_t *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((uint8_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((uint8_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((uint8_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,uint8_t); return; case GD_COMPLEX128: TO_COMPLEX(double,uint8_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_INT16: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *)data_out)[i] = (int8_t)((int16_t *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *)data_out)[i] = (uint8_t)((int16_t *)data_in)[i]; return; case GD_INT16: memcpy(data_out, data_in, n * sizeof(int16_t)); return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((int16_t *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((int16_t *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((uint16_t *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((int16_t *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (uint64_t)((int16_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((int16_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((int16_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,int16_t); return; case GD_COMPLEX128: TO_COMPLEX(double,int16_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_UINT16: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *)data_out)[i] = (int8_t)((uint16_t *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *)data_out)[i] = (uint8_t)((uint16_t *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((uint16_t *)data_in)[i]; return; case GD_UINT16: memcpy(data_out, data_in, n * sizeof(uint16_t)); return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((uint16_t *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((uint16_t *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((uint16_t *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((uint16_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((uint16_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((uint16_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,uint16_t); return; case GD_COMPLEX128: TO_COMPLEX(double,uint16_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_INT32: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *) data_out)[i] = (int8_t)((int32_t *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *) data_out)[i] = (uint8_t)((int32_t *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((int32_t *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((int32_t *)data_in)[i]; return; case GD_INT32: memcpy(data_out, data_in, n * sizeof(int32_t)); return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((int32_t *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((int32_t *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((int32_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((int32_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((int32_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,int32_t); return; case GD_COMPLEX128: TO_COMPLEX(double,int32_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_UINT32: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *) data_out)[i] = (int8_t)((uint32_t *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *) data_out)[i] = (uint8_t)((uint32_t *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((uint32_t *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((uint32_t *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((uint32_t *)data_in)[i]; return; case GD_UINT32: memcpy(data_out, data_in, n * sizeof(uint32_t)); return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((uint32_t *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((uint32_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((uint32_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((uint32_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,uint32_t); return; case GD_COMPLEX128: TO_COMPLEX(double,uint32_t); return; default: break; } break; case GD_INT64: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *) data_out)[i] = (int64_t)((int64_t *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *) data_out)[i] = (uint8_t)((int64_t *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((int64_t *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((int64_t *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((int64_t *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((int64_t *)data_in)[i]; return; case GD_INT64: memcpy(data_out, data_in, n * sizeof(int64_t)); return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((int64_t *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((int64_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((int64_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,int64_t); return; case GD_COMPLEX128: TO_COMPLEX(double,int64_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_UINT64: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *) data_out)[i] = (int8_t)((uint64_t *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *) data_out)[i] = (uint8_t)((uint64_t *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((uint64_t *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((uint64_t *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((uint64_t *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((uint64_t *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((uint64_t *)data_in)[i]; return; case GD_UINT64: memcpy(data_out, data_in, n * sizeof(uint64_t)); return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((uint64_t *)data_in)[i]; return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((uint64_t *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,uint64_t); return; case GD_COMPLEX128: TO_COMPLEX(double,uint64_t); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_FLOAT32: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *) data_out)[i] = (int8_t)((float *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *) data_out)[i] = (uint8_t)((float *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((float *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((float *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((float *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (uint32_t)((float *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((float *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((float *)data_in)[i]; return; case GD_FLOAT32: memcpy(data_out, data_in, n * sizeof(float)); return; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)data_out)[i] = (double)((float *)data_in)[i]; return; case GD_COMPLEX64: TO_COMPLEX(float,float); return; case GD_COMPLEX128: TO_COMPLEX(double,float); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_FLOAT64: switch (out_type) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *) data_out)[i] = (int8_t)((double *)data_in)[i]; return; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *) data_out)[i] = (uint8_t)((double *)data_in)[i]; return; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)data_out)[i] = (int16_t)((double *)data_in)[i]; return; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)data_out)[i] = (uint16_t)((double *)data_in)[i]; return; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)data_out)[i] = (int32_t)((double *)data_in)[i]; return; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)data_out)[i] = (int32_t)((double *)data_in)[i]; return; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)data_out)[i] = (int64_t)((double *)data_in)[i]; return; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)data_out)[i] = (uint64_t)((double *)data_in)[i]; return; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)data_out)[i] = (float)((double *)data_in)[i]; return; case GD_FLOAT64: memcpy(data_out, data_in, n * sizeof(double)); return; case GD_COMPLEX64: TO_COMPLEX(float,double); return; case GD_COMPLEX128: TO_COMPLEX(double,double); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_COMPLEX64: switch (out_type) { case GD_INT8: FROM_COMPLEX(int8_t,float); return; case GD_UINT8: FROM_COMPLEX(uint8_t,float); return; case GD_INT16: FROM_COMPLEX(int16_t,float); return; case GD_UINT16: FROM_COMPLEX(uint16_t,float); return; case GD_INT32: FROM_COMPLEX(int32_t,float); return; case GD_UINT32: FROM_COMPLEX(uint32_t,float); return; case GD_INT64: FROM_COMPLEX(int64_t,float); return; case GD_UINT64: FROM_COMPLEX(uint64_t,float); return; case GD_FLOAT32: FROM_COMPLEX(float,float); return; case GD_FLOAT64: FROM_COMPLEX(double,float); return; case GD_COMPLEX64: memcpy(data_out, data_in, n * 2 * sizeof(float)); return; case GD_COMPLEX128: for (i = 0; i < 2 * n; i++) ((double *)data_out)[i] = (double)((float *)data_in)[i]; return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; case GD_COMPLEX128: switch (out_type) { case GD_INT8: FROM_COMPLEX(int8_t,double); return; case GD_UINT8: FROM_COMPLEX(uint8_t,double); return; case GD_INT16: FROM_COMPLEX(int16_t,double); return; case GD_UINT16: FROM_COMPLEX(uint16_t,double); return; case GD_INT32: FROM_COMPLEX(int32_t,double); return; case GD_UINT32: FROM_COMPLEX(uint32_t,double); return; case GD_INT64: FROM_COMPLEX(int64_t,double); return; case GD_UINT64: FROM_COMPLEX(uint64_t,double); return; case GD_FLOAT32: FROM_COMPLEX(float,double); return; case GD_FLOAT64: FROM_COMPLEX(double,double); return; case GD_COMPLEX64: for (i = 0; i < 2 * n; i++) ((float *)data_out)[i] = (float)((double *)data_in)[i]; return; case GD_COMPLEX128: memcpy(data_out, data_in, 2 * n * sizeof(double)); return; default: _GD_SetError(D, GD_E_BAD_TYPE, out_type, NULL, 0, NULL); break; } break; default: _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL); break; } } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/errors.c0000640000175000017500000003712512614323564016263 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* Error strings. */ static const struct { int error; int suberror; /* 0 = any */ const char* format; /* 1 = suberror, 2 = file, 3 = line, 4 = string */ int adderr; /* 1 = append strerror(errno) */ } error_string[] = { /* GD_E_FORMAT: 1 = suberror, 2 = formatfile, 3 = line number, 4 = token */ { GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, "Bad data type on line {3} of {2}: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_BAD_SPF, "Samples per frame out of range on line {3} of {2}: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_N_FIELDS, "LINCOM field count out of range on line {3} of {2}: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_N_TOK, "Missing token on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_NUMBITS, "Numbits out of range on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_BITNUM, "Starting bit out of range on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_BITSIZE, "End of bitfield out of bounds on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_CHARACTER, "Invalid character on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_BAD_LINE, "Line {3} of {2} indecipherable", 0 }, { GD_E_FORMAT, GD_E_FORMAT_RES_NAME, "Field name is reserved on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_ENDIAN, "Unrecognised endianness on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, "Bad name on line {3} of {2}: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_UNTERM, "Unterminated token on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_METARAW, "Invalid metafield type on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, "Field code not found on line {3} of {2}: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, "Field code on line {3} of {2} already defined: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_LOCATION, "META in a different file than parent ({4}) on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_PROTECT, "Bad protection level on line {3} of {2}: {4}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_LITERAL, "Unexpected characters in scalar literal ({4}) on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_WINDOP, "Unrecognised operator ({4}) on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_META_META, "Cannot attach meta field to meta field {4} on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_ALIAS, "Cannot use alias {4} as parent to a meta field on line {3} of {2}", 0 }, { GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL, "Bad MPLEX period ({4}) on line {3} of {2}", 0 }, /* GD_E_CREAT: 1 = suberror, 2 = filename */ { GD_E_CREAT, GD_E_CREAT_DIR, "Unable to create directory {2}: ", 1 }, { GD_E_CREAT, GD_E_CREAT_OPEN, "Unable to open directory {2}: ", 1 }, { GD_E_CREAT, GD_E_CREAT_FORMAT, "Unable to create format file {2}: ", 1 }, /* GD_E_BAD_CODE: 4 = field code */ { GD_E_BAD_CODE, GD_E_CODE_MISSING, "Field not found: {4}", 0 }, { GD_E_BAD_CODE, GD_E_CODE_INVALID, "Bad field code: {4}", 0 }, { GD_E_BAD_CODE, GD_E_CODE_AMBIGUOUS, "Ambiguous field code: {4}", 0 }, { GD_E_BAD_CODE, GD_E_CODE_INVALID_NS, "Bad namespace: {4}", 0 }, { GD_E_BAD_CODE, GD_E_CODE_REPR, "Invalid representation suffix in: {4}", 0 }, /* GD_E_BAD_TYPE: 1 = data type */ { GD_E_BAD_TYPE, 0, "Bad data type: {1}", 0 }, /* GD_E_IO: 2 = filename; 3 = line; 4 = included file/encoding error */ { GD_E_IO, GD_E_IO_OPEN, "Error opening {2}: ", 1 }, { GD_E_IO, GD_E_IO_READ, "Error reading {2}: ", 1 }, { GD_E_IO, GD_E_IO_WRITE, "Error writing {2}: ", 1 }, { GD_E_IO, GD_E_IO_CLOSE, "Error closing {2}: ", 1 }, { GD_E_IO, GD_E_IO_UNLINK, "Error unlinking {2}: ", 1 }, { GD_E_IO, GD_E_IO_RENAME, "Error renaming {2}: ", 1 }, { GD_E_IO, GD_E_IO_INCL, "Error opening {4} included on line {3} of {2}: ", 1 }, { GD_E_IO, GD_E_IO_ENC_OPEN, "Error opening {2}: {4}", 0 }, { GD_E_IO, GD_E_IO_ENC_READ, "Error reading {2}: {4}", 0 }, { GD_E_IO, GD_E_IO_ENC_WRITE, "Error writing {2}: {4}", 0 }, { GD_E_IO, GD_E_IO_ENC_CLOSE, "Error closing {2}: {4}", 0 }, { GD_E_IO, GD_E_IO_ENC_UNLINK, "Error unlinking {2}: {4} ", 0 }, { GD_E_IO, GD_E_IO_ENC_RENAME, "Error renaming {2}: {4} ", 0 }, { GD_E_IO, 0, "Error accessing {2}: ", 1 }, /* GD_E_INTERNAL_ERROR: 2 = source file, 3 = line */ { GD_E_INTERNAL_ERROR, 0, "Internal error at [{2},{3}]; " "please report to " PACKAGE_BUGREPORT , 0 }, /* GD_E_ALLOC: (nothing) */ { GD_E_ALLOC, 0, "Memory allocation error", 0 }, /* GD_E_RANGE: (nothing) */ { GD_E_RANGE, GD_E_OUT_OF_RANGE, "Request out of range", 0 }, { GD_E_RANGE, GD_E_SINGULAR_RANGE, "Singular range", 0 }, /* GD_E_LUT: 1 = suberror, 2 = lutfile, 3 = line */ { GD_E_LUT, GD_E_LUT_LENGTH, "LINTERP table {2} too short", 0 }, { GD_E_LUT, GD_E_LUT_SYNTAX, "Malfomed data on line {3} of LINTERP table {2}", 0 }, /* GD_E_RECURSE_LEVEL: 2 = file; 3 = line; 4 = name */ { GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, "Recursion too deep resolving field {4}", 0 }, { GD_E_RECURSE_LEVEL, GD_E_RECURSE_INCLUDE, "Recursion too deep including {4} on line {3} of {2}", 0 }, /* GD_E_BAD_DIRFILE: (nothing) */ { GD_E_BAD_DIRFILE, 0, "Invalid dirfile", 0 }, /* GD_E_BAD_FIELD_TYPE: 2 = parent field (if any) 4 = fieldcode */ { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_PUT, "No method to write field {4}", 0 }, { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, "Invalid field type for {4}", 0 }, { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_MATCH, "Field type mismatch for {4}", 0 }, { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_FORMAT, "Bad field type for {4} in definition of {2}", 0 }, { GD_E_BAD_FIELD_TYPE, GD_E_FIELD_STR, "Non-numeric data in {4}", 0 }, /* GD_E_ACCMODE: (nothing) */ { GD_E_ACCMODE, 0, "Dirfile has been opened read-only", 0 }, /* GD_E_UNSUPPORTED: (nothing) */ { GD_E_UNSUPPORTED, 0, "Operation not supported by current encoding scheme", 0 }, /* GD_E_UNKNOWN_ENCODING: (nothing) */ { GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, "Unable to determine encoding scheme", 0 }, { GD_E_UNKNOWN_ENCODING, GD_E_UNENC_TARGET, "Unknown ouput encoding scheme", 0 }, /* GD_E_BAD_ENTRY: 3 = parameter */ { GD_E_BAD_ENTRY, GD_E_ENTRY_TYPE, "Invalid entry type: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_SPF, "Samples per frame out of range: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_NFIELDS, "LINCOM field count out of range: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_BITNUM, "Starting bit out of range: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_NUMBITS, "Numbits out of range: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_BITSIZE, "End of bitfield out of range: {3}", 0}, { GD_E_BAD_ENTRY, GD_E_ENTRY_METARAW, "Invalid metafield type: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_POLYORD, "POLYNOM order out of range: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_WINDOP, "Unrecognised WINDOW operator: {3}", 0 }, { GD_E_BAD_ENTRY, GD_E_ENTRY_PERIOD, "MPLEX period out of range: {3}", 0 }, /* GD_E_DUPLICATE: 4 = name */ { GD_E_DUPLICATE, 0, "Field code already present: {4}", 0 }, /* GD_E_DIMENSION: 2 = parent field (if any), 4 = field code */ { GD_E_DIMENSION, GD_E_DIM_FORMAT, "Scalar field {4} found where vector " "field expected in definition of {2}", 0 }, { GD_E_DIMENSION, GD_E_DIM_CALLER, "Vector field expected, but scalar field given: {4}", 0 }, /* GD_E_BAD_INDEX: 3 = index */ { GD_E_BAD_INDEX, 0, "Invalid fragment index: {3}", 0 }, /* GD_E_BAD_SCALAR: 2 = parent field, 4 = scalar field */ { GD_E_BAD_SCALAR, GD_E_SCALAR_CODE, "Scalar field {4} not found in definition of {2}", 0 }, { GD_E_BAD_SCALAR, GD_E_SCALAR_TYPE, "Scalar field {4} has wrong type in definition of {2}", 0 }, /* GD_E_BAD_REFERENCE: 4 = field name */ { GD_E_BAD_REFERENCE, GD_E_REFERENCE_CODE, "REFERENCE field code not found: {4}", 0 }, { GD_E_BAD_REFERENCE, GD_E_REFERENCE_TYPE, "Bad field type for REFERENCE field: {4}", 0 }, /* GD_E_PROTECTED: 4 = fragment name */ { GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, "Fragment is protected: {4}", 0 }, { GD_E_PROTECTED, GD_E_PROTECTED_DATA, "Data for fragment is protected: {4}", 0 }, /* GD_E_DELETE: 2 = client field, 4 = deleted field */ { GD_E_DELETE, GD_E_DEL_META, "Cannot delete field {4} with metafields", 0 }, { GD_E_DELETE, GD_E_DEL_CONST, "Cannot delete field {4} used in definiton of field {2}", 0 }, { GD_E_DELETE, GD_E_DEL_DERIVED, "Cannot delete field {4} used as input to field {2}", 0 }, { GD_E_DELETE, GD_E_DEL_ALIAS, "Cannot delete field {4} with aliases", 0 }, /* GD_E_ARGUMENT: (nothing) */ { GD_E_ARGUMENT, GD_E_ARG_WHENCE, "Invalid origin specified", 0 }, { GD_E_ARGUMENT, GD_E_ARG_ENDIANNESS, "Invalid endianness specified", 0 }, { GD_E_ARGUMENT, GD_E_ARG_PROTECTION, "Invalid protection level specified", 0 }, { GD_E_ARGUMENT, GD_E_ARG_NODATA, "No data", 0 }, { GD_E_ARGUMENT, GD_E_ARG_NO_VERS, "Dirfile conforms to no Standards Version", 0 }, { GD_E_ARGUMENT, GD_E_ARG_BAD_VERS, "Dirfile does not conform to specified Standards Version", 0 }, { GD_E_ARGUMENT, 0, "Bad argument", 0 }, /* GD_E_CALLBACK: 3 = response */ { GD_E_CALLBACK, 0, "Unrecognised response from callback function: {3}", 0 }, /* GD_E_ExISTS: (nothing) */ { GD_E_EXISTS, 0, "Dirfile exists", 0 }, /* GD_E_UNCLEAN_DB: 2 = fragment, 4 = call */ { GD_E_UNCLEAN_DB, GD_E_UNCLEAN_CALL, "Unexpected system error processing {2}; database unclean: {4}: ", 1 }, { GD_E_UNCLEAN_DB, 0, "Unexpected system error processing {2}; database unclean", 0 }, /* GD_E_DOMAIN: (nothing) */ { GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, "Improper domain: complex valued", 0 }, { GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, "Improper domain: empty set", 0 }, { GD_E_DOMAIN, GD_E_DOMAIN_ANTITONIC, "Improper domain: not monotonic", 0 }, { GD_E_DOMAIN, GD_E_DOMAIN_MULTIPOS, "I/O position mismatch in inputs", 0 }, /* GD_E_BOUNDS: (nothing) */ { GD_E_BOUNDS, 0, "Array length out of bounds", 0 }, /* GD_E_LINE_TOO_LONG */ { GD_E_LINE_TOO_LONG, GD_E_LONG_FLUSH, "Line too long writing {2}", 0 }, { GD_E_LINE_TOO_LONG, 0, "Line {3} of {2} too long", 0 }, /* GD_E_OK: (nothing) */ { 0, 0, "Success", 0} /* this must be the last error string defined */ }; /* _GD_SetError: Sets the global error variables for a library error */ void _GD_SetError2(DIRFILE* D, int error, int suberror, const char* format_file, int line, const char* token, int stdlib_errno) { dtrace("%p, %i, %i, \"%s\", %i, \"%s\", %i", D, error, suberror, format_file, line, token, stdlib_errno); D->error = error; if (error != GD_E_OK) D->n_error++; D->suberror = suberror; D->stdlib_errno = stdlib_errno; D->error_line = line; if (format_file != NULL) { free(D->error_file); D->error_file = strdup(format_file); } if (token != NULL) { free(D->error_string); D->error_string = strdup(token); } if (D->flags & GD_VERBOSE) { char *error_string = gd_error_string(D, NULL, 0); fprintf(stderr, "%slibgetdata: %s\n", D->error_prefix ? D->error_prefix : "", error_string); free(error_string); } dreturnvoid(); } void _GD_SetError(DIRFILE* D, int error, int suberror, const char* format_file, int line, const char* token) { dtrace("%p, %i, %i, \"%s\", %i, \"%s\"", D, error, suberror, format_file, line, token); _GD_SetError2(D, error, suberror, format_file, line, token, errno); dreturnvoid(); } /* Set an appropriate error message for encoding framework errors */ void _GD_SetEncIOError(DIRFILE *D, int suberror, const struct gd_raw_file_ *f) { dtrace("%p, %i, %p", D, suberror, f); /* If the encoding has no strerr function, fallback on strerr */ if (_GD_MissingFramework(f->subenc, GD_EF_STRERR)) _GD_SetError(D, GD_E_IO, suberror, f->name, 0, NULL); else { char buffer[GD_MAX_LINE_LENGTH]; if ((*_GD_ef[f->subenc].strerr)(f, buffer, GD_MAX_LINE_LENGTH)) strcpy(buffer, "Unknown error"); _GD_SetError2(D, GD_E_IO, GD_E_IO_ENC_OFFSET + suberror, f->name, 0, buffer, 0); } } /* Return the error */ int gd_error(const DIRFILE* D) gd_nothrow { dtrace("%p", D); dreturn("%i", D->error); return D->error; } /* Write a descriptive message in the supplied buffer describing the last * library error. The message may be truncated but will be null terminated. * Returns buffer, or NULL if buflen < 1. */ #define UNKNOWN "Unknown error %i:%i. Please report to " PACKAGE_BUGREPORT char* gd_error_string(const DIRFILE* D, char* buffer, size_t buflen) gd_nothrow { const char* ip; char* op; char* bufend; int i, s = -1; dtrace("%p, %p, %" PRNsize_t, D, buffer, buflen); /* Sanity check */ if (buffer && buflen < 1) { dreturn("%p", NULL); return NULL; } /* Find the error message */ for (i = 0; error_string[i].error; ++i) if ((error_string[i].error == D->error) && ((error_string[i].suberror == 0) || (error_string[i].suberror == D->suberror))) { s = i; break; } if (D->error == 0) s = i; if (buffer == NULL) { /* computer buffer length */ if (s == -1) { /* a 64-bit int is 20 decimal digits, the %i takes up two characters, * so at most 18 more are needed for each integer */ buflen = sizeof(UNKNOWN) + 2 * 18 + 1; } else { /* again, space for two 64-bit ints - "{n}" = 17 */ buflen = strlen(error_string[s].format) + 2 * 17 + 1; if (D->error_file) buflen += strlen(D->error_file); if (D->error_string) buflen += strlen(D->error_string); if (error_string[s].adderr) /* hmmm... how long is our strerror string? Really, the only way to * find out is to run strerror_r with increasingly long buffers until * we don't get ERANGE anymore. Um, let's just guess. */ buflen += GD_MAX_LINE_LENGTH; } buffer = (char *)malloc(buflen); if (buffer == NULL) { dreturn("%p", NULL); return NULL; } } op = buffer; bufend = buffer + buflen; if (s == -1) /* Unhandled error */ snprintf(buffer, buflen, UNKNOWN, D->error, D->suberror); else { for (ip = error_string[s].format; *ip != '\0' && op < bufend - 1; ++ip) { if (*ip == '{') { ip++; if (*ip == '1') op += snprintf(op, bufend - op, "%02x", D->suberror); else if (*ip == '2') op += snprintf(op, bufend - op, "%s", D->error_file); else if (*ip == '3') op += snprintf(op, bufend - op, "%i", D->error_line); else if (*ip == '4') op += snprintf(op, bufend - op, "%s", D->error_string); ip++; } else *(op++) = *ip; } *op = '\0'; if (op < bufend - 1 && error_string[s].adderr) gd_strerror(D->stdlib_errno, op, bufend - op); } dreturn("\"%s\"", buffer); return buffer; } int gd_error_count(DIRFILE *D) gd_nothrow { int count; dtrace("%p", D); count = D->n_error; D->n_error = 0; dreturn("%i", count); return count; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/open.c0000640000175000017500000004356112614323564015711 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* crawl the directory, and delete everything */ static int _GD_TruncDir(DIRFILE *D, int dirfd, const char *dirfile, int root) { int ret, format_trunc = 0; DIR* dir; struct dirent *lamb, *result; struct stat statbuf; size_t dirent_len = offsetof(struct dirent, d_name); size_t dirfile_len = strlen(dirfile); dtrace("%p, %i, \"%s\", %i", D, dirfd, dirfile, root); #if defined(HAVE_FDOPENDIR) && !defined(GD_NO_DIR_OPEN) { int fd = dirfd; /* only need to duplicate the fd of the root directory; otherwise this * function will close the fd */ if (root && (fd = dup(dirfd)) == -1) { _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, dirfile, 0, NULL); dreturn("%i", -1); return -1; } dir = fdopendir(fd); #ifdef HAVE_FPATHCONF dirent_len += fpathconf(fd, _PC_NAME_MAX) + 1; #elif defined HAVE_PATHCONF dirent_len += pathconf(dirfile, _PC_NAME_MAX) + 1; #else dirent_len += FILENAME_MAX; #endif } #else dir = opendir(dirfile); #ifdef HAVE_PATHCONF dirent_len += pathconf(dirfile, _PC_NAME_MAX) + 1; #else dirent_len += FILENAME_MAX; #endif #endif if (dir == NULL) { _GD_SetError(D, GD_E_IO, GD_E_IO_OPEN, dirfile, 0, NULL); dreturn("%i", -1); return -1; } if ((lamb = _GD_Malloc(D, dirent_len)) == NULL) { closedir(dir); dreturn("%i", -1); return -1; } ret = _GD_ReadDir(dir, lamb, &result); for (; result; ret = _GD_ReadDir(dir, lamb, &result)) { char *name; if (lamb->d_name[0] == '.' && lamb->d_name[1] == '\0') continue; /* skip current dir */ else if (lamb->d_name[0] == '.' && lamb->d_name[1] == '.' && lamb->d_name[2] == '\0') { continue; /* skip parent dir */ } name = _GD_Malloc(D, dirfile_len + strlen(lamb->d_name) + 2); if (name == NULL) { free(lamb); closedir(dir); dreturn("%i", -1); return -1; } sprintf(name, "%s%c%s", dirfile, GD_DIRSEP, lamb->d_name); if ( #if defined(HAVE_FSTATAT) && !defined(GD_NO_DIR_OPEN) fstatat(dirfd, lamb->d_name, &statbuf, AT_SYMLINK_NOFOLLOW) #elif HAVE_LSTAT lstat(name, &statbuf) #else stat(name, &statbuf) #endif ) { _GD_SetError(D, GD_E_IO, 0, name, 0, NULL); free(name); closedir(dir); dreturn("%i", -1); return -1; } /* check file type */ switch (statbuf.st_mode & S_IFMT) { case S_IFREG: #ifdef S_IFBLK case S_IFBLK: #endif #ifdef S_IFIFO case S_IFIFO: #endif #ifdef S_IFCHR case S_IFCHR: #endif #ifdef S_IFLNK case S_IFLNK: #endif if (root && strcmp(lamb->d_name, "format") == 0) { /* don't delete the format file; we'll truncate it later */ format_trunc = 1; } else if ( #ifdef HAVE_UNLINKAT unlinkat(dirfd, lamb->d_name, 0) #else unlink(name) #endif ) { _GD_SetError(D, GD_E_IO, GD_E_IO_UNLINK, name, 0, NULL); free(lamb); free(name); closedir(dir); dreturn("%i", -1); return -1; } break; case S_IFDIR: /* descend into subdir if requested */ if (D->flags & GD_TRUNCSUB) { int subdirfd; #ifdef GD_NO_DIR_OPEN subdirfd = 0; /* unused */ #else if (( #ifdef HAVE_OPENAT subdirfd = openat(dirfd, lamb->d_name, O_RDONLY) #else subdirfd = open(name, O_RDONLY) #endif ) < 0) { _GD_SetError(D, GD_E_IO, 0, name, 0, NULL); free(lamb); closedir(dir); free(name); dreturn("%i", -1); return -1; } #endif /* descend -- this will close subdirfd */ _GD_TruncDir(D, subdirfd, name, 0); /* delete */ if ( #ifdef HAVE_UNLINKAT unlinkat(dirfd, lamb->d_name, AT_REMOVEDIR) #else rmdir(name) #endif ) { _GD_SetError(D, GD_E_IO, GD_E_IO_UNLINK, name, 0, NULL); free(lamb); free(name); closedir(dir); dreturn("%i", -1); return -1; } } } free(name); } free(lamb); closedir(dir); if (ret) { _GD_SetError(D, GD_E_IO, GD_E_IO_READ, dirfile, 0, NULL); dreturn("%i", -1); return -1; } dreturn("%i", format_trunc); return format_trunc; } /* attempt to open or create a new dirfile - set error appropriately */ static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error, char *restrict dirfile, time_t *mtime) { struct stat statbuf; int fd = -1; int format_error = 0, format_trunc = 0; FILE* fp = NULL; dtrace("%p, %i, %i, \"%s\", %p", D, dirfd, dir_error, dirfile, mtime); /* naively try to open the format file */ if (dirfd < 0) ; /* Directory error */ else if ((fd = gd_OpenAt(D, dirfd, "format", O_RDONLY | O_BINARY, 0666)) < 0) { format_error = errno; /* in the non-POSIX case, this has already been done. */ #ifndef GD_NO_DIR_OPEN /* open failed, try to stat the directory itself */ if (fstat(dirfd, &statbuf)) dir_error = errno; else if (!S_ISDIR(statbuf.st_mode)) dir_error = ENOTDIR; #endif } else dir_error = 0; /* First, cast out our failure modes */ /* Error reading the directory, and we weren't asked to create it */ if (dir_error == EACCES || (dirfd < 0 && !(D->flags & GD_CREAT))) { _GD_SetError2(D, GD_E_IO, GD_E_IO_OPEN, dirfile, 0, NULL, dir_error); free(dirfile); dreturn("%p", NULL); return NULL; } /* Error reading the format file, and we weren't asked to create it; do * nothing else. */ if (format_error == EACCES || (format_error && !(D->flags & GD_CREAT))) { char *format_file = (char *)malloc(strlen(dirfile) + 8); sprintf(format_file, "%s%cformat", dirfile, GD_DIRSEP); _GD_SetError2(D, GD_E_IO, GD_E_IO_OPEN, format_file, 0, NULL, format_error); free(format_file); free(dirfile); dreturn("%p", NULL); return NULL; } /* It does exist, but we were asked to exclusively create it */ if (!format_error && dirfd >= 0 && (D->flags & GD_CREAT) && (D->flags & GD_EXCL)) { _GD_SetError(D, GD_E_EXISTS, 0, NULL, 0, NULL); free(dirfile); close(fd); dreturn("%p", NULL); return NULL; } /* If we made it here we either: * 1) have no such directory, but plan to create it, or * 2) have a "dirfile", i.e. the directory supplied contains a readable * file called format */ /* Truncate, if needed -- dangerous! Truncating a dirfile deletes every * regular file in the specified directory. It does not touch subdirectories. * Note that the rather lame definition of a dirfile at this point * (specifically, we haven't bothered to see if the format file is parsable) * could be problematic if users use GD_TRUNC cavalierly. */ if (D->flags & GD_TRUNC && !format_error && dirfd >= 0) { close(fd); /* can't truncate a read-only dirfile */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); free(dirfile); dreturn("%p", NULL); return NULL; } format_trunc = _GD_TruncDir(D, dirfd, dirfile, 1); if (format_trunc < 0) { free(dirfile); dreturn("%p", NULL); return NULL; } } /* Create, if needed */ if ((D->flags & GD_CREAT && (dirfd < 0 || format_error)) || (D->flags & GD_TRUNC)) { /* a newly created dirfile ignores the specified access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) D->flags |= GD_RDWR; /* attempt to create the dirfile directory, if not present */ if (dirfd < 0) { if (mkdir(dirfile, 0777) < 0) { _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_DIR, dirfile, 0, NULL); free(dirfile); dreturn("%p", NULL); return NULL; } #ifdef GD_NO_DIR_OPEN /* in the non-POSIX situation, dirfd just holds the index in the * directory entry */ dirfd = 0; #else if ((dirfd = open(dirfile, O_RDONLY)) < 0) { _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_OPEN, dirfile, 0, NULL); free(dirfile); dreturn("%p", NULL); return NULL; } #endif } /* create a new, empty format file, or else truncate it */ if ((fd = gd_OpenAt(D, dirfd, "format", O_RDWR | O_CREAT | O_BINARY | (format_trunc ? O_TRUNC : O_EXCL), 0666)) < 0) { char *format_file = (char *)malloc(strlen(dirfile) + 8); sprintf(format_file, "%s/format", dirfile); _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, 0, NULL); free(dirfile); free(format_file); #ifndef GD_NO_DIR_OPEN if (dirfd >= 0) close(dirfd); #endif dreturn("%p", NULL); return NULL; } /* set GD_UNENCODED if GD_AUTO_ENCODED was specified */ if ((D->flags & GD_ENCODING) == GD_AUTO_ENCODED) D->flags = (D->flags & ~GD_ENCODING) | GD_UNENCODED; } /* associate a stream with the format file */ if ((fp = fdopen(fd, "rb")) == NULL) { char *format_file = (char *)malloc(strlen(dirfile) + 8); sprintf(format_file, "%s/format", dirfile); _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_FORMAT, format_file, 0, NULL); free(dirfile); free(format_file); close(fd); #ifndef GD_NO_DIR_OPEN if (dirfd >= 0) close(dirfd); #endif dreturn("%p", NULL); return NULL; } /* open succeeds */ D->dir = (struct gd_dir_t *)malloc(sizeof(struct gd_dir_t)); D->dir[0].fd = dirfd; D->dir[0].rc = 1; D->dir[0].path = dirfile; D->ndir = 1; /* get the mtime */ if (fstat(fd, &statbuf) == 0) *mtime = statbuf.st_mtime; dreturn("%p", fp); return fp; } void gd_parser_callback(DIRFILE* D, gd_parser_callback_t sehandler, void* extra) gd_nothrow { dtrace("%p, %p, %p", D, sehandler, extra); D->sehandler = sehandler; D->sehandler_extra = extra; dreturnvoid(); } DIRFILE* gd_invalid_dirfile(void) gd_nothrow { DIRFILE *D; dtracevoid(); D = (DIRFILE *)malloc(sizeof(DIRFILE)); if (D) { memset(D, 0, sizeof(DIRFILE)); D->flags = GD_INVALID; } dreturn("%p", D); return D; } /* _GD_Open: open (or, perhaps, create) and parse the specified dirfile */ DIRFILE *_GD_Open(DIRFILE *D, int dirfd, const char *filedir, unsigned long flags, gd_parser_callback_t sehandler, void *extra) { FILE *fp; char *ref_name; char *dirfile; gd_entry_t* E; int dirfd_error = 0; time_t mtime = 0; struct parser_state p; #ifdef GD_NO_DIR_OPEN gd_stat64_t statbuf; #endif dtrace("%p, %i, \"%s\", 0x%lX, %p, %p", D, dirfd, filedir, (unsigned long)flags, sehandler, extra); errno = 0; /* canonicalise the path to protect us against the caller chdir'ing away */ dirfile = _GD_CanonicalPath(NULL, filedir); if (dirfile) { #ifdef GD_NO_DIR_OPEN /* if we can't cache directory descriptors, we just have to remember paths. * so stat the path to see if it exists (and is a directory) */ if (gd_stat64(dirfile, &statbuf)) dirfd_error = errno; else if (!S_ISDIR(statbuf.st_mode)) dirfd_error = ENOTDIR; else dirfd = 0; #else /* quickly, before it goes away, grab the directory (if it exists) */ if (dirfd == -1) dirfd = open(dirfile, O_RDONLY); dirfd_error = errno; #endif } else dirfd_error = errno; _GD_InitialiseFramework(); if (D == NULL) D = (DIRFILE *)malloc(sizeof(DIRFILE)); if (D == NULL) { free(dirfile); #ifndef GD_NO_DIR_OPEN if (dirfd >= 0) close(dirfd); #endif dreturn("%p", NULL); return NULL; } memset(D, 0, sizeof(DIRFILE)); /* user specified flags (used if we're forced to re-open) */ D->open_flags = flags; /* clear GD_PERMISSIVE if it was specified along with GD_PEDANTIC */ if (flags & GD_PERMISSIVE && flags & GD_PEDANTIC) flags &= ~GD_PERMISSIVE; D->name = dirfile; /* temporarily store canonicalised path here */ D->flags = (flags | GD_INVALID) & ~GD_IGNORE_REFS; D->sehandler = sehandler; D->sehandler_extra = extra; D->standards = GD_DIRFILE_STANDARDS_VERSION; D->lookback = GD_DEFAULT_LOOKBACK; if (dirfile == NULL) { _GD_SetError2(D, GD_E_IO, 0, filedir, 0, NULL, dirfd_error); #ifndef GD_NO_DIR_OPEN if (dirfd >= 0) close(dirfd); #endif dreturn("%p", D); return D; } /* Add the INDEX entry */ D->n_entries = 1; D->entry = _GD_Malloc(D, sizeof(*D->entry)); if (D->entry) D->entry[0] = _GD_Malloc(D, sizeof(**D->entry)); if (D->error) { free(dirfile); #ifndef GD_NO_DIR_OPEN close(dirfd); #endif dreturn("%p", D); return D; } memset(D->entry[0], 0, sizeof(gd_entry_t)); D->entry[0]->field_type = GD_INDEX_ENTRY; D->entry[0]->e = _GD_Malloc(D, sizeof(*D->entry[0]->e)); D->entry[0]->field = _GD_Strdup(D, "INDEX"); if (D->error) { free(dirfile); #ifndef GD_NO_DIR_OPEN close(dirfd); #endif dreturn("%p", D); return D; } memset(D->entry[0]->e, 0, sizeof(struct gd_private_entry_)); D->entry[0]->flags = GD_EN_CALC; /* open the format file (or create it) */ if ((fp = _GD_CreateDirfile(D, dirfd, dirfd_error, dirfile, &mtime)) == NULL) { #ifndef GD_NO_DIR_OPEN if (dirfd >= 0) close(dirfd); #endif D->name = NULL; /* so a subsequent gd_discard() doesn't go awry. */ dreturn("%p", D); return D; /* errors have already been set */ } /* remember back when we temporarily stored the canonicalised path here? * We're over that. Remember the dirfile's name. */ D->name = strdup(filedir); if (D->name == NULL) { fclose(fp); _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); dreturn("%p", D); return D; } /* Parse the file. This will take care of any necessary inclusions */ D->n_fragment = 1; D->fragment = _GD_Malloc(D, sizeof(*D->fragment)); if (D->error) { dreturn("%p", D); return D; } D->fragment[0].cname = _GD_CanonicalPath(dirfile, "format"); if (D->fragment[0].cname == NULL) { if (errno == ENOMEM) _GD_SetError(D, GD_E_ALLOC, 0, NULL, 0, NULL); else _GD_SetError(D, GD_E_IO, 0, dirfile, 0, NULL); } D->fragment[0].bname = _GD_Strdup(D, "format"); if (D->error) { dreturn("%p", D); return D; } D->fragment[0].sname = NULL; /* The root format file needs no external name */ D->fragment[0].ename = NULL; D->fragment[0].enc_data = NULL; D->fragment[0].modified = 0; D->fragment[0].parent = -1; D->fragment[0].dirfd = D->dir[0].fd; D->fragment[0].encoding = D->flags & GD_ENCODING; D->fragment[0].byte_sex = ( #ifdef WORDS_BIGENDIAN (D->flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN #else (D->flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN #endif ) | (D->flags & GD_ARM_FLAG); D->fragment[0].ref_name = NULL; D->fragment[0].frame_offset = 0; D->fragment[0].mtime = mtime; D->fragment[0].protection = GD_PROTECT_NONE; D->fragment[0].vers = (flags & GD_PEDANTIC) ? GD_DIRFILE_STANDARDS_VERSION : 0; D->fragment[0].suffix = D->fragment[0].prefix = NULL; D->fragment[0].ns = NULL; /* parser proto-state */ p.line = 0; p.file = NULL; p.standards = GD_DIRFILE_STANDARDS_VERSION; p.pedantic = flags & GD_PEDANTIC; p.flags = D->flags; p.ns = NULL; p.nsl = 0; ref_name = _GD_ParseFragment(fp, D, &p, 0, 1); fclose(fp); if (D->error != GD_E_OK) { dreturn("%p", D); return D; } /* export the parser data */ D->standards = p.standards; if (p.pedantic) D->flags |= GD_PEDANTIC; else D->flags &= ~GD_PEDANTIC; /* Find the reference field */ if (ref_name != NULL) { E = _GD_FindField(D, ref_name, D->entry, D->n_entries, 1, NULL); if (E == NULL) _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_CODE, NULL, 0, ref_name); else if (E->field_type != GD_RAW_ENTRY) _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_TYPE, NULL, 0, ref_name); else D->reference_field = E; free(ref_name); } /* Success! Clear invalid bit */ if (D->error == GD_E_OK) D->flags &= ~GD_INVALID; /* if GD_PEDANTIC is not set or GD_MULTISTANDARD is set, we don't know which * version this conforms to; try to figure it out. */ if (!D->error && (!(D->flags & GD_PEDANTIC) || D->flags & GD_MULTISTANDARD)) { if (_GD_FindVersion(D)) { /* conforms to some standard, use the latest */ gd_dirfile_standards(D, GD_VERSION_LATEST); /* can't fail */ D->flags &= ~GD_NOSTANDARD; } else /* non-conformant dirfile, flag it */ D->flags |= GD_NOSTANDARD; } else D->flags &= ~GD_NOSTANDARD; dreturn("%p", D); return D; } DIRFILE *gd_cbopen(const char* filedir, unsigned long flags, gd_parser_callback_t sehandler, void* extra) { DIRFILE *D; dtrace("\"%s\", 0x%lX, %p, %p", filedir, (unsigned long)flags, sehandler, extra); D = _GD_Open(NULL, -1, filedir, flags, sehandler, extra); dreturn("%p", D); return D; } DIRFILE* gd_open(const char* filedir, unsigned long flags) { DIRFILE *D; dtrace("\"%s\", 0x%lX", filedir, (unsigned long)flags); D = _GD_Open(NULL, -1, filedir, flags, NULL, NULL); dreturn("%p", D); return D; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/parse.c0000640000175000017500000021504112614323564016054 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static gd_type_t _GD_RawType(const char* type, int standards, int pedantic) { gd_type_t t = GD_UNKNOWN;; dtrace("\"%s\", %i, %i", type, standards, pedantic); if (type[0] != '\0' && type[1] == '\0' && (!pedantic || standards < 8)) t = _GD_LegacyType(type[0]); else if (pedantic && standards < 5) t = GD_UNKNOWN; else if (strcmp(type, "NULL") == 0) t = GD_NULL; else if (strcmp(type, "INT8") == 0) t = GD_INT8; else if (strcmp(type, "UINT8") == 0) t = GD_UINT8; else if (strcmp(type, "INT16") == 0) t = GD_INT16; else if (strcmp(type, "INT32") == 0) t = GD_INT32; else if (strcmp(type, "UINT32") == 0) t = GD_UINT32; else if (strcmp(type, "UINT64") == 0) t = GD_UINT64; else if (strcmp(type, "INT64") == 0) t = GD_INT64; else if (strcmp(type, "UINT16") == 0) t = GD_UINT16; else if (strcmp(type, "FLOAT32") == 0) t = GD_FLOAT32; else if (strcmp(type, "FLOAT") == 0) t = GD_FLOAT32; else if (strcmp(type, "FLOAT64") == 0) t = GD_FLOAT64; else if (strcmp(type, "DOUBLE") == 0) t = GD_FLOAT64; else if (pedantic && standards < 7) t = GD_UNKNOWN; else if (strcmp(type, "COMPLEX64") == 0) t = GD_COMPLEX64; else if (strcmp(type, "COMPLEX128") == 0) t = GD_COMPLEX128; dreturn("0x%X", t); return t; } static gd_windop_t _GD_WindOp(const char *op) { gd_windop_t o = GD_WINDOP_UNK; dtrace("\"%s\"", op); switch (op[0]) { case 'E': if (op[1] == 'Q') o = GD_WINDOP_EQ; break; case 'L': if (op[1] == 'T') o = GD_WINDOP_LT; else if (op[1] == 'E') o = GD_WINDOP_LE; break; case 'G': if (op[1] == 'T') o = GD_WINDOP_GT; else if (op[1] == 'E') o = GD_WINDOP_GE; break; case 'N': if (op[1] == 'E') o = GD_WINDOP_NE; break; case 'S': if (op[1] == 'E' && op[2] == 'T') o = GD_WINDOP_SET; break; case 'C': if (op[1] == 'L' && op[2] == 'R') o = GD_WINDOP_CLR; break; } dreturn("%i", o); return o; } /* Convert a string to a number. The non-NULL pointers provided dictate the * returned type. Returns -1 if it wasn't a number or -2 if it was but was * out of range */ int _GD_TokToNum(const char *restrict token, int standards, int pedantic, double *re, double *im, uint64_t *u, int64_t *i) { int64_t ir = 0, ii = 0; uint64_t ur = 0, ui = 0; double dr = 0, di = 0; char *endptr = NULL; gd_type_t rt = GD_UNKNOWN, it = GD_UNKNOWN; const int base = (!pedantic || standards >= 9) ? 0 : 10; dtrace("\"%s\", %i, %i, %p, %p, %p, %p", token, standards, pedantic, re, im, u, i); /* we have to run the token through both strtod and strtol because neither of * these handles all the allowed syntax */ /* the real part */ errno = 0; ir = gd_strtoll(token, &endptr, base); if (!errno && (*endptr == '\0' || *endptr == ';')) rt = GD_INT64; if (rt == GD_UNKNOWN && errno == ERANGE) { /* could be a uint64 > 2**63 */ errno = 0; ur = gd_strtoull(token, &endptr, base); if (!errno && (*endptr == '\0' || *endptr == ';')) rt = GD_UINT64; } if (rt == GD_UNKNOWN) { /* all that's left to try */ errno = 0; dr = gd_strtod(token, &endptr); if (!errno && (*endptr == '\0' || *endptr == ';')) rt = GD_FLOAT64; } /* check for real-part success */ if (rt == GD_UNKNOWN) { dreturn("%i", -1); return -1; } /* if there's no semicolon, set the imaginary part to zero */ if (*endptr == '\0') { it = GD_NULL; } else { /* convert imaginary part the same way */ token = endptr + 1; errno = 0; ii = gd_strtoll(token, &endptr, base); if (!errno && *endptr == '\0') it = (ii == 0) ? GD_NULL : GD_INT64; if (it == GD_UNKNOWN && errno == ERANGE) { /* could be a uint64 > 2**63 */ errno = 0; ui = gd_strtoull(token, &endptr, base); if (!errno && *endptr == '\0') it = (ui == 0) ? GD_NULL : GD_UINT64; } if (it == GD_UNKNOWN) { /* all that's left to try */ errno = 0; di = gd_strtod(token, &endptr); if (!errno && *endptr == '\0') it = (di == 0) ? GD_NULL : GD_FLOAT64; } /* check for imaginary-part success */ if (it == GD_UNKNOWN) { dreturn("%i", -1); return -1; } if (!im && it != GD_NULL) { /* reject unwanted complex value */ dreturn("%i", -2); return -2; } } /* return the desired value, if possible */ if (re) { /* float or complex */ if (rt == GD_FLOAT64) *re = dr; else if (rt == GD_INT64) *re = ir; else *re = ur; if (im) { /* complex */ if (it == GD_NULL) *im = 0; else if (it == GD_FLOAT64) *im = di; else if (it == GD_INT64) *im = ii; else if (it == GD_UINT64) *im = ui; } } else if (u) { /* unsigned int -- reject negative values */ if (rt == GD_UINT64) *u = ur; else if (rt == GD_INT64) { if (ir < 0) { dreturn("%i", -2); return -2; } *u = ir; } else { if (dr < 0) { dreturn("%i", -2); return -2; } *u = dr; } } else if (i) { /* int */ if (rt == GD_INT64) *i = ir; else if (rt == GD_FLOAT64) *i = dr; else { /* this must be an overflow */ dreturn("%i", -2); return -2; } } dreturn("%i", 0); return 0; } /* Compose a subfield code from a parent code and a subfield name -- this * used to be done in _GD_MungeCode */ static char *_GD_SubfieldCode(DIRFILE *D, const gd_entry_t *P, const char *code, char **nso, int *offset) { size_t len, len_par; char *new_code; dtrace("%p, %p, \"%s\", %p, %p", D, P, code, nso, offset); if (code == NULL) { dreturn("%p", NULL); return NULL; } len = strlen(code); len_par = strlen(P->field) + 1; if ((new_code = _GD_Malloc(D, len_par + len + 1)) == NULL) { dreturn("%p", NULL); return NULL; } strcpy(new_code, P->field); new_code[len_par - 1] = '/'; strcpy(new_code + len_par, code); if (offset) *offset = len_par; /* find the namespace, if necessary */ if (nso) { size_t i; for (i = strlen(new_code); i > 0; --i) if (new_code[i - 1] == ',') break; *nso = new_code + i; } dreturn("\"%s\" (%i, %p)", new_code, offset ? *offset : -1, nso ? *nso : NULL); return new_code; } /* Create a field code using the prefix and suffix of the given fragment and the * current namespace. * * Returns a newly malloc'd code, or NULL on error. nso points to the portion * of the code immediately after the namespace prefix. Offset is the offset * from the start of the code to the field name (ie. the character following * / for a metafield. */ static char *_GD_CodeFromFrag(DIRFILE *restrict D, const struct parser_state *restrict p, const gd_entry_t *restrict P, int me, const char *code, char **nso, int *offset) { char *new_code; dtrace("%p, %p, %p, %i, \"%s\", %p", D, p, P, me, code, offset); if (P) new_code = _GD_SubfieldCode(D, P, code, nso, offset); else { const char *ns = p->ns; size_t nsl = p->nsl; /* set fragment root space, if necessary */ if (!ns) { ns = D->fragment[me].ns; nsl = D->fragment[me].nsl; } new_code = _GD_MungeCode(D, ns, nsl, NULL, NULL, D->fragment[me].prefix, D->fragment[me].suffix, code, nso, offset, GD_MC_RQ_PARTS | GD_MC_ERROR_OK | GD_MC_NO_NS); } dreturn("\"%s\"", new_code); return new_code; } /* Canonicalise a field code used to specify an input field (scalar or vector) */ static char *_GD_InputCode(DIRFILE *D, const struct parser_state *restrict p, int me, const char *token) { char *code; const char *ns = p->ns; size_t nsl = p->nsl; unsigned flags = GD_MC_RQ_PARTS | GD_MC_ERROR_OK; dtrace("%p, %p, %i, \"%s\"", D, p, me, token); if (token[0] == '.') { /* absolute name */ token++; ns = D->fragment[me].ns; nsl = D->fragment[me].nsl; } else if (ns == NULL) { ns = D->fragment[me].ns; nsl = D->fragment[me].nsl; } code = _GD_MungeCode(D, ns, nsl, NULL, NULL, D->fragment[me].prefix, D->fragment[me].suffix, token, NULL, NULL, flags); dreturn("\"%s\"", code); return code; } /* Create E->field; frees the entry and returns non-zero on error. */ static int _GD_SetField(DIRFILE *restrict D, const struct parser_state *restrict p, gd_entry_t *restrict E, const gd_entry_t *restrict P, int me, const char *restrict name, int no_dot) { int offset; int is_dot = 0; dtrace("%p, %p, %p, %p, %i, \"%s\", %i", D, p, E, P, me, name, no_dot); E->field = _GD_CodeFromFrag(D, p, P, me, name, NULL, &offset); if (E->field && _GD_ValidateField(E->field + offset, p->standards, p->pedantic, GD_VF_NAME, (p->ns || no_dot) ? NULL : &is_dot)) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, p->file, p->line, name); } if (D->error) { _GD_FreeE(D, E, 1); dreturn("%i", 1); return 1; } if (is_dot) E->flags |= GD_EN_DOTTED; dreturn("%i", 0); return 0; } /* Returns a newly malloc'd string containing the scalar field name, or NULL on * numeric literal or error */ static char *_GD_SetScalar(DIRFILE *restrict D, const struct parser_state *restrict p, const char *restrict token, void *restrict data, gd_type_t type, int me, int *restrict index, unsigned *restrict flags) { char *lt, *ptr; int i; dtrace("%p, %p, \"%s\", %p, 0x%X, %p, %p", D, p, token, data, type, index, flags); /* try a numerical conversion */ if (type & GD_COMPLEX) { double re, im; i = _GD_TokToNum(token, p->standards, p->pedantic, &re, &im, NULL, NULL); if (i == -2) { /* malformed number */ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line, token); dreturn("%p", NULL); return NULL; } else if (i == -1) { /* assume it's a field name */ ptr = _GD_InputCode(D, p, me, token); if (D->error) { dreturn("%p", NULL); return NULL; } goto carray_check; } /* flag */ if (im && flags) *flags |= GD_EN_COMPSCAL; /* store the number */ if (type == GD_COMPLEX128) { *(double *)data = re; *((double *)data + 1) = im; } else if (type == GD_COMPLEX64) { *(float *)data = (float)re; *((float *)data + 1) = (float)im; } else _GD_InternalError(D); } else if (type & GD_IEEE754) { double d; i = _GD_TokToNum(token, p->standards, p->pedantic, &d, NULL, NULL, NULL); if (i == -2) { /* malformed number */ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line, token); dreturn("%p", NULL); return NULL; } else if (i == -1) { /* assume it's a field name */ ptr = _GD_InputCode(D, p, me, token); if (D->error) { dreturn("%p", NULL); return NULL; } goto carray_check; } /* store the number */ if (type == GD_FLOAT64) *(double *)data = d; else if (type == GD_FLOAT32) *(float *)data = (float)d; else _GD_InternalError(D); } else if (type & GD_SIGNED) { int64_t lli; i = _GD_TokToNum(token, p->standards, p->pedantic, NULL, NULL, NULL, &lli); if (i == -2) { /* malformed number */ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line, token); dreturn("%p", NULL); return NULL; } else if (i == -1) { /* assume it's a field name */ ptr = _GD_InputCode(D, p, me, token); if (D->error) { dreturn("%p", NULL); return NULL; } goto carray_check; } if (type == GD_INT64) *(int64_t *)data = (int64_t)lli; else if (type == GD_INT32) *(int32_t *)data = (int32_t)lli; else if (type == GD_INT16) *(int16_t *)data = (int16_t)lli; else if (type == GD_INT8) *(int8_t *)data = (int8_t)lli; else _GD_InternalError(D); } else { uint64_t ulli; i = _GD_TokToNum(token, p->standards, p->pedantic, NULL, NULL, &ulli, NULL); if (i == -2) { /* malformed number */ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line, token); dreturn("%p", NULL); return NULL; } else if (i == -1) { /* assume it's a field name */ ptr = _GD_InputCode(D, p, me, token); if (D->error) { dreturn("%p", NULL); return NULL; } goto carray_check; } if (type == GD_UINT64) *(uint64_t *)data = (uint64_t)ulli; else if (type == GD_UINT32) *(uint32_t *)data = (uint32_t)ulli; else if (type == GD_UINT16) *(uint16_t *)data = (uint16_t)ulli; else if (type == GD_UINT8) *(uint8_t *)data = (uint8_t)ulli; else _GD_InternalError(D); } dreturn("%p", NULL); return NULL; carray_check: /* look a < > delimeters */ *index = -1; for (lt = ptr; *lt; ++lt) { if (*lt == '<') { char *endptr = NULL; *lt = '\0'; *index = (int)strtol(lt + 1, &endptr, 0); if (*endptr != '>') { /* invalid CARRAY index, undo the elision */ *lt = '<'; *index = -1; } else break; } } dreturn("\"%s\" (%i)", ptr, *index); return ptr; } /* _GD_ParseRaw: parse a RAW entry in the format file */ static gd_entry_t *_GD_ParseRaw(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } /* META RAW fields are prohibited */ if (parent != NULL) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_METARAW, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_RAW_ENTRY; E->e->u.raw.file[0].idata = E->e->u.raw.file[1].idata = -1; E->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN; /* don't know the encoding subscheme yet */ if (_GD_SetField(D, p, E, NULL, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->e->u.raw.filebase = _GD_Strdup(D, in_cols[0]); E->EN(raw,data_type) = _GD_RawType(in_cols[2], p->standards, p->pedantic); E->e->u.raw.size = GD_SIZE(E->EN(raw,data_type)); if (E->e->u.raw.size == 0 || E->EN(raw,data_type) & 0x40) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, p->file, p->line, in_cols[2]); else if ((E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(raw,spf), GD_UINT_TYPE, me, E->scalar_ind, NULL)) == NULL) { E->flags |= GD_EN_CALC; if (!D->error && E->EN(raw,spf) <= 0) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_SPF, p->file, p->line, in_cols[3]); } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseLincom: parse a LINCOM entry in the format file. */ static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { int i; char* ptr = NULL; gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 3) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_LINCOM_ENTRY; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->flags |= GD_EN_CALC; E->EN(lincom,n_fields) = (int)(strtol(in_cols[2], &ptr, 10)); if (*ptr != '\0') { E->EN(lincom,n_fields) = (n_cols - 2) / 3; /* assume has been omitted */ if (n_cols % 3 != 2 || E->EN(lincom,n_fields) < 1 || E->EN(lincom,n_fields) > GD_MAX_LINCOM) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } /* the following two statements are somewhat hacky.... */ n_cols++; in_cols--; } if ((E->EN(lincom,n_fields) < 1) || (E->EN(lincom,n_fields) > GD_MAX_LINCOM)) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_FIELDS, p->file, p->line, in_cols[2]); else if (n_cols < E->EN(lincom,n_fields) * 3 + 3) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); else for (i = 0; i < E->EN(lincom,n_fields); i++) { E->in_fields[i] = _GD_InputCode(D, p, me, in_cols[i * 3 + 3]); E->scalar[i] = _GD_SetScalar(D, p, in_cols[i * 3 + 4], &E->EN(lincom,cm)[i], GD_COMPLEX128, me, E->scalar_ind + i, &E->flags); E->EN(lincom,m)[i] = creal(E->EN(lincom,cm)[i]); E->scalar[i + GD_MAX_LINCOM] = _GD_SetScalar(D, p, in_cols[i * 3 + 5], &E->EN(lincom,cb)[i], GD_COMPLEX128, me, E->scalar_ind + i + GD_MAX_LINCOM, &E->flags); E->EN(lincom,b)[i] = creal(E->EN(lincom,cb)[i]); if (E->scalar[i] != NULL || E->scalar[i + GD_MAX_LINCOM] != NULL) E->flags &= ~GD_EN_CALC; } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseLinterp: parse a LINTERP entry in the format file. */ static gd_entry_t *_GD_ParseLinterp(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_LINTERP_ENTRY; E->in_fields[0] = NULL; E->e->entry[0] = NULL; E->flags |= GD_EN_CALC; E->EN(linterp,table) = NULL; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); E->e->u.linterp.table_len = -1; /* linterp file not read yet */ E->EN(linterp,table) = _GD_Strdup(D, in_cols[3]); if (D->error) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseYoke: parse a field specified by two input fields only (MULTIPLY, * DIVIDE) */ static gd_entry_t *_GD_ParseYoke(DIRFILE *restrict D, gd_entype_t type, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, 0x%X, %p, %p, %i, %p, %i", D, type, p, in_cols, n_cols, parent, me); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = type; E->in_fields[0] = E->in_fields[1] = NULL; E->e->entry[0] = E->e->entry[1] = NULL; E->flags |= GD_EN_CALC; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); E->in_fields[1] = _GD_InputCode(D, p, me, in_cols[3]); if (D->error) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseRecip: parse RECIP entry in format file. */ static gd_entry_t *_GD_ParseRecip(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_RECIP_ENTRY; E->in_fields[0] = NULL; E->e->entry[0] = NULL; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(recip,cdividend), GD_COMPLEX128, me, E->scalar_ind, &E->flags); E->EN(recip,dividend) = creal(E->EN(recip,cdividend)); if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseWindow: parse WINDOW entry in format file. */ static gd_entry_t *_GD_ParseWindow(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 6) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_WINDOW_ENTRY; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); E->in_fields[1] = _GD_InputCode(D, p, me, in_cols[3]); E->EN(window,windop) = _GD_WindOp(in_cols[4]); if (E->EN(window,windop) == GD_WINDOP_UNK) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_WINDOP, p->file, p->line, in_cols[4]); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } switch (E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: E->scalar[0] = _GD_SetScalar(D, p, in_cols[5], &E->EN(window,threshold.i), GD_INT64, me, E->scalar_ind, NULL); break; case GD_WINDOP_SET: case GD_WINDOP_CLR: E->scalar[0] = _GD_SetScalar(D, p, in_cols[5], &E->EN(window,threshold.u), GD_UINT64, me, E->scalar_ind, NULL); break; default: E->scalar[0] = _GD_SetScalar(D, p, in_cols[5], &E->EN(window,threshold.r), GD_FLOAT64, me, E->scalar_ind, NULL); break; } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseMplex: parse MPLEX entry in format file. */ static gd_entry_t *_GD_ParseMplex(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 5) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_MPLEX_ENTRY; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); E->in_fields[1] = _GD_InputCode(D, p, me, in_cols[3]); E->scalar[0] = _GD_SetScalar(D, p, in_cols[4], &E->EN(mplex,count_val), GD_INT_TYPE, me, E->scalar_ind, NULL); /* the period, if present */ if (n_cols > 5) { E->scalar[1] = _GD_SetScalar(D, p, in_cols[5], &E->EN(mplex,period), GD_INT_TYPE, me, E->scalar_ind + 1, NULL); if (E->scalar[1] == NULL && E->EN(mplex,period) < 0) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_MPLEXVAL, p->file, p->line, in_cols[5]); } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseBit: parse BIT entry in format file. */ static gd_entry_t *_GD_ParseBit(DIRFILE *restrict D, int is_signed, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %i, %p, %p, %i, %p, %i", D, is_signed, p, in_cols, n_cols, parent, me); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = (is_signed) ? GD_SBIT_ENTRY : GD_BIT_ENTRY; E->in_fields[0] = NULL; E->e->entry[0] = NULL; E->flags |= GD_EN_CALC; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(bit,bitnum), GD_INT_TYPE, me, E->scalar_ind, NULL); if (n_cols > 4) E->scalar[1] = _GD_SetScalar(D, p, in_cols[4], &E->EN(bit,numbits), GD_INT_TYPE, me, E->scalar_ind + 1, NULL); else E->EN(bit,numbits) = 1; if (E->scalar[0] != NULL || E->scalar[1] != NULL) E->flags &= ~GD_EN_CALC; if (E->scalar[1] == NULL && E->EN(bit,numbits) < 1) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NUMBITS, p->file, p->line, NULL); else if (E->scalar[0] == NULL && E->EN(bit,bitnum) < 0) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITNUM, p->file, p->line, NULL); else if ((E->flags & GD_EN_CALC) && E->EN(bit,bitnum) + E->EN(bit,numbits) - 1 > 63) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BITSIZE, p->file, p->line, NULL); } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParsePhase: parse PHASE entry in formats file. */ static gd_entry_t *_GD_ParsePhase(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_PHASE_ENTRY; E->in_fields[0] = NULL; E->e->entry[0] = NULL; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); if ((E->scalar[0] = _GD_SetScalar(D, p, in_cols[3], &E->EN(phase,shift), GD_INT64, me, E->scalar_ind, NULL)) == NULL) { E->flags |= GD_EN_CALC; } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParsePolynom: parse a POLYNOM in the format file. */ static gd_entry_t *_GD_ParsePolynom(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { int i; gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 5) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_POLYNOM_ENTRY; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->EN(polynom,poly_ord) = n_cols - 4; /* the legacy ignore-trailing-tokens "feature" */ if (E->EN(polynom,poly_ord) > GD_MAX_POLYORD) E->EN(polynom,poly_ord) = GD_MAX_POLYORD; E->flags |= GD_EN_CALC; E->in_fields[0] = _GD_InputCode(D, p, me, in_cols[2]); for (i = 0; i <= E->EN(polynom,poly_ord); i++) { E->scalar[i] = _GD_SetScalar(D, p, in_cols[i + 3], &E->EN(polynom,ca)[i], GD_COMPLEX128, me, E->scalar_ind + i, &E->flags); E->EN(polynom,a)[i] = creal(E->EN(polynom,ca)[i]); if (E->scalar[i] != NULL) E->flags &= ~GD_EN_CALC; } if (D->error != GD_E_OK) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type) { dtrace("%p, 0x%X", D, type); switch (type) { case GD_UINT8: case GD_UINT16: case GD_UINT32: case GD_UINT64: dreturn("0x%X", GD_UINT64); return GD_UINT64; case GD_INT8: case GD_INT16: case GD_INT32: case GD_INT64: dreturn("0x%X", GD_INT64); return GD_INT64; case GD_FLOAT32: case GD_FLOAT64: dreturn("0x%X", GD_FLOAT64); return GD_FLOAT64; case GD_COMPLEX64: case GD_COMPLEX128: dreturn("0x%X", GD_COMPLEX128); return GD_COMPLEX128; case GD_NULL: case GD_UNKNOWN: _GD_InternalError(D); } dreturn("0x%X", GD_NULL); return GD_NULL; } /* _GD_ParseConst: parse CONST entry in formats file. */ static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { int offset; char* ptr; gd_type_t type; gd_entry_t *E; dtrace("%p, %p, %p, %i, %p", D, p, in_cols, n_cols, parent); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_CONST_ENTRY; E->flags |= GD_EN_CALC; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->EN(scalar,const_type) = _GD_RawType(in_cols[2], p->standards, p->pedantic); E->EN(scalar,array_len) = -1; if (GD_SIZE(E->EN(scalar,const_type)) == 0 || E->EN(scalar,const_type) & 0x40) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, p->file, p->line, in_cols[2]); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } type = _GD_ConstType(D, E->EN(scalar,const_type)); E->e->u.scalar.d = _GD_Malloc(D, GD_SIZE(type)); if (D->error) { _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } ptr = _GD_SetScalar(D, p, in_cols[3], E->e->u.scalar.d, type, me, &offset, NULL); if (ptr) { free(ptr); _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line, in_cols[3]); } if (D->error) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseArray: parse [CS]ARRAY entry in formats file. */ static gd_entry_t *_GD_ParseArray(DIRFILE *restrict D, const struct parser_state *restrict p, char *in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me, char **outstring, const char *tok_pos) { int offset, c, first, s; size_t n = 0, data_size = 0, new_size; gd_type_t t = GD_NULL; char* ptr; void *data = NULL; gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i, %p, %p", D, p, in_cols, n_cols, parent, me, outstring, tok_pos); if (n_cols < 4) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_CARRAY_ENTRY; E->flags |= GD_EN_CALC; if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } E->EN(scalar,const_type) = _GD_RawType(in_cols[2], p->standards, p->pedantic); t = _GD_ConstType(D, E->EN(scalar,const_type)); first = 3; s = GD_SIZE(t); if (GD_SIZE(E->EN(scalar,const_type)) == 0 || E->EN(raw,data_type) & 0x40) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_TYPE, p->file, p->line, in_cols[2]); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } /* spool in the data */ new_size = MAX_IN_COLS - first; for (;;) { if (data_size < new_size) { void *new_data = _GD_Realloc(D, data, new_size * s); if (new_data == NULL) { free(data); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } data = new_data; data_size = new_size; } for (c = first; c < n_cols; ++c) { if (n == GD_SIZE_T_MAX) break; ptr = _GD_SetScalar(D, p, in_cols[c], (char *)data + s * n++, t, me, &offset, NULL); if (ptr) { free(ptr); free(data); _GD_FreeE(D, E, 1); _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LITERAL, p->file, p->line, in_cols[c]); dreturn("%p", NULL); return NULL; } } if (n_cols < MAX_IN_COLS) break; /* get more tokens */ free(*outstring); n_cols = _GD_Tokenise(D, p, tok_pos, outstring, &tok_pos, MAX_IN_COLS, in_cols); if (n_cols == 0 || D->error) break; first = 0; new_size = data_size + n_cols; } /* save the list */ E->e->u.scalar.d = data; E->EN(scalar,array_len) = n; if (D->error) { _GD_FreeE(D, E, 1); E = NULL; } dreturn("%p", E); return E; } /* _GD_ParseString: parse STRING entry in formats file. */ static gd_entry_t *_GD_ParseString(DIRFILE *restrict D, const struct parser_state *restrict p, char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols, const gd_entry_t *restrict parent, int me) { gd_entry_t *E; dtrace("%p, %p, %p, %i, %p, %i", D, p, in_cols, n_cols, parent, me); if (n_cols < 3) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); dreturn("%p", NULL); return NULL; } E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturn("%p", NULL); return NULL; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturn("%p", NULL); return NULL; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_STRING_ENTRY; E->e->u.string = _GD_Strdup(D, in_cols[2]); E->flags |= GD_EN_CALC; if (D->error) { _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } if (_GD_SetField(D, p, E, parent, me, in_cols[0], 0)) { dreturn("%p", NULL); return NULL; } dreturn("%p", E); return E; } static int _GD_UTF8Encode(DIRFILE *restrict D, const char *restrict format_file, int linenum, char **restrict op, uint32_t value) { dtrace("%p, %p, %llx", D, op, (unsigned long long)value); if (value > 0x10FFFF || value == 0) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, format_file, linenum, NULL); dreturn("%i", 1); return 1; } if (value <= 0x7F) *((*op)++) = (char)value; else if (value <= 0x7FF) { *((*op)++) = (char)(0xC0 + (value >> 6)); *((*op)++) = (char)(0x80 + (value & 0x3F)); } else if (value <= 0xFFFF) { *((*op)++) = (char)(0xE0 + (value >> 12)); *((*op)++) = (char)(0x80 + ((value >> 6) & 0x3F)); *((*op)++) = (char)(0x80 + (value & 0x3F)); } else { *((*op)++) = (char)(0xF0 + (value >> 18)); *((*op)++) = (char)(0x80 + ((value >> 12) & 0x3F)); *((*op)++) = (char)(0x80 + ((value >> 6) & 0x3F)); *((*op)++) = (char)(0x80 + (value & 0x3F)); } dreturn("%i", 0); return 0; } /* _GD_CheckParent: look for a slashed field name and, if found, see if the * parent exists in the current fragment. Returns parent entry on success, * and points *name to the metaname part. me == -1 implies we're not in the * parser, but called from _GD_Add. */ gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, const struct parser_state *p, char **restrict name, int me) { char *cptr, *munged_code; gd_entry_t *P = NULL; dtrace("%p, %p, \"%s\", %i", D, p, *name, me); for (cptr = *name + 1; *cptr != '\0'; ++cptr) if (*cptr == '/') { *cptr = '\0'; if (me == -1) munged_code = strdup(*name); else munged_code = _GD_CodeFromFrag(D, p, NULL, me, *name, NULL, NULL); if (munged_code) { P = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL); free(munged_code); } if (P == NULL) { if (me == -1) { *cptr = '/'; /* undo field munging; _GD_Add will conclude this is a field with an illegal '/' */ dreturn("%p", NULL); return NULL; } _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, p->file, p->line, *name); } else if (P->field_type == GD_ALIAS_ENTRY) { if (me == -1) P = P->e->entry[0]; /* just de-alias */ else _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ALIAS, p->file, p->line, *name); } else if (P->fragment_index != me && me != -1) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, p->file, p->line, *name); if (D->error) { dreturn("%p", NULL); return NULL; } /* point name to the metafield name */ *name = cptr + 1; break; } dreturn("%p", P); return P; } /* _GD_ParseFieldSpec: Parse a format file line fragment containing a field * specification */ gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict D, const struct parser_state *restrict p, int n_cols, char **in_cols, const gd_entry_t *restrict P, int me, int creat, int insert, char **outstring, const char *tok_pos) { gd_entry_t* E = NULL; void *ptr; dtrace("%p, %p, %i, %p, %p, %i, %i, %i, %p, %p", D, p, n_cols, in_cols, P, me, creat, insert, outstring, tok_pos); /* Check for barth-style metafield definition */ if (P == NULL && GD_PVERS_GE(*p, 7)) { P = _GD_CheckParent(D, p, in_cols + 0, me); if (P) { if (n_cols < 2) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); else E = _GD_ParseFieldSpec(D, p, n_cols, in_cols, P, me, creat, insert, outstring, tok_pos); dreturn("%p", (!insert) ? E : NULL); return (!insert) ? E : NULL; } } ptr = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*)); if (ptr == NULL) { dreturn ("%p", NULL); return NULL; } D->entry = (gd_entry_t **)ptr; if (n_cols < 2) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); else if (P == NULL && (strcmp(in_cols[0], "INDEX") == 0 || (p->pedantic && p->standards < 6 && strcmp(in_cols[0], "FILEFRAM") == 0))) /* reserved field name */ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_RES_NAME, p->file, p->line, NULL); else switch (in_cols[1][0]) { case 'B': if (strcmp(in_cols[1], "BIT") == 0) E = _GD_ParseBit(D, 0, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'C': if (strcmp(in_cols[1], "CARRAY") == 0 && GD_PVERS_GE(*p, 8)) E = _GD_ParseArray(D, p, in_cols, n_cols, P, me, outstring, tok_pos); else if (strcmp(in_cols[1], "CONST") == 0 && GD_PVERS_GE(*p, 6)) E = _GD_ParseConst(D, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'D': if (strcmp(in_cols[1], "DIVIDE") == 0 && GD_PVERS_GE(*p, 8)) E = _GD_ParseYoke(D, GD_DIVIDE_ENTRY, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'L': if (strcmp(in_cols[1], "LINCOM") == 0) E = _GD_ParseLincom(D, p, in_cols, n_cols, P, me); else if (strcmp(in_cols[1], "LINTERP") == 0) E = _GD_ParseLinterp(D, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'M': if (strcmp(in_cols[1], "MPLEX") == 0 && GD_PVERS_GE(*p, 9)) E = _GD_ParseMplex(D, p, in_cols, n_cols, P, me); else if (strcmp(in_cols[1], "MULTIPLY") == 0 && GD_PVERS_GE(*p, 2)) E = _GD_ParseYoke(D, GD_MULTIPLY_ENTRY, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'P': if (strcmp(in_cols[1], "PHASE") == 0 && GD_PVERS_GE(*p, 4)) E = _GD_ParsePhase(D, p, in_cols, n_cols, P, me); else if (strcmp(in_cols[1], "POLYNOM") == 0 && GD_PVERS_GE(*p, 7)) E = _GD_ParsePolynom(D, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'R': if (strcmp(in_cols[1], "RAW") == 0) { E = _GD_ParseRaw(D, p, in_cols, n_cols, P, me); /* Create the binary file, if requested */ if (!D->error && creat) { /* If this fragment is protected, we can't do anything */ if (D->fragment[me].protection != GD_PROTECT_NONE) _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[me].cname); /* If the encoding scheme is unknown, we can't add the field */ if (D->fragment[me].encoding == GD_AUTO_ENCODED) _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0, NULL); else if (D->fragment[me].encoding == GD_ENC_UNSUPPORTED) /* If the encoding scheme is unsupported, can't add the field */ _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL); else _GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_WRITE | GD_FILE_TOUCH, _GD_FileSwapBytes(D, E)); } /* Is this the first raw field ever defined? */ if (!D->error && D->fragment[E->fragment_index].ref_name == NULL) if (D->reference_field == NULL) D->reference_field = E; } else if (strcmp(in_cols[1], "RECIP") == 0 && GD_PVERS_GE(*p, 8)) E = _GD_ParseRecip(D, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'S': if (strcmp(in_cols[1], "SBIT") == 0 && GD_PVERS_GE(*p, 7)) E = _GD_ParseBit(D, 1, p, in_cols, n_cols, P, me); else if (strcmp(in_cols[1], "STRING") == 0 && GD_PVERS_GE(*p, 6)) E = _GD_ParseString(D, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; case 'W': if (strcmp(in_cols[1], "WINDOW") == 0 && GD_PVERS_GE(*p, 9)) E = _GD_ParseWindow(D, p, in_cols, n_cols, P, me); else goto NO_MATCH; break; default: NO_MATCH: /* We ignore indecipherable lines if we seen a /VERSION greater than * what we know about and we're not in pedantic mode */ if (p->standards <= GD_DIRFILE_STANDARDS_VERSION || p->pedantic) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_LINE, p->file, p->line, NULL); } if (insert && D->error == GD_E_OK && E != NULL) { unsigned int u; /* Check for duplicate */ if (_GD_FindField(D, E->field, D->entry, D->n_entries, 0, &u)) { if (~p->flags & GD_IGNORE_DUPS) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, p->file, p->line, E->field); _GD_FreeE(D, E, 1); dreturn("%p", NULL); return NULL; } if (E->flags & GD_EN_DOTTED) { ptr = _GD_Realloc(D, D->dot_list, (D->n_dot + 1) * sizeof(gd_entry_t*)); if (ptr == NULL) { _GD_FreeE(D, E, 1); dreturn ("%p", NULL); return NULL; } D->dot_list = (gd_entry_t **)ptr; } /* Initialse the meta counts */ if (P != NULL) { E->e->n_meta = -1; E->e->p.parent = P; /* there is no need to sort this list */ ptr = _GD_Realloc(D, P->e->p.meta_entry, (P->e->n_meta + 1) * sizeof(gd_entry_t*)); if (ptr == NULL) { _GD_FreeE(D, E, 1); dreturn ("%p", NULL); return NULL; } /* Nothing may fail from now on */ P->e->p.meta_entry = (gd_entry_t **)ptr; P->e->p.meta_entry[P->e->n_meta++] = E; } /* the Format file fragment index */ E->fragment_index = me; /* update the dot list if necessary */ if (E->flags & GD_EN_DOTTED) { D->dot_list[D->n_dot++] = E; qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp); } /* sort */ _GD_InsertSort(D, E, u); D->n_entries++; } /* return the entry object if we either: * - didn't insert the object into the list of fields (ie. we were called * by [m]alter_spec) * - found a RAW field (which might be the reference field) */ dreturn("%p", (!insert || (E && E->field_type == GD_RAW_ENTRY)) ? E : NULL); return (!insert || (E && E->field_type == GD_RAW_ENTRY)) ? E : NULL; } /* _GD_Tokenise: Tokenise a line. Returns n_cols. This is a simple state * machine. */ #define ACC_MODE_NONE 0 #define ACC_MODE_OCTAL 1 #define ACC_MODE_HEX 2 #define ACC_MODE_UTF8 3 int _GD_Tokenise(DIRFILE *restrict D, const struct parser_state *restrict p, const char *restrict instring, char **outstring, const char **pos, int tok_want, char **in_cols) { const char* ip; char* op; int n_cols = 0; int escaped_char = 0; int quotated = 0; int ws = 1; uint32_t accumulator = 0; int n_acc = 0; int acc_mode = ACC_MODE_NONE; dtrace("%p, %p, \"%s\", %p, %p, %i, %p", D, p, instring, outstring, pos, tok_want, in_cols); op = *outstring = _GD_Strdup(D, instring); if (op == NULL) { dreturn("%i", 0); return 0; } *op = '\0'; /* tokenise the line */ for (ip = instring; *ip != '\0'; ++ip) { if (escaped_char) { if (ws) { if (n_cols >= tok_want) break; /* Ignore trailing data on the line */ in_cols[n_cols++] = op; ws = 0; } if (acc_mode == ACC_MODE_OCTAL) { if (*ip >= '0' && *ip <= '7') { accumulator = accumulator * 8 + *ip - '0'; n_acc++; } if (n_acc == 3 || accumulator > 037 || *ip < '0' || *ip > '7') { if (accumulator == 0) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, p->file, p->line, NULL); break; } *(op++) = (char)accumulator; if (*ip < '0' || *ip > '7') ip--; /* rewind */ escaped_char = 0; acc_mode = ACC_MODE_NONE; } } else if (acc_mode != ACC_MODE_NONE) { if (isxdigit(*ip)) { n_acc++; if (*ip >= '0' && *ip <= '9') accumulator = accumulator * 16 + *ip - '0'; else if (*ip >= 'A' && *ip <= 'F') accumulator = accumulator * 16 + *ip - 'A' + 10; else accumulator = accumulator * 16 + *ip - 'a' + 10; } if (acc_mode == ACC_MODE_HEX && (n_acc == 2 || !isxdigit(*ip))) { if (accumulator == 0) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_CHARACTER, p->file, p->line, NULL); break; } *(op++) = (char)accumulator; if (!isxdigit(*ip)) ip--; /* rewind */ escaped_char = 0; acc_mode = ACC_MODE_NONE; } else if (acc_mode == ACC_MODE_UTF8 && (n_acc == 7 || accumulator > 0x10FFFF || !isxdigit(*ip))) { if (_GD_UTF8Encode(D, p->file, p->line, &op, accumulator)) break; /* syntax error */ if (!isxdigit(*ip)) ip--; /* rewind */ escaped_char = 0; acc_mode = ACC_MODE_NONE; } } else { switch(*ip) { case '\n': /* this is a backslach at the end of a line -- we don't support line splicing in this manner */ break; case 'a': *(op++) = '\a'; escaped_char = 0; break; case 'b': *(op++) = '\b'; escaped_char = 0; break; case 'e': *(op++) = '\x1B'; escaped_char = 0; break; case 'f': *(op++) = '\f'; escaped_char = 0; break; case 'n': *(op++) = '\n'; escaped_char = 0; break; case 'r': *(op++) = '\r'; escaped_char = 0; break; case 't': *(op++) = '\t'; escaped_char = 0; break; case 'v': *(op++) = '\v'; escaped_char = 0; break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': n_acc = 1; accumulator = *ip - '0'; acc_mode = ACC_MODE_OCTAL; break; case 'u': n_acc = 0; accumulator = 0; acc_mode = ACC_MODE_UTF8; break; case 'x': n_acc = 0; accumulator = 0; acc_mode = ACC_MODE_HEX; break; default: *(op++) = *ip; escaped_char = 0; } } } else { if (*ip == '\\' && GD_PVERS_GE(*p, 6)) escaped_char = 1; else if (*ip == '"' && GD_PVERS_GE(*p, 6)) { if ((quotated = !quotated)) { if (ws) { if (n_cols >= tok_want) break; /* Ignore trailing data on the line */ in_cols[n_cols++] = op; ws = 0; } } } else if (!quotated && *ip <= ' ' && (*ip == ' ' || *ip == '\n' || *ip == '\t' || *ip == '\r' || *ip == '\f' || *ip == '\v')) { if (!ws) { *(op++) = '\0'; ws = 1; } } else if (!quotated && *ip == '#') { *op = '\0'; break; } else { if (ws) { if (n_cols >= tok_want) break; /* Ignore trailing data on the line */ in_cols[n_cols++] = op; ws = 0; } *(op++) = *ip; } } } *op = '\0'; if (quotated || escaped_char) { if (*ip == 0 || *ip == '\n') { /* Unterminated token */ if (D->error == 0) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_UNTERM, p->file, p->line, NULL); } else { /* a partial tokenisation where we've landed on top of " or \ when * finishing up; back up a space */ ip--; } } if (pos) *pos = ip; dreturn("%i", n_cols); return n_cols; } /* _GD_ParseAlias: set up an alias */ static void _GD_ParseAlias(DIRFILE *restrict D, const struct parser_state *restrict p, char **restrict name, const char *restrict target, int me) { gd_entry_t **new_meta_list = NULL; gd_entry_t *E, *P = NULL; unsigned int u; void *ptr; dtrace("%p, %p, \"%s\", \"%s\", %i", D, p, *name, target, me); P = _GD_CheckParent(D, p, name, me); if (D->error) { dreturnvoid(); return; } ptr = _GD_Realloc(D, D->entry, (D->n_entries + 1) * sizeof(gd_entry_t*)); if (ptr == NULL) { dreturnvoid(); return; } D->entry = (gd_entry_t **)ptr; E = (gd_entry_t *)_GD_Malloc(D, sizeof(gd_entry_t)); if (E == NULL) { dreturnvoid(); return; } memset(E, 0, sizeof(gd_entry_t)); E->e = (struct gd_private_entry_ *)_GD_Malloc(D, sizeof(struct gd_private_entry_)); if (E->e == NULL) { free(E); dreturnvoid(); return; } memset(E->e, 0, sizeof(struct gd_private_entry_)); E->field_type = GD_ALIAS_ENTRY; E->fragment_index = me; E->in_fields[0] = _GD_InputCode(D, p, me, target); if (D->error) { _GD_FreeE(D, E, 1); dreturnvoid(); return; } if (_GD_SetField(D, p, E, P, me, *name, 1)) { dreturnvoid(); return; } /* Check for duplicate */ if (_GD_FindField(D, E->field, D->entry, D->n_entries, 0, &u)) { if (!(p->flags & GD_IGNORE_DUPS)) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_DUPLICATE, p->file, p->line, E->field); _GD_FreeE(D, E, 1); dreturnvoid(); return; } /* Allocate where necessary */ if (P) { new_meta_list = (gd_entry_t **)_GD_Realloc(D, P->e->p.meta_entry, (P->e->n_meta + 1) * sizeof(gd_entry_t*)); if (new_meta_list == NULL) { _GD_FreeE(D, E, 1); dreturnvoid(); return; } } /* Nothing from here on may fail */ /* Initialse the meta counts */ if (P) { E->e->n_meta = -1; E->e->p.parent = P; /* there is no need to sort this list */ P->e->p.meta_entry = new_meta_list; P->e->p.meta_entry[P->e->n_meta++] = E; } /* sort */ _GD_InsertSort(D, E, u); D->n_entries++; dreturnvoid(); } /* _GD_ParseDirective: Actually parse a single format file line. * Returns 1 if a match was made. */ static int _GD_ParseDirective(DIRFILE *D, struct parser_state *restrict p, char **in_cols, int n_cols, int me, char **restrict ref_name, char **outstring, const char *tok_pos) { const char* ptr; char *munged_code; int i, matched = 0; gd_entry_t *E = NULL; dtrace("%p, %p, %p, %i, %i, %p, %p, %p", D, p, in_cols, n_cols, me, ref_name, outstring, tok_pos); /* Starting with Standards Version 8, the forward slash is required. */ if (p->standards >= 8 && p->pedantic && in_cols[0][0] != '/') { dreturn("%i", 0); return 0; } /* set up for possibly slashed reserved words */ ptr = in_cols[0]; if (GD_PVERS_GE(*p, 5)) if (in_cols[0][0] == '/') ptr++; if (!p->pedantic && in_cols[0][0] != '/' && n_cols > 2) /* check for a field spec masquerading as a directive */ if ((strcmp(in_cols[1], "RAW") == 0) || (strcmp(in_cols[1], "LINCOM") == 0) || (strcmp(in_cols[1], "BIT") == 0) || (strcmp(in_cols[1], "LINTERP") == 0) || (strcmp(in_cols[1], "PHASE") == 0) || (strcmp(in_cols[1], "MULTIPLY") == 0) || (strcmp(in_cols[1], "SBIT") == 0) || (strcmp(in_cols[1], "POLYNOM") == 0) || (strcmp(in_cols[1], "STRING") == 0) || (strcmp(in_cols[1], "CONST") == 0)) { dreturn("%i", 0); return 0; } switch(ptr[0]) { case 'A': if (strcmp(ptr, "ALIAS") == 0 && GD_PVERS_GE(*p, 9)) { matched = 1; if (n_cols < 3) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); break; } _GD_ParseAlias(D, p, in_cols + 1, in_cols[2], me); } break; case 'E': if (strcmp(ptr, "ENCODING") == 0 && GD_PVERS_GE(*p, 6)) { matched = 1; if (!(p->flags & GD_FORCE_ENCODING)) { D->fragment[me].encoding = GD_ENC_UNSUPPORTED; for (i = 0; i < GD_N_SUBENCODINGS - 1; ++i) if (strcmp(in_cols[1], _GD_ef[i].ffname) == 0) { D->fragment[me].encoding = _GD_ef[i].scheme; free(D->fragment[me].enc_data); if (n_cols > 2 && _GD_ef[i].flags & GD_EF_EDAT) D->fragment[me].enc_data = _GD_Strdup(D, in_cols[2]); else D->fragment[me].enc_data = NULL; break; } } } else if (strcmp(ptr, "ENDIAN") == 0 && GD_PVERS_GE(*p, 5)) { matched = 1; if (!(p->flags & GD_FORCE_ENDIAN)) { if (strcmp(in_cols[1], "big") == 0) D->fragment[me].byte_sex = GD_BIG_ENDIAN; else if (strcmp(in_cols[1], "little") == 0) D->fragment[me].byte_sex = GD_LITTLE_ENDIAN; else _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN, p->file, p->line, NULL); if (n_cols > 2 && GD_PVERS_GE(*p, 8)) { if (strcmp(in_cols[2], "arm") == 0) { #if ! defined(ARM_ENDIAN_DOUBLES) D->fragment[me].byte_sex |= GD_ARM_FLAG; #endif } else _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ENDIAN, p->file, p->line, NULL); } #ifdef ARM_ENDIAN_DOUBLES else D->fragment[me].byte_sex |= GD_ARM_FLAG; #endif } } break; case 'F': if (strcmp(ptr, "FRAMEOFFSET") == 0 && GD_PVERS_GE(*p, 1)) { matched = 1; D->fragment[me].frame_offset = gd_strtoll(in_cols[1], NULL, GD_PVERS_GE(*p, 9) ? 0 : 10); } break; case 'H': if (strcmp(ptr, "HIDDEN") == 0 && GD_PVERS_GE(*p, 9)) { matched = 1; munged_code = _GD_CodeFromFrag(D, p, NULL, me, in_cols[1], NULL, NULL); if (munged_code) E = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL); free(munged_code); if (E == NULL) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, p->file, p->line, in_cols[1]); else if (E->fragment_index != me) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, p->file, p->line, in_cols[1]); else E->flags |= GD_EN_HIDDEN; } break; case 'I': if (strcmp(ptr, "INCLUDE") == 0 && GD_PVERS_GE(*p, 3)) { char *new_ref = NULL; int frag; unsigned long oldflags = p->flags; matched = 1; p->flags = D->fragment[me].encoding | D->fragment[me].byte_sex | (p->flags & (GD_PEDANTIC | GD_PERMISSIVE | GD_FORCE_ENDIAN | GD_FORCE_ENCODING | GD_IGNORE_DUPS | GD_IGNORE_REFS)); frag = _GD_Include(D, p, in_cols[1], &new_ref, me, (n_cols > 2) ? in_cols[2] : NULL, (n_cols > 3) ? in_cols[3] : NULL, 0); if (new_ref) { free(*ref_name); *ref_name = new_ref; } p->flags = oldflags; if (p->pedantic) p->flags |= GD_PEDANTIC; if (frag != -1) D->fragment[me].vers |= D->fragment[frag].vers; } break; case 'M': if (strcmp(ptr, "META") == 0 && GD_PVERS_GE(*p, 6)) { matched = 1; munged_code = _GD_CodeFromFrag(D, p, NULL, me, in_cols[1], NULL, NULL); if (munged_code) { E = _GD_FindField(D, munged_code, D->entry, D->n_entries, 0, NULL); free(munged_code); } if (E == NULL) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_NO_FIELD, p->file, p->line, in_cols[1]); else if (E->field_type == GD_ALIAS_ENTRY) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_ALIAS, p->file, p->line, in_cols[1]); else if (E->fragment_index != me) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_LOCATION, p->file, p->line, in_cols[1]); else if (E->e->n_meta == -1) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_META_META, p->file, p->line, in_cols[1]); else if (n_cols < 4) _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); else _GD_ParseFieldSpec(D, p, n_cols - 2, in_cols + 2, E, me, 0, 1, outstring, tok_pos); } break; case 'P': if (strcmp(ptr, "PROTECT") == 0 && GD_PVERS_GE(*p, 6)) { matched = 1; if (strcmp(in_cols[1], "none") == 0) D->fragment[me].protection = GD_PROTECT_NONE; else if (strcmp(in_cols[1], "format") == 0) D->fragment[me].protection = GD_PROTECT_FORMAT; else if (strcmp(in_cols[1], "data") == 0) D->fragment[me].protection = GD_PROTECT_DATA; else if (strcmp(in_cols[1], "all") == 0) D->fragment[me].protection = GD_PROTECT_ALL; else _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_PROTECT, p->file, p->line, in_cols[1]); } break; case 'R': if (strcmp(ptr, "REFERENCE") == 0 && GD_PVERS_GE(*p, 6)) { matched = 1; free(*ref_name); *ref_name = _GD_InputCode(D, p, me, in_cols[1]); } break; case 'V': if (strcmp(ptr, "VERSION") == 0 && GD_PVERS_GE(*p, 5)) { matched = 1; p->standards = atoi(in_cols[1]); if (!p->pedantic && ~(p->flags) & GD_PERMISSIVE) p->flags |= (p->pedantic = GD_PEDANTIC); if (p->pedantic) D->fragment[me].vers |= 1ULL << p->standards; } break; } dreturn("%i", matched); return matched; } /* Resolve and record an alias, taking care of loops */ static gd_entry_t *_GD_ResolveAlias(DIRFILE *restrict D, gd_entry_t *restrict E) { gd_entry_t *T = NULL; dtrace("%p, %p", D, E); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%p", NULL); return NULL; } /* Find the target */ T = _GD_FindField(D, E->in_fields[0], D->entry, D->n_entries, 0, NULL); /* Aliases store the ulitmate target in entry[0] and the direct link * in entry[1]. */ E->e->entry[0] = E->e->entry[1] = T; if (T) { if (T->field_type == GD_ALIAS_ENTRY) { if (T->e->entry[0]) T = T->e->entry[0]; else T = _GD_ResolveAlias(D, T); } E->e->entry[0] = T; } D->recurse_level--; dreturn("%p", D->error ? NULL : E->e->entry[0]); return D->error ? NULL : E->e->entry[0]; } void _GD_UpdateAliases(DIRFILE *D, int reset) { unsigned u; dtrace("%p, %i", D, reset); if (reset) for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->field_type == GD_ALIAS_ENTRY) D->entry[u]->e->entry[0] = D->entry[u]->e->entry[1] = NULL; for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->field_type == GD_ALIAS_ENTRY && D->entry[u]->e->entry[1] == NULL) { _GD_ResolveAlias(D, D->entry[u]); } dreturnvoid(); } /* _GD_ParseFragment: Parse each line of the fragment. * * Returns NULL unless this fragment contains a REFERENCE directive. */ char *_GD_ParseFragment(FILE *restrict fp, DIRFILE *D, struct parser_state *p, int me, int resolve) { char *instring = NULL; char *outstring = NULL; const char *tok_pos = NULL; char *in_cols[MAX_IN_COLS]; int linenum = 0; char* ref_name = NULL; int n_cols; size_t n; int match = 0; int rescan = 0; int se_action = GD_SYNTAX_ABORT; gd_entry_t* first_raw = NULL; gd_parser_data_t pdata; int saved_error = 0; int saved_suberror = 0; int saved_line = 0; char* saved_token = NULL; dtrace("%p, %p, %p, %i, %i", fp, D, p, me, resolve); /* update the parser */ p->line = 0; p->file = D->fragment[me].cname; /* start parsing */ while (rescan || (instring = _GD_GetLine(fp, &n, &linenum))) { rescan = 0; n_cols = _GD_Tokenise(D, p, instring, &outstring, &tok_pos, MAX_IN_COLS, in_cols); if (n_cols == 0) {/* a blank line */ free(outstring); continue; } else if (n_cols < 2) /* any valid, non-blank line has at least two tokens */ _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_N_TOK, p->file, p->line, NULL); if (D->error == GD_E_OK) match = _GD_ParseDirective(D, p, in_cols, n_cols, me, &ref_name, &outstring, tok_pos); if (D->error == GD_E_OK && !match) first_raw = _GD_ParseFieldSpec(D, p, n_cols, in_cols, NULL, me, 0, 1, &outstring, tok_pos); if (D->error == GD_E_FORMAT) { /* call the callback for this error */ if (D->sehandler != NULL) { /* we guarantee a buffer size of at least GD_MAX_LINE_LENGTH */ if (n < GD_MAX_LINE_LENGTH) { char *ptr = (char *)_GD_Realloc(D, instring, GD_MAX_LINE_LENGTH); if (ptr == NULL) break; instring = ptr; } pdata.dirfile = D; pdata.suberror = D->suberror; pdata.linenum = linenum; pdata.filename = D->fragment[me].cname; pdata.line = instring; pdata.buflen = n; se_action = (*D->sehandler)(&pdata, D->sehandler_extra); } switch(se_action) { case GD_SYNTAX_ABORT: break; /* abort parsing */ case GD_SYNTAX_CONTINUE: if (!saved_error) { /* remember this error ... */ saved_suberror = D->suberror; saved_line = D->error_line; if (D->error_string != NULL) saved_token = _GD_Strdup(D, D->error_string); saved_error = 1; } /* ... and continue parsing (fallthrough) */ case GD_SYNTAX_IGNORE: _GD_ClearError(D); /* ignore this line, continue parsing */ break; case GD_SYNTAX_RESCAN: _GD_ClearError(D); rescan = 1; /* rescan the modified instring */ if (pdata.line != instring) { /* a new line was malloc'd by the caller, delete our old one. */ free(instring); instring = pdata.line; n = pdata.buflen; } break; default: /* improper callback response */ _GD_SetError(D, GD_E_CALLBACK, 0, NULL, se_action, NULL); break; } } /* clean up */ free(outstring); if (!rescan) free(instring); if (D->error) break; /* abort in the event of a non-syntax error */ } if (instring == NULL && errno == EOVERFLOW) _GD_SetError(D, GD_E_LINE_TOO_LONG, 0, p->file, p->line, NULL); /* restore a saved error, if we have one */ if (!D->error && saved_error) { _GD_SetError(D, GD_E_FORMAT, saved_suberror, D->fragment[me].cname, saved_line, saved_token); free(saved_token); } /* Set reference */ if (!D->error) { if (ref_name != NULL) D->fragment[me].ref_name = _GD_Strdup(D, ref_name); else if (first_raw != NULL) D->fragment[me].ref_name = _GD_Strdup(D, first_raw->field); } /* resolve aliases, if requested */ if (resolve && !D->error) _GD_UpdateAliases(D, 0); dreturn("%p", ref_name); return ref_name; } void _GD_SimpleParserInit(DIRFILE *D, const char *name, struct parser_state *p) { dtrace("%p, \"%s\", %p", D, name, p); if (~D->flags & GD_HAVE_VERSION) _GD_FindVersion(D); p->file = name; p->line = 0; if (D->av) { p->standards = D->standards; p->pedantic = 1; } else { p->standards = GD_DIRFILE_STANDARDS_VERSION; p->pedantic = 0; } p->ns = NULL; p->nsl = 0; p->flags = 0; dreturnvoid(); } /* public access to the GetData tokeniser */ char *gd_strtok(DIRFILE *D, const char *string) gd_nothrow { char *outstring, *in_col; int n_cols; struct parser_state p; dtrace("%p, \"%s\"", D, string); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); if (string) { free(D->tok_base); D->tok_pos = D->tok_base = _GD_Strdup(D, string); if (D->error) { dreturn("%p", NULL); return NULL; } } else if (D->tok_pos == NULL) { _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_NODATA, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } /* tokenise! */ _GD_SimpleParserInit(D, "gd_strtok()", &p); n_cols = _GD_Tokenise(D, &p, D->tok_pos, &outstring, (const char **)&D->tok_pos, 1, &in_col); if (D->error || n_cols < 1) { free(D->tok_base); D->tok_pos = D->tok_base = NULL; free(outstring); outstring = NULL; } /* in_col invariably points to outstring, so just let the caller worry about * cleaning up. Ha! */ dreturn("\"%s\"", outstring); return outstring; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/Makefile.am0000640000175000017500000001336612614323564016640 0ustar alastairalastair# Copyright (C) 2008-2013, 2015 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign if USE_SLIM if USE_MODULES LIBGETDATASLIM_LA=libgetdataslim.la DLOPEN_LIBGETDATASLIM_LA=-dlopen libgetdataslim.la else SLIM_C=slim.c endif endif if USE_FLAC if USE_MODULES LIBGETDATAFLAC_LA=libgetdataflac.la DLOPEN_LIBGETDATAFLAC_LA=-dlopen libgetdataflac.la else FLAC_C=flac.c endif endif if USE_GZIP if USE_MODULES LIBGETDATAGZIP_LA=libgetdatagzip.la DLOPEN_LIBGETDATAGZIP_LA=-dlopen libgetdatagzip.la else GZIP_C=gzip.c endif endif if USE_BZIP2 if USE_MODULES LIBGETDATABZIP2_LA=libgetdatabzip2.la DLOPEN_LIBGETDATABZIP2_LA=-dlopen libgetdatabzip2.la else BZIP2_C=bzip.c endif endif if USE_LZMA if USE_MODULES LIBGETDATALZMA_LA=libgetdatalzma.la DLOPEN_LIBGETDATALZMA_LA=-dlopen libgetdatalzma.la else LZMA_C=lzma.c endif endif if USE_ZZIP if USE_MODULES LIBGETDATAZZIP_LA=libgetdatazzip.la DLOPEN_LIBGETDATAZZIP_LA=-dlopen libgetdatazzip.la else ZZIP_C=zzip.c endif endif if USE_ZZSLIM if USE_MODULES LIBGETDATAZZSLIM_LA=libgetdatazzslim.la DLOPEN_LIBGETDATAZZSLIM_LA=-dlopen libgetdatazzslim.la else ZZSLIM_C=zzslim.c endif endif if USE_MODULES EXPORT_DYNAMIC=-export-dynamic DGETDATA_MODULEDIR=-DGETDATA_MODULEDIR="\"$(moduledir)\"" else EXTERNAL_CPPFLAGS=$(SLIM_CPPFLAGS) $(GZIP_CPPFLAGS) $(BZIP2_CPPFLAGS) \ $(LZMA_CPPFLAGS) $(ZZIP_CPPFLAGS) $(FLAC_CPPFLAGS) EXTERNAL_LDFLAGS=$(SLIM_LDFLAGS) $(GZIP_LDFLAGS) $(BZIP2_LDFLAGS) \ $(LZMA_LDFLAGS) $(ZZIP_LDFLAGS) $(FLAC_LDFLAGS) EXTERNAL_LIBS=$(SLIM_LIBS) $(GZIP_LIBS) $(BZIP2_LIBS) $(LZMA_LIBS) \ $(ZZIP_LIBS) $(FLAC_LIBS) endif if INCLUDE_LEGACY_API LEGACY_C = legacy.c GETDATA_LEGACY_H = getdata_legacy.h install-data-hook: cd $(DESTDIR)$(includedir) && \ $(LN_S) -f getdata.h getdata_struct.h uninstall-hook: cd $(DESTDIR)$(includedir) && rm -rf getdata_struct.h endif if GETDATA_DEBUG DEBUG_C = debug.c endif pkgconfigdir = @libdir@/pkgconfig AM_CFLAGS = ${GD_CC_WALL} ${GD_CC_WEXTRA} $(DGETDATA_MODULEDIR) AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS) BUILT_SOURCES = getdata.h nodist_include_HEADERS = getdata.h include_HEADERS = ${GETDATA_LEGACY_H} pkgconfig_DATA = getdata.pc lib_LTLIBRARIES = libgetdata.la module_LTLIBRARIES = ${LIBGETDATABZIP2_LA} ${LIBGETDATAFLAC_LA} \ ${LIBGETDATAGZIP_LA} ${LIBGETDATALZMA_LA} \ ${LIBGETDATASLIM_LA} ${LIBGETDATAZZIP_LA} \ ${LIBGETDATAZZSLIM_LA} libgetdata_la_SOURCES = add.c ascii.c ${BZIP2_C} close.c common.c compat.c \ constant.c ${DEBUG_C} del.c encoding.c endian.c \ entry.c errors.c field_list.c ${FLAC_C} flimits.c \ flush.c fpos.c fragment.c getdata.c globals.c \ ${GZIP_C} index.c include.c ${LEGACY_C} ${LZMA_C} \ mod.c move.c name.c native.c nfields.c nframes.c \ open.c parse.c protect.c putdata.c raw.c sie.c \ ${SLIM_C} spf.c string.c types.c ${ZZIP_C} ${ZZSLIM_C} \ ${GETDATA_LEGACY_H} internal.h libgetdata_la_LDFLAGS = $(EXPORT_DYNAMIC) -export-symbols-regex '^[^_]' \ -version-info \ ${GETDATA_IFACE_VERSION}:${GETDATA_IMPL_REVISION}:${GETDATA_IFACE_AGE} \ $(EXTERNAL_LDFLAGS) $(EXTERNAL_LIBS) libgetdata_la_LIBADD = $(LIBLTDL) $(DLOPEN_LIBGETDATASLIM_LA) \ $(DLOPEN_LIBGETDATAGZIP_LA) $(DLOPEN_LIBGETDATABZIP2_LA) \ $(DLOPEN_LIBGETDATALZMA_LA) $(DLOPEN_LIBGETDATAZZIP_LA) \ $(DLOPEN_LIBGETDATAZZSLIM_LA) $(DLOPEN_LIBGETDATAFLAC_LA) libgetdataslim_la_SOURCES = slim.c libgetdataslim_la_LDFLAGS = $(SLIM_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(SLIM_LIBS) libgetdataslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS) libgetdataflac_la_SOURCES = flac.c libgetdataflac_la_LDFLAGS = $(FLAC_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(FLAC_LIBS) libgetdataflac_la_CPPFLAGS = $(AM_CPPFLAGS) $(FLAC_CPPFLAGS) libgetdatagzip_la_SOURCES = gzip.c libgetdatagzip_la_LDFLAGS = $(GZIP_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(GZIP_LIBS) libgetdatagzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(GZIP_CPPFLAGS) libgetdatabzip2_la_SOURCES = bzip.c libgetdatabzip2_la_LDFLAGS = $(BZIP2_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(BZIP2_LIBS) libgetdatabzip2_la_CPPFLAGS = $(AM_CPPFLAGS) $(BZIP2_CPPFLAGS) libgetdatalzma_la_SOURCES = lzma.c libgetdatalzma_la_LDFLAGS = $(LZMA_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(LZMA_LIBS) libgetdatalzma_la_CPPFLAGS = $(AM_CPPFLAGS) $(LZMA_CPPFLAGS) libgetdatazzip_la_SOURCES = zzip.c libgetdatazzip_la_LDFLAGS = $(ZZIP_LDFLAGS) -release $(PACKAGE_VERSION) \ -module $(ZZIP_LIBS) libgetdatazzip_la_CPPFLAGS = $(AM_CPPFLAGS) $(ZZIP_CPPFLAGS) libgetdatazzslim_la_SOURCES = zzslim.c libgetdatazzslim_la_LDFLAGS = $(SLIM_LDFLAGS) $(ZZIP_LDFLAGS) \ -release $(PACKAGE_VERSION) -module \ $(SLIM_LIBS) $(ZZIP_LIBS) libgetdatazzslim_la_CPPFLAGS = $(AM_CPPFLAGS) $(SLIM_CPPFLAGS) $(ZZIP_CPPFLAGS) clean-local: rm -rf *~ getdata.pc libgetdata-0.9.0/src/internal.h0000640000175000017500000013457612614323564016600 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef GETDATA_INTERNAL_H #define GETDATA_INTERNAL_H #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #ifdef HAVE_CONFIG_H #include "gd_config.h" #endif #define GD_64BIT_API #include "getdata.h" /* MacOS 10.6 deprecates the LFS transitional API */ #ifdef HAVE_AVAILABILITY_H #include #endif #if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && \ (__MAC_OS_X_VERSION_MIN_REQUIRED >= 1060) # undef HAVE_LSTAT64 # undef HAVE_STRUCT_STAT64 # ifndef _DARWIN_FEATURE_64_BIT_INODE # define _DARWIN_FEATURE_64_BIT_INODE # endif #endif /* library headers */ #ifdef HAVE_SYS_FILE_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_SYS_STAT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef STDC_HEADERS #include #include #include #include #include #include #include #include #include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_DIRENT_H #include #endif #ifdef HAVE_INTTYPES_H #ifndef __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS #endif #include #endif #ifdef HAVE_LIBGEN_H #include #endif #ifdef HAVE_STDDEF_H #include #endif #ifdef HAVE_STDINT_H #include #endif #ifdef HAVE_UNISTD_H #include #endif #ifdef HAVE_DIRECT_H #include #endif #ifdef HAVE_IO_H #include #endif /* MSVC types */ #ifdef _MSC_VER #ifdef _WIN64 typedef __int64 ssize_t; #define PRNssize_t "li" #define PRNsize_t "lu" #else typedef int ssize_t; #define PRNssize_t "i" #define PRNsize_t "u" #endif #else #define PRNssize_t "zi" #define PRNsize_t "zu" #endif #ifndef HAVE_OFF64_T typedef gd_off64_t off64_t; #endif #ifdef _MSC_VER /* missing in sys/stat.h */ #define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) #define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) #endif /* the open() in the MSVCRT doesn't permit open()ing directories */ #ifdef __MSVCRT__ #define GD_NO_DIR_OPEN /* rename open() flags */ #define O_RDWR _O_RDWR #define O_RDONLY _O_RDONLY #define O_CREAT _O_CREAT #define O_EXCL _O_EXCL #define O_TRUNC _O_TRUNC #endif #ifdef GD_NO_C99_API /* generic dcomplex pointer for passing around malloc'd vectors */ # define GD_DCOMPLEXP_t double * /* a dcomplex scalar */ # define GD_DCOMPLEXA(v) double v[2] /* used when passing the complex arrays from the entry struct */ # define GD_DCOMPLEXV(v) double v[][2] /* norm */ # define cabs(z) sqrt((z)[0] * (z)[0] + (z)[1] * (z)[1]) /* phase */ # define carg(z) atan2((z)[1], (z)[0]) /* real part of z */ # define creal(z) ((z)[0]) /* imaginary part of z */ # define cimag(z) ((z)[1]) /* real part of (*z) */ # define crealp(z) creal(z) /* imaginary part of (*z) */ # define cimagp(z) cimag(z) /* a pointer to element i of GD_DCOMPLEXP_t array a */ # define gd_cap_(a,i) (((GD_DCOMPLEXP_t)(a)) + 2 * i) /* a pointer to a complex scalar */ # define gd_csp_(a) ((GD_DCOMPLEXP_t)a) /* assign real two-element array b to scalar a */ # define gd_ra2cs_(a,b) gd_cs2cs_(a,b) /* assign scalar b to scalar a */ # define gd_cs2cs_(a,b) do { (a)[0] = (b)[0]; (a)[1] = (b)[1]; } while(0) /* assign scalar *b to scalar a */ # define gd_cp2cs_(a,b) gd_cs2cs_(a,b) /* assign scalar b to scalar (*a) */ # define gd_cs2cp_(a,b) gd_cs2cs_(a,b) /* assign b[i] to scalar a */ # define gd_ca2cs_(a,b,i) gd_cs2cs_((a),(b) + 2 * i) /* assign scalar (*b) to a[i] */ # define gd_cp2ca_(a,i,b) do { \ (a)[2 * i] = (b)[0]; (a)[2 * i + 1] = (b)[1]; \ } while(0) /* assign complex pair (x;y) to scalar a */ # define gd_li2cs_(a,x,y) do { (a)[0] = (x); (a)[1] = (y); } while(0) /* assign complex pair (x;y) to scalar (*a) */ # define gd_li2cp_(a,x,y) gd_li2cs_(a,x,y) /* assign polar (r,p) to scalar a */ # define gd_po2cs_(a,r,p) do { \ (a)[0] = (r) * cos(p); (a)[1] = (r) * sin(p); \ } while (0) /* assign polar (r,p) to scalar (*a) */ # define gd_po2cp_(a,r,p) gd_po2cs_(a,r,p) /* assign real scalar b to scalar a */ # define gd_rs2cs_(a,b) gd_li2cs_(a,b,0) /* assign real scalar b to scalar (*a) */ # define gd_rs2cp_(a,b) gd_rs2cs_(a,b) /* assign complex scalar b to a[i], both of type t */ # define gd_cs2ca_(a,i,b,t) do { \ ((t*)a)[2 * i] = (t)(b)[0]; ((t*)a)[2 * i + 1] = (t)(b)[1]; \ } while(0) /* assign real scalar b to a[i], both of type t */ # define gd_rs2ca_(a,i,b,t) do { \ ((t*)a)[2 * i] = (t)(b); ((t*)a)[2 * i + 1] = 0; \ } while(0) /* compare a to complex pair (x;y) */ # define gd_ccmpl_(a,x,y) ((a)[0] == x && (a)[1] == y) /* compare a to b */ # define gd_ccmpc_(a,b) ((a)[0] == (b)[0] && (a)[1] == (b)[1]) #else # define GD_DCOMPLEXP_t double _Complex * # define GD_DCOMPLEXA(v) double _Complex v # define GD_DCOMPLEXV(v) double _Complex *restrict v # define crealp(z) creal(*(z)) # define cimagp(z) cimag(*(z)) # define gd_cap_(a,i) (a + i) # define gd_csp_(a) (&(a)) # define gd_ra2cs_(a,b) a = *((double complex*)(b)) # define gd_cs2cs_(a,b) a = b # define gd_cp2cs_(a,b) a = *(b) # define gd_cs2cp_(a,b) *(a) = b # define gd_ca2cs_(a,b,i) a = b[i] # define gd_cp2ca_(a,i,b) (a)[i] = *(b) # define gd_li2cs_(a,x,y) a = (x + _Complex_I * y) # define gd_li2cp_(a,x,y) *(a) = (x + _Complex_I * y) # define gd_po2cs_(a,r,p) a = (r) * cexp(p) # define gd_po2cp_(a,r,p) *(a) = (r) * cexp(p) # define gd_rs2cs_(a,b) a = b # define gd_rs2cp_(a,b) *(a) = b # define gd_cs2ca_(a,i,b,t) ((complex t*)a)[i] = (complex t)(b) # define gd_rs2ca_(a,i,b,t) gd_cs2ca_(a,i,b,t) # define gd_ccmpl_(a,x,y) (a == (x + _Complex_I * y)) # define gd_ccmpc_(a,b) (a == b) #ifdef HAVE_COMPLEX_H #include #elif defined HAVE_CABS && defined __GNUC__ && (__GNUC__ > 3) /* This is a cygwin hack: the Cygwin C library isn't C99 compliant, but gcc 3+ * contains built-in versions of these functions */ #define complex _Complex #define _Complex_I (__extension__ 1.0iF) double cabs(double complex z); double carg(double complex z); #define cexp(z) (exp(__real__ (z)) * (cos(__imag__ (z)) + _Complex_I \ * sin(__imag__ (z)))) double creal(double complex z); double cimag(double complex z); #endif #endif #ifndef NAN # if HAVE_NAN # define NAN nan("") # else # define NAN gd_strtod("NAN", NULL) # endif #endif #ifdef GD_RESTRICT_ARRAY_OK #define gd_restrict_arr restrict #else #define gd_restrict_arr #endif #ifndef PATH_MAX # ifdef _POSIX_PATH_MAX # define PATH_MAX _POSIX_PATH_MAX # elif defined MAXPATHLEN # define PATH_MAX MAXPATHLEN # else /* POSIX says we're supposed to check _pathconf in this case, but it goes on to * say that the PATH_MAX value reported by _pathconf isn't guaranteed to be * suitable for mallocing, so its not clear what they're trying to do there. * The following will have to do. */ # define PATH_MAX 4096 # endif #endif /* gd_type_t type for native integers */ #ifndef SIZEOF_INT #define SIZEOF_INT (sizeof(int)) #endif #ifndef SIZEOF_UNSIGNED_INT #define SIZEOF_UNSIGNED_INT (sizeof(unsigned int)) #endif #define GD_INT_TYPE ((gd_type_t)(SIZEOF_INT | GD_SIGNED)) #define GD_UINT_TYPE ((gd_type_t)(SIZEOF_UNSIGNED_INT)) /* a few integer limits */ #ifndef SIZEOF_SIZE_T #define SIZEOF_SIZE_T (sizeof(size_t)) #endif #define GD_INT64_MAX ((int64_t)((uint64_t)-1>>1)) #define GD_SSIZE_T_MAX ((ssize_t)((size_t)-1>>1)) #define GD_SIZE_T_MAX ((size_t)-1) /* default buffer size */ #if SIZEOF_INT < 4 #define GD_BUFFER_SIZE 32767 #else #define GD_BUFFER_SIZE 9000000 #endif /* the default mplex cycle length */ #define GD_MPLEX_CYCLE 10 #ifdef _MSC_VER # define gd_static_inline_ static #else # define gd_static_inline_ static inline #endif /* unaligned access */ #ifdef UNALIGNED_ACCESS_OK #define gd_get_unaligned64(p) (*(p)) #define gd_put_unaligned64(v,p) *(p) = (v) #else #ifdef HAVE_ASM_UNALIGNED_H #include #endif #if defined HAVE_DECL_GET_UNALIGNED && HAVE_DECL_GET_UNALIGNED == 1 #define gd_get_unaligned64 get_unaligned #else gd_static_inline_ int64_t gd_get_unaligned64(const void *p) { int64_t v; memcpy(&v, p, 8); return v; } #endif #if defined HAVE_DECL_PUT_UNALIGNED && HAVE_DECL_PUT_UNALIGNED == 1 #define gd_put_unaligned64 put_unaligned #else gd_static_inline_ int64_t gd_put_unaligned64(int64_t v, void *p) { memcpy(p, &v, 8); return v; } #endif #endif #define GD_ARM_FLAG (GD_ARM_ENDIAN | GD_NOT_ARM_ENDIAN) /* Internal type conventions: * * - samples per frame is always unsigned int * - variables holding offsets or file sizes should be of type gd_off64_t * (which may be simply off_t, if it's the right size) * - variables holding object sizes or counts of items read or written should * be of type size_t * - public functions taking or returning types of off64_t should have both * a off_t prototype and a gd_off64_t type prototype. */ #ifndef __attribute_malloc__ # define __attribute_malloc__ #endif #ifndef __wur # define __wur #endif #ifdef _MSC_VER # define gd_unused_ #else # define gd_unused_ __attribute__ (( unused )) #endif /* disable the "unspecified order" remark in ICC */ #ifdef __INTEL_COMPILER # pragma warning (disable : 981) #endif /* debugging macros */ #ifdef GETDATA_DEBUG #define GD_COL_SIZE 100 #ifdef __cplusplus extern "C" { #endif const char* gd_colnil(void); const char* gd_coladd(void); const char* gd_colsub(void); void gd_colclear(void); #ifdef __cplusplus } #endif #define dtracevoid() printf("%s %s()\n", gd_coladd(), __func__) #define dtrace(fmt, ...) printf("%s %s(" fmt ")\n", gd_coladd(), \ __func__, ##__VA_ARGS__) #define dprintf(fmt, ...) printf("%s %s:%i " fmt "\n", gd_colnil(), \ __func__, __LINE__, ##__VA_ARGS__) #define dreturnvoid() printf("%s %s = (nil)\n", gd_colsub(), __func__) #define dreturn(fmt, ...) printf("%s %s = " fmt "\n", gd_colsub(), \ __func__, ##__VA_ARGS__) #define dwatch(fmt, v) printf("%s %s = " fmt "\n", gd_colnil(), #v, v) #else #define gd_colclear() #define dtracevoid() #define dtrace(...) #define dprintf(...) #define dreturnvoid() #define dreturn(...) #define dwatch(...) #endif #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef O_TEXT #define O_TEXT 0 #endif /* The Microsoft CRT appears to treat %hh as %h */ #ifdef __MSVCRT__ #define NO_8BIT_INT_PREFIX #endif /* function aliases */ #ifndef HAVE_FSEEKO64 # ifndef HAVE_FSEEKO # define fseeko64(a,b,c) fseek(a,(long)(b),c) # else # define fseeko64(a,b,c) fseeko(a,(off_t)(b),c) # endif #endif #ifdef HAVE__GETCWD # define gd_getcwd _getcwd #elif defined HAVE_GETCWD # define gd_getcwd getcwd #else # define gd_getcwd(...) (NULL) #endif #ifndef HAVE_SNPRINTF # ifdef HAVE__SNPRINTF # define snprintf _snprintf # endif #endif #ifndef HAVE_BASENAME char *basename(char *path); #endif #ifndef HAVE_FTELLO64 # ifndef HAVE_FTELLO # define ftello64 (off64_t)ftell # else # define ftello64 (off64_t)ftello # endif #endif #ifndef HAVE_LSTAT64 # ifdef HAVE_LSTAT # define lstat64 lstat # define HAVE_LSTAT64 # endif #endif #ifndef offsetof #define offsetof(t,m) ((size_t)(((char*)&((t*)0)->m) - (char*)0)) #endif #ifdef HAVE_READDIR_R # define _GD_ReadDir readdir_r #else int _GD_ReadDir(DIR *dirp, struct dirent *entry, struct dirent **result); #endif #ifdef HAVE__STRTOI64 #if HAVE_DECL__STRTOI64 == 0 __int64 _strtoi64(const char *nptr, char **endptr, int base); #endif # define gd_strtoll _strtoi64 #elif defined(HAVE_STRTOLL) # define gd_strtoll strtoll #elif defined(HAVE_STRTOQ) # define gd_strtoll strtoq #else # define gd_strtoll strtol #endif #ifdef HAVE__STRTOUI64 #if HAVE_DECL__STRTOUI64 == 0 unsigned __int64 _strtoui64(const char *nptr, char **endptr, int base); #endif # define gd_strtoull _strtoi64 #elif defined(HAVE_STRTOULL) # define gd_strtoull strtoull #elif defined(HAVE_STRTOUQ) # define gd_strtoll strtouq #else # define gd_strtoull strtoul #endif /* the MSVCRT's strtod is not POSIX compliant */ #ifdef __MSVCRT__ double gd_strtod(const char *nptr, char **endptr); #else #define gd_strtod strtod #endif #if defined __MSVCRT__ && defined HAVE__FDOPEN #define fdopen _fdopen #endif #if !HAVE_FSYNC && HAVE__COMMIT # define fsync _commit #endif #ifndef __MINGW64_VERSION_MAJOR /* mingw-w64 has pthread.h*/ #ifndef HAVE_PTHREAD_H #ifndef HAVE_GMTIME_R struct tm *gmtime_r(const time_t *timep, struct tm *result); #endif #endif #endif #ifndef HAVE_LSEEK64 # ifdef HAVE__LSEEKI64 # define lseek64 (off64_t)_lseeki64 # else # define lseek64 (off64_t)lseek # endif #endif #ifdef MKDIR_NO_MODE #ifdef HAVE__MKDIR #define mkdir(f,m) _mkdir(f) #else #define mkdir(f,m) mkdir(f) #endif #endif #ifndef EOVERFLOW #define EOVERFLOW EINVAL #endif #if defined __MSVCRT__ && defined HAVE__OPEN #define open _open #endif #if defined __MSVCRT__ && defined HAVE__READ #define read _read #endif #if defined __MSVCRT__ && defined HAVE__RMDIR #define rmdir _rmdir #endif #if HAVE_STRUCT_STAT64 typedef struct stat64 gd_stat64_t; #elif HAVE_STRUCT__STAT64 typedef struct _stat64 gd_stat64_t; #elif HAVE_STRUCT___STAT64 typedef struct __stat64 gd_stat64_t; #else typedef struct stat gd_stat64_t; #define GD_NO_64BIT_STAT #endif #ifdef GD_NO_64BIT_STAT # define gd_stat64 stat # define gd_fstat64 fstat # define gd_StatAt64 gd_StatAt #else # if HAVE_STAT64 # define gd_stat64 stat64 # elif HAVE__STAT64 # define gd_stat64 _stat64 # else # define gd_stat64 stat # endif # if HAVE_FSTAT64 # define gd_fstat64 fstat64 # elif HAVE__FSTAT64 # define gd_fstat64 _fstat64 # elif HAVE__FSTAT # define gd_fstat64 _fstat # else # define gd_fstat64 fstat # endif # ifdef HAVE_FSTATAT64 # define gd_StatAt64(d,...) fstatat64(__VA_ARGS__) # else int gd_StatAt64(const DIRFILE*, int, const char*, gd_stat64_t*, int); # endif #endif #ifdef HAVE_OPENAT # ifdef GETDATA_DEBUG # define gd_unused_d /**/ # else # define gd_unused_d gd_unused_ # endif # define gd_OpenAt(d,...) openat(__VA_ARGS__) #else # define gd_unused_d /**/ int gd_OpenAt(const DIRFILE*, int, const char*, int, mode_t); #endif #ifdef HAVE_FSTATAT # define gd_StatAt(d,...) fstatat(__VA_ARGS__) #else #ifndef HAVE_SYS_STAT_H struct stat; #endif int gd_StatAt(const DIRFILE*, int, const char*, struct stat*, int); #endif #ifdef HAVE_RENAMEAT #define gd_RenameAt(d,...) renameat(__VA_ARGS__) #else int gd_RenameAt(const DIRFILE *D, int, const char*, int, const char*); #endif #ifdef HAVE_UNLINKAT # define gd_UnlinkAt(d,...) unlinkat(__VA_ARGS__) #else int gd_UnlinkAt(const DIRFILE*, int, const char*, int); #endif #if defined HAVE_STERROR_R && ! defined HAVE_DECL_STRERROR_R # if ! HAVE_DECL_STRERROR_R char* strerror_r(int, char*, size_t); # else int strerror_r(int, char*, size_t); # endif #endif #if !defined HAVE_STRERROR_R || defined STRERROR_R_CHAR_P int gd_strerror(int errnum, char *buf, size_t buflen); #else # define gd_strerror strerror_r #endif #if defined HAVE_FTRUNCATE64 #define gd_truncate ftruncate64 #elif defined HAVE_FTRUNCATE #define gd_truncate(d,l) ftruncate(d, (off_t)l) #elif defined HAVE__CHSIZE_S #define gd_truncate(d,l) _chsize_s(d, (int64_t)l) #elif defined HAVE__CHSIZE #define gd_truncate(d,l) _chsize(d, (long)l) #endif #if defined __MSVCRT__ && defined HAVE__UNLINK #define unlink _unlink #endif #if defined __MSVCRT__ && defined HAVE__WRITE #define write _write #endif #ifndef HAVE_GETDELIM ssize_t getdelim(char**, size_t*, int, FILE*); #endif /* byte swapping */ #ifdef HAVE_BYTESWAP_H #include #endif #ifdef HAVE_SYS_ENDIAN_H #include #endif #ifdef HAVE_LIBKERN_OSBYTEORDER_H #include #endif #if defined HAVE_DECL_BSWAP_16 && HAVE_DECL_BSWAP_16 == 1 # define gd_swap16 bswap_16 # define gd_swap32 bswap_32 # define gd_swap64 bswap_64 #elif defined HAVE_DECL_OSSWAPINT16 && HAVE_DECL_OSSWAPINT16 == 1 # define gd_swap16 OSSwapInt16 # define gd_swap32 OSSwapInt32 # define gd_swap64 OSSwapInt64 #elif defined HAVE_DECL_BSWAP16 && HAVE_DECL_BSWAP16 == 1 # define gd_swap16 bswap16 # define gd_swap32 bswap32 # define gd_swap64 bswap64 #else # define gd_swap16(x) (((uint16_t)(x) << 8) | ((uint16_t)(x) >> 8)) # define gd_swap32(x) ( \ (((uint32_t)(x) << 24) & 0xff000000UL) | \ (((uint32_t)(x) << 8) & 0xff0000UL) | \ (((uint32_t)(x) >> 8) & 0xff00UL) | \ ((uint32_t)(x) >> 24)) #define gd_swap64(x) ( \ (((uint64_t)(x) << 56) | \ (((uint64_t)(x) << 40) & 0xff000000000000ULL) | \ (((uint64_t)(x) << 24) & 0xff0000000000ULL) | \ (((uint64_t)(x) << 8) & 0xff00000000ULL) | \ (((uint64_t)(x) >> 8) & 0xff000000ULL) | \ (((uint64_t)(x) >> 24) & 0xff0000ULL) | \ (((uint64_t)(x) >> 40) & 0xff00ULL) | \ ((uint64_t)(x) >> 56))) #endif /* path malarkey */ #define _GD_IsDirSep(c) (((c) == GD_DIRSEP) || ((c) == '/')) #if defined _WIN32 || defined _WIN64 # define _GD_AbsPath(s) (s && ((s)[0] == '/' || (s)[0] == GD_DIRSEP || \ ((s)[0] != '\0' && (s)[1] == ':'))) # define _GD_Root(s,d,l) \ do { \ if ((d)[0] == '/' || (d)[0] == GD_DIRSEP) { \ (s)[0] = (d)[0]; \ l = 1; \ if ((d)[1] == '/' || (d)[1] == GD_DIRSEP) { \ (s)[1] = (d)[1]; \ l = 2; \ } \ } else { \ (s)[0] = (d)[0]; \ (s)[1] = ':'; \ (s)[2] = '\\'; \ (s)[3] = '\0'; \ l = 3; \ } \ } while (0) # define _GD_RootLen(d) ( \ ((d)[0] == '/' || (d)[0] == GD_DIRSEP) ? \ ((d)[1] == '/' || (d)[1] == GD_DIRSEP) ? 2 : 1 : 3 \ ) #else # define _GD_AbsPath(s) (s && (s)[0] == '/') # define _GD_Root(s,d,l) \ do { \ (s)[0] = '/'; \ (s)[1] = '\0'; \ l = 1; \ } while (0) # define _GD_RootLen(d) 1 #endif /* maximum number of recursions */ #define GD_MAX_RECURSE_LEVEL 32 #define MAX_IN_COLS (3 * GD_MAX_LINCOM + 5) /* for META lincom */ /* Suberror codes */ /* GD_E_FORMAT suberrors are in getdata.h */ #define GD_E_CREAT_FORMAT 1 #define GD_E_CREAT_DIR 2 #define GD_E_CREAT_OPEN 3 #define GD_E_CODE_MISSING 1 #define GD_E_CODE_INVALID 2 #define GD_E_CODE_AMBIGUOUS 3 #define GD_E_CODE_INVALID_NS 4 #define GD_E_CODE_REPR 5 #define GD_E_IO_OPEN 1 #define GD_E_IO_READ 2 #define GD_E_IO_WRITE 3 #define GD_E_IO_CLOSE 4 #define GD_E_IO_UNLINK 5 #define GD_E_IO_RENAME 6 #define GD_E_IO_INCL 7 #define GD_E_IO_ENC_OFFSET GD_E_IO_INCL #define GD_E_IO_ENC_OPEN ( GD_E_IO_OPEN + GD_E_IO_ENC_OFFSET ) #define GD_E_IO_ENC_READ ( GD_E_IO_READ + GD_E_IO_ENC_OFFSET ) #define GD_E_IO_ENC_WRITE ( GD_E_IO_WRITE + GD_E_IO_ENC_OFFSET ) #define GD_E_IO_ENC_CLOSE ( GD_E_IO_CLOSE + GD_E_IO_ENC_OFFSET ) #define GD_E_IO_ENC_UNLINK ( GD_E_IO_UNLINK + GD_E_IO_ENC_OFFSET ) #define GD_E_IO_ENC_RENAME ( GD_E_IO_RENAME + GD_E_IO_ENC_OFFSET ) #define GD_E_RECURSE_CODE 1 #define GD_E_RECURSE_INCLUDE 2 #define GD_E_FIELD_PUT 1 #define GD_E_FIELD_BAD 2 #define GD_E_FIELD_MATCH 3 #define GD_E_FIELD_FORMAT 4 #define GD_E_FIELD_STR 5 #define GD_E_ENTRY_TYPE 1 #define GD_E_ENTRY_METARAW 2 #define GD_E_ENTRY_SPF 3 #define GD_E_ENTRY_NFIELDS 4 #define GD_E_ENTRY_NUMBITS 5 #define GD_E_ENTRY_BITNUM 6 #define GD_E_ENTRY_BITSIZE 7 #define GD_E_ENTRY_POLYORD 8 #define GD_E_ENTRY_WINDOP 9 #define GD_E_ENTRY_PERIOD 10 #define GD_E_SCALAR_CODE 1 #define GD_E_SCALAR_TYPE 2 #define GD_E_REFERENCE_CODE 1 #define GD_E_REFERENCE_TYPE 2 #define GD_E_PROTECTED_FORMAT 1 #define GD_E_PROTECTED_DATA 2 #define GD_E_DEL_META 1 #define GD_E_DEL_CONST 2 #define GD_E_DEL_DERIVED 3 #define GD_E_DEL_ALIAS 4 #define GD_E_UNCLEAN_CALL 1 #define GD_E_DOMAIN_COMPLEX 1 #define GD_E_DOMAIN_EMPTY 2 #define GD_E_DOMAIN_ANTITONIC 3 #define GD_E_DOMAIN_MULTIPOS 4 #define GD_E_OUT_OF_RANGE 1 #define GD_E_SINGULAR_RANGE 2 #define GD_E_LUT_LENGTH 1 #define GD_E_LUT_SYNTAX 2 #define GD_E_DIM_FORMAT 1 #define GD_E_DIM_CALLER 2 #define GD_E_UNENC_UNDET 1 #define GD_E_UNENC_TARGET 2 #define GD_E_ARG_WHENCE 1 #define GD_E_ARG_ENDIANNESS 2 #define GD_E_ARG_PROTECTION 3 #define GD_E_ARG_NODATA 4 #define GD_E_ARG_NO_VERS 5 #define GD_E_ARG_BAD_VERS 6 #define GD_E_LONG_FLUSH 1 /* number of lines chunked-in from a LINTERP table at a time */ #define GD_LUT_CHUNK 100 /* I/O flags */ #define GD_FILE_READ 0x1 #define GD_FILE_WRITE 0x2 #define GD_FILE_RDWR ( GD_FILE_READ | GD_FILE_WRITE ) #define GD_FILE_TEMP 0x4 #define GD_FILE_TOUCH 0x8 /* lists -- all the entry types plus alias, scalar, vector, all */ #define GD_N_ENTRY_LISTS (GD_N_ENTYPES + 4) #define GD_LIST_VALID_STRING_VALUE 0x01 /* name types for ValidateField */ #define GD_VF_NAME 0 #define GD_VF_AFFIX 1 #define GD_VF_NS 2 #define GD_VF_CODE 3 /* MungeCode flags */ #define GD_MC_RQ_PARTS 0x01 #define GD_MC_CHECK_NS 0x02 #define GD_MC_ERROR_OK 0x04 #define GD_MC_NO_NS 0x08 #define GD_MC_NO_ALLOC 0x10 /* database metadata update data for a field rename */ struct gd_rename_data_ { int n_meta, n_code, old_dot, new_dot; gd_entype_t type; unsigned flags, dot_ind; size_t old_len, new_len; char **meta_name, **code_list, *old_code, *new_code; gd_entry_t *E, **meta_entry; }; /* data file book-keeping record */ struct gd_raw_file_ { char* name; int idata; void* edata; int subenc; int error; const DIRFILE *D; unsigned int mode; off64_t pos; }; /* linterp table datum */ struct gd_lut_ { double x; union { double r; GD_DCOMPLEXM(c); } y; }; /* Unified entry struct */ struct gd_private_entry_ { gd_entry_t* entry[GD_MAX_LINCOM]; int repr[GD_MAX_LINCOM]; int n_meta; union { gd_entry_t** meta_entry; const gd_entry_t* parent; } p; /* field lists */ const char **alias_list; const char **entry_list[GD_N_ENTRY_LISTS]; unsigned int entry_list_flags[GD_N_ENTRY_LISTS]; const char **string_value_list; void *const_value_list; gd_carray_t *carray_value_list; uint32_t value_list_validity; uint32_t entry_list_validity; union { struct { /* RAW */ char* filebase; size_t size; struct gd_raw_file_ file[2]; /* encoding framework data */ } raw; struct { /* LINTERP */ char *table_file; int table_dirfd; int table_len; int complex_table; int table_monotonic; struct gd_lut_ *lut; } linterp; struct { /* CONST */ void *d; int n_client; gd_entry_t** client; } scalar; struct { /* MPLEX */ gd_type_t type; off64_t sample; char d[16]; } mplex; char *string; /* STRING */ off64_t index_pos; /* INDEX */ } u; }; /* _GD_FiniRawIO flags */ #define GD_FINIRAW_KEEP 0x0 #define GD_FINIRAW_DISCARD 0x1 #define GD_FINIRAW_DEFER 0x2 #define GD_FINIRAW_CLOTEMP 0x4 /* number of subencodings (ie. the length of the _GD_ef array */ #define GD_N_SUBENCODINGS 12 /* the last record of the _GD_ef array is always the unknown encoding */ #define GD_ENC_UNKNOWN (GD_N_SUBENCODINGS - 1) /* external module function provides flags */ #define GD_EF_NAME 0x0001 #define GD_EF_OPEN 0x0002 #define GD_EF_CLOSE 0x0004 #define GD_EF_SEEK 0x0008 #define GD_EF_READ 0x0010 #define GD_EF_SIZE 0x0020 #define GD_EF_WRITE 0x0040 #define GD_EF_SYNC 0x0080 #define GD_EF_MOVE 0x0100 #define GD_EF_UNLINK 0x0200 #define GD_EF_STRERR 0x0400 /* encoding scheme method prototypes */ typedef int (*gd_ef_name_t)(DIRFILE *D, const char *, struct gd_raw_file_*, const char*, int, int); typedef int (*gd_ef_open_t)(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); typedef off64_t (*gd_ef_seek_t)(struct gd_raw_file_*, off64_t, gd_type_t, unsigned int); typedef off64_t (*gd_ef_size_t)(int, struct gd_raw_file_*, gd_type_t, int); typedef ssize_t (*gd_ef_read_t)(struct gd_raw_file_*, void*, gd_type_t, size_t); typedef ssize_t (*gd_ef_write_t)(struct gd_raw_file_*, const void*, gd_type_t, size_t); typedef int (*gd_ef_close_t)(struct gd_raw_file_*); typedef int (*gd_ef_sync_t)(struct gd_raw_file_*); typedef int (*gd_ef_unlink_t)(int, struct gd_raw_file_*); typedef int (*gd_ef_move_t)(int, struct gd_raw_file_*, int, char*); typedef int (*gd_ef_strerr_t)(const struct gd_raw_file_*, char *, size_t); /* Encoding scheme flags */ #define GD_EF_ECOR 0x1 /* post-framework byte-sex correction required */ #define GD_EF_SWAP 0x2 /* in-framework byte-sex metadata correction occurs */ #define GD_EF_OOP 0x4 /* writes occur out-of-place */ #define GD_EF_EDAT 0x8 /* The /ENCODING datum is used */ /* Just so we're clear on the difference between GD_EF_ECOR and GD_EF_SWAP: * * - ECOR means the data returned by the encoding framework has the byte sex of * the fragment; GetData needs to swap bytes around after the framework * finishes if this is different than the machine endianness. Most binary * formats set ECOR, but TEXT doesn't, since sscanf() puts stuff into the * machine endianness. * * - SWAP means that internal workings of the encoding needs to know whether * the byte sex of the fragment is different than the machine endianness. * This is set by SIE since its sample indices are stored in the fragment * endianness, which need to be converted by within the encoding scheme itself * to be able to read opposite endian data files. * * Note: any encoding scheme could set SWAP instead of ECOR and then perform its * own byte sex correction to hide it from GetData proper, but this should be * avoided because it can lead to more byte swapping than necessary. */ /* Encoding schemes */ extern struct encoding_t { unsigned long int scheme; /* scheme number (the gd_open() flag value) */ const char* ext; /* filename extension */ unsigned int flags; /* encoding flags */ const char* affix; /* function name prefix (NULL for internal scheme)*/ const char* ffname; /* /ENCODING directive name */ unsigned int provides; /* bitfield of functions provided by external module (0 for internal scheme) */ gd_ef_name_t name; gd_ef_open_t open; gd_ef_close_t close; gd_ef_seek_t seek; gd_ef_read_t read; gd_ef_size_t size; gd_ef_write_t write; gd_ef_sync_t sync; gd_ef_move_t move; gd_ef_unlink_t unlink; gd_ef_strerr_t strerr; } _GD_ef[GD_N_SUBENCODINGS]; /* parser data */ struct parser_state { const char *file; int line; int standards; int pedantic; char *ns; size_t nsl; unsigned long flags; }; #define GD_PVERS_GE(p, v) (!(p).pedantic || (p).standards >= (v)) #define GD_PVERS_LT(p, v) (!(p).pedantic || (p).standards < (v)) /* Format file fragment metadata */ struct gd_fragment_t { char* cname; /* Canonical name (full path) */ char* sname; /* Subdirectory name (path relative to dirfile or absolute) */ char *bname; /* basename (filename) */ char* ename; /* External name (the one that appears in the format file) */ char *ns; /* unused */ size_t nsl; /* strlen(ns) */ void *enc_data; int modified; int parent; int dirfd; time_t mtime; unsigned long int encoding; unsigned long int byte_sex; int protection; char* ref_name; off64_t frame_offset; uint32_t vers; char *prefix; char *suffix; }; /* directory metadata */ struct gd_dir_t { char *path; int fd; int rc; }; /* internal dirfile flags */ #define GD_MULTISTANDARD 0x20000000 /* have multiple standards in format */ #define GD_HAVE_VERSION 0x40000000 /* have computed the version */ #define GD_INVALID 0x80000000 /* the dirfile is invalid */ /* This has been the meaning of GD_PERMISSIVE post-open for a while; let's * alias it to avoid confusing ourselves */ #define GD_NOSTANDARD GD_PERMISSIVE /* dirfile conforms to no standard */ /* representation suffixes */ #define GD_REPR_NONE 0 #define GD_REPR_REAL 'r' #define GD_REPR_IMAG 'i' #define GD_REPR_MOD 'm' #define GD_REPR_ARG 'a' /* the implicit representation */ #define GD_REPR_AUTO GD_REPR_REAL /* The DIRFILE struct. */ struct gd_dirfile_ { /* library error data */ int error; int suberror; char* error_string; char* error_file; int error_line; int stdlib_errno; /* global data */ unsigned long int flags; char *error_prefix; unsigned long int open_flags; /* the original flags (used in gd_desynced) */ uint64_t av; int standards; int n_error; int lookback; /* for the public tokeniser */ char *tok_base; const char *tok_pos; /* field counts */ unsigned int n_entries; unsigned int n_dot; /* field array */ gd_entry_t** entry; gd_entry_t** dot_list; /* the reference field */ gd_entry_t* reference_field; /* directory name (this is just whatever was passed to gd_open() */ char* name; /* directory list */ unsigned int ndir; struct gd_dir_t *dir; /* recursion counter */ int recurse_level; /* fragment list */ struct gd_fragment_t* fragment; int n_fragment; /* field lists */ const char **entry_list[GD_N_ENTRY_LISTS]; unsigned int entry_list_flags[GD_N_ENTRY_LISTS]; const char **string_value_list; void *const_value_list; gd_carray_t *carray_value_list; uint32_t value_list_validity; uint32_t entry_list_validity; /* syntax error callback */ gd_parser_callback_t sehandler; void* sehandler_extra; }; /* forward declarations */ void *_GD_Alloc(DIRFILE*, gd_type_t, size_t) __attribute_malloc__; int _GD_BadInput(DIRFILE *, const gd_entry_t *, int, gd_entype_t, int); #define _GD_BadWindop(op) \ ( \ (op != GD_WINDOP_EQ) && (op != GD_WINDOP_GE) && (op != GD_WINDOP_GT) && \ (op != GD_WINDOP_LE) && (op != GD_WINDOP_LT) && (op != GD_WINDOP_NE) && \ (op != GD_WINDOP_SET) && (op != GD_WINDOP_CLR) \ ) int _GD_CalculateEntry(DIRFILE *restrict, gd_entry_t *restrict, int); char *_GD_CanonicalPath(const char *restrict, const char *restrict); int _GD_CheckByteSex(gd_type_t, unsigned, unsigned, int, int *restrict); gd_entry_t *_GD_CheckParent(DIRFILE *restrict D, const struct parser_state *restrict, char **restrict name, int me); int _GD_CheckCodeAffixes(DIRFILE *D, const char *field_code, int fragment, int set_error); void _GD_CInvertData(DIRFILE *restrict, void *restrict, gd_type_t, GD_DCOMPLEXA(dividend), size_t); void _GD_CleanUpRename(struct gd_rename_data_*, int); /* _GD_ClearError: Everything's A-OK; clear the last error. */ #define _GD_ClearError(D) (D)->error = 0 void _GD_CLincomData(DIRFILE *restrict, int, void *restrict, gd_type_t, const GD_DCOMPLEXP_t restrict, const GD_DCOMPLEXP_t restrict, GD_DCOMPLEXV(m), GD_DCOMPLEXV(b), const unsigned int *restrict, size_t); void _GD_ConvertType(DIRFILE *restrict, const void *restrict, gd_type_t, void *restrict, gd_type_t, size_t) gd_nothrow; gd_type_t _GD_ConstType(DIRFILE *D, gd_type_t type); const char *_GD_DirName(const DIRFILE *D, int dirfd); size_t _GD_DoField(DIRFILE *restrict, gd_entry_t *restrict, int, off64_t, size_t, gd_type_t, void *restrict); size_t _GD_DoFieldOut(DIRFILE *restrict, gd_entry_t *restrict, off64_t, size_t, gd_type_t, const void *restrict); off64_t _GD_DoSeek(DIRFILE *restrict, gd_entry_t *restrict, const struct encoding_t *restrict, off64_t, unsigned int mode); int _GD_EntryCmp(const void*, const void*); gd_entry_t *_GD_FindEntry(DIRFILE *restrict, const char *restrict, unsigned int *restrict, int, int); gd_entry_t *_GD_FindField(const DIRFILE *restrict, const char *restrict, gd_entry_t *const *, unsigned int, int, unsigned int *restrict); gd_entry_t *_GD_FindFieldAndRepr(DIRFILE *restrict, const char *restrict, char **restrict, int *restrict, unsigned int *restrict, int, int); uint64_t _GD_FindVersion(DIRFILE *D); void _GD_FixEndianness(void*, size_t, gd_type_t, unsigned, unsigned); int _GD_FileSwapBytes(const DIRFILE *restrict, const gd_entry_t *restrict); int _GD_FiniRawIO(DIRFILE*, const gd_entry_t*, int, int); void _GD_Flush(DIRFILE *restrict, gd_entry_t *restrict, int, int); void _GD_FlushMeta(DIRFILE* D, int fragment, int force); void _GD_FreeE(DIRFILE *restrict, gd_entry_t *restrict, int); off64_t _GD_GetEOF(DIRFILE *restrict, const gd_entry_t *restrict, const char *restrict, int *restrict); off64_t _GD_GetFilePos(DIRFILE *restrict, gd_entry_t *restrict, off64_t); char *_GD_GetLine(FILE *restrict, size_t *restrict, int *restrict); int _GD_GetRepr(DIRFILE *restrict, const char *restrict, char **restrict, int); unsigned int _GD_GetSPF(DIRFILE*, gd_entry_t*); int _GD_GrabDir(DIRFILE*, int, const char *restrict, int); int _GD_Include(DIRFILE*, struct parser_state *restrict, const char *restrict, char **restrict, int, const char *restrict, const char *restrict, int); void _GD_InitialiseFramework(void); int _GD_InitRawIO(DIRFILE*, const gd_entry_t*, const char*, int, const struct encoding_t*, unsigned int, unsigned int, int); void _GD_InvertData(DIRFILE *restrict, void *restrict, gd_type_t return_type, double dividend, size_t n_read); void _GD_InsertSort(DIRFILE *restrict, gd_entry_t *restrict, int u) gd_nothrow; #define _GD_InternalError(D) \ _GD_SetError(D, GD_E_INTERNAL_ERROR, 0, __FILE__, __LINE__, NULL) int _GD_InvalidEntype(gd_entype_t t); gd_type_t _GD_LegacyType(char c); void _GD_LincomData(DIRFILE *restrict, int n, void *restrict, gd_type_t return_type, const double *restrict, const double *restrict, const double *restrict, const double *restrict, const unsigned int *restrict, size_t); void _GD_LinterpData(DIRFILE *restrict, void *restrict, gd_type_t, int, const double *restrict, size_t, const struct gd_lut_ *restrict, size_t); int _GD_ListEntry(const gd_entry_t *E, int meta, int hidden, int noalias, int special, gd_entype_t type); char *_GD_MakeFullPath(DIRFILE *restrict, int, const char *restrict, int); #ifdef USE_MODULES #define _GD_MakeFullPathOnly gd_MakeFullPathOnly #define _GD_MakeTempFile gd_MakeTempFile #ifdef __cplusplus extern "C" { #endif #else #define gd_MakeFullPathOnly _GD_MakeFullPathOnly #define gd_MakeTempFile _GD_MakeTempFile #endif char *_GD_MakeFullPathOnly(const DIRFILE *D, int dirfd, const char *name); int _GD_MakeTempFile(const DIRFILE*, int, char*); #ifdef USE_MODULES #ifdef __cplusplus } #endif #endif void *_GD_Malloc(DIRFILE *D, size_t size); int _GD_MissingFramework(int encoding, unsigned int funcs); int _GD_MogrifyFile(DIRFILE *restrict, gd_entry_t *restrict, unsigned long int, unsigned long int, off64_t, int, int, char *restrict); char *_GD_MungeCode(DIRFILE *restrict, const char *restrict, size_t, const char *restrict, const char *restrict, const char *restrict, const char *restrict, const char *restrict, char **restrict, int *restrict, unsigned); gd_type_t _GD_NativeType(DIRFILE *restrict, gd_entry_t *restrict, int); unsigned int _GD_NEntries(DIRFILE*, struct gd_private_entry_*, int, unsigned int); DIRFILE *_GD_Open(DIRFILE*, int, const char*, unsigned long, gd_parser_callback_t, void*); gd_entry_t *_GD_ParseFieldSpec(DIRFILE *restrict, const struct parser_state *restrict, int, char**, const gd_entry_t *restrict, int, int, int, char **, const char *); char *_GD_ParseFragment(FILE *restrict, DIRFILE*, struct parser_state *restrict, int, int); void _GD_PerformRename(DIRFILE *restrict, struct gd_rename_data_ *restrict); struct gd_rename_data_ *_GD_PrepareRename(DIRFILE *restrict, char *restrict, gd_entry_t *restrict, int, unsigned, int, unsigned); void _GD_ReadLinterpFile(DIRFILE *restrict, gd_entry_t *restrict); void *_GD_Realloc(DIRFILE *restrict, void *restrict, size_t size); void _GD_ReleaseDir(DIRFILE *D, int dirfd); int _GD_Seek(DIRFILE *restrict, gd_entry_t *restrict, off64_t offset, unsigned int mode); void _GD_SetEncIOError(DIRFILE*, int suberror, const struct gd_raw_file_ *); void _GD_SetError(DIRFILE*, int, int, const char*, int, const char*); void _GD_SetError2(DIRFILE*, int, int, const char*, int, const char*, int); int _GD_SetTablePath(DIRFILE *restrict, const gd_entry_t *restrict, struct gd_private_entry_ *restrict); void _GD_SimpleParserInit(DIRFILE *restrict D, const char *restrict name, struct parser_state *restrict p); int _GD_ShutdownDirfile(DIRFILE*, int, int); int _GD_StrCmpNull(const char *restrict, const char *restrict); char *_GD_Strdup(DIRFILE *restrict, const char *restrict); int _GD_Supports(DIRFILE *, const gd_entry_t*, unsigned int funcs); int _GD_Tokenise(DIRFILE *restrict, const struct parser_state *restrict, const char *restrict, char **, const char **, int, char **); int _GD_TokToNum(const char *restrict, int, int, double*, double*, uint64_t*, int64_t*); void _GD_UpdateAliases(DIRFILE*, int); int _GD_ValidateField(const char*, int, int, unsigned, int*); ssize_t _GD_WriteOut(const gd_entry_t*, const struct encoding_t*, const void*, gd_type_t, size_t, int); /* generic I/O methods */ int _GD_GenericMove(int, struct gd_raw_file_ *restrict, int, char *restrict); int _GD_GenericName(DIRFILE *restrict, const char *restrict, struct gd_raw_file_ *restrict, const char *restrict, int, int); int _GD_GenericUnlink(int, struct gd_raw_file_* file); /* unencoded I/O methods */ int _GD_RawOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_RawRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_RawWrite(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_RawSync(struct gd_raw_file_* file); int _GD_RawClose(struct gd_raw_file_* file); off64_t _GD_RawSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); /* text I/O methods */ int _GD_AsciiOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_AsciiSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_AsciiRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_AsciiWrite(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_AsciiSync(struct gd_raw_file_* file); int _GD_AsciiClose(struct gd_raw_file_* file); off64_t _GD_AsciiSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); /* SIE I/O methods */ int _GD_SampIndOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_SampIndSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_SampIndRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_SampIndWrite(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_SampIndSync(struct gd_raw_file_* file); int _GD_SampIndClose(struct gd_raw_file_* file); off64_t _GD_SampIndSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); #ifdef USE_MODULES #define _GD_Bzip2Open lt_libgetdatabzip2_LTX_GD_Bzip2Open #define _GD_Bzip2Seek lt_libgetdatabzip2_LTX_GD_Bzip2Seek #define _GD_Bzip2Read lt_libgetdatabzip2_LTX_GD_Bzip2Read #define _GD_Bzip2Write lt_libgetdatabzip2_LTX_GD_Bzip2Write #define _GD_Bzip2Sync lt_libgetdatabzip2_LTX_GD_Bzip2Sync #define _GD_Bzip2Close lt_libgetdatabzip2_LTX_GD_Bzip2Close #define _GD_Bzip2Size lt_libgetdatabzip2_LTX_GD_Bzip2Size #define _GD_Bzip2Strerr lt_libgetdatabzip2_LTX_GD_Bzip2Strerr #define _GD_FlacOpen lt_libgetdataflac_LTX_GD_FlacOpen #define _GD_FlacSeek lt_libgetdataflac_LTX_GD_FlacSeek #define _GD_FlacRead lt_libgetdataflac_LTX_GD_FlacRead #define _GD_FlacWrite lt_libgetdataflac_LTX_GD_FlacWrite #define _GD_FlacSync lt_libgetdataflac_LTX_GD_FlacSync #define _GD_FlacClose lt_libgetdataflac_LTX_GD_FlacClose #define _GD_FlacSize lt_libgetdataflac_LTX_GD_FlacSize #define _GD_FlacStrerr lt_libgetdataflac_LTX_GD_FlacStrerr #define _GD_GzipOpen lt_libgetdatagzip_LTX_GD_GzipOpen #define _GD_GzipSeek lt_libgetdatagzip_LTX_GD_GzipSeek #define _GD_GzipRead lt_libgetdatagzip_LTX_GD_GzipRead #define _GD_GzipWrite lt_libgetdatagzip_LTX_GD_GzipWrite #define _GD_GzipSync lt_libgetdatagzip_LTX_GD_GzipSync #define _GD_GzipClose lt_libgetdatagzip_LTX_GD_GzipClose #define _GD_GzipSize lt_libgetdatagzip_LTX_GD_GzipSize #define _GD_GzipStrerr lt_libgetdatagzip_LTX_GD_GzipStrerr #define _GD_LzmaOpen lt_libgetdatalzma_LTX_GD_LzmaOpen #define _GD_LzmaSeek lt_libgetdatalzma_LTX_GD_LzmaSeek #define _GD_LzmaRead lt_libgetdatalzma_LTX_GD_LzmaRead #define _GD_LzmaWrite lt_libgetdatalzma_LTX_GD_LzmaWrite #define _GD_LzmaSync lt_libgetdatalzma_LTX_GD_LzmaSync #define _GD_LzmaClose lt_libgetdatalzma_LTX_GD_LzmaClose #define _GD_LzmaSize lt_libgetdatalzma_LTX_GD_LzmaSize #define _GD_LzmaStrerr lt_libgetdatalzma_LTX_GD_LzmaStrerr #define _GD_SlimOpen lt_libgetdataslim_LTX_GD_SlimOpen #define _GD_SlimSeek lt_libgetdataslim_LTX_GD_SlimSeek #define _GD_SlimRead lt_libgetdataslim_LTX_GD_SlimRead #define _GD_SlimClose lt_libgetdataslim_LTX_GD_SlimClose #define _GD_SlimSize lt_libgetdataslim_LTX_GD_SlimSize #define _GD_SlimStrerr lt_libgetdataslim_LTX_GD_SlimStrerr #define _GD_ZzipName lt_libgetdatazzip_LTX_GD_ZzipName #define _GD_ZzipOpen lt_libgetdatazzip_LTX_GD_ZzipOpen #define _GD_ZzipSeek lt_libgetdatazzip_LTX_GD_ZzipSeek #define _GD_ZzipRead lt_libgetdatazzip_LTX_GD_ZzipRead #define _GD_ZzipClose lt_libgetdatazzip_LTX_GD_ZzipClose #define _GD_ZzipSize lt_libgetdatazzip_LTX_GD_ZzipSize #define _GD_ZzipStrerr lt_libgetdatazzip_LTX_GD_ZzipStrerr #define _GD_ZzslimName lt_libgetdatazzslim_LTX_GD_ZzslimName #define _GD_ZzslimOpen lt_libgetdatazzslim_LTX_GD_ZzslimOpen #define _GD_ZzslimSeek lt_libgetdatazzslim_LTX_GD_ZzslimSeek #define _GD_ZzslimRead lt_libgetdatazzslim_LTX_GD_ZzslimRead #define _GD_ZzslimClose lt_libgetdatazzslim_LTX_GD_ZzslimClose #define _GD_ZzslimSize lt_libgetdatazzslim_LTX_GD_ZzslimSize #define _GD_ZzslimStrerr lt_libgetdatazzslim_LTX_GD_ZzslimStrerr #ifdef __cplusplus extern "C" { #endif #endif /* bzip I/O methods */ int _GD_Bzip2Open(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_Bzip2Seek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_Bzip2Read(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_Bzip2Write(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_Bzip2Sync(struct gd_raw_file_*); int _GD_Bzip2Close(struct gd_raw_file_*); off64_t _GD_Bzip2Size(int, struct gd_raw_file_*, gd_type_t, int); int _GD_Bzip2Strerr(const struct gd_raw_file_*, char*, size_t); /* flac I/O methods */ int _GD_FlacOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_FlacSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_FlacRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_FlacWrite(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_FlacSync(struct gd_raw_file_*); int _GD_FlacClose(struct gd_raw_file_* file); off64_t _GD_FlacSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); int _GD_FlacStrerr(const struct gd_raw_file_*, char*, size_t); /* gzip I/O methods */ int _GD_GzipOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_GzipSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_GzipRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_GzipWrite(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_GzipSync(struct gd_raw_file_*); int _GD_GzipClose(struct gd_raw_file_* file); off64_t _GD_GzipSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); int _GD_GzipStrerr(const struct gd_raw_file_*, char*, size_t); /* lzma I/O methods */ int _GD_LzmaOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_LzmaSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_LzmaRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); ssize_t _GD_LzmaWrite(struct gd_raw_file_ *restrict, const void *restrict, gd_type_t, size_t); int _GD_LzmaClose(struct gd_raw_file_* file); int _GD_LzmaSync(struct gd_raw_file_ *file); off64_t _GD_LzmaSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); int _GD_LzmaStrerr(const struct gd_raw_file_*, char*, size_t); /* slim I/O methods */ int _GD_SlimOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_SlimSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_SlimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); int _GD_SlimClose(struct gd_raw_file_* file); off64_t _GD_SlimSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); int _GD_SlimStrerr(const struct gd_raw_file_*, char*, size_t); /* zzip I/O methods */ int _GD_ZzipName(DIRFILE *restrict, const char *restrict, struct gd_raw_file_ *restrict, const char *restrict, int, int); int _GD_ZzipOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_ZzipSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_ZzipRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); int _GD_ZzipClose(struct gd_raw_file_* file); off64_t _GD_ZzipSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); int _GD_ZzipStrerr(const struct gd_raw_file_*, char*, size_t); /* zzslim I/O methods */ int _GD_ZzslimName(DIRFILE *restrict, const char *restrict, struct gd_raw_file_ *restrict, const char *restrict, int, int); int _GD_ZzslimOpen(int, struct gd_raw_file_*, gd_type_t, int, unsigned int); off64_t _GD_ZzslimSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int); ssize_t _GD_ZzslimRead(struct gd_raw_file_ *restrict, void *restrict, gd_type_t, size_t); int _GD_ZzslimClose(struct gd_raw_file_* file); off64_t _GD_ZzslimSize(int, struct gd_raw_file_* file, gd_type_t data_type, int swap); int _GD_ZzslimStrerr(const struct gd_raw_file_*, char*, size_t); #ifdef USE_MODULES #ifdef __cplusplus } #endif #endif #ifndef __cplusplus # undef gd_nothrow # define gd_nothrow #endif /* deal with GD_ANON */ #ifdef GD_C89_API # define EN(t,v) u.t.v #else # define EN(t,v) v #endif #endif libgetdata-0.9.0/src/raw.c0000640000175000017500000000756612614323564015546 0ustar alastairalastair/* Copyright (C) 2008, 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" int _GD_RawOpen(int fd, struct gd_raw_file_* file, gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode) { dtrace("%i, %p, , , 0x%X", fd, file, mode); if (!(mode & GD_FILE_TEMP)) { if (file->mode & mode) { dreturn("%i", 0); return 0; } else if (file->idata >= 0) close(file->idata); file->idata = gd_OpenAt(file->D, fd, file->name, ((mode & GD_FILE_WRITE) ? (O_RDWR | O_CREAT) : O_RDONLY) | O_BINARY, 0666); } else { file->idata = _GD_MakeTempFile(file->D, fd, file->name); } if (file->idata < 0) { dreturn("%i", 1); return 1; } file->pos = 0; file->mode = mode | GD_FILE_READ; dreturn("%i", 0); return 0; } off64_t _GD_RawSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode gd_unused_) { off64_t pos; dtrace("%p, %lli, 0x%X, ", file, (long long)count, data_type); /* short circuit */ if (file->pos == count) { dreturn("%lli", (long long)count); return count; } pos = lseek64(file->idata, count * GD_SIZE(data_type), SEEK_SET); /* If we've landed in the middle of a sample, we have to back up */ if (pos > 0 && (pos % GD_SIZE(data_type))) pos = lseek64(file->idata, -(pos % GD_SIZE(data_type)), SEEK_CUR); if (pos == -1) { dreturn("%i", -1); return -1; } pos /= GD_SIZE(data_type); file->pos = pos; dreturn("%lli", (long long)pos); return pos; } ssize_t _GD_RawRead(struct gd_raw_file_ *restrict file, void *restrict ptr, gd_type_t data_type, size_t nmemb) { ssize_t nread; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); nread = read(file->idata, ptr, nmemb * GD_SIZE(data_type)); if (nread >= 0) { nread /= GD_SIZE(data_type); file->pos += nread; } dreturn("%" PRNssize_t, nread); return nread; } ssize_t _GD_RawWrite(struct gd_raw_file_ *restrict file, const void *restrict ptr, gd_type_t data_type, size_t nmemb) { ssize_t nwrote; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); nwrote = write(file->idata, ptr, nmemb * GD_SIZE(data_type)); if (nwrote >= 0) { nwrote /= GD_SIZE(data_type); file->pos += nwrote; } dreturn("%" PRNsize_t, nwrote); return nwrote; } int _GD_RawSync(struct gd_raw_file_ *file) { int r; dtrace("%p", file); r = fsync(file->idata); dreturn("%i", r); return r; } int _GD_RawClose(struct gd_raw_file_ *file) { int ret; dtrace("%p", file); ret = close(file->idata); if (!ret) { file->idata = -1; file->mode = 0; } dreturn("%i", ret); return ret; } off64_t _GD_RawSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { gd_stat64_t statbuf; dtrace("%i, %p, 0x%X, ", dirfd, file, data_type); if (gd_StatAt64(file->D, dirfd, file->name, &statbuf, 0) < 0) { dreturn("%lli", -1LL); return -1; } dreturn("%lli", (long long)statbuf.st_size); return statbuf.st_size / GD_SIZE(data_type); } libgetdata-0.9.0/src/globals.c0000640000175000017500000001047212614323564016366 0ustar alastairalastair/* Copyright (C) 2008-2012, 2014 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* This is a canonicalised version of the path specified in the open call. * In the presence of third parties modifying symlinks after dirfile open, the * caller is unable to determine the actual path to the dirfile that was * opened if we don't help out. */ const char *gd_dirfilename(DIRFILE* D) gd_nothrow { dtrace("%p", D); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); dreturn("\"%s\"", D->dir[0].path); return D->dir[0].path; } const char *gd_reference(DIRFILE* D, const char* field_code) gd_nothrow { gd_entry_t *E; char *ptr; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } _GD_ClearError(D); /* if no field specified, return only the field name */ if (field_code == NULL) { if (D->reference_field == NULL) { dreturn("%p", NULL); return NULL; } dreturn("\"%s\"", D->reference_field->field); return D->reference_field->field; } /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } /* Check field */ E = _GD_FindField(D, field_code, D->entry, D->n_entries, 1, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } if (E->field_type != GD_RAW_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); dreturn("%p", NULL); return NULL; } /* Check protection */ if (D->fragment[0].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[0].cname); dreturn("%p", NULL); return NULL; } ptr = _GD_Strdup(D, E->field); if (ptr == NULL) { dreturn("%p", NULL); return NULL; } /* set the new reference field */ D->reference_field = E; free(D->fragment[0].ref_name); D->fragment[0].ref_name = ptr; D->fragment[0].modified = 1; D->flags &= ~GD_HAVE_VERSION; dreturn("\"%s\"", D->reference_field->field); return D->reference_field->field; } /* the mask of allowed flags */ #define GD_FLAG_MASK (GD_VERBOSE | GD_PRETTY_PRINT) unsigned long gd_flags(DIRFILE *D, unsigned long set, unsigned long reset) gd_nothrow { dtrace("%p, 0x%lX, 0x%lX", D, set, reset); _GD_ClearError(D); set &= GD_FLAG_MASK; reset &= GD_FLAG_MASK; D->flags = (D->flags | set) & ~(D->flags & reset); D->open_flags = (D->open_flags | set) & ~(D->open_flags & reset); dreturn("0x%lX", D->flags & GD_FLAG_MASK); return D->flags & GD_FLAG_MASK; } int gd_verbose_prefix(DIRFILE *D, const char *prefix) gd_nothrow { char *ptr = NULL; dtrace("%p, \"%s\"", D, prefix); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); if (prefix) { ptr = _GD_Strdup(D, prefix); if (D->error) { dreturn("%i", -1); return -1; } } free(D->error_prefix); D->error_prefix = ptr; dreturn("%i", 0); return 0; } void gd_mplex_lookback(DIRFILE *D, int lookback) gd_nothrow { dtrace("%p, %i", D, lookback); _GD_ClearError(D); D->lookback = lookback; dreturnvoid(); } libgetdata-0.9.0/src/index.c0000640000175000017500000002006312614323564016047 0ustar alastairalastair/* Copyright (C) 2009-2013 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" static double _GD_Extrapolate(DIRFILE *D, gd_entry_t *E, int repr, double value, off64_t limit, int eof) { off64_t n; double sample = NAN; double data[2]; dtrace("%p, %p, %i, %g, %lli, %i", D, E, repr, value, (long long)limit, eof); /* load data */ n = _GD_DoField(D, E, repr, limit - eof, 2, GD_FLOAT64, data); if (D->error) { dreturn("%.15g", sample); return sample; } else if (n < 2) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL); dreturn("%.15g", sample); return sample; } sample = limit + (value - data[eof]) / (data[1] - data[0]); dreturn("%.15g", sample); return sample; } /* find the (fractional) frame number based on a monotonic look-up */ static double _GD_GetIndex(DIRFILE* D, gd_entry_t *E, int repr, double value, off64_t field_start, off64_t field_end) { double sample = NAN; int dir = -1; /* -1 = unknown; 0 = ascending; 1 = descending */ off64_t low = field_start; off64_t high = field_end; off64_t c; double low_v, high_v, field_start_v, c_v; size_t n; dtrace("%p, %p, %i, %g, %lli, %lli", D, E, repr, value, (long long)field_start, (long long)field_end); /* find the end-points */ n = _GD_DoField(D, E, repr, field_start, 1, GD_FLOAT64, &low_v); field_start_v = low_v; if (D->error) { dreturn("%.15g", sample); return sample; } if (n == 0) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL); dreturn("%.15g", sample); return sample; } n = _GD_DoField(D, E, repr, field_end - 1, 1, GD_FLOAT64, &high_v); if (D->error) { dreturn("%.15g", sample); return sample; } if (n > 0) { if (high_v == low_v) { _GD_SetError(D, GD_E_RANGE, GD_E_SINGULAR_RANGE, NULL, 0, NULL); dreturn("%.15g", sample); return sample; } dir = (high_v < low_v) ? 1 : 0; /* extrapolate, if necessary */ if ((!dir && low_v > value) || (dir && low_v < value)) { sample = _GD_Extrapolate(D, E, repr, value, low, 0); dreturn("%.15g", sample); return sample; } else if ((!dir && high_v < value) || (dir && high_v > value)) { sample = _GD_Extrapolate(D, E, repr, value, high - 1, 1); dreturn("%.15g", sample); return sample; } } else { /* binary search until either we find the end or we find a subdomain in * which our value lies */ for (;;) { c = (high + low) / 2; n = _GD_DoField(D, E, repr, c, 1, GD_FLOAT64, &c_v); if (D->error) { dreturn("%.15g", sample); return sample; } if (n == 0) { if (c - low == 1) { if (low == field_start) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL); dreturn("%.15g", sample); return sample; } /* low is the EOF -- so, extrapolate */ sample = _GD_Extrapolate(D, E, repr, value, low, 1); dreturn("%.15g", sample); return sample; } else { /* haven't found the EOF yet */ high = c; } } else { if (dir == -1) { if (c_v == low_v) { /* in this case, the range may not be singular, so use our guess * as the new lower limit and keep looking */ low = c; continue; } dir = (c_v < field_start_v) ? 1 : 0; if ((!dir && field_start_v > value) || (dir && field_start_v < value)) { /* extrapolate BOF */ sample = _GD_Extrapolate(D, E, repr, value, low, 0); dreturn("%.15g", sample); return sample; } } if ((!dir && c_v > value) || (dir && c_v < value)) { /* below our guess -- finding the end is no longer relevant */ high = c; high_v = c_v; break; } else if ((!dir && c_v < value) || (dir && c_v > value)) { /* above our guess -- still need to look for the end */ low = c; low_v = c_v; } } } } /* Step 2: binary search until we find the value */ for (;high - low > 1;) { /* load data */ c = (high + low) / 2; n = _GD_DoField(D, E, repr, c, 1, GD_FLOAT64, &c_v); if (D->error) { dreturn("%.15g", sample); return sample; } if (n == 0) { /* someone's been stealing our data. How Rude! */ _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL); dreturn("%.15g", sample); return sample; } if ((!dir && c_v > value) || (dir && c_v < value)) { /* before our guess */ high_v = c_v; high = c; } else if ((!dir && c_v < value) || (dir && c_v > value)) { /* after our guess */ low_v = c_v; low = c; } else { /* our guess was unexpectedly correct */ sample = (double)c; dreturn("%.15g", sample); return sample; } } sample = low + (value - low_v) / (high_v - low_v); dreturn("%.15g", sample); return sample; } double gd_framenum_subset64(DIRFILE* D, const char* field_code_in, double value, off64_t field_start, off64_t field_end) { double frame = NAN; gd_entry_t* entry; char* field_code; int repr = GD_REPR_NONE; unsigned int spf; dtrace("%p, \"%s\", %g, %lli, %lli", D, field_code_in, value, (long long)field_start, (long long)field_end); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%.15g", frame); return frame; } _GD_ClearError(D); entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("%.15g", frame); return frame; } if (_GD_NativeType(D, entry, repr) & GD_COMPLEX) _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_COMPLEX, NULL, 0, NULL); else if (entry->field_type & GD_SCALAR_ENTRY_BIT) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code); if (field_code != field_code_in) free(field_code); if (D->error) { dreturn("%.15g", frame); return frame; } spf = _GD_GetSPF(D, entry); if (field_start == 0) field_start = D->fragment[entry->fragment_index].frame_offset * spf; else field_start *= spf; if (field_end == 0) field_end = (gd_nframes64(D) + 1) * spf - 1; else field_end = (field_end + 1) * spf - 1; if (field_end - field_start < 2) _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_EMPTY, NULL, 0, NULL); if (!D->error) frame = _GD_GetIndex(D, entry, repr, value, field_start, field_end) / spf; dreturn("%.15g", frame); return frame; } double gd_framenum_subset(DIRFILE* D, const char* field_code, double value, off_t field_start, off_t field_end) { double frame; dtrace("%p, \"%s\", %g, %lli, %lli", D, field_code, value, (long long int)field_start, (long long int)field_end); frame = gd_framenum_subset64(D, field_code, value, (off64_t)field_start, (off64_t)field_end); dreturn("%.15g", frame); return frame; } double gd_framenum(DIRFILE* D, const char* field_code, double value) { double frame; dtrace("%p, \"%s\", %g", D, field_code, value); frame = gd_framenum_subset64(D, field_code, value, 0, 0); dreturn("%.15g", frame); return frame; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/bzip.c0000640000175000017500000002430012614323564015702 0ustar alastairalastair/* Copyright (C) 2008-2011, 2013, 2014, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef HAVE_BZLIB_H #include #endif #if SIZEOF_INT < 4 #define GD_BZIP_BUFFER_SIZE 32767 #else #define GD_BZIP_BUFFER_SIZE 1000000 #endif struct gd_bzdata { BZFILE* bzfile; FILE* stream; int bzerror; int stream_end; int pos, end; off64_t base; char data[GD_BZIP_BUFFER_SIZE]; }; /* The bzip encoding scheme uses edata as a gd_bzdata pointer. If a file is * open, idata = 0 otherwise idata = -1. */ static struct gd_bzdata *_GD_Bzip2DoOpen(int dirfd, struct gd_raw_file_* file, unsigned int mode) { int fd; struct gd_bzdata *ptr; FILE *stream; const char *fdmode = "rb"; dtrace("%i, %p, 0x%X", dirfd, file, mode); if (mode & GD_FILE_READ) { fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666); } else if (mode & GD_FILE_TEMP) { fd = _GD_MakeTempFile(file->D, dirfd, file->name); fdmode = "wb"; } else { /* internal error */ errno = EINVAL; /* I guess ... ? */ dreturn("%p", NULL); return NULL; } if (fd < 0) { dreturn("%p", NULL); return NULL; } if ((stream = fdopen(fd, fdmode)) == NULL) { close(fd); dreturn("%p", NULL); return NULL; } if ((ptr = (struct gd_bzdata *)malloc(sizeof(struct gd_bzdata))) == NULL) { fclose(stream); dreturn("%p", NULL); return NULL; } ptr->stream = stream; ptr->bzerror = ptr->stream_end = 0; if (mode & GD_FILE_READ) { ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, stream, 0, 0, NULL, 0); } else { ptr->bzfile = BZ2_bzWriteOpen(&ptr->bzerror, stream, 9, 0, 30); memset(ptr->data, 0, GD_BZIP_BUFFER_SIZE); } if (ptr->bzerror != BZ_OK) { if (mode & GD_FILE_READ) BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile); else BZ2_bzWriteClose(&ptr->bzerror, ptr->bzfile, 0, NULL, NULL); fclose(stream); free(ptr); file->error = ptr->bzerror; dreturn("%p", NULL); return NULL; } ptr->pos = ptr->end = 0; ptr->base = 0; file->pos = 0; dreturn("%p", ptr); return ptr; } int _GD_Bzip2Open(int dirfd, struct gd_raw_file_* file, gd_type_t type gd_unused_, int swap gd_unused_, unsigned int mode) { dtrace("%i, %p, , , 0x%X", dirfd, file, mode); file->edata = _GD_Bzip2DoOpen(dirfd, file, mode); if (file->edata == NULL) { dreturn("%i", 1); return 1; } file->mode = mode; file->idata = 0; dreturn("%i", 0); return 0; } ssize_t _GD_Bzip2Read(struct gd_raw_file_ *restrict file, void *restrict data, gd_type_t data_type, size_t nmemb) { char* output = (char*)data; struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata; uint64_t nbytes = nmemb * GD_SIZE(data_type); dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); while (nbytes > (uint64_t)(ptr->end - ptr->pos)) { int n; memcpy(output, ptr->data + ptr->pos, ptr->end - ptr->pos); output += ptr->end - ptr->pos; nbytes -= ptr->end - ptr->pos; ptr->pos = ptr->end; if (ptr->stream_end) { dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type))); return nmemb - nbytes / GD_SIZE(data_type); } ptr->bzerror = 0; n = BZ2_bzRead(&ptr->bzerror, ptr->bzfile, ptr->data, GD_BZIP_BUFFER_SIZE); if (ptr->bzerror == BZ_OK || ptr->bzerror == BZ_STREAM_END) { ptr->base += ptr->end; ptr->pos = 0; ptr->end = n; } else { file->error = ptr->bzerror; dreturn("%i", -1); return -1; } /* eof */ if (ptr->bzerror != BZ_OK) { ptr->stream_end = 1; break; } } if (nbytes > (uint64_t)(ptr->end - ptr->pos)) { memcpy(output, ptr->data + ptr->pos, ptr->end - ptr->pos); ptr->pos = ptr->end; nbytes -= ptr->end; } else { memcpy(output, ptr->data + ptr->pos, nbytes); ptr->pos += nbytes; nbytes = 0; } file->pos = (ptr->base + ptr->pos) / GD_SIZE(data_type); dreturn("%li", (long)(nmemb - nbytes / GD_SIZE(data_type))); return nmemb - nbytes / GD_SIZE(data_type); } ssize_t _GD_Bzip2Write(struct gd_raw_file_ *file, const void *data, gd_type_t data_type, size_t nmemb) { struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata; ssize_t n; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, data, data_type, nmemb); n = GD_SIZE(data_type) * nmemb; if (n > INT_MAX) n = INT_MAX; BZ2_bzWrite(&ptr->bzerror, ptr->bzfile, (void*)data, (int)n); if (ptr->bzerror) { file->error = ptr->bzerror; n = -1; } else { ptr->base += n; n /= GD_SIZE(data_type); file->pos += n; } dreturn("%" PRNssize_t, n); return n; } off64_t _GD_Bzip2Seek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode) { struct gd_bzdata *ptr; dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode); ptr = (struct gd_bzdata *)(file[(mode == GD_FILE_WRITE) ? 1 : 0].edata); /* nothing to do */ if (ptr->base + ptr->pos == count * GD_SIZE(data_type)) { dreturn("%lli", (long long)count); return count; } count *= GD_SIZE(data_type); if (mode == GD_FILE_WRITE) { /* we only get here when we need to pad */ count -= file->pos * GD_SIZE(data_type); while (ptr->base < count) { int n; if (count > GD_BZIP_BUFFER_SIZE) n = GD_BZIP_BUFFER_SIZE; else n = count; _GD_Bzip2Write(file + 1, ptr->data, GD_UINT8, n); count -= n; } } else { if (ptr->base > count) { /* a backwards seek: reopen the file */ ptr->bzerror = 0; BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile); if (ptr->bzerror != BZ_OK) { file->error = ptr->bzerror; fclose(ptr->stream); dreturn("%i", -1); return -1; } rewind(ptr->stream); ptr->bzfile = BZ2_bzReadOpen(&ptr->bzerror, ptr->stream, 0, 0, NULL, 0); if (ptr->bzerror != BZ_OK) { file->error = ptr->bzerror; BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile); fclose(ptr->stream); dreturn("%i", -1); return -1; } ptr->pos = ptr->end = 0; ptr->base = ptr->stream_end = 0; } /* seek forward the slow way */ while (ptr->base + ptr->end < count) { int n; /* eof */ if (ptr->stream_end) break; ptr->bzerror = 0; n = BZ2_bzRead(&ptr->bzerror, ptr->bzfile, ptr->data, GD_BZIP_BUFFER_SIZE); if (ptr->bzerror == BZ_OK || ptr->bzerror == BZ_STREAM_END) { ptr->base += ptr->end; ptr->end = n; if (ptr->bzerror == BZ_STREAM_END) ptr->stream_end = 1; } else { file->error = ptr->bzerror; dreturn("%i", -1); return -1; } } ptr->pos = (ptr->stream_end && count >= ptr->base + ptr->end) ? ptr->end : count - ptr->base; } file->pos = (ptr->base + ptr->pos) / GD_SIZE(data_type); dreturn("%lli", (long long)file->pos); return file->pos;; } /* This function does nothing */ int _GD_Bzip2Sync(struct gd_raw_file_ *file gd_unused_) { dtrace(""); dreturn("%i", 0); return 0; } int _GD_Bzip2Close(struct gd_raw_file_ *file) { struct gd_bzdata *ptr = (struct gd_bzdata *)file->edata; dtrace("%p", file); ptr->bzerror = 0; if (file->mode & GD_FILE_READ) BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile); else BZ2_bzWriteClose(&ptr->bzerror, ptr->bzfile, 0, NULL, NULL); if (ptr->bzerror || fclose(ptr->stream)) { file->error = ptr->bzerror; dreturn("%i", 1); return 1; } file->idata = -1; file->mode = 0; free(file->edata); dreturn("%i", 0); return 0; } off64_t _GD_Bzip2Size(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { struct gd_bzdata *ptr; off_t n; dtrace("%i, %p, 0x%X, ", dirfd, file, data_type); ptr = _GD_Bzip2DoOpen(dirfd, file, GD_FILE_READ); if (ptr == NULL) { dreturn("%i", -1); return -1; } /* seek forward the slow way to the end */ while (ptr->bzerror != BZ_STREAM_END) { int n; ptr->bzerror = 0; n = BZ2_bzRead(&ptr->bzerror, ptr->bzfile, ptr->data, GD_BZIP_BUFFER_SIZE); if (ptr->bzerror == BZ_OK || ptr->bzerror == BZ_STREAM_END) { ptr->base += ptr->end; ptr->pos = 0; ptr->end = n; } else { file->error = ptr->bzerror; BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile); fclose(ptr->stream); free(ptr); dreturn("%i", -1); return -1; } } BZ2_bzReadClose(&ptr->bzerror, ptr->bzfile); fclose(ptr->stream); n = (ptr->base + ptr->end) / GD_SIZE(data_type); free(ptr); dreturn("%lli", (long long)n); return n; } int _GD_Bzip2Strerr(const struct gd_raw_file_ *file, char *buf, size_t buflen) { int r = 0; dtrace("%p, %p, %" PRNsize_t, file, buf, buflen); switch (file->error) { case BZ_OK: case BZ_IO_ERROR: r = gd_strerror(errno, buf, buflen); break; case BZ_SEQUENCE_ERROR: case BZ_PARAM_ERROR: /* these indicate bugs in the code */ strncpy(buf, "Internal error in Bzip2 encoding", buflen); break; case BZ_MEM_ERROR: strncpy(buf, "libbz2: Out of memory", buflen); break; case BZ_DATA_ERROR: strncpy(buf, "libbz2: Data integrity error", buflen); break; case BZ_UNEXPECTED_EOF: strncpy(buf, "libbz2: Unexpected EOF", buflen); break; default: snprintf(buf, buflen, "libbz2: Unkown error %i", file->error); break; } buf[buflen - 1] = 0; dreturn("%i", r); return r; } libgetdata-0.9.0/src/encoding.c0000640000175000017500000010126712614323564016534 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef USE_MODULES #ifdef USE_PTHREAD #ifdef HAVE_PTHREAD_H #include #endif static pthread_mutex_t gd_mutex_ = PTHREAD_MUTEX_INITIALIZER; #endif #ifdef HAVE_LTDL_H #include #endif static int framework_initialised = 0; #endif /* encoding schemas */ #define GD_EF_NULL_SET NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, \ NULL, NULL #define GD_EF_GENERIC_SET &_GD_GenericName, NULL, NULL, NULL, NULL, NULL, \ NULL, NULL, &_GD_GenericMove, &_GD_GenericUnlink, NULL #ifdef USE_MODULES #define GD_EXT_ENCODING_NULL(sc,ex,ec,af,ff) \ { sc,ex,ec,af,ff,GD_EF_PROVIDES,GD_EF_NULL_SET } #define GD_EXT_ENCODING_GEN(sc,ex,ec,af,ff) \ { sc,ex,ec,af,ff,GD_EF_PROVIDES,GD_EF_GENERIC_SET } #else #define GD_EXT_ENCODING(sc,ex,ec,af,ff) { sc,ex,ec,af,ff,0,GD_INT_FUNCS } #define GD_EXT_ENCODING_NULL GD_EXT_ENCODING #define GD_EXT_ENCODING_GEN GD_EXT_ENCODING #endif struct encoding_t _GD_ef[GD_N_SUBENCODINGS] = { { GD_UNENCODED, "", GD_EF_ECOR, NULL, "none", 0, &_GD_GenericName, &_GD_RawOpen, &_GD_RawClose, &_GD_RawSeek, &_GD_RawRead, &_GD_RawSize, &_GD_RawWrite, &_GD_RawSync, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* strerr */ }, #ifdef USE_GZIP #define GD_EF_PROVIDES \ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \ GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_GenericName, &_GD_GzipOpen, &_GD_GzipClose, &_GD_GzipSeek, \ &_GD_GzipRead, &_GD_GzipSize, &_GD_GzipWrite, &_GD_GzipSync, \ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_GzipStrerr #else #define GD_EF_PROVIDES 0 #define GD_INT_FUNCS GD_EF_NULL_SET #endif GD_EXT_ENCODING_GEN(GD_GZIP_ENCODED, ".gz", GD_EF_ECOR | GD_EF_OOP, "Gzip", "gzip"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES #ifdef USE_BZIP2 #define GD_EF_PROVIDES \ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \ GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_GenericName, &_GD_Bzip2Open, &_GD_Bzip2Close, &_GD_Bzip2Seek, \ &_GD_Bzip2Read, &_GD_Bzip2Size, &_GD_Bzip2Write, &_GD_Bzip2Sync, \ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_Bzip2Strerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_GEN(GD_BZIP2_ENCODED, ".bz2", GD_EF_ECOR | GD_EF_OOP, "Bzip2", "bzip2"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES #ifdef USE_SLIM #define GD_EF_PROVIDES \ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_GenericName, &_GD_SlimOpen, &_GD_SlimClose, &_GD_SlimSeek, \ &_GD_SlimRead, &_GD_SlimSize, NULL /* WRITE */, NULL /* SYNC */, \ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_SlimStrerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_GEN(GD_SLIM_ENCODED, ".slm", GD_EF_ECOR, "Slim", "slim"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES /* We only provide write support for .xz files, not .lzma */ #ifdef USE_LZMA #define GD_EF_PROVIDES \ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \ GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_GenericName, &_GD_LzmaOpen, &_GD_LzmaClose, &_GD_LzmaSeek, \ &_GD_LzmaRead, &_GD_LzmaSize, &_GD_LzmaWrite, &_GD_LzmaSync, \ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_LzmaStrerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_GEN(GD_LZMA_ENCODED, ".xz", GD_EF_ECOR | GD_EF_OOP, "Lzma", "lzma"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES #ifdef USE_LZMA #define GD_EF_PROVIDES \ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_GenericName, &_GD_LzmaOpen, &_GD_LzmaClose, &_GD_LzmaSeek, \ &_GD_LzmaRead, &_GD_LzmaSize, NULL /* WRITE */, NULL /* SYNC */, \ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_LzmaStrerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_GEN(GD_LZMA_ENCODED, ".lzma", GD_EF_ECOR, "Lzma", "lzma"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES { GD_TEXT_ENCODED, ".txt", 0, NULL, "text", 0, &_GD_GenericName, &_GD_AsciiOpen, &_GD_AsciiClose, &_GD_AsciiSeek, &_GD_AsciiRead, &_GD_AsciiSize, &_GD_AsciiWrite, &_GD_AsciiSync, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* strerr */ }, { GD_SIE_ENCODED, ".sie", GD_EF_ECOR | GD_EF_SWAP, NULL, "sie", 0, &_GD_GenericName, &_GD_SampIndOpen, &_GD_SampIndClose, &_GD_SampIndSeek, &_GD_SampIndRead, &_GD_SampIndSize, &_GD_SampIndWrite, &_GD_SampIndSync, &_GD_GenericMove, &_GD_GenericUnlink, NULL /* strerr */ }, #ifdef USE_ZZIP #define GD_EF_PROVIDES \ GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | \ GD_EF_SIZE | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_ZzipName, &_GD_ZzipOpen, &_GD_ZzipClose, &_GD_ZzipSeek, &_GD_ZzipRead, \ &_GD_ZzipSize, NULL /* WRITE */, NULL /* SYNC */, NULL /* MOVE */, \ NULL /* UNLINK */, &_GD_ZzipStrerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_NULL(GD_ZZIP_ENCODED, NULL, GD_EF_ECOR | GD_EF_EDAT, "Zzip", "zzip"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES #ifdef USE_ZZSLIM #define GD_EF_PROVIDES \ GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | \ GD_EF_SIZE | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_ZzslimName, &_GD_ZzslimOpen, &_GD_ZzslimClose, &_GD_ZzslimSeek, \ &_GD_ZzslimRead, &_GD_ZzslimSize, NULL /* WRITE */, NULL /* SYNC */, \ NULL /* MOVE */, NULL /* UNLINK */, &_GD_ZzslimStrerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_NULL(GD_ZZSLIM_ENCODED, NULL, GD_EF_ECOR | GD_EF_EDAT, "Zzslim", "zzslim"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES #ifdef USE_FLAC #define GD_EF_PROVIDES \ GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE | \ GD_EF_WRITE | GD_EF_SYNC | GD_EF_STRERR #define GD_INT_FUNCS \ &_GD_GenericName, &_GD_FlacOpen, &_GD_FlacClose, &_GD_FlacSeek, \ &_GD_FlacRead, &_GD_FlacSize, &_GD_FlacWrite, &_GD_FlacSync, \ &_GD_GenericMove, &_GD_GenericUnlink, &_GD_FlacStrerr #else #define GD_INT_FUNCS GD_EF_NULL_SET #define GD_EF_PROVIDES 0 #endif GD_EXT_ENCODING_GEN(GD_FLAC_ENCODED, ".flac", GD_EF_ECOR | GD_EF_OOP, "Flac", "flac"), #undef GD_INT_FUNCS #undef GD_EF_PROVIDES { GD_ENC_UNSUPPORTED, NULL, 0, "", "", 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL } }; void _GD_InitialiseFramework(void) { dtracevoid(); #ifdef USE_MODULES #ifdef USE_PTHREAD if (!framework_initialised) { pthread_mutex_lock(&gd_mutex_); #endif /* check again */ if (!framework_initialised) { framework_initialised = 1; lt_dlinit(); } #ifdef USE_PTHREAD pthread_mutex_unlock(&gd_mutex_); } #endif #endif dreturnvoid(); } #define _GD_EncodingUnderstood(encoding) \ ((encoding == GD_UNENCODED || encoding == GD_SLIM_ENCODED || \ encoding == GD_GZIP_ENCODED || encoding == GD_BZIP2_ENCODED || \ encoding == GD_TEXT_ENCODED || encoding == GD_LZMA_ENCODED || \ encoding == GD_SIE_ENCODED || encoding == GD_ZZIP_ENCODED || \ encoding == GD_ZZSLIM_ENCODED || encoding == GD_FLAC_ENCODED)) #ifdef USE_MODULES static void *_GD_ResolveSymbol(lt_dlhandle lib, struct encoding_t *restrict enc, const char *restrict name) { void* func; char symbol[100]; dtrace("%p, %p, \"%s\"", lib, enc, name); /* create the symbol name */ sprintf(symbol, "lt_libgetdata%s_LTX_GD_%s%s", enc->affix, enc->affix, name); symbol[13] -= 'A' - 'a'; func = lt_dlsym(lib, symbol); dreturn("%p", func); return func; } #endif #define GETDATA_MODULEPREFIX GETDATA_MODULEDIR "/libgetdata" int _GD_MissingFramework(int encoding, unsigned int funcs) { int ret; dtrace("%i, 0x%X", encoding, funcs); #ifdef USE_MODULES #ifdef USE_PTHREAD pthread_mutex_lock(&gd_mutex_); #endif /* set up the encoding library if required */ if (_GD_ef[encoding].provides) { char *library; lt_dlhandle lib; /* make the library name */ library = (char *)malloc(sizeof(GETDATA_MODULEDIR) + strlen(_GD_ef[encoding].affix) + sizeof(PACKAGE_VERSION) + 13); if (!library) { _GD_ef[encoding].provides = 0; #ifdef USE_PTHREAD pthread_mutex_unlock(&gd_mutex_); #endif dreturn("%i", 1); return 1; } sprintf(library, GETDATA_MODULEPREFIX "%s-" PACKAGE_VERSION, _GD_ef[encoding].affix); /* affix starts with a capital letter, we need to lowercasify it -- * also, sizeof includes the trailing NUL in its count */ library[sizeof(GETDATA_MODULEPREFIX) - 1] -= 'A' - 'a'; /* open */ if ((lib = lt_dlopenext(library)) == NULL) { /* if that didn't work, look for it in the search path */ if ((lib = lt_dlopenext(library + sizeof(GETDATA_MODULEDIR))) == NULL) { free(library); _GD_ef[encoding].provides = 0; #ifdef USE_PTHREAD pthread_mutex_unlock(&gd_mutex_); #endif dreturn("%i", 1); return 1; } } free(library); /* Try to resolve the symbols */ if (_GD_ef[encoding].provides & GD_EF_NAME) _GD_ef[encoding].name = (gd_ef_name_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Name"); if (_GD_ef[encoding].provides & GD_EF_OPEN) _GD_ef[encoding].open = (gd_ef_open_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Open"); if (_GD_ef[encoding].provides & GD_EF_CLOSE) _GD_ef[encoding].close = (gd_ef_close_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Close"); if (_GD_ef[encoding].provides & GD_EF_SEEK) _GD_ef[encoding].seek = (gd_ef_seek_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Seek"); if (_GD_ef[encoding].provides & GD_EF_READ) _GD_ef[encoding].read = (gd_ef_read_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Read"); if (_GD_ef[encoding].provides & GD_EF_SIZE) _GD_ef[encoding].size = (gd_ef_size_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Size"); if (_GD_ef[encoding].provides & GD_EF_WRITE) _GD_ef[encoding].write = (gd_ef_write_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Write"); if (_GD_ef[encoding].provides & GD_EF_SYNC) _GD_ef[encoding].sync = (gd_ef_sync_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Sync"); if (_GD_ef[encoding].provides & GD_EF_UNLINK) _GD_ef[encoding].unlink = (gd_ef_unlink_t)_GD_ResolveSymbol(lib, _GD_ef + encoding, "Unlink"); /* we tried our best, don't bother trying again */ _GD_ef[encoding].provides = 0; } #ifdef USE_PTHREAD pthread_mutex_unlock(&gd_mutex_); #endif #endif ret = (funcs & GD_EF_NAME && _GD_ef[encoding].name == NULL) || (funcs & GD_EF_OPEN && _GD_ef[encoding].open == NULL) || (funcs & GD_EF_CLOSE && _GD_ef[encoding].close == NULL) || (funcs & GD_EF_SEEK && _GD_ef[encoding].seek == NULL) || (funcs & GD_EF_READ && _GD_ef[encoding].read == NULL) || (funcs & GD_EF_SIZE && _GD_ef[encoding].size == NULL) || (funcs & GD_EF_WRITE && _GD_ef[encoding].write == NULL) || (funcs & GD_EF_SYNC && _GD_ef[encoding].sync == NULL) || (funcs & GD_EF_UNLINK && _GD_ef[encoding].unlink == NULL) || (funcs & GD_EF_STRERR && _GD_ef[encoding].strerr == NULL); dreturn("%i", ret); return ret; } static int _GD_MoveOver(DIRFILE *restrict D, int fragment, struct gd_raw_file_ *restrict file) { const int dirfd = D->fragment[fragment].dirfd; #ifdef HAVE_FCHMOD int fd; struct stat stat_buf; mode_t mode, tmode; #endif dtrace("%p, %i, %p", D, fragment, file); #ifdef HAVE_FCHMOD if (gd_StatAt(D, dirfd, file[1].name, &stat_buf, 0)) tmode = 0644; else tmode = stat_buf.st_mode; if (gd_StatAt(D, dirfd, file[0].name, &stat_buf, 0)) mode = tmode; else mode = stat_buf.st_mode; #endif if (gd_RenameAt(D, dirfd, file[1].name, dirfd, file[0].name)) { int move_errno = errno; if (gd_UnlinkAt(D, dirfd, file[1].name, 0) == 0) { free(file[1].name); file[1].name = NULL; } errno = move_errno; _GD_SetError(D, GD_E_UNCLEAN_DB, GD_E_UNCLEAN_CALL, D->fragment[fragment].cname, 0, "gd_RenameAt"); D->flags |= GD_INVALID; dreturn("%i", -1); return -1; } #ifdef HAVE_FCHMOD if (tmode != mode) { fd = gd_OpenAt(file->D, dirfd, file[0].name, O_RDONLY, 0666); fchmod(fd, mode); close(fd); } #endif dreturn("%i", 0); return 0; } /* Close a raw file, taking care of cleaning-up out-of-place writes, and * discarding temporary files */ int _GD_FiniRawIO(DIRFILE *D, const gd_entry_t *E, int fragment, int flags) { const int clotemp = (flags & GD_FINIRAW_CLOTEMP) ? 1 : 0; const int old_mode = E->e->u.raw.file[0].mode; const int oop_write = ((_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP) && (old_mode & GD_FILE_WRITE)) ? 1 : 0; dtrace("%p, %p, %i, 0x%X", D, E, fragment, flags); if ((E->e->u.raw.file[clotemp].idata >= 0) || (clotemp == 0 && oop_write && (E->e->u.raw.file[1].idata >= 0))) { /* close the secondary file in write mode (but not temp mode) */ if (oop_write && E->e->u.raw.file[1].idata >= 0) { if (E->e->u.raw.file[0].idata >= 0) { /* copy the rest of the input to the output */ char *buffer; int n_read, n_wrote, n_to_write; buffer = _GD_Malloc(D, GD_BUFFER_SIZE); if (buffer == NULL) { dreturn("%i", -1); return -1; } do { n_to_write = n_read = (*_GD_ef[E->e->u.raw.file[0].subenc].read)( E->e->u.raw.file, buffer, E->EN(raw,data_type), GD_BUFFER_SIZE); if (n_read < 0) { free(buffer); _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); dreturn("%i", -1); return -1; } else while (n_to_write > 0) { n_wrote = (*_GD_ef[E->e->u.raw.file[0].subenc].write)( E->e->u.raw.file + 1, buffer, E->EN(raw,data_type), n_to_write); if (n_wrote < 0) { free(buffer); _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0); dreturn("%i", -1); return -1; } n_to_write -= n_wrote; } } while (n_read == GD_BUFFER_SIZE); free(buffer); } if ((*_GD_ef[E->e->u.raw.file[0].subenc].close)(E->e->u.raw.file + 1)) { dreturn("%i", -1); return -1; } } /* close the file */ if ((E->e->u.raw.file[clotemp].idata >= 0) && (*_GD_ef[E->e->u.raw.file[clotemp].subenc].close)(E->e->u.raw.file + clotemp)) { if (D->error == GD_E_OK) _GD_SetEncIOError(D, GD_E_IO_CLOSE, E->e->u.raw.file + clotemp); dreturn("%i", 1); return 1; } } if (flags & GD_FINIRAW_DEFER) { dreturn("%i", 0); return 0; } /* take care of moving things into place */ if (oop_write || clotemp) { if (flags & GD_FINIRAW_DISCARD) { /* Throw away the temporary file */ if (E->e->u.raw.file[1].name != NULL && gd_UnlinkAt(D, D->fragment[fragment].dirfd, E->e->u.raw.file[1].name, 0)) { if (D->error == GD_E_OK) _GD_SetEncIOError(D, GD_E_IO_UNLINK, E->e->u.raw.file + 1); dreturn("%i", -1); return -1; } } else { /* Move the old file over the new file */ if (_GD_MoveOver(D, fragment, E->e->u.raw.file)) { dreturn("%i", -1); return -1; } } free(E->e->u.raw.file[1].name); E->e->u.raw.file[1].name = NULL; } dreturn("%i", 0); return 0; } /* Perform a RAW field write */ ssize_t _GD_WriteOut(const gd_entry_t *E, const struct encoding_t *enc, const void *ptr, gd_type_t type, size_t n, int temp) { ssize_t n_wrote; dtrace("%p, %p, %p, 0x%X, %" PRNsize_t ", %i", E, enc, ptr, type, n, temp); if (temp) n_wrote = (*enc->write)(E->e->u.raw.file + 1, ptr, type, n); else { if (enc->flags & GD_EF_OOP) { n_wrote = (*enc->write)(E->e->u.raw.file + 1, ptr, type, n); if (n_wrote > 0 && E->e->u.raw.file[0].idata >= 0) { /* advance the read pointer by the appropriate amount */ if ((*enc->seek)(E->e->u.raw.file, E->e->u.raw.file[0].pos + n_wrote, E->EN(raw,data_type), GD_FILE_READ) < 0) { n_wrote = -1; } } } else n_wrote = (*enc->write)(E->e->u.raw.file, ptr, type, n); } dreturn("%" PRNssize_t, n_wrote); return n_wrote; } /* Open a raw file, if necessary; also check for required functions */ int _GD_InitRawIO(DIRFILE *D, const gd_entry_t *E, const char *filebase, int fragment, const struct encoding_t *enc, unsigned int funcs, unsigned int mode, int swap) { const int touch = mode & GD_FILE_TOUCH; int oop_write = 0; dtrace("%p, %p, \"%s\", %i, %p, 0x%X, 0x%X, %i", D, E, filebase, fragment, enc, funcs, mode, swap); if (mode & (GD_FILE_WRITE | GD_FILE_TOUCH)) funcs |= GD_EF_WRITE; mode &= ~GD_FILE_TOUCH; if (!(mode & GD_FILE_TEMP)) { if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_OPEN | funcs)) { dreturn("%i", 1); return 1; } enc = _GD_ef + E->e->u.raw.file[0].subenc; oop_write = ((enc->flags & GD_EF_OOP) && mode == GD_FILE_WRITE) ? 1 : 0; /* Do nothing, if possible */ if (!touch && (((mode & GD_FILE_READ) && (E->e->u.raw.file[0].idata >= 0) && (E->e->u.raw.file[0].mode & GD_FILE_READ)) || ((mode & GD_FILE_WRITE) && (E->e->u.raw.file[oop_write].idata >= 0) && (E->e->u.raw.file[0].mode & GD_FILE_WRITE)))) { dreturn("%i", 0); return 0; } /* close the file, if necessary */ if ((E->e->u.raw.file[0].idata >= 0 || ((enc->flags & GD_EF_OOP) && (E->e->u.raw.file[1].idata >= 0))) && ((mode == GD_FILE_READ && (enc->flags & GD_EF_OOP) && (E->e->u.raw.file[0].mode & GD_FILE_WRITE)) || (mode == GD_FILE_WRITE && !(E->e->u.raw.file[0].mode & GD_FILE_WRITE)))) { if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) { dreturn("%i", 1); return 1; } } } if (filebase == NULL) filebase = E->e->u.raw.filebase; if (fragment == -1) fragment = E->fragment_index; if (oop_write || mode & GD_FILE_TEMP) { /* create temporary file in file[1] */ if ((*enc->name)(D, (const char*)D->fragment[fragment].enc_data, E->e->u.raw.file + 1, filebase, 1, 0)) { ; /* error already set */ dreturn("%i", 1); return 1; } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file + 1, E->EN(raw,data_type), swap, GD_FILE_WRITE | GD_FILE_TEMP)) { _GD_SetEncIOError(D, GD_E_IO_OPEN, E->e->u.raw.file + 1); dreturn("%i", 1); return 1; } if (oop_write) { /* The read file in OOP mode is flagged as RW. */ mode = GD_FILE_RDWR; } else { /* Temp file creation complete */ dreturn("%i", 0); return 0; } } /* open a regular file, if necessary */ if (E->e->u.raw.file[0].idata < 0) { if ((*enc->name)(D, (const char*)D->fragment[fragment].enc_data, E->e->u.raw.file, filebase, 0, 0)) { dreturn("%i", 1); return 1; } else if ((*enc->open)(D->fragment[fragment].dirfd, E->e->u.raw.file, E->EN(raw,data_type), swap, mode)) { /* In oop_write mode, it doesn't matter if the old file doesn't exist */ if (!oop_write || errno != ENOENT) { _GD_SetEncIOError(D, GD_E_IO_OPEN, E->e->u.raw.file + 0); dreturn("%i", 1); return 1; } E->e->u.raw.file[0].mode = mode; } } if (touch) _GD_FiniRawIO(D, E, fragment, GD_FINIRAW_KEEP); dreturn("%i", 0); return 0; } /* Figure out the encoding scheme */ static unsigned long _GD_ResolveEncoding(DIRFILE *restrict D, const char *restrict name, const char *restrict enc_data, unsigned long scheme, int dirfd, struct gd_raw_file_ *restrict file) { char *candidate; int i; const size_t len = strlen(name); struct stat statbuf; dtrace("%p, \"%s\", \"%s\", 0x%08lx, %i, %p", D, name, enc_data, scheme, dirfd, file); for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) { if (scheme == GD_AUTO_ENCODED || scheme == _GD_ef[i].scheme) { if (_GD_ef[i].ext) { candidate = (char *)malloc(len + strlen(_GD_ef[i].ext) + 1); if (!candidate) continue; sprintf(candidate, "%s%s", name, _GD_ef[i].ext); } else { if (_GD_MissingFramework(i, GD_EF_NAME)) continue; if ((*_GD_ef[i].name)(D, enc_data, file, name, 0, 1)) continue; candidate = file->name; file->name = NULL; } if (gd_StatAt(D, dirfd, candidate, &statbuf, 0) == 0) if (S_ISREG(statbuf.st_mode)) { if (file != NULL) file->subenc = i; free(candidate); dreturn("%08lx", _GD_ef[i].scheme); return _GD_ef[i].scheme; } free(candidate); } } if (scheme != 0 && file != NULL) { for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) if (scheme == _GD_ef[i].scheme) { file->subenc = i; dreturn("0x%08lx", _GD_ef[i].scheme); return _GD_ef[i].scheme; } } dreturn("%08lx", (unsigned long)GD_AUTO_ENCODED); return GD_AUTO_ENCODED; } int _GD_Supports(DIRFILE *D, const gd_entry_t *E, unsigned int funcs) { dtrace("%p, %p, 0x%X", D, E, funcs); /* Figure out the dirfile encoding type, if required */ if (D->fragment[E->fragment_index].encoding == GD_AUTO_ENCODED) { D->fragment[E->fragment_index].encoding = _GD_ResolveEncoding(D, E->e->u.raw.filebase, (const char*)D->fragment[E->fragment_index].enc_data, GD_AUTO_ENCODED, D->fragment[E->fragment_index].dirfd, E->e->u.raw.file); } /* If the encoding scheme is unknown, complain */ if (D->fragment[E->fragment_index].encoding == GD_AUTO_ENCODED) { _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_UNDET, NULL, 0, NULL); dreturn("%i", 0); return 0; } /* Figure out the encoding subtype, if required */ if (E->e->u.raw.file[0].subenc == GD_ENC_UNKNOWN) _GD_ResolveEncoding(D, E->e->u.raw.filebase, (const char*)D->fragment[E->fragment_index].enc_data, D->fragment[E->fragment_index].encoding, D->fragment[E->fragment_index].dirfd, E->e->u.raw.file); /* check for our function(s) */ if (_GD_MissingFramework(E->e->u.raw.file[0].subenc, funcs)) { _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } dreturn("%i", 1); return 1; } int _GD_GenericName(DIRFILE *restrict D, const char *restrict enc_data gd_unused_, struct gd_raw_file_ *restrict file, const char *restrict base, int temp, int resolv gd_unused_) { dtrace("%p, , %p, \"%s\", %i, ", D, file, base, temp); if (file->name == NULL) { file->D = D; file->name = _GD_Malloc(D, strlen(base) + (temp ? 8 : strlen(_GD_ef[file->subenc].ext) + 1)); if (file->name == NULL) { dreturn("%i", -1); return -1; } sprintf(file->name, "%s%s", base, temp ? "_XXXXXX" : _GD_ef[file->subenc].ext); } dreturn("%i (%s)", 0, file->name); return 0; } /* This function assumes that the new encoding has no fragment->enc_data. */ static void _GD_RecodeFragment(DIRFILE* D, unsigned long encoding, int fragment, int move) { unsigned int i, n_raw = 0; dtrace("%p, %lx, %i, %i", D, encoding, fragment, move); /* check protection */ if (D->fragment[fragment].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[fragment].cname); dreturnvoid(); return; } if (move && encoding != D->fragment[fragment].encoding) { gd_entry_t **raw_entry = _GD_Malloc(D, sizeof(*raw_entry) * D->n_entries); if (raw_entry == NULL) { dreturnvoid(); return; } /* Because it may fail, the move must occur out-of-place and then be copied * back over the affected files once success is assured */ for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->fragment_index == fragment && D->entry[i]->field_type == GD_RAW_ENTRY) { if (!_GD_Supports(D, D->entry[i], GD_EF_UNLINK)) continue; /* add this raw field to the list */ raw_entry[n_raw++] = D->entry[i]; if (_GD_MogrifyFile(D, D->entry[i], encoding, D->fragment[D->entry[i]->fragment_index].byte_sex, D->fragment[D->entry[i]->fragment_index].frame_offset, 0, -1, NULL)) break; } /* If successful, move the temporary file over the old file, otherwise * remove the temporary files */ if (D->error) { for (i = 0; i < n_raw; ++i) _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD | GD_FINIRAW_CLOTEMP); } else for (i = 0; i < n_raw; ++i) { struct gd_raw_file_ temp; memcpy(&temp, raw_entry[i]->e->u.raw.file, sizeof(temp)); raw_entry[i]->e->u.raw.file[0].name = NULL; raw_entry[i]->e->u.raw.file[0].subenc = raw_entry[i]->e->u.raw.file[1].subenc; /* discard the old file */ _GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_DISCARD); if ((*_GD_ef[temp.subenc].name)(D, (const char*)D->fragment[raw_entry[i]->fragment_index].enc_data, raw_entry[i]->e->u.raw.file, raw_entry[i]->e->u.raw.filebase, 0, 0)) { raw_entry[i]->e->u.raw.file[0].name = temp.name; raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc; } else if (_GD_FiniRawIO(D, raw_entry[i], fragment, GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP)) { raw_entry[i]->e->u.raw.file[0].name = temp.name; raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc; } else if ((*_GD_ef[temp.subenc].unlink)(D->fragment[fragment].dirfd, &temp)) { _GD_SetError(D, GD_E_UNCLEAN_DB, 0, D->fragment[D->entry[i]->fragment_index].cname, 0, NULL); D->flags |= GD_INVALID; raw_entry[i]->e->u.raw.file[0].name = temp.name; raw_entry[i]->e->u.raw.file[0].subenc = temp.subenc; } else free(temp.name); } free(raw_entry); if (D->error) { dreturnvoid(); return; } } else { for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->fragment_index == fragment && D->entry[i]->field_type == GD_RAW_ENTRY) { /* close the old file */ _GD_FiniRawIO(D, D->entry[i], fragment, GD_FINIRAW_KEEP); /* reset encoding subscheme. */ D->entry[i]->e->u.raw.file[0].subenc = GD_ENC_UNKNOWN; /* delete name */ free(D->entry[i]->e->u.raw.file[0].name); D->entry[i]->e->u.raw.file[0].name = NULL; } } free(D->fragment[fragment].enc_data); D->fragment[fragment].enc_data = NULL; D->fragment[fragment].encoding = encoding; D->fragment[fragment].modified = 1; D->flags &= ~GD_HAVE_VERSION; dreturnvoid(); } int gd_alter_encoding(DIRFILE* D, unsigned long encoding, int fragment, int move) { int i; dtrace("%p, %lu, %i, %i", D, (unsigned long)encoding, fragment, move); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) != GD_RDWR) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment < GD_ALL_FRAGMENTS || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (!_GD_EncodingUnderstood(encoding)) { _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_TARGET, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); if (fragment == GD_ALL_FRAGMENTS) { for (i = 0; i < D->n_fragment; ++i) { _GD_RecodeFragment(D, encoding, i, move); if (D->error) break; } } else _GD_RecodeFragment(D, encoding, fragment, move); dreturn("%i", (D->error) ? -1 : 0); return (D->error) ? -1 : 0; } unsigned long gd_encoding(DIRFILE* D, int fragment) gd_nothrow { unsigned long reported_encoding = GD_ENC_UNSUPPORTED; unsigned int i; dtrace("%p, %i", D, fragment); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } if (fragment < 0 || fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } _GD_ClearError(D); /* Attempt to figure out the encoding, if it's not known */ if (D->fragment[fragment].encoding == GD_AUTO_ENCODED) { /* locate a RAW field in this fragment */ for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->fragment_index == fragment && D->entry[i]->field_type == GD_RAW_ENTRY) { D->fragment[fragment].encoding = _GD_ResolveEncoding(D, D->entry[i]->e->u.raw.filebase, (const char*)D->fragment[fragment].enc_data, GD_AUTO_ENCODED, D->fragment[fragment].dirfd, D->entry[i]->e->u.raw.file); if (D->fragment[fragment].encoding != GD_AUTO_ENCODED) break; } } if (D->fragment[fragment].encoding != GD_AUTO_ENCODED) reported_encoding = D->fragment[fragment].encoding; dreturn("%lx", (unsigned long)reported_encoding); return reported_encoding; } /* report whether a particular encoding is supported */ int gd_encoding_support(unsigned long encoding) gd_nothrow { int i; const unsigned int read_funcs = GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_SIZE; const unsigned int write_funcs = read_funcs | GD_EF_WRITE | GD_EF_SYNC | GD_EF_MOVE | GD_EF_UNLINK; dtrace("0x%lX", encoding); /* make sure we have a valid encoding */ if (!_GD_EncodingUnderstood(encoding)) { dreturn("%i", -1); return -1; } /* spin up ltdl if needed */ _GD_InitialiseFramework(); /* Loop through valid subencodings checking for write support */ for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) if (_GD_ef[i].scheme == encoding) { if (!_GD_MissingFramework(i, write_funcs)) { dreturn("%i", GD_RDWR); return GD_RDWR; } } /* No write support; try read support */ for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) if (_GD_ef[i].scheme == encoding) { if (!_GD_MissingFramework(i, read_funcs)) { dreturn("%i", GD_RDONLY); return GD_RDONLY; } } /* nope */ dreturn("%i", -1); return -1; } /* This is basically the non-existant POSIX funcion mkstempat. There are two * approaches we could take here: * 1) fchdir to dirfd, use mkstemp to grab a file descriptor; fchdir back to * cwd, but this isn't thread-safe, so we're stuck with: * 2) use mktemp to generate a "unique" file name, and then try to openat it * exclusively; repeat as necessary. */ int _GD_MakeTempFile(const DIRFILE *D gd_unused_d, int dirfd, char *tmpl) { int fd = -1; char *tmp = strdup(tmpl); dtrace("%p, %i, \"%s\"", D, dirfd, tmpl); if (!tmp) { dreturn("%i", -1); return -1; } do { strcpy(tmpl, tmp); mktemp(tmpl); if (tmpl[0] == 0) { free(tmp); dreturn("%i", -1); return -1; } fd = gd_OpenAt(D, dirfd, tmpl, O_RDWR | O_CREAT | O_EXCL, 0666); } while (errno == EEXIST); free(tmp); dreturn("%i", fd); return fd; } int _GD_GenericUnlink(int dirfd, struct gd_raw_file_* file) { int r; dtrace("%i, %p", dirfd, file); r = gd_UnlinkAt(file->D, dirfd, file->name, 0); dreturn("%i", r); return r; } int _GD_GenericMove(int olddirfd, struct gd_raw_file_ *restrict file, int newdirfd, char *restrict new_path) { int r, rename_errno; dtrace("%i, %p, %i, \"%s\"", olddirfd, file, newdirfd, new_path); r = gd_RenameAt(file->D, olddirfd, file->name, newdirfd, new_path); rename_errno = errno; if (!r) { free(file->name); file->name = new_path; } else free(new_path); errno = rename_errno; dreturn("%i", r); return r; } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/include.c0000640000175000017500000004175212614323564016373 0ustar alastairalastair/* Copyright (C) 2008, 2010-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" /* Create new affixes given the current affixes and the new parts indicated * on a /INCLUDE line. Also, change the root namespace, if necessary. The * caller is responsible for freeing strings on error */ static int _GD_SetFieldAffixes(DIRFILE *D, const struct parser_state *p, int me, const char *prefix_in, const char *suffix_in, char **prefix, char **suffix) { dtrace("%p, %p, %i, \"%s\", \"%s\", %p, %p", D, p, me, prefix_in, suffix_in, prefix, suffix); /* suffix first, for some reason */ if (suffix_in && suffix_in[0] != '\0') { if (_GD_ValidateField(suffix_in, p->standards, p->pedantic, GD_VF_AFFIX, NULL)) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, p->file, p->line, suffix_in); dreturn("%i", 1); return 1; } if (D->fragment[me].suffix == NULL) *suffix = _GD_Strdup(D, suffix_in); else { *suffix = _GD_Malloc(D, strlen(D->fragment[me].suffix) + strlen(suffix_in) + 1); if (*suffix) sprintf(*suffix, "%s%s", suffix_in, D->fragment[me].suffix); } } else if (D->fragment[me].suffix) *suffix = _GD_Strdup(D, D->fragment[me].suffix); if (D->error) { dreturn("%i", 1); return 1; } /* now the prefix */ if (prefix_in && prefix_in[0] != '\0') { if (_GD_ValidateField(prefix_in, p->standards, p->pedantic, GD_VF_AFFIX, NULL)) { _GD_SetError(D, GD_E_FORMAT, GD_E_FORMAT_BAD_NAME, p->file, p->line, prefix_in); dreturn("%i", 1); return 1; } if (D->fragment[me].prefix == NULL) *prefix = _GD_Strdup(D, prefix_in); else { *prefix = _GD_Malloc(D, strlen(D->fragment[me].prefix) + strlen(prefix_in) + 1); if (*prefix) sprintf(*prefix, "%s%s", D->fragment[me].prefix, prefix_in); } } else { if (D->fragment[me].prefix) *prefix = _GD_Strdup(D, D->fragment[me].prefix); } if (D->error) { dreturn("%i", 1); return 1; } dreturn("%i (\"%s\", \"%s\")", 0, *prefix, *suffix); return 0; } /* Include a format file fragment -- returns the new fragment index, or * -1 on error */ int _GD_Include(DIRFILE *D, struct parser_state *p, const char *ename, char **ref_name, int parent, const char *prefix_in, const char *suffix_in, int immediate) { int i; int me = D->n_fragment; struct parser_state oldp = *p; int dirfd = -1, pop_ns = 0, free_ns = 1; char *temp_buf1 = NULL, *temp_buf2, *sname = NULL; char *base = NULL, *prefix = NULL, *suffix = NULL, *ns = NULL; size_t nsl = 0; void *ptr = NULL; FILE* new_fp = NULL; time_t mtime = 0; struct stat statbuf; dtrace("%p, %p, \"%s\", %p, %i, \"%s\", \"%s\", %i", D, p, ename, ref_name, parent, prefix_in, suffix_in, immediate); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_INCLUDE, p->file, p->line, ename); goto include_error; } if (_GD_SetFieldAffixes(D, p, parent, prefix_in, suffix_in, &prefix, &suffix)) { goto include_error; } if (ns) { /* namespace change, remember old one so we can pop at the end */ pop_ns = 1; if (ns[0] == '\0') { /* revert to NULLspace */ free(ns); ns = p->ns = NULL; } else { /* new namespace */ p->ns = _GD_Strdup(D, ns); if (p->ns == NULL) goto include_error; p->nsl = nsl; } } else { /* no namespace change; inherit from parent */ free_ns = 0; ns = D->fragment[parent].ns; nsl = D->fragment[parent].nsl; } /* isolate filename */ temp_buf2 = _GD_Strdup(D, ename); if (temp_buf2 == NULL) goto include_error; base = _GD_Strdup(D, basename(temp_buf2)); free(temp_buf2); if (base == NULL) goto include_error; /* isolate relative path */ temp_buf2 = _GD_Strdup(D, ename); if (temp_buf2 == NULL) goto include_error; sname = _GD_Strdup(D, dirname(temp_buf2)); free(temp_buf2); if (sname == NULL) goto include_error; /* canonicalise */ temp_buf1 = _GD_MakeFullPath(D, D->fragment[parent].dirfd, ename, 1); if (temp_buf1 == NULL) goto include_error; /* Open the containing directory */ dirfd = _GD_GrabDir(D, D->fragment[parent].dirfd, temp_buf1, 1); if (dirfd == -1 && D->error == GD_E_OK) _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, ename); if (D->error) goto include_error; /* Reject weird stuff */ if (gd_StatAt(D, dirfd, base, &statbuf, 0)) { if (!(p->flags & GD_CREAT)) { _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1); _GD_ReleaseDir(D, dirfd); goto include_error; } } else { if (S_ISDIR(statbuf.st_mode)) { _GD_SetError2(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1, EISDIR); _GD_ReleaseDir(D, dirfd); goto include_error; } else if (!S_ISREG(statbuf.st_mode)) { _GD_SetError2(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1, EINVAL); _GD_ReleaseDir(D, dirfd); goto include_error; } } /* Try to open the file */ i = gd_OpenAt(D, dirfd, base, ((p->flags & (GD_CREAT | GD_TRUNC)) ? O_RDWR : O_RDONLY) | ((p->flags & GD_CREAT) ? O_CREAT : 0) | ((p->flags & GD_TRUNC) ? O_TRUNC : 0) | ((p->flags & GD_EXCL) ? O_EXCL : 0) | O_BINARY, 0666); if (i < 0) { _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1); _GD_ReleaseDir(D, dirfd); goto include_error; } new_fp = fdopen(i, (p->flags & (GD_CREAT | GD_TRUNC)) ? "rb+" : "rb"); /* If opening the file failed, set the error code and abort parsing. */ if (new_fp == NULL) { _GD_SetError(D, GD_E_IO, GD_E_IO_INCL, p->file, p->line, temp_buf1); _GD_ReleaseDir(D, dirfd); goto include_error; } /* fstat the file and record the mtime */ if (fstat(i, &statbuf) == 0) mtime = statbuf.st_mtime; /* If we got here, we managed to open the included file; parse it */ ptr = _GD_Realloc(D, D->fragment, (++D->n_fragment) * sizeof(D->fragment[0])); if (ptr == NULL) { fclose(new_fp); _GD_ReleaseDir(D, dirfd); D->n_fragment--; goto include_error; } D->fragment = ptr; D->fragment[me].bname = base; D->fragment[me].cname = temp_buf1; D->fragment[me].ename = _GD_Strdup(D, ename); D->fragment[me].enc_data = NULL; D->fragment[me].modified = 0; D->fragment[me].parent = parent; D->fragment[me].dirfd = dirfd; D->fragment[me].encoding = p->flags & GD_ENCODING; D->fragment[me].byte_sex = #ifdef WORDS_BIGENDIAN (p->flags & GD_LITTLE_ENDIAN) ? GD_LITTLE_ENDIAN : GD_BIG_ENDIAN #else (p->flags & GD_BIG_ENDIAN) ? GD_BIG_ENDIAN : GD_LITTLE_ENDIAN #endif ; D->fragment[me].ref_name = NULL; D->fragment[me].frame_offset = D->fragment[parent].frame_offset; D->fragment[me].protection = GD_PROTECT_NONE; D->fragment[me].prefix = prefix; D->fragment[me].suffix = suffix; D->fragment[me].ns = ns; D->fragment[me].nsl = nsl; D->fragment[me].mtime = mtime; D->fragment[me].vers = (p->pedantic) ? 1ULL << p->standards : 0; /* compute the (relative) subdirectory name */ if (sname[0] == '.' && sname[1] == '\0') { /* dirname is the same as the parent fragment's */ D->fragment[me].sname = (D->fragment[parent].sname) ? _GD_Strdup(D, D->fragment[parent].sname) : NULL; free(sname); } else if (D->fragment[parent].sname && _GD_AbsPath(sname)) { /* have both a relative dirname and the parent's sname; squish them * together */ D->fragment[me].sname = _GD_Malloc(D, strlen(sname) + strlen(D->fragment[parent].sname) + 2); if (D->fragment[me].sname) sprintf(D->fragment[me].sname, "%s%c%s", D->fragment[parent].sname, GD_DIRSEP, sname); free(sname); } else /* just save the sname */ D->fragment[me].sname = sname; /* catch alloc errors */ if (D->error) { D->n_fragment--; temp_buf1 = prefix = suffix = base = NULL; fclose(new_fp); _GD_ReleaseDir(D, dirfd); goto include_error; } *ref_name = _GD_ParseFragment(new_fp, D, p, me, immediate); fclose(new_fp); /* prevent /VERSION leak in DSV >= 9 */ if ((oldp.standards >= 9 && oldp.pedantic) || p->standards >= 9) { if (p->standards != oldp.standards) { p->standards = oldp.standards; D->flags |= GD_MULTISTANDARD; } if (!oldp.pedantic) p->pedantic = 0; } /* pop namespace, if necessary */ if (pop_ns) { free(p->ns); p->ns = oldp.ns; p->nsl = oldp.nsl; } D->recurse_level--; dreturn("%i", me); return me; include_error: if (free_ns) free(ns); free(prefix); free(suffix); free(base); free(sname); free(temp_buf1); D->recurse_level--; dreturn("%i", -1); return -1; } int gd_include_affix(DIRFILE* D, const char* file, int fragment_index, const char *prefix, const char *suffix, unsigned long flags) { char* ref_name = NULL; int i, new_fragment; struct parser_state p = { "gd_include_affix()", 0, GD_DIRFILE_STANDARDS_VERSION, flags & GD_PEDANTIC, NULL, 0, flags }; dtrace("%p, \"%s\", %i, \"%s\", \"%s\", 0x%lX", D, file, fragment_index, prefix, suffix, flags); _GD_ClearError(D); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check for include index out of range */ if (fragment_index < 0 || fragment_index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL); dreturn("%i", -1); return -1; } /* check protection */ if (D->fragment[fragment_index].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[fragment_index].cname); dreturn("%i", -1); return -1; } if (~D->flags & GD_HAVE_VERSION) _GD_FindVersion(D); /* only set if the dirfile conforms to some standard */ if (D->av) p.standards = D->standards; /* if the caller specified no encoding scheme, but we were asked to create * the fragment, inherit it from the parent */ if ((p.flags & (GD_ENCODING | GD_CREAT)) == GD_CREAT) p.flags |= D->fragment[fragment_index].encoding; new_fragment = _GD_Include(D, &p, file, &ref_name, fragment_index, prefix, suffix, 1); if (!D->error) { D->fragment[fragment_index].modified = 1; D->flags &= ~GD_HAVE_VERSION; } /* If ref_name is non-NULL, the included fragment contained a REFERENCE * directive. If ref_name is NULL but D->fragment[new_fragment].ref_name is * non-NULL, no REFERENCE directive was present, but the parser found a RAW * field to serve as a reference field. */ if (new_fragment >= 0 && D->fragment[new_fragment].ref_name != NULL) /* If the parser chose a reference field, propagate it upward if requried */ for (i = fragment_index; i != -1; i = D->fragment[i].parent) { if (D->fragment[i].ref_name == NULL) { D->fragment[i].ref_name = strdup(D->fragment[new_fragment].ref_name); D->fragment[i].modified = 1; } else break; } /* Honour the reference directive, if not prohibited by the caller */ if (ref_name != NULL && ~flags & GD_IGNORE_REFS) { gd_entry_t *E = _GD_FindField(D, ref_name, D->entry, D->n_entries, 1, NULL); /* FIXME: These errors are problematic, since they'll cause the call to * fail, even though the new fragment has been integrated into the DIRFILE. */ if (E == NULL) _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_CODE, NULL, 0, ref_name); else if (E->field_type != GD_RAW_ENTRY) _GD_SetError(D, GD_E_BAD_REFERENCE, GD_E_REFERENCE_TYPE, NULL, 0, ref_name); else D->reference_field = E; } free(ref_name); dreturn("%i", new_fragment); return new_fragment; } int gd_include(DIRFILE* D, const char* file, int fragment_index, unsigned long flags) { int new_fragment; dtrace("%p, \"%s\", %i, 0x%lX", D, file, fragment_index, flags); new_fragment = gd_include_affix(D, file, fragment_index, NULL, NULL, flags); dreturn("%i", new_fragment); return new_fragment; } static int _GD_CollectFragments(DIRFILE* D, int** f, int fragment, int nf) { int i; int *new_f; dtrace("%p, %p, %i, %i", D, f, fragment, nf); new_f = _GD_Realloc(D, *f, sizeof(*new_f) * ++nf); if (new_f == NULL) { dreturn("%i", -1); return -1; } new_f[nf - 1] = fragment; for (i = 0; i < D->n_fragment; ++i) if (D->fragment[i].parent == fragment) { nf = _GD_CollectFragments(D, &new_f, i, nf); if (nf == -1) break; } *f = new_f; dreturn("%i", nf); return nf; } static int _GD_ContainsFragment(int* f, int nf, int fragment) { int i; dtrace("%p, %i, %i", f, nf, fragment); for (i = 0; i < nf; ++i) if (f[i] == fragment) { dreturn("%i", 1); return 1; } dreturn("%i", 0); return 0; } int gd_uninclude(DIRFILE* D, int fragment_index, int del) { int parent, j, nf; unsigned int i, o, old_count; int *f = NULL; dtrace("%p, %i, %i", D, fragment_index, del); _GD_ClearError(D); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment_index <= 0 || fragment_index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, fragment_index, NULL); dreturn("%i", -1); return -1; } parent = D->fragment[fragment_index].parent; if (D->fragment[parent].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[parent].cname); dreturn("%i", -1); return -1; } /* find all affected fragments */ nf = _GD_CollectFragments(D, &f, fragment_index, 0); if (D->error) { free(f); dreturn("%i", -1); return -1; } /* close affected raw fields */ for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->field_type == GD_RAW_ENTRY && _GD_ContainsFragment(f, nf, D->entry[i]->fragment_index)) { _GD_Flush(D, D->entry[i], 0, 1); } /* flush the fragment's metadata, if requested */ if (!del) for (j = 0; j < nf; ++j) _GD_FlushMeta(D, f[j], 0); if (D->error) { free(f); dreturn("%i", -1); return -1; } /* Nothing from now on may fail */ /* delete the fragments, if requested */ if (del) for (j = 0; j < nf; ++j) gd_UnlinkAt(D, D->fragment[f[j]].dirfd, D->fragment[f[j]].bname, 0); /* delete fields from the fragment -- memory use is not sufficient to warrant * resizing D->entry */ old_count = D->n_entries; for (i = o = 0; i < old_count; ++i) if (_GD_ContainsFragment(f, nf, D->entry[i]->fragment_index)) { if (D->entry[i]->e->n_meta >= 0) D->n_entries--; _GD_FreeE(D, D->entry[i], 1); } else D->entry[o++] = D->entry[i]; /* Flag the parent as modified */ D->fragment[parent].modified = 1; D->flags &= ~GD_HAVE_VERSION; /* delete the fragments -- again, don't bother resizing D->fragment */ for (j = 0; j < nf; ++j) { _GD_ReleaseDir(D, D->fragment[f[j]].dirfd); free(D->fragment[f[j]].cname); free(D->fragment[f[j]].ename); free(D->fragment[f[j]].bname); free(D->fragment[f[j]].ref_name); memcpy(D->fragment + f[j], D->fragment + D->n_fragment - 1, sizeof(struct gd_fragment_t)); D->n_fragment--; /* Relocate all fields of the fragment we just moved */ for (i = 0; i < D->n_entries; ++i) if (D->entry[i]->fragment_index == D->n_fragment) D->entry[i]->fragment_index = f[j]; } /* Clear the cache of all fields */ /* FIXME: Should probably just clear affected fields */ for (i = 0; i < D->n_entries; ++i) { D->entry[i]->flags &= ~GD_EN_CALC; for (j = 0; j < GD_MAX_LINCOM; ++j) D->entry[i]->e->entry[j] = NULL; D->entry[i]->e->value_list_validity = 0; D->entry[i]->e->entry_list_validity = 0; } /* Invalidate the field lists */ D->value_list_validity = 0; D->entry_list_validity = 0; free(f); dreturn("%i", 0); return 0; } libgetdata-0.9.0/src/getdata.c0000640000175000017500000016537012614323564016364 0ustar alastairalastair/* Copyright (C) 2002-2005 C. Barth Netterfield * Copyright (C) 2005-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #define EXTRACT_REPR(it,ot,f) \ for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f(((it *)cdata)[i]) #define fargs(x) (((x) < 0) ? M_PI : 0) #define fargu(x) (((x) & (1 << sizeof((x)))) ? M_PI : 0) #define EXTRACT_REPRR2(it,ot,fb,fr) \ switch (repr) { \ case GD_REPR_REAL: EXTRACT_REPR(it,ot,); break; \ case GD_REPR_IMAG: EXTRACT_REPR(it,ot,0 *); break; \ case GD_REPR_MOD: EXTRACT_REPR(it,ot,fb); break; \ case GD_REPR_ARG: EXTRACT_REPR(it,ot,fr); break; \ } #define EXTRACT_REPRS(ot) \ switch (in_type) { \ case GD_UINT8: EXTRACT_REPRR2( uint8_t, ot,,fargu); break; \ case GD_INT8: EXTRACT_REPRR2( int8_t, ot,abs,fargs); break; \ case GD_UINT16: EXTRACT_REPRR2( uint16_t, ot,,fargu); break; \ case GD_INT16: EXTRACT_REPRR2( int16_t, ot,abs,fargs); break; \ case GD_UINT32: EXTRACT_REPRR2( uint32_t, ot,,fargu); break; \ case GD_INT32: EXTRACT_REPRR2( int32_t, ot,abs,fargs); break; \ case GD_UINT64: EXTRACT_REPRR2( uint64_t, ot,,fargu); break; \ case GD_INT64: EXTRACT_REPRR2( int64_t, ot,llabs,fargs); break; \ case GD_FLOAT32: EXTRACT_REPRR2( float, ot,fabs,fargs); break; \ case GD_FLOAT64: EXTRACT_REPRR2( double, ot,fabs,fargs); break; \ case GD_COMPLEX64: EXTRACT_REPRC2( float, ot); break; \ case GD_COMPLEX128: EXTRACT_REPRC2( double, ot); break; \ case GD_NULL: \ break; \ default: \ _GD_SetError(D, GD_E_BAD_TYPE, in_type, NULL, 0, NULL); \ } #define EXTRACT_REPRC2(it,ot) \ switch (repr) { \ case GD_REPR_REAL: EXTRACT_REPRC(it,ot,creal); break; \ case GD_REPR_IMAG: EXTRACT_REPRC(it,ot,cimag); break; \ case GD_REPR_MOD: EXTRACT_REPRC(it,ot,cabs); break; \ case GD_REPR_ARG: EXTRACT_REPRC(it,ot,carg); break; \ } #ifdef GD_NO_C99_API #define EXTRACT_REPRC(it,ot,f) \ for (i = 0; i < n; ++i) ((ot *)rdata)[i] = (ot)f((it *)cdata + 2 * i) #else #define EXTRACT_REPRC(it,ot,f) EXTRACT_REPR(_Complex it,ot,f) #endif static void _GD_ExtractRepr(DIRFILE *restrict D, const void *restrict cdata, gd_type_t in_type, void *restrict rdata, gd_type_t type, size_t n, int repr) { size_t i; dtrace("%p, %p, 0x%X, %p, 0x%X, %" PRNsize_t ", %i", D, cdata, in_type, rdata, type, n, repr); switch (type) { case GD_UINT8: EXTRACT_REPRS( uint8_t); break; case GD_INT8: EXTRACT_REPRS( int8_t); break; case GD_UINT16: EXTRACT_REPRS( uint16_t); break; case GD_INT16: EXTRACT_REPRS( int16_t); break; case GD_UINT32: EXTRACT_REPRS( uint32_t); break; case GD_INT32: EXTRACT_REPRS( int32_t); break; case GD_UINT64: EXTRACT_REPRS( uint64_t); break; case GD_INT64: EXTRACT_REPRS( int64_t); break; case GD_FLOAT32: EXTRACT_REPRS( float); break; case GD_FLOAT64: EXTRACT_REPRS( double); break; #ifdef GD_NO_C99_API #undef EXTRACT_REPRC #undef EXTRACT_REPR #define EXTRACT_REPRC(it,ot,f) \ do { \ for (i = 0; i < n; ++i) { \ ((ot *)rdata)[2 * i] = (ot)f((it *)cdata + 2 * i); \ ((ot *)rdata)[2 * i + 1] = 0; \ } \ } while(0) #define EXTRACT_REPR(it,ot,f) \ do { \ for (i = 0; i < n; ++i) { \ ((ot *)rdata)[2 * i] = (ot)f(((it *)cdata)[i]); \ ((ot *)rdata)[2 * i + 1] = 0; \ } \ } while(0) case GD_COMPLEX64: EXTRACT_REPRS( float); break; case GD_COMPLEX128: EXTRACT_REPRS( double); break; #else case GD_COMPLEX64: EXTRACT_REPRS( float complex); break; case GD_COMPLEX128: EXTRACT_REPRS(double complex); break; #endif case GD_NULL: break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } /* _GD_FillFileFrame: fill dataout with frame indices */ static void _GD_FillFileFrame(void *dataout, gd_type_t rtype, off64_t s0, size_t n) { size_t i; dtrace("%p, 0x%X, %lli, %" PRNsize_t, dataout, rtype, (long long)s0, n); switch (rtype) { case GD_INT8: for (i = 0; i < n; i++) ((int8_t *)dataout)[i] = (int8_t)(i + s0); break; case GD_UINT8: for (i = 0; i < n; i++) ((uint8_t *)dataout)[i] = (uint8_t)(i + s0); break; case GD_INT16: for (i = 0; i < n; i++) ((int16_t *)dataout)[i] = (int16_t)(i + s0); break; case GD_UINT16: for (i = 0; i < n; i++) ((uint16_t *)dataout)[i] = (uint16_t)(i + s0); break; case GD_INT32: for (i = 0; i < n; i++) ((int32_t *)dataout)[i] = (int32_t)(i + s0); break; case GD_UINT32: for (i = 0; i < n; i++) ((uint32_t *)dataout)[i] = (uint32_t)(i + s0); break; case GD_INT64: for (i = 0; i < n; i++) ((int64_t *)dataout)[i] = (int64_t)(i + s0); break; case GD_UINT64: for (i = 0; i < n; i++) ((uint64_t *)dataout)[i] = (uint64_t)(i + s0); break; case GD_FLOAT32: for (i = 0; i < n; i++) ((float *)dataout)[i] = (float)(i + s0); break; case GD_FLOAT64: for (i = 0; i < n; i++) ((double *)dataout)[i] = (double)(i + s0); break; case GD_COMPLEX64: for (i = 0; i < n; i++) gd_rs2ca_(dataout, i, i + s0, float); break; case GD_COMPLEX128: for (i = 0; i < n; i++) gd_rs2ca_(dataout, i, i + s0, double); break; default: break; } dreturnvoid(); } /* _GD_FillZero: fill data buffer with zero/NaN of the appropriate type. */ static int _GD_FillZero(void *databuffer, gd_type_t type, size_t nz) { size_t i; const double NaN = NAN; dtrace("%p, 0x%X, %" PRNsize_t, databuffer, type, nz); if (type & GD_IEEE754) { if (type == GD_FLOAT32) for (i = 0; i < nz; ++i) *((float *)databuffer + i) = (float)NaN; else for (i = 0; i < nz; ++i) *((double *)databuffer + i) = (double)NaN; } else if (type & GD_COMPLEX) { if (type == GD_COMPLEX64) for (i = 0; i < 2 * nz; ++i) *((float *)databuffer + i) = (float)NaN; else for (i = 0; i < 2 * nz; ++i) *((double *)databuffer + i) = (double) NaN; } else memset(databuffer, 0, nz * GD_SIZE(type)); dreturn("%" PRNsize_t, nz); return (nz); } /* _GD_DoRaw: Read from a raw. Returns number of samples read. */ static size_t _GD_DoRaw(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t s0, size_t ns, gd_type_t return_type, void *restrict data_out) { size_t n_read, zeroed_samples = 0; ssize_t samples_read = 0; char *databuffer; size_t zero_pad = 0; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p)", D, E, (long long)s0, ns, return_type, data_out); if (s0 < E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset) zero_pad = E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset - s0; else s0 -= E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset; databuffer = _GD_Malloc(D, ns * E->e->u.raw.size); if (databuffer == NULL) { dreturn("%i", 0); return 0; } if (zero_pad > 0) { /* frame offset in samples */ const off64_t foffs = E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset; zeroed_samples = _GD_FillZero(databuffer, E->EN(raw,data_type), (zero_pad > ns) ? ns : zero_pad); ns -= zeroed_samples; /* Padding up to the end of the frameoffset, results in a "real" file * position. In this case we need to make sure the underlying file is * actually at the BOF, for consistency. */ if (s0 + (off64_t)zeroed_samples == foffs) /* ie. file->pos is zero */ _GD_Seek(D, E, foffs, GD_SEEK_SET); else E->e->u.raw.file[0].pos = s0 + zeroed_samples - foffs; s0 = 0; } if (ns > 0) { /* open the file (and cache the fp) if it hasn't been opened yet. */ if (_GD_InitRawIO(D, E, NULL, -1, NULL, GD_EF_SEEK | GD_EF_READ, GD_FILE_READ, _GD_FileSwapBytes(D, E))) { free(databuffer); dreturn("%i", 0); return 0; } if ((*_GD_ef[E->e->u.raw.file[0].subenc].seek)(E->e->u.raw.file, s0, E->EN(raw,data_type), GD_FILE_READ) == -1) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); free(databuffer); dreturn("%i", 0); return 0; } samples_read = (*_GD_ef[E->e->u.raw.file[0].subenc].read)(E->e->u.raw.file, databuffer + zeroed_samples * E->e->u.raw.size, E->EN(raw,data_type), ns); if (samples_read == -1) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); free(databuffer); dreturn("%i", 0); return 0; } if (_GD_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_ECOR) _GD_FixEndianness(databuffer + zeroed_samples * E->e->u.raw.size, samples_read, E->EN(raw,data_type), D->fragment[E->fragment_index].byte_sex, 0); } n_read = samples_read + zeroed_samples; _GD_ConvertType(D, databuffer, E->EN(raw,data_type), data_out, return_type, n_read); free(databuffer); dreturn("%" PRNsize_t, (D->error == GD_E_OK) ? n_read : (size_t)0); return (D->error == GD_E_OK) ? n_read : (size_t)0; } /* Macros to reduce tangly code */ #define POLYNOM5(t,npts) \ for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \ ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] \ * ((t*)data)[i] * ((t*)data)[i] * a[5] \ + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[4] \ + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3] \ + ((t*)data)[i] * ((t*)data)[i] * a[2] \ + ((t*)data)[i] * a[1] + a[0] \ ) #define POLYNOM4(t,npts) \ for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \ ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[4] \ + ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3] \ + ((t*)data)[i] * ((t*)data)[i] * a[2] \ + ((t*)data)[i] * a[1] + a[0] \ ) #define POLYNOM3(t,npts) \ for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \ ((t*)data)[i] * ((t*)data)[i] * ((t*)data)[i] * a[3] \ + ((t*)data)[i] * ((t*)data)[i] * a[2] \ + ((t*)data)[i] * a[1] + a[0] \ ) #define POLYNOM2(t,npts) \ for (i = 0; i < npts; i++) ((t*)data)[i] = (t)( \ ((t*)data)[i] * ((t*)data)[i] * a[2] \ + ((t*)data)[i] * a[1] + a[0] \ ) #ifdef GD_NO_C99_API #define POLYNOMC(t) \ switch (n) { \ case 2: POLYNOMC2(t,npts); break; \ case 3: POLYNOMC3(t,npts); break; \ case 4: POLYNOMC4(t,npts); break; \ case 5: POLYNOMC5(t,npts); break; \ default: _GD_InternalError(D); \ } #define POLYNOMC5(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double x3 = x2 * x; \ const double x4 = x3 * x; \ const double x5 = x4 * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ const double y3 = y2 * y; \ const double y4 = y3 * y; \ const double y5 = y4 * y; \ ((t*)data)[2 * i] = (t)( \ a[5] * (x5 - 10 * x3 * y2 + 5 * x * y4) \ - a[4] * (x4 - 6 * x2 * y2 + y4) - a[3] * (x3 - 3 * x * y2) \ + a[2] * (x2 - y2) + a[1] * x + a[0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[5] * (5 * x4 * y - 10 * x3 * y2 + y5) \ + a[4] * (4 * x3 * y - 4 * x * y3) + a[3] * (3 * x2 * y - y3) \ + a[2] * 2 * x * y + a[1] * y \ ); \ } \ } while (0) #define POLYNOMC4(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double x3 = x2 * x; \ const double x4 = x3 * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ const double y3 = y2 * y; \ const double y4 = y3 * y; \ ((t*)data)[2 * i] = (t)( \ a[4] * (x4 - 6 * x2 * y2 + y4) + a[3] * (x3 - 3 * x * y2) \ + a[2] * (x2 - y2) + a[1] * x + a[0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[4] * (4 * x3 * y - 4 * x * y3) + a[3] * (3 * x2 * y - y3) \ + a[2] * 2 * x * y + a[1] * y \ ); \ } \ } while (0) #define POLYNOMC3(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double x3 = x2 * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ const double y3 = y2 * y; \ ((t*)data)[2 * i] = (t)( \ a[3] * (x3 - 3 * x * y2) + a[2] * (x2 - y2) + a[1] * x + a[0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[3] * (3 * x2 * y - y3) + a[2] * 2 * x * y + a[1] * y \ ); \ } \ } while (0) #define POLYNOMC2(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ ((t*)data)[2 * i] = (t)(a[2] * (x2 - y2) + a[1] * x + a[0]); \ ((t*)data)[2 * i + 1] = (t)(a[2] * 2 * x * y + a[1] * y); \ } \ } while (0) #else #define POLYNOMC(t) POLYNOM(complex t) #endif #define POLYNOM(t) \ switch (n) { \ case 2: POLYNOM2(t,npts); break; \ case 3: POLYNOM3(t,npts); break; \ case 4: POLYNOM4(t,npts); break; \ case 5: POLYNOM5(t,npts); break; \ default: _GD_InternalError(D); \ } /* _GD_PolynomData: Compute data = Sum(i=0..n; data**i * a[i]), for scalar a, * and integer 2 <= n < GD_MAX_POLYORD */ static void _GD_PolynomData(DIRFILE *restrict D, void *restrict data, gd_type_t type, size_t npts, int n, const double *restrict a) { size_t i; dtrace("%p, %p, 0x%X, %" PRNsize_t ", %i, %p", D, data, type, npts, n, a); if (n == 1) { /* no need to duplicate this case */ _GD_LincomData(D, 1, data, type, NULL, NULL, a + 1, a, NULL, npts); } else { switch (type) { case GD_NULL: break; case GD_INT8: POLYNOM( int8_t); break; case GD_UINT8: POLYNOM( uint8_t); break; case GD_INT16: POLYNOM( int16_t); break; case GD_UINT16: POLYNOM(uint16_t); break; case GD_INT32: POLYNOM( int32_t); break; case GD_UINT32: POLYNOM(uint32_t); break; case GD_INT64: POLYNOM( int64_t); break; case GD_UINT64: POLYNOM(uint64_t); break; case GD_FLOAT32: POLYNOM( float); break; case GD_FLOAT64: POLYNOM( double); break; case GD_COMPLEX64: POLYNOMC( float); break; case GD_COMPLEX128: POLYNOMC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } } dreturnvoid(); } #ifdef GD_NO_C99_API #undef POLYNOMC5 #undef POLYNOMC4 #undef POLYNOMC3 #undef POLYNOMC2 #undef POLYNOMC1 #define POLYNOMC5(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double x3 = x2 * x; \ const double x4 = x3 * x; \ const double x5 = x4 * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ const double y3 = y2 * y; \ const double y4 = y3 * y; \ const double y5 = y4 * y; \ ((t*)data)[2 * i] = (t)( \ a[5][0] * (x5 - 10 * x3 * y2 + 5 * x * y4) - \ a[5][1] * (5 * x4 * y - 10 * x3 * y2 + y5) + \ a[4][0] * (x4 - 6 * x2 * y2 + y4) - \ a[4][1] * (4 * x3 * y - 4 * x * y3) + \ a[3][0] * (x3 - 3 * x * y2) - a[3][1] * (3 * x2 * y - y3) + \ a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \ a[1][0] * x - a[1][1] * y + a[0][0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[5][1] * (x5 - 10 * x3 * y2 + 5 * x * y4) + \ a[5][0] * (5 * x4 * y - 10 * x3 * y2 + y5) + \ a[4][1] * (x4 - 6 * x2 * y2 + y4) + \ a[4][0] * (4 * x3 * y - 4 * x * y3) + \ a[3][1] * (x3 - 3 * x * y2) + a[3][0] * (3 * x2 * y - y3) + \ a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \ a[1][1] * x + a[1][0] * y + a[0][1] \ ); \ } \ } while (0) #define POLYNOMC4(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double x3 = x2 * x; \ const double x4 = x3 * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ const double y3 = y2 * y; \ const double y4 = y3 * y; \ ((t*)data)[2 * i] = (t)( \ a[4][0] * (x4 - 6 * x2 * y2 + y4) - \ a[4][1] * (4 * x3 * y - 4 * x * y3) + \ a[3][0] * (x3 - 3 * x * y2) - a[3][1] * (3 * x2 * y - y3) + \ a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \ a[1][0] * x - a[1][1] * y + a[0][0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[4][1] * (x4 - 6 * x2 * y2 + y4) + \ a[4][0] * (4 * x3 * y - 4 * x * y3) + \ a[3][1] * (x3 - 3 * x * y2) + a[3][0] * (3 * x2 * y - y3) + \ a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \ a[1][1] * x + a[1][0] * y + a[0][1] \ ); \ } \ } while (0) #define POLYNOMC3(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double x3 = x2 * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ const double y3 = y2 * y; \ ((t*)data)[2 * i] = (t)( \ a[3][0] * (x3 - 3 * x * y2) - a[3][1] * (3 * x2 * y - y3) + \ a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \ a[1][0] * x - a[1][1] * y + a[0][0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[3][1] * (x3 - 3 * x * y2) + a[3][0] * (3 * x2 * y - y3) + \ a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \ a[1][1] * x + a[1][0] * y + a[0][1] \ ); \ } \ } while (0) #define POLYNOMC2(t,npts) \ do { \ for (i = 0; i < npts; i++) { \ const double x = ((t*)data)[2 * i]; \ const double x2 = x * x; \ const double y = ((t*)data)[2 * i + 1]; \ const double y2 = y * y; \ ((t*)data)[2 * i] = (t)( \ a[2][0] * (x2 - y2) - a[2][1] * 2 * x * y + \ a[1][0] * x - a[1][1] * y + a[0][0] \ ); \ ((t*)data)[2 * i + 1] = (t)( \ a[2][1] * (x2 - y2) + a[2][0] * 2 * x * y + \ a[1][1] * x + a[1][0] * y + a[0][1] \ ); \ } \ } while (0) #endif /* _GD_CPolynomData: Compute data = Sum(i=0..n; data**i * a[i]), for complex * scalar a, and integer 2 <= n < GD_MAX_POLYORD */ static void _GD_CPolynomData(DIRFILE *restrict D, void *restrict data, gd_type_t type, size_t npts, int n, GD_DCOMPLEXV(a)) { size_t i; dtrace("%p, %p, 0x%X, %" PRNsize_t ", %i, %p", D, data, type, npts, n, a); if (n == 1) { /* no need to duplicate this case */ _GD_CLincomData(D, 1, data, type, NULL, NULL, a + 1, a, NULL, npts); } else { switch (type) { case GD_NULL: break; case GD_INT8: case GD_UINT8: case GD_INT16: case GD_UINT16: case GD_INT32: case GD_UINT32: case GD_INT64: case GD_UINT64: case GD_FLOAT32: case GD_FLOAT64: _GD_InternalError(D); break; case GD_COMPLEX64: POLYNOMC( float); break; case GD_COMPLEX128: POLYNOMC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } } dreturnvoid(); } #ifdef GD_NO_C99_API #define MULTIPLYC(t) \ do { \ for (i = 0; i < n; i++) { \ ((t*)A)[2 * i] = (t)(((t*)A)[2 * i] * B[i * spfB / spfA]); \ ((t*)A)[2 * i + 1] = (t)(((t*)A)[2 * i + 1] * B[i * spfB / spfA]); \ } \ } while (0) #else #define MULTIPLYC(t) MULTIPLY(complex t) #endif #define MULTIPLY(t) \ for (i = 0; i < n; i++) ((t*)A)[i] = (t)(((t*)A)[i] * B[i * spfB / spfA]) /* MultiplyData: Multiply A by purely real B. B is unchanged. */ static void _GD_MultiplyData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, const double *B, unsigned int spfB, gd_type_t type, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n); switch (type) { case GD_NULL: break; case GD_UINT8: MULTIPLY( uint8_t); break; case GD_INT8: MULTIPLY( int8_t); break; case GD_UINT16: MULTIPLY(uint16_t); break; case GD_INT16: MULTIPLY( int16_t); break; case GD_UINT32: MULTIPLY(uint32_t); break; case GD_INT32: MULTIPLY( int32_t); break; case GD_UINT64: MULTIPLY(uint64_t); break; case GD_INT64: MULTIPLY( int64_t); break; case GD_FLOAT32: MULTIPLY( float); break; case GD_FLOAT64: MULTIPLY( double); break; case GD_COMPLEX64: MULTIPLYC( float); break; case GD_COMPLEX128: MULTIPLYC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } #ifdef GD_NO_C99_API #undef MULTIPLYC #define MULTIPLYC(t) \ do { \ for (i = 0; i < n; i++) { \ const int i2 = 2 * (i * spfB / spfA); \ const t x = ((t*)A)[2 * i]; \ const t y = ((t*)A)[2 * i + 1]; \ ((t*)A)[2 * i] = (t)(x * B[i2] - y * B[i2 + 1]); \ ((t*)A)[2 * i + 1] = (t)(y * B[i2] + x * B[i2 + 1]); \ } \ } while (0) #endif /* CMultiplyData: Multiply A by B. B is complex -- as it happens A is also * complex due to the way we deal with complex valued derived fields */ static void _GD_CMultiplyData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, GD_DCOMPLEXP(B), unsigned int spfB, gd_type_t type, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n); switch (type) { case GD_NULL: break; case GD_UINT8: case GD_INT8: case GD_UINT16: case GD_INT16: case GD_UINT32: case GD_INT32: case GD_UINT64: case GD_INT64: case GD_FLOAT32: case GD_FLOAT64: _GD_InternalError(D); break; case GD_COMPLEX64: MULTIPLYC( float); break; case GD_COMPLEX128: MULTIPLYC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } #ifdef GD_NO_C99_API #define DIVIDEC(t) \ do { \ for (i = 0; i < n; i++) { \ ((t*)A)[2 * i] = (t)(((t*)A)[2 * i] / B[i * spfB / spfA]); \ ((t*)A)[2 * i + 1] = (t)(((t*)A)[2 * i + 1] / B[i * spfB / spfA]); \ } \ } while(0) #else #define DIVIDEC(t) DIVIDE(complex t) #endif #define DIVIDE(t) \ for (i = 0; i < n; i++) \ ((t*)A)[i] = (t)(((t*)A)[i] / B[i * spfB / spfA]) /* DivideData: Divide B by A. B is unchanged. */ static void _GD_DivideData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, double *restrict B, unsigned int spfB, gd_type_t type, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n); switch (type) { case GD_NULL: break; case GD_UINT8: DIVIDE( uint8_t); break; case GD_INT8: DIVIDE( int8_t); break; case GD_UINT16: DIVIDE(uint16_t); break; case GD_INT16: DIVIDE( int16_t); break; case GD_UINT32: DIVIDE(uint32_t); break; case GD_INT32: DIVIDE( int32_t); break; case GD_UINT64: DIVIDE(uint64_t); break; case GD_INT64: DIVIDE( int64_t); break; case GD_FLOAT32: DIVIDE( float); break; case GD_FLOAT64: DIVIDE( double); break; case GD_COMPLEX64: DIVIDEC( float); break; case GD_COMPLEX128: DIVIDEC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } #ifdef GD_NO_C99_API #undef DIVIDEC #define DIVIDEC(t) \ do { \ for (i = 0; i < n; i++) { \ const int i2 = 2 * (i * spfB / spfA); \ const t x = ((t*)A)[2 * i]; \ const t y = ((t*)A)[2 * i + 1]; \ const double d = B[i2] * B[i2] + B[i2 + 1] * B[i2 + 1]; \ ((t*)A)[2 * i] = (t)((x * B[i2] + y * B[i2 + 1]) / d); \ ((t*)A)[2 * i + 1] = (t)((y * B[i2] - x * B[i2 + 1]) / d); \ } \ } while (0) #endif /* CDivideData: Divide A by B. B is complex. (See remarks on CMultiplyData * about A.) */ static void _GD_CDivideData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, GD_DCOMPLEXP(B), unsigned int spfB, gd_type_t type, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, 0x%X, %" PRNsize_t, D, A, spfA, B, spfB, type, n); switch (type) { case GD_NULL: break; case GD_UINT8: case GD_INT8: case GD_UINT16: case GD_INT16: case GD_UINT32: case GD_INT32: case GD_UINT64: case GD_INT64: case GD_FLOAT32: case GD_FLOAT64: _GD_InternalError(D); break; case GD_COMPLEX64: DIVIDEC( float); break; case GD_COMPLEX128: DIVIDEC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } #define WINDOP(ot,ct,bo,op,tt,z) \ for (i = 0; i < n; i++) \ if (!((bo(((ct*)B)[i * spfB / spfA])) op threshold.tt)) \ ((ot*)A)[i] = (ot)(z) #define WINDOPC(ot,ct,bo,op,tt,z) \ for (i = 0; i < n; i++) \ if (!((bo(((ct*)B)[i * spfB / spfA])) op threshold.tt)) \ ((ot*)A)[i * 2] = ((ot*)A)[i * 2 + 1] = (ot)(z) #define WINDOW(t,z) \ switch (op) { \ case GD_WINDOP_EQ: WINDOP(t, int64_t, ,==,i,z); break; \ case GD_WINDOP_GE: WINDOP(t, double, ,>=,r,z); break; \ case GD_WINDOP_GT: WINDOP(t, double, ,> ,r,z); break; \ case GD_WINDOP_LE: WINDOP(t, double, ,<=,r,z); break; \ case GD_WINDOP_LT: WINDOP(t, double, ,< ,r,z); break; \ case GD_WINDOP_NE: WINDOP(t, int64_t, ,!=,i,z); break; \ case GD_WINDOP_SET: WINDOP(t,uint64_t, ,& ,u,z); break; \ case GD_WINDOP_CLR: WINDOP(t,uint64_t,~,& ,u,z); break; \ default: \ _GD_InternalError(D); \ } #define WINDOWC(t,z) \ switch (op) { \ case GD_WINDOP_EQ: WINDOPC(t, int64_t, ,==,i,z); break; \ case GD_WINDOP_GE: WINDOPC(t, double, ,>=,r,z); break; \ case GD_WINDOP_GT: WINDOPC(t, double, ,> ,r,z); break; \ case GD_WINDOP_LE: WINDOPC(t, double, ,<=,r,z); break; \ case GD_WINDOP_LT: WINDOPC(t, double, ,< ,r,z); break; \ case GD_WINDOP_NE: WINDOPC(t, int64_t, ,!=,i,z); break; \ case GD_WINDOP_SET: WINDOPC(t,uint64_t, ,& ,u,z); break; \ case GD_WINDOP_CLR: WINDOPC(t,uint64_t,~,& ,u,z); break; \ default: \ _GD_InternalError(D); \ } /* WindowData: Zero data in A where the condition is false. B is unchanged. */ static void _GD_WindowData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, void *restrict B, unsigned int spfB, gd_type_t type, gd_windop_t op, gd_triplet_t threshold, size_t n) { size_t i; const double NaN = NAN; dtrace("%p, %p, %u, %p, %u, 0x%X, %i, {%g,%llx,%lli}, %" PRNsize_t, D, A, spfA, B, spfB, type, op, threshold.r, (unsigned long long)threshold.u, (long long)threshold.i, n); switch (type) { case GD_NULL: break; case GD_UINT8: WINDOW( uint8_t, 0) break; case GD_INT8: WINDOW( int8_t, 0) break; case GD_UINT16: WINDOW(uint16_t, 0) break; case GD_INT16: WINDOW( int16_t, 0) break; case GD_UINT32: WINDOW(uint32_t, 0) break; case GD_INT32: WINDOW( int32_t, 0) break; case GD_UINT64: WINDOW(uint64_t, 0) break; case GD_INT64: WINDOW( int64_t, 0) break; case GD_FLOAT32: WINDOW( float,NaN) break; case GD_FLOAT64: WINDOW( double,NaN) break; case GD_COMPLEX64: WINDOWC( float,NaN) break; case GD_COMPLEX128: WINDOWC( double,NaN) break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } #define MPLEX(t) \ do { \ t last = *(t*)start; \ for (i = 0; i < n; i++) {\ if (B[i * spfB / spfA] == val) \ last = ((t*)A)[i]; \ else \ ((t*)A)[i] = last; \ } \ } while(0) #define MPLEXC(t) \ do { \ t rlast, ilast; \ rlast = *(t*)start; \ ilast = ((t*)start)[1]; \ for (i = 0; i < n; i++) \ if (B[i * spfB / spfA] == val) { \ rlast = ((t*)A)[i * 2]; \ ilast = ((t*)A)[i * 2 + 1]; \ } else { \ ((t*)A)[i * 2] = rlast; \ ((t*)A)[i * 2 + 1] = ilast; \ } \ } while(0) /* demultiplex data */ static void _GD_MplexData(DIRFILE *restrict D, void *restrict A, unsigned int spfA, const int *restrict B, unsigned int spfB, gd_type_t type, int val, void *restrict start, size_t n) { size_t i; dtrace("%p, %p, %u, %p, %u, 0x%X, %i, %p, %" PRNsize_t, D, A, spfA, B, spfB, type, val, start, n); switch (type) { case GD_NULL: break; case GD_UINT8: MPLEX( uint8_t); break; case GD_INT8: MPLEX( int8_t); break; case GD_UINT16: MPLEX(uint16_t); break; case GD_INT16: MPLEX( int16_t); break; case GD_UINT32: MPLEX(uint32_t); break; case GD_INT32: MPLEX( int32_t); break; case GD_UINT64: MPLEX(uint64_t); break; case GD_INT64: MPLEX( int64_t); break; case GD_FLOAT32: MPLEX( float); break; case GD_FLOAT64: MPLEX( double); break; case GD_COMPLEX64: MPLEXC( float); break; case GD_COMPLEX128: MPLEXC( double); break; default: _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } dreturnvoid(); } /* _GD_DoLincom: Read from a lincom. Returns number of samples read. */ static size_t _GD_DoLincom(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { unsigned int spf[GD_MAX_LINCOM]; size_t n_read; int i; void *tmpbuf2 = NULL; void *tmpbuf3 = NULL; const gd_type_t ntype = (return_type & GD_COMPLEX) ? GD_COMPLEX128 : GD_FLOAT64; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); /* input field checks */ for (i = 0; i < E->EN(lincom,n_fields); ++i) { if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } spf[i] = _GD_GetSPF(D, E->e->entry[i]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } } /* read the first field and record the number of samples returned -- we can * safely store this in the output buffer, with the correct return type as * it will not aversely affect our later math */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error) { dreturn("%i", 0); return 0; } /* Nothing to lincomise */ if (n_read == 0) { dreturn("%i", 0); return 0; } /* Some dirfiles use "bar LINCOM foo 1 0" to rename to . I * recommend using "bar PHASE foo 0" in this case, but we'll accomodate them * as much as we can. Suggested by MDT. */ if (E->EN(lincom,n_fields) == 1 && gd_ccmpl_(E->EN(lincom,cm)[0],1,0) && gd_ccmpl_(E->EN(lincom,cb)[0],0,0)) { dreturn("%" PRNsize_t, n_read); return n_read; } /* Read the second field, if present */ if (E->EN(lincom,n_fields) > 1) { /* calculate the first sample, type and number of samples to read of the * second field */ size_t n_read2; size_t num_samp2 = (int)ceil((double)n_read * spf[1] / spf[0]); off64_t first_samp2 = first_samp * spf[1] / spf[0]; /* Allocate a temporary buffer for the next field */ tmpbuf2 = _GD_Alloc(D, ntype, num_samp2); if (D->error) { free(tmpbuf2); dreturn("%i", 0); return 0; } /* read the second field */ n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2, ntype, tmpbuf2); if (D->error || n_read2 == 0) { free(tmpbuf2); dreturn("%i", 0); return 0; } /* adjust n_read for a short read from field two */ if (n_read2 * spf[0] != n_read * spf[1]) n_read = n_read2 * spf[0] / spf[1]; /* Do the same for the third field, if needed */ if (E->EN(lincom,n_fields) > 2) { size_t n_read3; size_t num_samp3 = (int)ceil((double)n_read * spf[2] / spf[0]); off64_t first_samp3 = first_samp * spf[2] / spf[0]; tmpbuf3 = _GD_Alloc(D, ntype, num_samp3); if (D->error) { free(tmpbuf2); free(tmpbuf3); dreturn("%i", 0); return 0; } n_read3 = _GD_DoField(D, E->e->entry[2], E->e->repr[2], first_samp3, num_samp3, ntype, tmpbuf3); if (D->error || n_read3 == 0) { free(tmpbuf2); free(tmpbuf3); dreturn("%i", 0); return 0; } if (n_read3 * spf[0] != n_read * spf[2]) n_read = n_read3 * spf[0] / spf[2]; } } /* Compute everything at once */ if (E->flags & GD_EN_COMPSCAL) _GD_CLincomData(D, E->EN(lincom,n_fields), data_out, return_type, (GD_DCOMPLEXP_t)tmpbuf2, (GD_DCOMPLEXP_t)tmpbuf3, E->EN(lincom,cm), E->EN(lincom,cb), spf, n_read); else _GD_LincomData(D, E->EN(lincom,n_fields), data_out, return_type, (double *)tmpbuf2, (double *)tmpbuf3, E->EN(lincom,m), E->EN(lincom,b), spf, n_read); /* free temporary buffers */ free(tmpbuf2); free(tmpbuf3); if (D->error) n_read = 0; dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoMultiply: Read from a multiply. Returns number of samples read. */ static size_t _GD_DoMultiply(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { void *tmpbuf = NULL; unsigned int spf1, spf2; size_t n_read, n_read2, num_samp2; off64_t first_samp2; gd_type_t type2; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); /* Check input fields */ if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* find the samples per frame of the first field */ spf1 = _GD_GetSPF(D, E->e->entry[0]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* read the first field and record the number of samples returned */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* Nothing to multiply */ if (n_read == 0) { dreturn("%i", 0); return 0; } /* find the samples per frame of the second field */ spf2 = _GD_GetSPF(D, E->e->entry[1]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* calculate the first sample and number of samples to read of the * second field */ num_samp2 = (int)ceil((double)n_read * spf2 / spf1); first_samp2 = first_samp * spf2 / spf1; /* find the native type of the second field */ type2 = (_GD_NativeType(D, E->e->entry[1], E->e->repr[1]) & GD_COMPLEX) ? GD_COMPLEX128 : GD_FLOAT64; /* Allocate a temporary buffer for the second field */ tmpbuf = _GD_Alloc(D, type2, num_samp2); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } /* read the second field */ n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2, type2, tmpbuf); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2) n_read = n_read2 * spf1 / spf2; if (type2 & GD_COMPLEX) _GD_CMultiplyData(D, data_out, spf1, tmpbuf, spf2, return_type, n_read); else _GD_MultiplyData(D, data_out, spf1, tmpbuf, spf2, return_type, n_read); free(tmpbuf); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoRecip: Read from a recip. Returns number of samples read. */ static size_t _GD_DoRecip(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { size_t n_read; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); /* Check input fields */ if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* read the first field and record the number of samples returned */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* Nothing to divide */ if (n_read == 0) { dreturn("%i", 0); return 0; } /* Compute a reciprocal */ if (E->flags & GD_EN_COMPSCAL) _GD_CInvertData(D, data_out, return_type, E->EN(recip,cdividend), num_samp); else _GD_InvertData(D, data_out, return_type, E->EN(recip,dividend), num_samp); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoDivide: Read from a divide. Returns number of samples read. */ static size_t _GD_DoDivide(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { void *tmpbuf = NULL; unsigned int spf1, spf2; size_t n_read, n_read2, num_samp2; off64_t first_samp2; gd_type_t type2; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); /* Check input fields */ if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) || _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* read the first field and record the number of samples returned */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* Nothing to divide */ if (n_read == 0) { dreturn("%i", 0); return 0; } /* compute a division */ /* find the samples per frame of the dividend */ spf1 = _GD_GetSPF(D, E->e->entry[0]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* find the samples per frame of the second field */ spf2 = _GD_GetSPF(D, E->e->entry[1]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* calculate the first sample and number of samples to read of the * second field */ num_samp2 = (int)ceil((double)n_read * spf2 / spf1); first_samp2 = first_samp * spf2 / spf1; /* find the native type of the second field */ type2 = (_GD_NativeType(D, E->e->entry[1], E->e->repr[1]) & GD_COMPLEX) ? GD_COMPLEX128 : GD_FLOAT64; /* Allocate a temporary buffer for the second field */ tmpbuf = _GD_Alloc(D, type2, num_samp2); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } /* read the second field */ n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2, type2, tmpbuf); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2) n_read = n_read2 * spf1 / spf2; if (type2 & GD_COMPLEX) _GD_CDivideData(D, data_out, spf1, (GD_DCOMPLEXP_t)tmpbuf, spf2, return_type, n_read); else _GD_DivideData(D, data_out, spf1, (double *)tmpbuf, spf2, return_type, n_read); free(tmpbuf); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoBit: Read from a bitfield. Returns number of samples read. * This is used by both BIT and SBIT (is_signed distinguishes) */ static size_t _GD_DoBit(DIRFILE *restrict D, gd_entry_t *restrict E, int is_signed, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { void *tmpbuf; size_t i; size_t n_read; const uint64_t mask = (E->EN(bit,numbits) == 64) ? 0xffffffffffffffffULL : ((uint64_t)1 << E->EN(bit,numbits)) - 1; dtrace("%p, %p, %i, %lli, %" PRNsize_t ", 0x%X, %p", D, E, is_signed, (long long)first_samp, num_samp, return_type, data_out); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (is_signed) tmpbuf = _GD_Malloc(D, num_samp * sizeof(int64_t)); else tmpbuf = _GD_Malloc(D, num_samp * sizeof(uint64_t)); if (tmpbuf == NULL) { dreturn("%i", 0); return 0; } n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, (is_signed) ? GD_INT64 : GD_UINT64, tmpbuf); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } /* extract bits */ if (is_signed) { uint64_t sign = -1LL << (E->EN(bit,numbits) - 1); for (i = 0; i < n_read; i++) ((int64_t *)tmpbuf)[i] = (((((uint64_t *)tmpbuf)[i] >> E->EN(bit,bitnum)) & mask) + sign) ^ sign; } else for (i = 0; i < n_read; i++) ((uint64_t *)tmpbuf)[i] = (((uint64_t *)tmpbuf)[i] >> E->EN(bit,bitnum)) & mask; _GD_ConvertType(D, tmpbuf, (is_signed) ? GD_INT64 : GD_UINT64, data_out, return_type, n_read); free(tmpbuf); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoPhase: Read from a phase. Returns number of samples read. */ static size_t _GD_DoPhase(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { size_t n_read; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp + E->EN(phase,shift), num_samp, return_type, data_out); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoLinterp: Read from a linterp. Returns number of samples read. */ static size_t _GD_DoLinterp(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { size_t n_read = 0; double* data_in; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* allocate a temporary buffer */ data_in = _GD_Alloc(D, GD_FLOAT64, num_samp); if (D->error) { free(data_in); dreturn("%i", 0); return 0; } n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, GD_FLOAT64, data_in); if (D->error != GD_E_OK) { free(data_in); dreturn("%i", 0); return 0; } _GD_LinterpData(D, data_out, return_type, E->e->u.linterp.complex_table, data_in, n_read, E->e->u.linterp.lut, E->e->u.linterp.table_len); free(data_in); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoPolynom: Read from a polynom. Returns number of samples read. */ static size_t _GD_DoPolynom(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { size_t n_read; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* read the input field */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* Nothing to polynomise */ if (n_read == 0) { dreturn("%i", 0); return 0; } if (E->flags & GD_EN_COMPSCAL) _GD_CPolynomData(D, data_out, return_type, n_read, E->EN(polynom,poly_ord), E->EN(polynom,ca)); else _GD_PolynomData(D, data_out, return_type, n_read, E->EN(polynom,poly_ord), E->EN(polynom,a)); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoWindow: Read from a window. Returns number of samples read. */ static size_t _GD_DoWindow(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { void *tmpbuf = NULL; unsigned int spf1, spf2; size_t n_read, n_read2, num_samp2; off64_t first_samp2; gd_type_t type2; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); /* Check input fields */ if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* find the samples per frame of the input field */ spf1 = _GD_GetSPF(D, E->e->entry[0]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* read the input field and record the number of samples returned */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* Nothing to window */ if (n_read == 0) { dreturn("%i", 0); return 0; } /* find the samples per frame of the check field */ spf2 = _GD_GetSPF(D, E->e->entry[1]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* calculate the first sample and number of samples to read of the * check field */ num_samp2 = (int)ceil((double)n_read * spf2 / spf1); first_samp2 = first_samp * spf2 / spf1; switch(E->EN(window,windop)) { case GD_WINDOP_EQ: case GD_WINDOP_NE: type2 = GD_INT64; break; case GD_WINDOP_SET: case GD_WINDOP_CLR: type2 = GD_UINT64; break; default: type2 = GD_FLOAT64; break; } /* Allocate a temporary buffer for the check field */ tmpbuf = _GD_Alloc(D, type2, num_samp2); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } /* read the check field */ n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2, type2, tmpbuf); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2) n_read = n_read2 * spf1 / spf2; _GD_WindowData(D, data_out, spf1, tmpbuf, spf2, return_type, E->EN(window,windop), E->EN(window,threshold), n_read); free(tmpbuf); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoMplex: Read from an mplex. Returns number of samples read. */ static size_t _GD_DoMplex(DIRFILE *restrict D, gd_entry_t *restrict E, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { char start[16]; int *tmpbuf = NULL; unsigned int spf1, spf2; size_t n_read, n_read2, num_samp2; const size_t size = GD_SIZE(return_type); off64_t first_samp2; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first_samp, num_samp, return_type, data_out); /* Check input fields */ if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { dreturn("%i", 0); return 0; } /* find the samples per frame of the input field */ spf1 = _GD_GetSPF(D, E->e->entry[0]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* set the start value */ _GD_FillZero(start, return_type, 1); /* read the input field and record the number of samples returned */ n_read = _GD_DoField(D, E->e->entry[0], E->e->repr[0], first_samp, num_samp, return_type, data_out); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* Nothing to mplex */ if (n_read == 0) { dreturn("%i", 0); return 0; } /* find the samples per frame of the count field -- it's probably weird if * this isn't the same, but who am I to judge? (It's extra weird if it's * larger.) */ spf2 = _GD_GetSPF(D, E->e->entry[1]); if (D->error != GD_E_OK) { dreturn("%i", 0); return 0; } /* calculate the first sample and number of samples to read of the * count field */ num_samp2 = (int)ceil((double)n_read * spf2 / spf1); first_samp2 = first_samp * spf2 / spf1; /* Allocate a temporary buffer for the count field */ tmpbuf = _GD_Alloc(D, GD_INT_TYPE, num_samp2); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } /* read the count field */ n_read2 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], first_samp2, num_samp2, GD_INT_TYPE, tmpbuf); if (D->error != GD_E_OK) { free(tmpbuf); dreturn("%i", 0); return 0; } /* Check whether we've saved the last sample */ if (return_type == E->e->u.mplex.type && first_samp == E->e->u.mplex.sample) memcpy(start, E->e->u.mplex.d, size); /* Otherwise, check whether the caller was lucky/clever */ else if (tmpbuf[0] != E->EN(mplex,count_val) && D->lookback) { /* It wasn't -- do a look-back to find the start value. On a, say, gzipped * field this is expensive since it involves a rewind. Hmm... */ size_t lb_cycle = E->EN(mplex,period); off64_t chunk_start = first_samp2, lb_start, lb_sample = -1; /* if period is zero, use a period of GD_MPLEX_CYCLE or * 2 * count_val + 1, whichever is larger */ if (lb_cycle == 0) { lb_cycle = 2 * E->EN(mplex,count_val) + 1; if (lb_cycle < GD_MPLEX_CYCLE) lb_cycle = GD_MPLEX_CYCLE; } /* the first sample we're willing to consider */ lb_start = (D->lookback == GD_LOOKBACK_ALL) ? 0 : first_samp2 - D->lookback * lb_cycle; if (lb_start < 0) lb_start = 0; /* stop if we're at the start of the lookback or we found the value */ while (lb_sample == -1 && chunk_start > lb_start) { /* the size of the next chunk */ size_t i, n_read3, chunk_size = chunk_start - lb_start; int *tmpbuf2; if (chunk_size > GD_BUFFER_SIZE) chunk_size = GD_BUFFER_SIZE; /* the start of the next chunk */ chunk_start -= chunk_size; tmpbuf2 = _GD_Alloc(D, GD_INT_TYPE, chunk_size); if (D->error) { free(tmpbuf); dreturn("%i", 0); return 0; } n_read3 = _GD_DoField(D, E->e->entry[1], E->e->repr[1], chunk_start, chunk_size, GD_INT_TYPE, tmpbuf2); if (D->error) { free(tmpbuf2); free(tmpbuf); dreturn("%i", 0); return 0; } /* find the sample */ i = n_read3 - 1; do { if (tmpbuf2[i] == E->EN(mplex,count_val)) { lb_sample = chunk_start + i; break; } } while (i-- != 0); free(tmpbuf2); } /* read the value of the start, if found */ if (lb_sample >= 0) { _GD_DoField(D, E->e->entry[0], E->e->repr[0], lb_sample * spf1 / spf2, 1, return_type, start); if (D->error) { free(tmpbuf); dreturn("%i", 0); return 0; } } /* now go and put the I/O pointers back where they belong, sigh */ _GD_Seek(D, E->e->entry[0], first_samp + n_read, GD_SEEK_SET); _GD_Seek(D, E->e->entry[1], first_samp2 + n_read2, GD_SEEK_SET); } if (n_read2 > 0 && n_read2 * spf1 < n_read * spf2) n_read = n_read2 * spf1 / spf2; _GD_MplexData(D, data_out, spf1, tmpbuf, spf2, return_type, E->EN(mplex,count_val), start, n_read); /* Cache the last sample read */ if (n_read > 0) { E->e->u.mplex.type = return_type; E->e->u.mplex.sample = first_samp + n_read; memcpy(E->e->u.mplex.d, (char*)data_out + size * (n_read - 1), size); } free(tmpbuf); dreturn("%" PRNsize_t, n_read); return n_read; } /* _GD_DoConst: Read from a const. Returns number of samples read */ static size_t _GD_DoConst(DIRFILE *restrict D, const gd_entry_t *restrict E, off64_t first, size_t len, gd_type_t return_type, void *restrict data_out) { gd_type_t type; dtrace("%p, %p, %lli, %" PRNsize_t ", 0x%X, %p", D, E, (long long)first, len, return_type, data_out); type = _GD_ConstType(D, E->EN(scalar,const_type)); _GD_ConvertType(D, (char *)E->e->u.scalar.d + first * GD_SIZE(type), type, data_out, return_type, len); if (D->error) { /* bad input type */ dreturn("%i", 0); return 0; } dreturn("%zu", len); return len; } /* _GD_DoField: Locate the field in the database and read it. */ size_t _GD_DoField(DIRFILE *restrict D, gd_entry_t *restrict E, int repr, off64_t first_samp, size_t num_samp, gd_type_t return_type, void *restrict data_out) { size_t n_read = 0; gd_type_t ntype; void *true_data_out = data_out; const gd_type_t true_return_type = return_type; int out_of_place = 0; dtrace("%p, %p(%s), %i, %lli, %" PRNsize_t ", 0x%X, %p", D, E, E->field, repr, (long long)first_samp, num_samp, return_type, data_out); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%i", 0); return 0; } if (!(E->flags & GD_EN_CALC)) { _GD_CalculateEntry(D, E, 1); if (D->error) { D->recurse_level--; dreturn("%i", 0); return 0; } } /* calculate the native type */ ntype = _GD_NativeType(D, E, GD_REPR_NONE); if (D->error) { D->recurse_level--; dreturn("%i", 0); return 0; } if (first_samp == GD_HERE) { first_samp = _GD_GetFilePos(D, E, -1); if (D->error) { D->recurse_level--; dreturn("%i", 0); return 0; } } /* short circuit for purely real native types */ if (~ntype & GD_COMPLEX) { if (repr == GD_REPR_IMAG) { memset(data_out, 0, GD_SIZE(return_type) * num_samp); dreturn("%" PRNsize_t, num_samp); return num_samp; } else if (repr == GD_REPR_REAL) repr = GD_REPR_NONE; } /* if the native type is complex valued, but our return type is purely real, * we compute the field out-of-place, and then cast it to the return type * later, otherwise we just compute things in-place and don't worry too much * about accuracy */ if (ntype & GD_COMPLEX && ~return_type & GD_COMPLEX) { out_of_place = 1; return_type = GD_COMPLEX128; data_out = _GD_Alloc(D, GD_COMPLEX128, num_samp); if (repr == GD_REPR_NONE) repr = GD_REPR_AUTO; } switch (E->field_type) { case GD_RAW_ENTRY: n_read = _GD_DoRaw(D, E, first_samp, num_samp, return_type, data_out); break; case GD_LINTERP_ENTRY: n_read = _GD_DoLinterp(D, E, first_samp, num_samp, return_type, data_out); break; case GD_LINCOM_ENTRY: n_read = _GD_DoLincom(D, E, first_samp, num_samp, return_type, data_out); break; case GD_BIT_ENTRY: n_read = _GD_DoBit(D, E, 0, first_samp, num_samp, return_type, data_out); break; case GD_RECIP_ENTRY: n_read = _GD_DoRecip(D, E, first_samp, num_samp, return_type, data_out); break; case GD_DIVIDE_ENTRY: n_read = _GD_DoDivide(D, E, first_samp, num_samp, return_type, data_out); break; case GD_MULTIPLY_ENTRY: n_read = _GD_DoMultiply(D, E, first_samp, num_samp, return_type, data_out); break; case GD_PHASE_ENTRY: n_read = _GD_DoPhase(D, E, first_samp, num_samp, return_type, data_out); break; case GD_INDEX_ENTRY: /* if Asking for "INDEX", just return it */ _GD_FillFileFrame(data_out, return_type, first_samp, n_read = num_samp); break; case GD_POLYNOM_ENTRY: n_read = _GD_DoPolynom(D, E, first_samp, num_samp, return_type, data_out); break; case GD_SBIT_ENTRY: n_read = _GD_DoBit(D, E, 1, first_samp, num_samp, return_type, data_out); break; case GD_WINDOW_ENTRY: n_read = _GD_DoWindow(D, E, first_samp, num_samp, return_type, data_out); break; case GD_MPLEX_ENTRY: n_read = _GD_DoMplex(D, E, first_samp, num_samp, return_type, data_out); break; case GD_CONST_ENTRY: case GD_CARRAY_ENTRY: n_read = _GD_DoConst(D, E, first_samp, num_samp, return_type, data_out); break; case GD_STRING_ENTRY: case GD_ALIAS_ENTRY: case GD_NO_ENTRY: /* Can't get here */ _GD_InternalError(D); n_read = 0; } /* extract the requested representation */ if (!D->error && repr != GD_REPR_NONE) _GD_ExtractRepr(D, data_out, return_type, true_data_out, true_return_type, n_read, repr); if (out_of_place) free(data_out); D->recurse_level--; dreturn("%" PRNsize_t, n_read); return n_read; } /* this function is little more than a public boilerplate for _GD_DoField */ size_t gd_getdata64(DIRFILE* D, const char *field_code_in, off64_t first_frame, off64_t first_samp, size_t num_frames, size_t num_samp, gd_type_t return_type, void *data_out) { size_t n_read = 0; gd_entry_t* entry; char* field_code; int repr; unsigned int spf; dtrace("%p, \"%s\", %lli, %lli, %" PRNsize_t ", %" PRNsize_t ", 0x%X, %p", D, field_code_in, (long long)first_frame, (long long)first_samp, num_frames, num_samp, return_type, data_out); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } _GD_ClearError(D); entry = _GD_FindFieldAndRepr(D, field_code_in, &field_code, &repr, NULL, 1, 1); if (D->error) { dreturn("%i", 0); return 0; } if (entry->field_type & GD_SCALAR_ENTRY_BIT) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code); if (field_code != field_code_in) free(field_code); if (D->error) { dreturn("%i", 0); return 0; } if (first_frame == GD_HERE || first_samp == GD_HERE) { first_samp = GD_HERE; first_frame = 0; } if (first_frame > 0 || num_frames > 0) { /* get the samples per frame */ spf = _GD_GetSPF(D, entry); if (D->error) { dreturn("%i", 0); return 0; } first_samp += spf * first_frame; num_samp += spf * num_frames; } if (first_samp < 0 && (first_samp != GD_HERE || first_frame != 0)) { _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL); dreturn("%i", 0); return 0; } n_read = _GD_DoField(D, entry, repr, first_samp, num_samp, return_type, data_out); dreturn("%" PRNsize_t, n_read); return n_read; } /* 32(ish)-bit wrapper for the 64-bit version, when needed */ size_t gd_getdata(DIRFILE* D, const char *field_code, off_t first_frame, off_t first_samp, size_t num_frames, size_t num_samp, gd_type_t return_type, void *data_out) { return gd_getdata64(D, field_code, first_frame, first_samp, num_frames, num_samp, return_type, data_out); } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/gzip.c0000640000175000017500000001276712614323564015725 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" #ifdef HAVE_ZLIB_H #include #endif #ifdef HAVE_GZSEEK64 #define gd_gzseek gzseek64 #else #define gd_gzseek gzseek #endif #ifdef HAVE_GZTELL64 #define gd_gztell gztell64 #else #define gd_gztell gztell #endif /* The gzip encoding scheme uses edata as a gzFile object. If a file is * open, idata >= 0 otherwise idata = -1. Writes occur out-of-place. */ int _GD_GzipOpen(int fd, struct gd_raw_file_* file, gd_type_t data_type gd_unused_, int swap gd_unused_, unsigned int mode) { const char *gzmode = "w"; dtrace("%i, %p, , , 0x%X", fd, file, mode); if (mode & GD_FILE_READ) { file->idata = gd_OpenAt(file->D, fd, file->name, O_RDONLY | O_BINARY, 0666); gzmode = "r"; } else if (mode & GD_FILE_TEMP) { file->idata = _GD_MakeTempFile(file->D, fd, file->name); } else { /* internal error */ dreturn("%i", 1); errno = EINVAL; /* I guess ... ? */ return 1; } if (file->idata == -1) { dreturn("%i", 1); return 1; } file->edata = gzdopen(file->idata, gzmode); if (file->edata == NULL) { close(file->idata); file->idata = -1; dreturn("%i", 1); return 1; } file->mode = mode; file->pos = 0; dreturn("%i", 0); return 0; } off64_t _GD_GzipSeek(struct gd_raw_file_* file, off64_t count, gd_type_t data_type, unsigned int mode) { off64_t n = 0; dtrace("%p, %lli, 0x%X, 0x%X", file, (long long)count, data_type, mode); if (file->pos == count) { dreturn("%lli", (long long)count); return count; } count *= GD_SIZE(data_type); if (count >= 0) { n = gd_gzseek((gzFile)file[(mode == GD_FILE_WRITE) ? 1 : 0].edata, count, SEEK_SET); if (n == -1) { /* gzseek returns error on attempts to seek past the EOF in read mode */ if (mode != GD_FILE_WRITE && gzeof((gzFile)file[0].edata)) n = gd_gztell((gzFile)file[0].edata); else { dreturn("%i", -1); return -1; } } n /= GD_SIZE(data_type); file->pos = n; } dreturn("%lli", (long long)n); return n; } ssize_t _GD_GzipRead(struct gd_raw_file_ *file, void *ptr, gd_type_t data_type, size_t nmemb) { ssize_t n; int errnum; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); n = gzread((gzFile)file->edata, ptr, GD_SIZE(data_type) * nmemb); if (n >= 0) { n /= GD_SIZE(data_type); file->pos += n; } else { gzerror((gzFile)file->edata, &errnum); if (errnum < 0) n = -1; } dreturn("%" PRNsize_t, n); return n; } ssize_t _GD_GzipWrite(struct gd_raw_file_ *file, const void *ptr, gd_type_t data_type, size_t nmemb) { ssize_t n; int errnum; dtrace("%p, %p, 0x%X, %" PRNsize_t, file, ptr, data_type, nmemb); n = gzwrite((gzFile)file->edata, ptr, GD_SIZE(data_type) * nmemb); if (n >= 0) { n /= GD_SIZE(data_type); file->pos += n; } else { gzerror((gzFile)file[1].edata, &errnum); if (errnum < 0) n = -1; } dreturn("%" PRNssize_t, n); return n; } /* Because calling gzflush can result in degredation of compression, we avoid * doing anything here */ int _GD_GzipSync(struct gd_raw_file_ *file gd_unused_) { dtrace(""); dreturn("%i", 0); return 0; } int _GD_GzipClose(struct gd_raw_file_ *file) { int ret; dtrace("%p", file); ret = gzclose((gzFile)file->edata); if (ret) { dreturn("%i", ret); return ret; } file->idata = -1; file->edata = NULL; file->mode = 0; dreturn("%i", 0); return 0; } off64_t _GD_GzipSize(int dirfd, struct gd_raw_file_ *file, gd_type_t data_type, int swap gd_unused_) { int fd; uint32_t size = 0; dtrace("%i, %p, 0x%X, ", dirfd, file, data_type); fd = gd_OpenAt(file->D, dirfd, file->name, O_RDONLY | O_BINARY, 0666); if (fd < 0) { dreturn("%i", -1); return -1; } /* seek to the end */ if (lseek64(fd, -4, SEEK_END) == -1) { dreturn("%i", -1); return -1; } if (read(fd, &size, 4) < 4) { dreturn("%i", -1); return -1; } /* the checksum size is stored little endian */ #ifdef WORDS_BIGENDIAN size = (size << 24) | ((size << 8) & 0x00ff0000) | (size >> 24) | ((size >> 8) & 0x0000ff00); #endif close(fd); size /= GD_SIZE(data_type); dreturn("%lli", (long long)size); return size; } int _GD_GzipStrerr(const struct gd_raw_file_ *file, char *buf, size_t buflen) { int r = 0; int gzerrnum = 0; const char *gzerr; dtrace("%p, %p, %" PRNsize_t, file, buf, buflen); gzerr = gzerror((gzFile)file->edata, &gzerrnum); if (gzerrnum == Z_ERRNO) r = gd_strerror(errno, buf, buflen); else { strncpy(buf, gzerr, buflen); buf[buflen - 1] = 0; } dreturn("%i", r); return r; } libgetdata-0.9.0/src/move.c0000640000175000017500000003342712614323564015716 0ustar alastairalastair/* Copyright (C) 2008-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" int _GD_MogrifyFile(DIRFILE* D, gd_entry_t* E, unsigned long encoding, unsigned long byte_sex, off64_t offset, int finalise, int new_fragment, char* new_filebase) { const struct encoding_t* enc_in; const struct encoding_t* enc_out; const size_t ns = GD_BUFFER_SIZE / E->e->u.raw.size; ssize_t nread, nwrote; int subencoding = GD_ENC_UNKNOWN; int i, ef_swap; int arm_fix = 0, endian_fix = 0; void *buffer; dtrace("%p, %p, %lu, %lu, %lli, %i, %i, %p", D, E, encoding, byte_sex, (long long)offset, finalise, new_fragment, new_filebase); if (new_fragment == -1) new_fragment = E->fragment_index; if (new_filebase == NULL) { new_filebase = _GD_Strdup(D, E->e->u.raw.filebase); if (new_filebase == NULL) { dreturn("%i", -1); return -1; } } offset -= D->fragment[E->fragment_index].frame_offset; /* Figure out the new subencoding scheme */ if (encoding == D->fragment[E->fragment_index].encoding && E->e->u.raw.file[0].subenc != GD_ENC_UNKNOWN) { subencoding = E->e->u.raw.file[0].subenc; } else for (i = 0; _GD_ef[i].scheme != GD_ENC_UNSUPPORTED; i++) { if (_GD_ef[i].scheme == encoding) { subencoding = i; break; } } if (subencoding == GD_ENC_UNKNOWN) { _GD_SetError(D, GD_E_UNKNOWN_ENCODING, GD_E_UNENC_TARGET, NULL, 0, NULL); free(new_filebase); dreturn("%i", -1); return -1; } enc_out = _GD_ef + subencoding; /* Check output encoding */ if (_GD_MissingFramework(subencoding, GD_EF_CLOSE | GD_EF_SEEK | GD_EF_WRITE | GD_EF_SYNC)) { _GD_SetError(D, GD_E_UNSUPPORTED, 0, NULL, 0, NULL); free(new_filebase); dreturn("%i", -1); return -1; } /* input encoding check */ if (!_GD_Supports(D, E, GD_EF_NAME | GD_EF_OPEN | GD_EF_CLOSE | GD_EF_SEEK | GD_EF_READ | GD_EF_UNLINK)) { free(new_filebase); dreturn("%i", -1); return -1; } enc_in = _GD_ef + E->e->u.raw.file[0].subenc; /* if neither encoding scheme does internal byte swapping, and the data * type can't be endianness swapped, sex differences can't matter */ if (GD_SIZE(E->e->u.raw.size) != 1 || (enc_in->flags & GD_EF_SWAP) || (enc_out->flags & GD_EF_SWAP)) { /* figure out whether endianness correction is required */ if ((enc_in->flags & GD_EF_ECOR) || (enc_in->flags & GD_EF_ECOR)) { unsigned in_sex = D->fragment[E->fragment_index].byte_sex; unsigned out_sex = byte_sex; /* fix endian flags for encoding behaviour */ if (!(enc_in->flags & (GD_EF_SWAP | GD_EF_ECOR))) { in_sex = (in_sex & ~(GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) | (out_sex & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)); if (!(enc_in->flags & GD_EF_ECOR)) in_sex = (in_sex & ~GD_ARM_FLAG) | (out_sex & GD_ARM_FLAG); } if (!(enc_out->flags & (GD_EF_SWAP | GD_EF_ECOR))) { out_sex = (out_sex & ~(GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)) | (in_sex & (GD_LITTLE_ENDIAN | GD_BIG_ENDIAN)); if (!(enc_out->flags & GD_EF_ECOR)) out_sex = (out_sex & ~GD_ARM_FLAG) | (in_sex | GD_ARM_FLAG); } endian_fix = _GD_CheckByteSex(E->EN(raw,data_type), in_sex, out_sex, 0, &arm_fix); } } /* If all that's changing is the byte sex, but we don't need to do * endianness conversion, don't do anything */ if (offset == 0 && encoding == D->fragment[E->fragment_index].encoding && !endian_fix && !arm_fix && strcmp(new_filebase, E->e->u.raw.filebase) == 0 && D->fragment[new_fragment].dirfd == D->fragment[E->fragment_index].dirfd) { free(new_filebase); dreturn("%i", 0); return 0; } /* check data protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_DATA || D->fragment[new_fragment].protection & GD_PROTECT_DATA) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_DATA, NULL, 0, D->fragment[E->fragment_index].cname); free(new_filebase); dreturn("%i", -1); return -1; } /* Open the input file, if necessary */ if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_READ, _GD_FileSwapBytes(D, E))) { free(new_filebase); dreturn("%i", -1); return -1; } /* set ef_swap, the output encoding in-framework endian correction flag */ ef_swap = _GD_CheckByteSex(E->EN(raw,data_type), byte_sex, 0, 0, NULL); /* Create the output file and open it. If we're changing encodings, we * could write to the new file directly. However, we use a temporary file * anyway just to keep things clean. */ E->e->u.raw.file[1].subenc = subencoding; if (_GD_InitRawIO(D, E, new_filebase, new_fragment, enc_out, 0, GD_FILE_WRITE | GD_FILE_TEMP, ef_swap)) { free(new_filebase); dreturn("%i", -1); return -1; } /* Adjust for the change in offset */ if (offset < 0) { /* new offset is less, pad new file */ if ((*enc_in->seek)(E->e->u.raw.file, 0, E->EN(raw,data_type), GD_FILE_WRITE) == -1) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0); } else _GD_DoSeek(D, E, enc_out, -offset * E->EN(raw,spf), GD_FILE_WRITE | GD_FILE_TEMP); } else { /* new offset is more, truncate old file */ if ((*enc_in->seek)(E->e->u.raw.file, offset * E->EN(raw,spf), E->EN(raw,data_type), GD_FILE_READ) == -1) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 0); } else _GD_DoSeek(D, E, enc_out, 0, GD_FILE_WRITE | GD_FILE_TEMP); } if (D->error) { free(new_filebase); dreturn("%i", -1); return -1; } if ((buffer = _GD_Malloc(D, GD_BUFFER_SIZE)) == NULL) { free(new_filebase); dreturn("%i", -1); return -1; } /* Now copy the old file to the new file */ for (;;) { nread = (*enc_in->read)(E->e->u.raw.file, buffer, E->EN(raw,data_type), ns); if (nread < 0) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); break; } if (nread == 0) break; /* swap endianness, if required */ _GD_FixEndianness(buffer, nread, E->EN(raw,data_type), D->fragment[E->fragment_index].byte_sex, byte_sex); nwrote = _GD_WriteOut(E, enc_out, buffer, E->EN(raw,data_type), nread, 1); if (nwrote < nread) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 1); break; } } free(buffer); if (finalise) { /* Finalise the conversion: on error delete the temporary file, otherwise * copy it over top of the new one. */ if (D->error) { /* An error occurred, delete the temporary file (the old * file can stay open) */ _GD_FiniRawIO(D, E, new_fragment, GD_FINIRAW_CLOTEMP | GD_FINIRAW_DISCARD); } else { struct gd_raw_file_ temp; memcpy(&temp, E->e->u.raw.file, sizeof(temp)); /* discard the old file */ _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DISCARD); E->e->u.raw.file[0].name = NULL; E->e->u.raw.file[0].subenc = subencoding; if ((*_GD_ef[E->e->u.raw.file[0].subenc].name)(D, (const char*)D->fragment[E->fragment_index].enc_data, E->e->u.raw.file, new_filebase, 0, 0)) { E->e->u.raw.file[0].name = temp.name; E->e->u.raw.file[0].subenc = temp.subenc; } else if (_GD_FiniRawIO(D, E, new_fragment, GD_FINIRAW_KEEP | GD_FINIRAW_CLOTEMP)) { E->e->u.raw.file[0].name = temp.name; E->e->u.raw.file[0].subenc = temp.subenc; } else if ((subencoding != temp.subenc || strcmp(E->e->u.raw.filebase, new_filebase) || D->fragment[new_fragment].dirfd != D->fragment[E->fragment_index].dirfd) && (*enc_in->unlink)( D->fragment[E->fragment_index].dirfd, &temp)) { _GD_SetError(D, GD_E_IO, GD_E_IO_UNLINK, temp.name, 0, NULL); E->e->u.raw.file[0].name = temp.name; E->e->u.raw.file[0].subenc = temp.subenc; } else { free(temp.name); free(E->e->u.raw.filebase); E->e->u.raw.filebase = new_filebase; } } } else { free(new_filebase); /* Close both files */ _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_DEFER); _GD_FiniRawIO(D, E, new_fragment, GD_FINIRAW_DEFER | GD_FINIRAW_CLOTEMP); } if (D->error) { dreturn("%i", -1); return -1; } dreturn("%i", 0); return 0; } int _GD_StrCmpNull(const char *s1, const char *s2) { int r; dtrace("%p, %p", s1, s2); if (s1 == NULL && s2 == NULL) { dreturn("%i", 0); return 0; } if (s1 == NULL) { dreturn("%i", -1); return -1; } if (s2 == NULL) { dreturn("%i", 1); return 1; } r = strcmp(s1, s2); dreturn("%i", r); return r; } int _GD_Move(DIRFILE *D, gd_entry_t *E, int new_fragment, unsigned flags) { char *new_filebase, *new_code; struct gd_rename_data_ *rdat = NULL; int i; dtrace("%p, %p, %i, 0x%X", D, E, new_fragment, flags); /* check access mode */ if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } /* check metadata protection */ if (D->fragment[E->fragment_index].protection & GD_PROTECT_FORMAT || D->fragment[new_fragment].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[E->fragment_index].cname); dreturn("%i", -1); return -1; } /* Compose the field's new name */ /* remove the old affixes */ new_filebase = _GD_MungeCode(D, NULL, 0, D->fragment[E->fragment_index].prefix, D->fragment[E->fragment_index].suffix, NULL, NULL, E->field, NULL, NULL, GD_MC_RQ_PARTS); if (!new_filebase) { _GD_InternalError(D); /* the prefix/suffix wasn't found */ dreturn("%i", -1); return -1; } /* add the new affixes */ new_code = _GD_MungeCode(D, NULL, 0, NULL, NULL, D->fragment[new_fragment].prefix, D->fragment[new_fragment].suffix, new_filebase, NULL, NULL, GD_MC_RQ_PARTS); if (strcmp(new_code, E->field)) { /* duplicate check */ if (_GD_FindField(D, new_code, D->entry, D->n_entries, 1, NULL)) { _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, new_code); free(new_filebase); free(new_code); dreturn("%i", -1); return -1; } /* moving a field can't add or remove a field from the dot list, so * we just set both old_dot and new_dot to one to ensure that the * dot_list is resorted, if necessary */ rdat = _GD_PrepareRename(D, new_code, E, 1, 0, 1, flags); if (rdat == NULL) { free(new_filebase); free(new_code); dreturn("%i", -1); return -1; } } else { free(new_code); new_code = NULL; } if ((flags & GD_REN_DATA) && E->field_type == GD_RAW_ENTRY && (D->fragment[E->fragment_index].encoding != D->fragment[new_fragment].encoding || D->fragment[E->fragment_index].byte_sex != D->fragment[new_fragment].byte_sex || D->fragment[E->fragment_index].frame_offset != D->fragment[new_fragment].frame_offset || _GD_StrCmpNull(D->fragment[E->fragment_index].sname, D->fragment[new_fragment].sname))) { if (_GD_MogrifyFile(D, E, D->fragment[new_fragment].encoding, D->fragment[new_fragment].byte_sex, D->fragment[new_fragment].frame_offset, 1, new_fragment, new_filebase)) { _GD_CleanUpRename(rdat, 1); free(new_code); dreturn("%i", -1); return -1; } } else free(new_filebase); /* nothing from now on may fail */ D->fragment[E->fragment_index].modified = 1; D->fragment[new_fragment].modified = 1; D->flags &= ~GD_HAVE_VERSION; E->fragment_index = new_fragment; /* update metadata */ for (i = 0; i < E->e->n_meta; ++i) E->e->p.meta_entry[i]->fragment_index = new_fragment; _GD_PerformRename(D, rdat); if (new_code) { /* resort */ qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp); qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp); } dreturn("%i", 0); return 0; } int gd_move(DIRFILE *D, const char *field_code, int new_fragment, unsigned flags) { gd_entry_t *E; int ret; dtrace("%p, \"%s\", %i, 0x%X", D, field_code, new_fragment, flags); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } _GD_ClearError(D); E = _GD_FindField(D, field_code, D->entry, D->n_entries, 0, NULL); if (E == NULL) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_MISSING, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (E->field_type == GD_INDEX_ENTRY) { _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, "INDEX"); dreturn("%i", -1); return -1; } if (new_fragment < 0 || new_fragment >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, new_fragment, NULL); dreturn("%i", -1); return -1; } else if (E->fragment_index == new_fragment) { dreturn("%i", 0); return 0; } ret = _GD_Move(D, E, new_fragment, flags); dreturn("%i", ret); return ret; } libgetdata-0.9.0/src/fragment.c0000640000175000017500000002541312614323564016547 0ustar alastairalastair/* Copyright (C) 2008, 2010, 2011, 2012, 2014, 2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" const char *gd_fragmentname(DIRFILE* D, int index) gd_nothrow { dtrace("%p, %i", D, index); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } if (index < 0 || index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%p", NULL); return NULL; } dreturn("\"%s\"", D->fragment[index].cname); return D->fragment[index].cname; } int gd_fragment_affixes(DIRFILE *D, int index, char **prefix, char **suffix) gd_nothrow { char *p = NULL, *s = NULL; dtrace("%p, %i, %p, %p", D, index, prefix, suffix); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (index < 0 || index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (D->fragment[index].prefix) p = _GD_Strdup(D, D->fragment[index].prefix); if (D->fragment[index].suffix) s = _GD_Strdup(D, D->fragment[index].suffix); if (D->error) { free(p); free(s); dreturn("%i", -1); return -1; } *prefix = p; *suffix = s; dreturn("%i", 0); return 0; } static char **_GD_CheckAffixes(DIRFILE *D, int i, const char *prefix, const char *suffix, char **codes, unsigned *n) { int j; unsigned u, nn = *n; char **new_codes = codes, **ptr; dtrace("%p, %i, \"%s\", \"%s\", %p, %p", D, i, prefix, suffix, new_codes, n); ptr = _GD_Realloc(D, codes, sizeof(*ptr) * (nn + 2)); if (!ptr) { dreturn("%p (%i)", codes, *n); return codes; } new_codes = ptr; /* push the new prefix and suffix onto the code stack */ new_codes[nn++] = prefix ? _GD_Strdup(D, prefix) : NULL; new_codes[nn++] = suffix ? _GD_Strdup(D, suffix) : NULL; *n = nn; if (D->error) { dreturn("%p (%i)", new_codes, *n); return new_codes; } /* Propagate changes downward */ for (j = 0; j < D->n_fragment; ++j) if (D->fragment[j].parent == i) { char *subprefix = _GD_MungeCode(D, NULL, 0, D->fragment[i].prefix, NULL, prefix, NULL, D->fragment[j].prefix, NULL, NULL, GD_MC_RQ_PARTS | GD_MC_ERROR_OK); char *subsuffix = _GD_MungeCode(D, NULL, 0, NULL, D->fragment[i].suffix, NULL, suffix, D->fragment[j].suffix, NULL, NULL, GD_MC_RQ_PARTS | GD_MC_ERROR_OK); if (D->error) { free(subprefix); dreturn("%p (%i)", new_codes, *n); return new_codes; } new_codes = _GD_CheckAffixes(D, j, subprefix, subsuffix, new_codes, n); free(subprefix); free(subsuffix); nn = *n; if (D->error) { dreturn("%p (%i)", new_codes, *n); return new_codes; } } /* Check for namespace clashes in our files */ for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) { ptr = _GD_Realloc(D, new_codes, sizeof(*ptr) * ++nn); if (ptr) { char *nso; new_codes = ptr; /* remunge the code */ new_codes[nn - 1] = _GD_MungeCode(D, NULL, 0, D->fragment[i].prefix, D->fragment[i].suffix, prefix, suffix, D->entry[u]->field, &nso, NULL, GD_MC_RQ_PARTS); /* look for a duplicate and validate */ if (new_codes[nn - 1] && _GD_FindField(D, new_codes[nn - 1], D->entry, D->n_entries, 0, NULL)) { _GD_SetError(D, GD_E_DUPLICATE, 0, NULL, 0, new_codes[nn - 1]); } else if (_GD_ValidateField(nso, D->standards, 1, GD_VF_NAME, NULL)) { _GD_SetError(D, GD_E_BAD_CODE, GD_E_CODE_INVALID, NULL, 0, new_codes[nn - 1]); } } else nn--; if (D->error) break; } *n = nn; dreturn("%p (%i)", new_codes, *n); return new_codes; } static int _GD_ChangeAffixes(DIRFILE *D, int i, char **codes, int *resort) { int j; unsigned u, n = 2; dtrace("%p, %i, %p, %p", D, i, codes, resort); free(D->fragment[i].prefix); free(D->fragment[i].suffix); D->fragment[i].prefix = codes[0]; D->fragment[i].suffix = codes[1]; /* Propagate changes downward */ for (j = 0; j < D->n_fragment; ++j) if (D->fragment[j].parent == i) n += _GD_ChangeAffixes(D, j, codes + n, resort); /* rename all the fields */ for (u = 0; u < D->n_entries; ++u) if (D->entry[u]->fragment_index == i && D->entry[u]->e->n_meta != -1) { *resort = 1; free(D->entry[u]->field); D->entry[u]->field = codes[n++]; } dreturn("%i", n); return n; } int gd_alter_affixes(DIRFILE *D, int index, const char *prefix, const char *suffix) gd_nothrow { unsigned u, n = 0; char **new_codes; int resort = 0; dtrace("%p, %i, \"%s\", \"%s\"", D, index, prefix, suffix); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (index <= 0 || index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if ((D->flags & GD_ACCMODE) == GD_RDONLY) { _GD_SetError(D, GD_E_ACCMODE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (D->fragment[D->fragment[index].parent].protection & GD_PROTECT_FORMAT) { _GD_SetError(D, GD_E_PROTECTED, GD_E_PROTECTED_FORMAT, NULL, 0, D->fragment[D->fragment[index].parent].cname); dreturn("%i", -1); return -1; } /* affixes to keep */ if (!prefix) prefix = D->fragment[index].prefix; if (!suffix) suffix = D->fragment[index].suffix; /* nothing to do */ if (strcmp(prefix, D->fragment[index].prefix) == 0 && strcmp(suffix, D->fragment[index].suffix) == 0) { dreturn("%i", 0); return 0; } new_codes = _GD_CheckAffixes(D, index, prefix, suffix, NULL, &n); if (D->error) { for (u = 0; u < n; ++u) free(new_codes[u]); free(new_codes); dreturn("%i", -1); return -1; } _GD_ChangeAffixes(D, index, new_codes, &resort); free(new_codes); if (resort) { /* resort */ qsort(D->entry, D->n_entries, sizeof(gd_entry_t*), _GD_EntryCmp); qsort(D->dot_list, D->n_dot, sizeof(gd_entry_t*), _GD_EntryCmp); } dreturn("%i", 0); return 0; } int gd_nfragments(DIRFILE* D) gd_nothrow { dtrace("%p", D); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } dreturn("%i", D->n_fragment); return D->n_fragment; } int gd_parent_fragment(DIRFILE* D, int fragment_index) gd_nothrow { dtrace("%p, %i", D, fragment_index); _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } if (fragment_index <= 0 || fragment_index >= D->n_fragment) { _GD_SetError(D, GD_E_BAD_INDEX, 0, NULL, 0, NULL); dreturn("%i", -1); return -1; } dreturn("%i", D->fragment[fragment_index].parent); return D->fragment[fragment_index].parent; } /* returns non-zero if the metadata has changed on disk since the dirfile was * opened and, optionally, re-opens the dirfile. */ int gd_desync(DIRFILE *D, unsigned int flags) { int changed = 0, i; struct stat statbuf; dtrace("%p, 0x%x", D, flags); /* if we can't open directories, we're stuck with the full path method */ #ifdef GD_NO_DIR_OPEN flags |= GD_DESYNC_PATHCHECK; #endif _GD_ClearError(D); if (D->flags & GD_INVALID) { _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%i", 0); return 0; } for (i = 0; i < D->n_fragment; ++i) { if (flags & GD_DESYNC_PATHCHECK) { /* stat the file via it's path relative to the original filedir */ char *buffer; if (D->fragment[i].sname) { buffer = _GD_Malloc(D, strlen(D->name) + strlen(D->fragment[i].bname) + strlen(D->fragment[i].sname) + 3); if (buffer == NULL) { dreturn("%i", -1); return -1; } sprintf(buffer, "%s%c%s%c%s", D->name, GD_DIRSEP, D->fragment[i].sname, GD_DIRSEP, D->fragment[i].bname); } else { buffer = _GD_Malloc(D, strlen(D->name) + strlen(D->fragment[i].bname) + 2); if (buffer == NULL) { dreturn("%i", -1); return -1; } sprintf(buffer, "%s%c%s", D->name, GD_DIRSEP, D->fragment[i].bname); } if (stat(buffer, &statbuf)) { _GD_SetError(D, GD_E_IO, 0, buffer, 0, NULL); free(buffer); dreturn("%i", -1); return -1; } free(buffer); } else /* stat the file based on it's name and our cached dirfd */ if (gd_StatAt(D, D->fragment[i].dirfd, D->fragment[i].bname, &statbuf, 0)) { _GD_SetError(D, GD_E_IO, 0, D->fragment[i].cname, 0, NULL); dreturn("%i", -1); return -1; } if (statbuf.st_mtime != D->fragment[i].mtime) { changed = 1; break; } } if (changed && flags & GD_DESYNC_REOPEN) { /* reopening is easy: just delete everything and start again. In the * non-PATHCHECK case, we also have to cache the dirfd to the root directory */ /* remember how we were called */ char *name = D->name; gd_parser_callback_t sehandler = D->sehandler; void *extra = D->sehandler_extra; unsigned long int flags = D->open_flags; int dirfd = -1; if (!(flags & GD_DESYNC_PATHCHECK)) { dirfd = dup(D->fragment[0].dirfd); if (dirfd == -1) { _GD_SetError(D, GD_E_IO, GD_E_OPEN, D->name, 0, NULL); dreturn("%i", -1); return -1; } } D->name = NULL; /* so FreeD doesn't delete it */ if (_GD_ShutdownDirfile(D, 0, 1)) { D->name = name; dreturn("%i", -1); return -1; } _GD_Open(D, dirfd, name, flags, sehandler, extra); free(name); if (D->error) changed = -1; } dreturn("%i", changed); return changed; } libgetdata-0.9.0/src/fpos.c0000640000175000017500000002576012614323564015720 0ustar alastairalastair/* Copyright (C) 2011-2015 D. V. Wiebe * *************************************************************************** * * This file is part of the GetData project. * * GetData 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. * * GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "internal.h" off64_t _GD_GetFilePos(DIRFILE *D, gd_entry_t *E, off64_t index_pos) { int i; off64_t pos = -1, pos2; dtrace("%p, %p, %lli", D, E, (long long)index_pos); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); dreturn("%u", 0); D->recurse_level--; return 0; } switch (E->field_type) { case GD_RAW_ENTRY: /* We must open the file to know its starting offset */ if (E->e->u.raw.file[0].idata < 0) if (_GD_InitRawIO(D, E, NULL, -1, NULL, 0, GD_FILE_READ, _GD_FileSwapBytes(D, E))) { break; } pos = E->e->u.raw.file[0].pos + E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset; break; case GD_LINCOM_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; pos = _GD_GetFilePos(D, E->e->entry[0], -1); if (!D->error) for (i = 1; i < E->EN(lincom,n_fields); ++i) { if (_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) { pos = -1; break; } pos2 = _GD_GetFilePos(D, E->e->entry[i], pos); if (pos2 != pos) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_MULTIPOS, NULL, 0, NULL); pos = -1; break; } } break; case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; pos = _GD_GetFilePos(D, E->e->entry[0], -1); break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1) || _GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) { break; } pos = _GD_GetFilePos(D, E->e->entry[0], -1); if (D->error) break; pos2 = _GD_GetFilePos(D, E->e->entry[1], pos); if (!D->error && pos != pos2) { _GD_SetError(D, GD_E_DOMAIN, GD_E_DOMAIN_MULTIPOS, NULL, 0, NULL); pos = -1; } break; case GD_PHASE_ENTRY: if (_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) break; pos = _GD_GetFilePos(D, E->e->entry[0], -1); if (pos >= 0) pos += E->EN(phase,shift); break; case GD_INDEX_ENTRY: if (index_pos == -1) pos = E->e->u.index_pos; else pos = index_pos; break; case GD_NO_ENTRY: case GD_CONST_ENTRY: case GD_STRING_ENTRY: case GD_CARRAY_ENTRY: case GD_ALIAS_ENTRY: _GD_InternalError(D); } D->recurse_level--; dreturn("%lli", (long long)pos); return pos; } /* Get the current I/O position of the given field */ off64_t gd_tell64(DIRFILE *D, const char *field_code) gd_nothrow { off64_t pos = -1; gd_entry_t* entry; dtrace("%p, \"%s\"", D, field_code); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%u", 0); return 0; } _GD_ClearError(D); entry = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%u", 0); return 0; } if (entry->field_type & GD_SCALAR_ENTRY_BIT) _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code); else pos = _GD_GetFilePos(D, entry, -1); dreturn("%lli", (long long)pos); return pos; } off_t gd_tell(DIRFILE *D, const char *field_code) gd_nothrow { return (off_t)gd_tell64(D, field_code); } off64_t _GD_DoSeek(DIRFILE *D, gd_entry_t *E, const struct encoding_t *enc, off64_t offset, unsigned int mode) { off64_t pos; const int which = (mode & GD_FILE_TEMP) ? 1 : 0; const int oop_write = ((enc->flags & GD_EF_OOP) && (mode & GD_FILE_WRITE)) ? 1 : 0; dtrace("%p, %p, %p, %lli, 0x%X", D, E, enc, (long long)offset, mode); if (oop_write) { /* in this case we need to close and then re-open the file */ if (offset < E->e->u.raw.file[which].pos) { if (_GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP)) { dreturn("%i", -1); return -1; } else if (_GD_InitRawIO(D, E, NULL, -1, NULL, GD_EF_SEEK, GD_FILE_WRITE, _GD_FileSwapBytes(D, E))) { dreturn("%i", -1); return -1; } } if (E->e->u.raw.file[0].idata >= 0) { /* read from the old file until we reach the point we're interested in or * run out of data */ char *buffer, *ptr; ssize_t n_read, n_wrote; const off64_t chunk_size = GD_BUFFER_SIZE / GD_SIZE(E->EN(raw,data_type)); off64_t count, remaining = offset - E->e->u.raw.file[which].pos; buffer = _GD_Malloc(D, GD_BUFFER_SIZE); if (buffer == NULL) { dreturn("%i", -1); return -1; } while (remaining > 0) { if (remaining > chunk_size) count = chunk_size; else count = remaining; n_read = (*enc->read)(E->e->u.raw.file, buffer, E->EN(raw,data_type), count); if (n_read < 0) { _GD_SetEncIOError(D, GD_E_IO_READ, E->e->u.raw.file + 0); free(buffer); dreturn("%i", -1); return -1; } else if (n_read == 0) /* EOF */ break; ptr = buffer; while (n_read > 0) { n_wrote = (*enc->write)(E->e->u.raw.file + 1, ptr, E->EN(raw,data_type), n_read); if (n_wrote < 0) { _GD_SetEncIOError(D, GD_E_IO_WRITE, E->e->u.raw.file + 1); free(buffer); dreturn("%i", -1); return -1; } remaining -= n_wrote; n_read -= n_wrote; ptr += n_wrote; } } free(buffer); } } pos = (*enc->seek)(E->e->u.raw.file + which, offset, E->EN(raw,data_type), mode); if (pos < 0) _GD_SetEncIOError(D, (mode & GD_FILE_WRITE) ? GD_E_IO_WRITE : GD_E_IO_READ, E->e->u.raw.file + 0); dreturn("%lli", (long long)pos); return pos; } int _GD_Seek(DIRFILE *D, gd_entry_t *E, off64_t offset, unsigned int mode) { int i; dtrace("%p, %p, %lli, 0x%X", D, E, (long long)offset, mode); if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) { _GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field); D->recurse_level--; dreturn("%i", 1); return 1; } if (offset < 0) { _GD_SetError(D, GD_E_RANGE, GD_E_OUT_OF_RANGE, NULL, 0, NULL); dreturn("%i", 1); return 1; } switch (E->field_type) { case GD_RAW_ENTRY: /* open/create the file, if necessary */ if (_GD_InitRawIO(D, E, NULL, -1, NULL, GD_EF_SEEK, mode, _GD_FileSwapBytes(D, E))) { break; } /* The requested offset is before the start of the file, so I guess * pretend we've repositioned it... */ if (E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset > offset) { E->e->u.raw.file[0].pos = offset - E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset; break; } _GD_DoSeek(D, E, _GD_ef + E->e->u.raw.file[0].subenc, offset - E->EN(raw,spf) * D->fragment[E->fragment_index].frame_offset, mode); break; case GD_LINCOM_ENTRY: for (i = 0; i < E->EN(lincom,n_fields); ++i) if (!_GD_BadInput(D, E, i, GD_NO_ENTRY, 1)) _GD_Seek(D, E->e->entry[i], offset, mode); else break; break; case GD_MULTIPLY_ENTRY: case GD_DIVIDE_ENTRY: case GD_WINDOW_ENTRY: case GD_MPLEX_ENTRY: if (_GD_BadInput(D, E, 1, GD_NO_ENTRY, 1)) break; if (_GD_Seek(D, E->e->entry[1], offset, mode)) break; /* fallthrough */ case GD_LINTERP_ENTRY: case GD_BIT_ENTRY: case GD_POLYNOM_ENTRY: case GD_SBIT_ENTRY: case GD_RECIP_ENTRY: if (!_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) _GD_Seek(D, E->e->entry[0], offset, mode); break; case GD_PHASE_ENTRY: if (!_GD_BadInput(D, E, 0, GD_NO_ENTRY, 1)) _GD_Seek(D, E->e->entry[0], offset - E->EN(phase,shift), mode); break; case GD_INDEX_ENTRY: E->e->u.index_pos = offset; break; case GD_NO_ENTRY: case GD_CONST_ENTRY: case GD_STRING_ENTRY: case GD_CARRAY_ENTRY: case GD_ALIAS_ENTRY: _GD_InternalError(D); } D->recurse_level--; dreturn("%i", (D->error == 0) ? 0 : 1); return (D->error == 0) ? 0 : 1; } /* Set the I/O position of the given field */ off64_t gd_seek64(DIRFILE *D, const char *field_code, off64_t frame_num, off64_t sample_num, int whence) { unsigned int spf = 0; off64_t pos = 0; gd_entry_t* entry; int is_index = 0; unsigned int mode = (whence & GD_SEEK_WRITE) ? GD_FILE_WRITE : GD_FILE_READ; dtrace("%p, \"%s\", %lli, %lli, 0x%X", D, field_code, (long long)frame_num, (long long)sample_num, whence); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%u", 0); return 0; } _GD_ClearError(D); entry = _GD_FindEntry(D, field_code, NULL, 1, 1); if (D->error) { dreturn("%i", -1); return -1; } if (entry->field_type & GD_SCALAR_ENTRY_BIT) { _GD_SetError(D, GD_E_DIMENSION, GD_E_DIM_CALLER, NULL, 0, field_code); dreturn("%i", -1); return -1; } if (frame_num) { spf = _GD_GetSPF(D, entry); if (D->error) { dreturn("%i", -1); return -1; } } sample_num += frame_num * spf; whence &= (GD_SEEK_SET | GD_SEEK_CUR | GD_SEEK_END); if (whence == GD_SEEK_SET) pos = 0; else if (whence == GD_SEEK_CUR) pos = _GD_GetFilePos(D, entry, -1); else if (whence == GD_SEEK_END) { pos = _GD_GetEOF(D, entry, NULL, &is_index); if (is_index) _GD_SetError(D, GD_E_BAD_FIELD_TYPE, GD_E_FIELD_BAD, NULL, 0, field_code); } else _GD_SetError(D, GD_E_ARGUMENT, GD_E_ARG_WHENCE, NULL, 0, NULL); if (!D->error) _GD_Seek(D, entry, sample_num + pos, mode); if (D->error) pos = -1; else pos = _GD_GetFilePos(D, entry, -1); dreturn("%lli", (long long)pos); return pos; } off_t gd_seek(DIRFILE *D, const char *field_code, off_t frame_num, off_t sample_num, int whence) { return (off_t)gd_seek64(D, field_code, frame_num, sample_num, whence); } /* vim: ts=2 sw=2 et tw=80 */ libgetdata-0.9.0/src/getdata.pc.in0000640000175000017500000000046712614323564017144 0ustar alastairalastair# GetData pkg-config metadata prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: GetData Description: Dirfile Interface Library Version: @PACKAGE_VERSION@ URL: http://getdata.sourceforge.net/ Libs: -L${libdir} -lgetdata Libs.private: @PRIVATE_LIBS@ Cflags: -I${includedir} libgetdata-0.9.0/NEWS0000640000175000017500000025245712614323564014522 0ustar alastairalastairNew in verison 0.9.0: Library Changes: * Literals in format metadata may now have complex form (i.e. include a semicolon) when the parameter is purely real. However, a non-zero imaginary part is still an error. * gd_free_entry_strings() now NULLs pointers after freeing them. * gd_entry() now returns entry metadata when they contain scalar field codes which do not exist. In this case the GD_EN_CALC flag in the object will not be set. Previously, on such entries, this function would fail with the error GD_E_BAD_SCALAR, and return nothing. * gd_rename() now by default updates the target of ALIASes pointing to a renamed field to point to the new field instead of leaving them dangle. (But see GD_REN_DANGLE in the API section below). * CARRAYs are no longer truncated to GD_MAX_CARRAY_LENGTH elements. Flushing metadata to disk will now fail if writing a CARRAY would overflow a format file line. (It's platform specific, but format file lines are typically permitted to be at least 2**31 bytes long, so such an error usually indicates something pathological happening.) The GD_MAX_CARRAY_LENGTH symbol has been removed from the GetData header file. * Write support for bzip2-encoded and lzma-encoded data has been added. LZMA write support is only available for .xz files, not the obsolete .lzma format. The write support occurs out-of-place, just like how writing gzip-encoded data works. See the gzip discussion in the 0.8.0 section below for important notes. * A new encoding scheme using the Free Lossless Audio Codec (FLAC) to compress data has been implemented. For some datasets, it provides a good trade-off between speed and compression. Like gzip, bzip2, and lzma, is also uses out-of-place writes (see previous point). * A newly-created dirfile is now always opened in read-write mode, ignor- ing the access mode specified in the call. Previously, specifying both GD_RDONLY and GD_CREAT in open calls would result in an access mode (GD_E_ACCMODE) error if the dirfile didn't already exist. * Many functions which used to silently ignore representation suffixes in field codes passed to them no longer do that. Most of these will report an error (GD_E_BAD_CODE) if passed a representation suffix. The affected functions are: gd_bof, gd_entry, gd_entry_type, gd_eof, gd_flush, gd_linterp_tablename, gd_put_carray, gd_put_carray_slice, gd_putdata, gd_raw_close, gd_raw_filename, gd_seek, gd_spf, gd_sync, gd_tell. * Attempts to seek past the end-of-field with gd_seek() now always succeed, although the resultant position is encoding specific. Previously, attempting to seek past the end-of-field on some encodings would return an error. * BUG FIX: The library now properly recovers from an I/O error while trying to open an unencoded datafile. Previously, such an error would poison the library's bookkeeping data, preventing all subsequent attempts to open that file unless the Dirfile was re-opened. Reported by Alexandra Rahlin. * BUG FIX: GetData no longer segfaults when trying to do a large forward seek before a write to a gzipped file. Reported by Joy Didier. * BUG FIX: gd_putdata() no longer ignores I/O errors while seeking to the first sample of a write. * BUG FIX: If the reference field is being written to, gd_nframes() now flushes it first before calculating the size of the dirfile. Previously a short count could result for some encodings in this case. * BUG FIX: Calling gd_putdata() to write gzip data with a non-zero starting offset equal to the field's current I/O position, no longer result in the call hanging. * BUG FIX: In addition to the addition of write support mentioned above, a number of problems with reading LZMA files has been fixed, which should result in fewer segmentaion faults. * BUG FIX: The parser no longer silently appends a closing > to scalar field codes that contain an umatched opening < (e.g. "scalar<3"). This is now interpreted as a simple field code (which may be rejected later due to the presence of the invalid '<' character). * BUG FIX: The parser no-longer interprets various numbers as field codes when it shouldn't (e.g. when specifying a PHASE shift as "1." instead of "1"). * BUG FIX: When writing scalar field codes to disk which could be inter- preted as a number (e.g. the field code "1"), the library now forces the interpretation of these field codes as codes rather than numbers by appending a scalar index (making, e.g., "1<0>"), which is harmless. Previously, these were written as-is, resulting in misinterpretation the next time the Dirfile was opened. This only happens with Standards Version 8 or later, see the following for earlier versions. * BUG FIX: If the current Standards Version in effect is 7 or earlier, ambiguous field codes (e.g., "1"), are now rejected by gd_[m]add() and gd_alter_entry() with the error GD_E_BAD_CODE, since they can't be represented in the metadata on disk. For the behaviour with later Versions, and in permissive mode, see the previous. * BUG FIX: If performing a metadata update due to renaming fields (perhaps by passing GD_REN_UPDB to gd_rename()) results in an invalid field code due to affix restrictions, the update now fails (but see GD_REN_FORCE). Previously the invalid field code would be stored, leading to errors when flushing the modified metadata to disk. * BUG FIX: When performing a metadata update due to a renamed field, the field codes containing subfields of the renamed field are now also updated, including field codes specifying meta subfields which do not exist. * BUG FIX: reading a LINTERP table with fewer than two lines no longer results in a segfault on close/discard. * BUG FIX: gd_alter_raw() and similar no longer fail when asked to re- encode the data file of a RAW field which has not been previously accessed. * BUG FIX: A previously-read LINTERP table is now always discarded when changing table paths with gd_alter_linterp() or similar. Previously these obsolete, cached LUTs would sometimes linger, causing incorrect LINTERP computation. * BUG FIX: The library now properly recovers from an I/O error while trying to open an unencoded datafile. Previously, such an error would poison the library's bookkeeping data, preventing all subsequent attempts to open that file unless the Dirfile was re-opened. Reported by Alexandra Rahlin. * BUG FIX: Calling gd_putdata() to write gzip data with a non-zero starting offset equal to the field's current I/O position, no longer result in the call hanging. * BUG FIX: The I/O position reported by gd_tell and gd_seek for slim, zzip, and zzslim encoded data is now correct. API Changes: * CLARIFICATION: The macro GD_SIZE() declared in getdata.h is indeed part of the public API. It returns the size in bytes of a sample of data of a given type (e.g. GD_SIZE(GD_COMPLEX64) returns 8). It has been around since GetData-0.3.0, but has only been documented since GetData-0.8.3. * The comp_scal member of the gd_entry_t object has been replaced with a flags member, containing a flag (GD_EN_COMPSCAL) with the meaning of the former comp_scal member. There are also flags for hiddenness (GD_EN_HIDDEN) and whether the scalar entry codes in the field defi- nition have been dereferenced (GD_EN_CALC). * gd_[m]add() and gd_alter_entry() can now be used to set or change the hiddenness of a field by setting or clearing the GD_EN_HIDDEN bit in the supplied gd_entry_t object. * Two new rename flags have been added: - GD_REN_DANGLE which indicates the library shouldn't update ALIASes whose target has been renamed (instead it will turn them into dangling aliases) - GD_REN_FORCE which causes the library to skip updating field codes which would be invalid due to affixes instead of failing. * The move_data argument of gd_move() has been replaced with a flags argument which accepts the GD_REN_* flags, which have the same meaning as they do with gd_rename(). * gd_move_alias() and gd_delete_alias() have been deleted: their functions are now performed by gd_move() and gd_delete(), which now operate on the alias itself when given the field code to an alias, rather than the field the alias points to. * A number of different error codes which indicated the same problem (an I/O error returned by the operating system) have been merged into one. The error codes GD_E_OPEN, GD_E_TRUNC, GD_E_RAW_IO, GD_E_OPEN_FRAGMENT, GD_E_FLUSH are replaced by the new error GD_E_IO. The old symbols remain as aliases but are deprecated. The corresponding error strings also now include information from the underlying encoding library, where possible. There is one exception to this merge: attempts to flush metadata lines which are too long are now reported using GD_E_LINE_TOO_LONG. Previously, these errors used GD_E_FLUSH. * The error code GD_E_OPEN_LINFILE has also been removed. It has been split into two parts: - I/O errors resulting from reading the LINTERP table file are now reported using GD_E_IO; - Syntax errors in the table are reported using the new GD_E_LUT error code. GD_E_OPEN_LINFILE remains as a deprecated alias for GD_E_LUT. * gd_encoding_support() has been added to permit run-time determination of supported encodings. * gd_array_len() is the new name for gd_carray_len(). It now also handles STRINGs (which have a length of one). The gd_carray_len() name remains in the library, but has been marked deprecated. * BUG FIX: If the dirfile path provided cannot be resolved (due to, for instance, a symbolic link pointing to a non-existent path), gd_open() and friends now return GD_E_OPEN, as documented, instead of GD_E_RAW_IO. * BUG FIX: gd_naliases() now returns an unsigned int, and zero on error, as documented. * BUG FIX: The API on 32-bit systems, which was broken in 0.8.7 and only partially fixed in 0.8.8, should now work as expected again. Bindings Changes: * PHP bindings have been added. * C++: There is no longer a default value for the "index" argument for Entry methods (including subclasses) which accept it (viz. Input, Scalar, ScalarIndex, Scale, CScale, Offset COffset, Coefficient, CCoefficient). The exception to this is with Entry subclasses for which zero is the only allowed value for the parameter. * F77 and F95: The bindings no longer raise SIGABRT when the dirfile space is exhausted. Instead they simply return a invalid dirfile unit number. * F77: Functions to add fields with named scalar parameters have been added (GDASBT GDASCL GDASCP GDASCR GDASLC GDASMX GDASPH GDASPN GDASRC GDASRW GDASSB GDASWD), but only for those field types which permit named scalars. Similarly, functions for altering field metatdata with named scalars are also present (GDLSBT GDLSCL GDLSCP GDLSCR GDLSLC GDLSMX GDLSPH GDLSPN GDLSRC GDLSRW GDLSSB GDLSWD). These are provided as an alternative to using GDASCA after the fact. * IDL: The entry structure parser has been rewritten. It no longer requires members which it doesn't need, and is also a lot more lax about numerical data types. Notably, it now ignores a supplied COMP_SCAL member. Floating point parameters can be specified in either the base name (M, B, A, DIVIDEND) or else the member prefixed with 'C' (CM, CB, CA, CDIVIDEND), whatever numerical type. The bindings will ingest them appropriately. Also, N_FIELDS and POLY_ORD, may be omitted, and will be calculated from the supplied data. A scalar IN_FIELDS is treated like an single element array. * IDL: GD_REFERENCE is now a function, instead of a procedure, as the documentation has always claimed it was. It returns the current reference field (or the empty string, if there is none). The second parameter, the new reference field, is optional. (Previously the second parameter was required.) * PERL: The entry hash parser has been rewritten. It no longer requires keys which it doesn't need. * PERL: alter_entry() now only updates defined elements in the passed entry hash. * PYTHON: Building the python bindings now requires NumPy. Previously, NumPy support was optional. * PYTHON: for backwards compatiblity, exceptions now exist for deprecated error codes (such as OpenError). These deprecated exceptions are simply aliases for the current ones and are never returned by the bindings. * C++ BUG FIX: The Entry methods Input, Scalar, and ScalarIndex (including subclasses) now return zero or NULL when passed an out-of-range index value. Previously they would return, variously, zero, NULL, another value for some other, valid index value, or segfault. * C++ BUG FIX: The flags parameter to Dirfile::Delete() is now unsigned, as it is in the C API. * F95 BUG FIX: fgd_add and fgd_alter_entry no longer ignore named scalar parameters provided in supplied entry structures. * PYTHON BUG FIX: Several memory leaks have been plugged. Patch from Matthew Petroff. Miscellaneous: * The minimum autotools versions have been bumped. Autoconf-2.65 or newer, automake-1.13 or newer, and libtool-2.2.7b or newer are now required to rebuild the configure script and associated build environ- ment. NOTE: In general, most people building GetData from a source release don't need the tools to build GetData; the autotools are only needed if changes need to be made to the configure script or Makefile input files provided in the release or if building from the repository. |=========================================================================| New in verison 0.8.9: Library Changes: * BUG FIX: The metadata writer now correctly stores bytes in the range 0x01 through 0x1F to the format files (encoded as hex escape sequences: \x##). * BUG FIX: A number of memory leaks associated with error returns from libary functions have been fixed. * BUG FIX: Attempting to create a new field or alias with the name of an existing dangling alias now fails with error GD_E_DUPLICATE, as it should. Reported by Alexandra Rahlin. * BUG FIX: Random-access reads on a RAW field with a frame offset no longer result in mispositioning of the field's I/O pointer, which previously would result in returning data from the wrong part of a field. Reported by S. J. Benton. * BUG FIX: The return value of gd_nframes() is now correct when using a sample-index encoded field as the reference field. * BUG FIX: The sample-index encoding no longer creates sequential records with the same value. Bindings Changes: * F77 and F95 BUG FIX: Passing zero as the field code length (F77) to GDFLSH GDSYNC GDRCLO, or, equivalently, an empty string as the field code to fgd_flush, fgd_sync, fgd_raw_close now causes operation on all fields, as with passing NULL to the corresponding C API functions does. This is what the documentation said these functions did all along. * PYTHON BUG FIX: Accessing the prefix or suffix member of fragment objects no longer leaks memory if the other affix is non-NULL. |=========================================================================| New in verison 0.8.8: Library Changes: * BUG FIX: The incorrect handling of the explicit 64-bit API declarations in getdata.h (those associated with the GD_64BIT_API symbol), which prevented GetData-0.8.7 from compiling on 32-bit systems, has been fixed. GetData-0.8.8 is ABI compatible with GetData-0.8.7. |=========================================================================| New in verison 0.8.7: Library Changes: * BUG FIX: Opening a Dirfile read-write (GD_RDWR) no longer fails if /INCLUDEd fragments are read-only. Reported by Alexandra Rahlin. * BUG FIX: Several fixes have been made to the sample index encoding (SIE) engine, which should now produce properly encoded data when performing random writes. Bindings Changes: * F95 BUG FIX: Passing the empty string to fgd_reference() now returns the current reference field without modifying it, instead of crashing. * PYTHON BUG FIX: Querying dirfile.reference no longer causes a crash on an empty dirfile. Reported by Alexandra Rahlin. * PYTHON BUG FIX: Memory leaks have been fixed in functions returning lists of field names or other metadata lists. Reported by Alexandra Rahlin. * PYTHON BUG FIX: On error, dirfile.get_string() no longer segfaults or leaks memory. |=========================================================================| New in version 0.8.6: Library Changes: * BUG FIX: Computation of LINCOMs with complex valued input fields now correctly happens in the complex plane. As a side effect, gd_native_type() now also correctly reports such LINCOM fields to be complex valued. * BUG FIX: The gd_[m]add() functions now ignore zero-length scalar strings. Previously they would store these invalid field codes, causing problems later. * BUG FIX: Returning complex-valued CARRAYs as purely real now works. Previously only the first element requested would be returned, the remaining output buffer containing uninitialised data. * BUG FIX: Entry members spf, bitnum, numbits, and period are now com- pletely ignored by gd_[m]add() when corresponding named scalars are specified. Previously, an invalid value in these members would result in the entry being rejected, even though the rest of GetData ignored the invalid, unsued value. * BUG FIX: The parsing of the \x and \u escape sequences is now correct. * BUG FIX: A scalar field code specified for the last factor in a POLYNOM entry is no longer ignored by gd_[m]add(). * BUG FIX: gd_[m]add() no longer rejects MPLEX fields with negative count_val. * BUG FIX: DIVIDE fields with complex-valued divisors are now properly computed. * BUG FIX: Complex-valued POLYNOM and RECIP fields are now computed properly when the library is built in ANSI C mode. * BUG FIX: gd_alter_entry() no longer corrupts the DIRFILE when modifying named scalars of MPLEX fields. * BUG FIX: Writing complex-valued MPLEX fields no longer corrupts the stored data. * BUG FIX: gd_bof() now returns the correct number (i.e.: zero) when reporting the beginning of field of derived fields shifted to before the start of the dirfile. Previously, this function incorrectly returned values ranging from zero to one less than the samples-per- frame of the requested field. * BUG FIX: gd_flush(), gd_sync(), gd_raw_close() no longer segfault when operating on a LINCOM with only one input field. * BUG FIX: gd_seek() now works correctly on PHASE fields; previously, the sign of the PHASE shift was flipped. * BUG FIX: gd_seek() now correctly positions the virtual I/O pointer of the INDEX field. * BUG FIX: gd_framenum_subset() now returns the correct value when passed a field_end which is beyond the end of field, and then is required to extrapolate outside of the specified frame range. * BUG FIX: gd_error_string() now produces the correct string when reporting an out-of-range poly_ord encountered by gd_add_polynom() and similar. * BUG FIX: gd_[m]alter_spec() no longer ignore co-efficients specified for POLYNOM entries. * BUG FIX: gd_alter_encoding() now deletes the internal cache of RAW filenames of the affected fragment; previously, these old, cached filenames could lead to I/O errors when reading and writing the re- encoded RAW data files. * BUG FIX: Calling the Legacy API function GetFormat() on a Dirfile with MPLEX or WINDOW fields no longer results in a segmentation fault. * BUG FIX: Attempts to read past the EOF of a gzipped field no longer results in an I/O error, but successfully returns no data. * BUG FIX: The internal recursion counter wasn't being properly reset on certain error conditions, leading to spurious GD_E_RECURSE_LEVEL errors being returned from valid calls. Bindings Changes: * F77 and F95 BUG FIX: Named scalar indices are now indexed from one instead of zero, like all other array indices are in the Fortran GetData bindings. * C++ BUG FIX: Fixed segfault in RawEntry destructor. Reported by S. J. Benton. * C++ BUG FIX: Entry::ComplexScalars() now returns non-zero for RECIP entries when appropriate, instead of always returning zero. (The RecipEntry::ComplexScalars() method always returned the correct value.) * IDL BUG FIX: The /UPDATEDB flag to gd_rename is no longer ignored; also, the /MOVE_DATA flag no longer also acts as if /UPDATEDB had been specified. * PYTHON BUG FIX: The keyword for the "dirfile" parameter in the getdata.fragment constructor is now properly spelled. |=========================================================================| New in verison 0.8.5: Library Changes: * BUG FIX: The zzslim encoding framework, which was inadvertantly rendered non-compilable in 0.8.4, should once again work. Reported by Matthew Hasselfield. Bindings Changes: * PYTHON BUG FIX: A spurious debugging message accidentally left in the 0.8.4 release has been expunged. |=========================================================================| New in version 0.8.4: Dirfile Changes: * CLARIFICATION: Inconsistant behaviour in the library, coupled with contradictory statements in the Dirfile Standards, has resulted in confusion over the meaning of the final, optional, parameter in a MPLEX definition. To be clear: this parameter is simply the expected period between successive occurances of the "count" value in the index vector. (It is used by GetData only to figure out a resonable length for the MPLEX lookback.) The following clarifications and corrections have been made to the definition of the MPLEX field type in dirfile-format(5): - The final, optional parameter has been renamed from "max" to "period". - This parameter indicates not the maximal range of the index vector, as previously stated, but the expected number of samples between successive occurances of the specified "count" value in the index vector; as before, it should be regarded as a hint, and does not place any actual restriction on the contents of the index vector. - The incorrect requirement that the "count" parameter be non-negative has been deleted. - The incorrect requirement that "count" be less than or equal to "max", if "max" is present and non-zero, has been deleted. - The meaning of an omitted or zero "period", indicating that the spacing of "count" in the index vector is unknown or non-uniform, is now explicitly stated. - Different MPLEX fields using the same index vector may specify different periods. See also the related library bug fixes below. Library Changes: * BUG FIX: The library no longer incorrectly rejects negative count_val MPLEX parameters. Furthermore, a count_val of -1 in gd_alter_entry or gd_[m]alter_mplex calls is not a special value: it just sets count_val to -1. * BUG FIX: The library no longer incorrectly rejects MPLEX fields where count_val is greater than the period (formerly called count_max). * BUG FIX: The default MPLEX period, if none is specified, is 2 * count_val + 1, not simply 2 * count_val, when count_val is greater than 5. * BUG FIX: Trying to position an I/O pointer to before sample zero with gd_seek() now properly fails. Previously it would allow it, causing bizarre things to happen later. * BUG FIX: Using gd_tell to get the I/O pointer position of a derived field with exactly two input fields (MULTIPLY, DIVIDE, MPLEX, WINDOW) now properly reports an error in the "multiposition" case (ie. when the two inputs are ultimately reading from different locations in the same RAW field). * BUG FIX: Trying to read sample zero of a gzipped RAW field the second time now works as expected. Previously, the request to reposition the I/O pointer back to zero would be ignored by the gzip framework. Reported by Alexandra Rahlin. * BUG FIX: The field code of a reference field declared in a subfragment included with affixes is no longer corrupted by spurious application of the affixes when the subfragment's metadata are (re-)written. Reported by Seth. API Changes: * The count_max member of the gd_entry_t object has been renamed to period. The corresponding dummy argument in various function proto- types has been similarly renamed. Bindings Changes: * C++: The Entry and MplexEntry member functions CountMax and SetCountMax have been renamed to Period and SetPeriod for consistency with the changes listed above. CountMax and SetCountMax are still avaialbe as aliases, but are marked deprecated. * IDL BUG FIX: GD_ENTRY structures representing MPLEX fields are now properly interpreted. Previously, the underlying gd_entry_t object was being incorrectly initialised. * PYTHON BUG FIX: Numpy arrays returned by dirfile.getdata() are now the correct length. Previously they would always be the length requested (or the length of the dirfile, if no length was explicitly given) even if fewer samples were returned. Extra elements would contain unini- tialised memory. |=========================================================================| New in version 0.8.3: Library Changes: * BUG FIX: Several bugs on big-ended systems have been fixed. Reported by Dinar Valeev. * BUG FIX: Adding an entry via gd_[m]add() with a negative CARRAY scalar index no longer results in an internal error or worse when the added field is later read. Instead, a proper error is returned. * BUG FIX: Changing a CONST field to a real floating point type using gd_alter_const() (or similar) no longer results in the value of the field being corrupted. * BUG FIX: A bug in the parser's tokeniser has been fixed to prevent spurious "unterminated token" syntax errors. Typically this would only be seen when using gd_strtok() to tokenise an (apparently innocuous) user-supplied string, but a carefully crafted format file could also be made to get gd_open() to produce it. Bindings Changes: * Bindings for MATLAB have been added. * The IDL, Perl, and Python bindings no longer require a C99 compiler to be built. |=========================================================================| New in version 0.8.2: Library Changes: * BUG FIX: A trailing symlink (i.e. situations where a symlink is the last element of a path) no longer confuses GetData when the target of the symlink: (1) is absolute, or (2) starts with "../". Reported by S. J. Benton. * BUG FIX: Trying to read data from the first sample of an MPLEX no longer results in an internal error if the first sample of the index doesn't match the target value. |=========================================================================| New in version 0.8.1: Library Changes: * gd_dirfilename() now returns a fully canonicalised version of the dirfile path. * BUG FIX: A segfault when negotiating symbolic links in file paths, typically manifesting in gd_open calls, has been fixed. * BUG FIX: gd_strtok now saves a copy of the string passed to it, as the documentation suggests it should. Previously it cached the pointer itself. * BUG FIX: A number of minor memory leaks, mostly occurring when the library encounters an error, have been fixed. * BUG FIX: /HIDDEN directives weren't being written for aliases. * BUG FIX: The parser now fails properly on /INCLUDEs which specify paths which don't point to regular files. * BUG FIX: Fixed a bug which would result in the parser getting confused over the current Standards Version, potentially leading to rejected valid dirfiles. Reported by Daniel Flanigan. * BUG FIX: gd_alter_entry() and gd_madd_alias() weren't clearing the Dirfile error before operation, resulting in them failing erroneously in certain situations. * BUG FIX: When including an existing fragment which itself has subfrag- ments, gd_include() no longer returns the wrong fragment index. * WIN32 BUG FIX: On Windows, the parser can now properly handle hexade- cimal floating point. API Changes: * How the API deals with field code affixes has changed. Input vector and scalar fields are reported by gd_entry(), &c. now include their prefix and suffix, if any, which should remove the need to do manual affix bookkeeping when reading metadata. The other side to this change is that when modifying metdata (gd_add(), gd_alter_entry(), &c.), supplied field codes must also contain the appropriate affixes. * A new function, gd_linterp_tablename() has been added which returns a fully canonicalised version of the look-up table pathname for a LINTERP. Bindings Changes: * F77 BUG FIX: A memory leak has been fixed in GDALLC. |=========================================================================| New in version 0.8.0: Dirfile Changes: * Dirfile Standards Version 9 has been released. It adds two new field types: MPLEX, which allows multiplexing multiple low-rate channels in one high-rate one, and WINDOW, which extracts a portion of a field based on the value of a second field. More changes are listed below. * Alternate field names may be defined using the /ALIAS directive. Aliases can't be used as a parent when defining metafields, but are otherwise indistinguishable from a field's original ("canonical") name. * The /VERSION directive now has fragment scope, which should alleviate some of the problems associated with "version leakage" found in previous versions. Previous versions are unchanged, but a "/VERSION 9" directive will not propagate back up into a parent fragment, nor will any /VERSION directive be propagated back up into a Version 9 fragment. * Fields may be "hidden" using the /HIDDEN directive. The Standards don't say what a "hidden" field does, but GetData will, by default, exclude them from the count and list functions. * Literal integers in the format may now be specified in octal (using 0####) or hexidecimal (using 0x##### or 0X#####) in addition to decimal. C99-standard hexidecimal floating point literals (0x##.##p##, &c.) are also accepted. * The /INCLUDE directive can take two additional, optional parameters which specify a prefix and/or suffix used to modify the entry names of the fields defined in the included fragment. (The intent of this is to permit the inclusion of multiple subdirfiles which define the same set of fields, by modifying their field names.) * Three new encoding schemes are available. The first is the Sample- Index Encoding (SIE), similar to run-length encoding, useful for compressing data which changes very rarely. Like the ASCII encoding, GetData implements it internally, so it's always available. The other two schemes (zzip and zzslim) are based around the ZZip library, an access library for PKWARE ZIP files. These are unusual in that they store all raw data in the same ZIP archive. * The /ENCODING directive takes an optional second token. The zzip and zzslim encoding schemes optionally use this token to specify the name of the combined ZIP archive. * The data type names FLOAT (an alias for FLOAT32) and DOUBLE (an alias for FLOAT64) have been deprecated. Library Changes: * On POSIX systems, GetData now caches the dirfile directory (and any other necessary subdirectories). This guards against third-parties renaming the directory while GetData is interested in it. * GetData is, in general, more careful about pathname management. At least on POSIX systems, it will now try to canonicalise all paths it comes across, including resolving symlinks. As a result, GetData no longer becomes befuddled by a caller who opens a Dirfile with a relative pathname and then calls chdir(2). Functions like gd_fragmentname() and gd_raw_filename() now return canonicalised paths. * The library no longer forces a sync of all raw data on close. The sync causes a flush of filesystem buffers, which is usually unnecessary overhead, and degredatious to efficient disk I/O. Use an explicit gd_sync() or gd_flush() before closing to recover the old behaviour, if desired. * The error messages output by GetData with GD_VERBOSE turned on now has "libgetdata: " prefixed to it. A further prefix may be specified by the caller. * When truncating a dirfile, the primary format file is no longer deleted and then recreated. Instead, it is simply truncated in-place. This change means that a Dirfile which is undergoing truncation always appears (to GetData, at least) to be a valid Dirfile, which can be useful if it is being concurrently read. * Write support for gzip-encoded data has been added. Writes occur out of place, which means sufficient space on the filesystem is needed for a second copy of every field being written. Writing to a gzip compressed field requires uncompressing the portion of the field before the write of the existing file, recompressing it to the temporary file, then writing the new data to the temporary file. A subsequent write at a later position, will continue to write to the compressed file, but a subsequent write to an earlier position requires coping all remaining data from the old file to the temporary file, finalising it, moving it over top of the old file, and then starting afresh with a new temporary file. As a result, it's not very fast, and likely should be avoided for non-sequential writes. * Raw data files are now only opened for writing if writing is going to occur. In particular, this means that opening a dirfile with GD_RDWR will still work even if you don't have write access to it, so long as you don't try writing to it. * GetData now tracks a "current location" for all RAW files, and allows reads and writes to occur at the "current location" (via the special symbol GD_HERE). For some derived fields the idea of a "current location" doesn't make sense, and this won't work. * BUG FIX: In previous versions, renaming a field with gd_rename() wouldn't update or invalidate the cache of fields which depended on the old name, leading to surprising results. It will now either invalidate these fields' metadata caches or else change the name in those definitions as well. * BUG FIX: The invalid syntax "/META parent/child granchild ..." is now properly rejected by the parser. Previously it half-worked, resulting in a segfault in gd_close(). * BUG FIX: Several syntax errors encountered in PHASE and RECIP field specifications weren't being reported by the parser, leading to corrupted metadata on open. * BUG FIX: GetData no longer omits the input field to a RECIP when writing metadata to disk. Nor does it forget to put newlines after RECIP or DIVIDE field specifications. * BUG FIX: GetData no longer assumes all LINCOM input fields have the same number of samples per frame. * BUG FIX: Writing an empty fragment with GD_PRETTY_PRINT turned on no longer results in a floating-point exception. * BUG FIX: Renaming a field now properly flags the fragment which contains it as dirty, which will ensure the rename is writen to disk when the metadata are next flushed. * BUG FIX: Whitespace within tokens is now properly escaped when metadata is flushed to disk. * BUG FIX: The parser no longer gets tripped up by two character escape sequences in a row, nor by an escape sequence at the start of a token. * BUG FIX: "/PROTECT data" directives are now being written when they should be. Previously, they were dropped completely. Reported by Alexandra Rahlin. * BUG FIX: CARRAY indices provided to gd_add() in the entry.scalar_ind member are no longer ignored. Reported by S. J. Benton. * BUG FIX: When adding a metafield with gd_(m)add(), GetData no longer checks the protection of the fragment indexed by entry->fragment_index. Instead it ignores entry->fragment_index completely (as the documentation indicates it should) and checks the protection of the fragment containing the parent field. * BUG FIX: calling gd_putdata() with num_frames and num_samples both zero no longer confuses GetData: instead it simply does nothing. API Changes: * Functions which add fields (gd_add(), gd_add_(), &c.) can now be used to add metafields by using their full "parent/name" field code. The old, explicit metafield adding routines (gd_madd(), &c.) are still available. * As with their corresponding names in the Standards, the gd_type_t symbols GD_FLOAT and GD_DOUBLE are now deprecated. Use GD_FLOAT32 and GD_FLOAT64 as appropriate. * A new open flag, GD_TRUNCSUB, will cause GD_TRUNC to descend into subdirectories of a directory it is truncating. If not specified along with GD_TRUNC, it does nothing. * New public functions gd_nentries() and gd_entry_list() provide a generic interface to the field counting and list functionality. The other functions (gd_nfields(), gd_nfields_by_type(), &c. and gd_field_list(), gd_field_list_by_type(), &c.) are now simply special cases of these two functions. * The "hiddenness" of a field name may be queried with gd_hidden(), set with gd_hide() and cleared with gd_unhide(). * /INCLUDE affixes may be queried with gd_fragment_affixes() and added, modified or deleted with gd_alter_affixes(). A new fragment can be added to the dirfile with affixes using gd_include_affix(). * New aliases may be added with gd_add_alias() or gd_madd_alais. The target of an alias is retrned by gd_alias_target(); a list of aliases of a field, or their number, is returned by gd_aliases() and gd_naliases(). * Because GetData considers aliases and canonical names to be indistinguishable, passing an alias name to most functions will result in the function operating on target field. To manipulate aliases themselves, the API has the new interfaces gd_move_alias() and gd_delete_alias(). * In addition to the special symbol GD_HERE which may be passed to gd_getdata() and gd_putdata(), the "current location" of fields may be queried with gd_tell() and moved with gd_seek(). * The typedefs gd_bit_t and gd_spf_t have been deprecated. They are replaced with 'int' and 'unsigned int' respectively. For backwards compatibility, the typedefs (with their new types) are still declared in getdata.h, but the API no longer makes use of them. * GetData's tokeniser has been exposed to the public API via the gd_strtok() function, which works similar to strtok(3), and returns successive tokens of a string given it. * A new function gd_error_count() returns the number of GetData errors encountered on a Dirfile since it was last called (or since the Dirfile was opened). This is useful for programs that care whether *something* failed, but don't really care what it was. * Reading MPLEX fields can result in inefficiencies due to GetData having to look backwards for the first value of the part of the derived field requested. A new function, gd_mplex_lookback(), can be used to alter how much lookback is done, if any. * The "move_data" flag in gd_rename() has been replaced with a generic "flags" parameter. Two rename flags are defined: GD_REN_DATA, which recovers the old behaviour of move_data, and GD_REN_UBDB which will cause references to the renamed field to be renamed also in derived fields which refer to it. Without GD_REN_UBDB, these definitions are left unchagned. * Flags which affect the long-term operation of GetData may be modified after open using gd_flags(). Currently these flags are just GD_VERBOSE and GD_PRETTY_PRTNT. * The gd_flush() function, which both syncs and closes RAW files, has been broken up into its two parts with two new functions: gd_sync(), which just syncs and gd_raw_close(), which just closes. gd_flush() still does both. * Using the new gd_desync() function will cause GetData to determine whether the Dirfile metadata on disk has changed since the Dirfile was opened. * A prefix to the automatic error messages printed by GetData when using the GD_VERBOSE flag may be specified with gd_verbose_prefix(). * When requesting the exclusive creation of a new dirfile with (GD_CREAT | GD_EXCL) GetData will now return the new error GD_E_EXISTS if the dirfile already exists. Previously it would return GD_E_CREAT in this situation. * The error codes GD_E_BAD_ENDIANNESS, GD_E_BAD_PROTECTION, and GD_E_BAD_VERSION have been combined into a more generic error code: GD_E_ARGUMENT. The old symbols are retained for backwards compatibility but have been marked deprecated. * CONST and CARRAY handling has been combined somewhat. When passed to {get,put}_carray[_slice]() or gd_carray_len(), CONSTs behave like length-one CARRAYs. Similarly, {get,put}_constant() will operate on the first element of a CARRAY, as if it were a CONST field. * C89 API: Passing NULL to gd_alter_crecip() for cdividend is now treated as if it were passed zero (ie. it indicates no change for cdividend). * BUG FIX: gd_spf() now returns GD_E_DIMENSION when passed a scalar field code, as the documentation says it should. Previously it returned GD_E_BAD_FIELD_TYPE. Legacy API Changes: * The never-used n_mplex/mplexEntries part of the FormatType now has a use: both MPLEX and WINDOW entries are reported there. Bindings Changes: * Bindings for Perl5 have been added. Perl is not well suited to numerical analysis, and the bindings may be inefficient. * F77: Due to small namespace issues, the encoding parameters (corresponding to the GD_...ENCODED symbols in the C API) have all been renamed. They are now of the form GDE_xx. * C++: The bindings now make use of the explicitly-64-bit offset type gd_off64_t defined in getdata.h. Previously, the bindings tried to force off_t to be 64-bit through preprocessor shenanigans, which led, in certain cases, to linking problems down the road when used by third parties. * Python: The return_type, num_fields, and num_samples parameters to dirfile.getdata() are now optional. The return_type defautls to pygetdata.FLOAT, and if neither num_fields nor num_samples are given, all frames (ie. the value of dirfile.nframes) are returned. * IDL: A number of undocumented, unnecessary function aliases have been removed. They should be replaced with their canonical names, without change in use: Alias Replacement ---------------------- ---------------- GD_ADD_CLINCOM GD_ADD_LINCOM GD_ADD_CPOLYNOM GD_ADD_POLYNOM GD_ADD_CRECIP GD_ADD_RECIP GD_ALTER_CLINCOM GD_ALTER_LINCOM GD_ALTER_CPOLYNOM GD_ALTER_POLYNOM GD_ALTER_CRECIP GD_ALTER_RECIP GD_FIELD_LIST_BY_TYPE GD_ENTRY_LIST GD_FRAMENUM_SUBSET GD_FRAMENUM GD_MADD GD_ADD GD_MADD_BIT GD_ADD_BIT GD_MADD_CARRAY GD_ADD_CARRAY GD_MADD_CLINCOM GD_ADD_LINCOM GD_MADD_CPOLYNOM GD_ADD_POLYNOM GD_MADD_CRECIP GD_ADD_RECIP GD_MADD_DIVIDE GD_ADD_DIVIDE GD_MADD_LINCOM GD_ADD_LINCOM GD_MADD_LINTERP GD_ADD_LINTERP GD_MADD_MULTIPLY GD_ADD_MULTIPLY GD_MADD_PHASE GD_ADD_PHASE GD_MADD_POLYNOM GD_ADD_POLYNOM GD_MADD_RECIP GD_ADD_RECIP GD_MADD_SBIT GD_ADD_SBIT GD_MADD_STRING GD_ADD_STRING GD_MALTER_SPEC GD_ALTER_SPEC GD_MCONSTANTS GD_CONSTANTS GD_MFIELD_LIST GD_ENTRY_LIST GD_MFIELD_LIST_BY_TYPE GD_ENTRY_LIST GD_MSTRINGS GD_STRINGS GD_MVECTOR_LIST GD_VECTOR_LIST GD_NFIELDS_BY_TYPE GD_NENTRIES GD_NMFIELDS GD_NENTRIES GD_NMFIELDS_BY_TYPE GD_NENTRIES GD_NMVECTORS GD_NVECTORS * BUG FIX: All bindings now provide a named constant corresponding to the C API error GD_E_UNKNOWN_ENCODING, which was overlooked in previous releases. * IDL BUG FIX: The missing /IGNORE_REFS and /PRETTY_PRINT are now available in gd_open. |=========================================================================| New in version 0.7.3: Library Changes * BUG FIX: Passing a zero dividend to alter_crecip() and alter_recip() now results in the dividend not changing, per documentation. * BUG FIX: GetData wasn't properly computing the module directory, causing encodings using external modules to fail with GD_E_UNSUPPORTED. * BUG FIX: Metafield records are now properly stored in the format file for Standards Version 8. * BUG FIX: gd_raw_filename() wasn't clearing the Dirfile error before operation, resulting in it failing erroneously in certain situations. Utilities Changes: * BUG FIX: A potential segmentation fault has been patched in dirfile2ascii. |=========================================================================| New in version 0.7.2: Library Changes * If built with modules, the plugin shared objects will now be installed in a separate directory (by default "${libdir}/getdata", but see the --with-module-dir option in ./configure). * BUG FIX: When using modules, a missing plugin no longer results in a lock up the second time an attempt is made to find it. * BUG FIX: GetData now properly processes /INCLUDE directives with absolute paths, as the documentation insists it should. * BUG FIX: gd_add()ing the first raw field in a dirfile to a subfragment no longer results in memory corruption when calling gd_close(). API Changes * If called with GD_CREAT but no encoding specified, gd_include() now will duplicate the encoding of the parent fragment (if any). Miscellaneous * The python module install dir can now be changed by passing --with-python-module-dir to configure. |=========================================================================| New in version 0.7.1: Library Changes * BUG FIX: When the parser fails in a gd_include() call, the internal list of conformant Standards Versions for the loaded dirfile is no longer corrupted. * BUG FIX Performing two consecutive reads of the same field in an ASCII encoded datasources no longer confuses GetData. * BUG FIX: Numerous memory leaks have been patched (mostly pin-holes, although there are a few, rare but egregious ones). API Changes: * The value(s) of a CONST or CARRAY field added with gd_[m]add() is now guaranteed to be zero; previously, it was unspecified. * BUG FIX: Specifying both GD_VERBOSE and GD_IGNORE_DUPS no longer results in spurious "Field code already defined" messages when dupli- cate fields are encountered. * BUG FIX: Calling gd_delete on a metafield no longer results in a segfault. Bindings Changes: * F77 BUG FIX: A memory leak in GDASCA has been fixed. * Python BUG FIX: The first element of a python list (instead of a NumPy array) is no longer dropped when passed to pygetdata on 64-bit systems. Utilities Changes: * dirfile2ascii now pads reads past the end-of-field. The value used to pad may be specified with '-z', and defaults to 0/NaN. Previously, the value of uninitialized memory was output. * BUG FIX: dirfile2ascii now does what the user intends when presented with cart-before-horse arguments, ie. "dirfile2ascii -e field DIRFILE". Previously this resulted in confusion. * BUG FIX: dirfile2ascii now accepts field conversion '-u', which was documented but overlooked in the argument parser. |=========================================================================| New in version 0.7.0: Dirfile Changes * Dirfile Standards Version 8 has been released. It adds three new field types: DIVIDE, which computes X/Y for vectors X and Y, RECIP, which computes A/X for vector X and scalar A, and CARRAY, which is an array of CONST scalars. A few other changes are listed below. * Like CONST fields, CARRAY elements can be used as parametersin the definition of other fields. Syntax is 'field', where 'field' is the field name and 'n' the element index in the CARRAY (and the angle brackets are literal angle brackets). If the '' is omitted, the first element (numbered 0) is assumed. * Slashes on reserved words are now mandatory, allowing fields with reserved words as names. * The long-deprecated single character data type codes have been removed from Standards Version 8. (They are still accepted by GetData, which handles all previous Standards Versions as well.) * The /ENDIAN directive now takes an optional second parameter. The only allowed value for this second token is "arm", which indicates that double precision floating point data (including double precision complex data) are stored in the ARM middle-endian format. Without this, floating point data are assumed to have the same byte sex as integer data. Library Changes * GetData, including its bindings, is now supported under MacOS X, Cygwin, and Win32 using MinGW. In the case of MinGW, this includes linking against the Microsoft C Runtime, which isn't POSIX compliant. Users should exercise caution when writing to dirfiles in this case. * GetData can now be used on ARM processors. As a side-effect, GetData can now read and write the middle-ended floating point format used by older ARM processors (on any processor, via endianness conversion). * Some changes have been made to the parser. It now operates in one of two modes: pedantic mode, which adheres strictly to one particular Dirfile Standards Version, and permissive mode (the default) which is more lenient, as the old parser was. Encountering a /VERSION directive will switch the parser from permissive to pedantic mode unless told not to (see GD_PERMISSIVE below), and will change the particular Standards Version to which pedantic mode is adhering. * As a result of the previous change, the Standards compliance of the parser in strict mode has been greatly increased. This affects allowed characters in field names, and field name lengths. The existence or lack thereof of the implicit FILEFRAM field (an alias for INDEX) is also affected. * Since Standards Versions 4 and earlier were never codified, we've made some assumptions as to their behaviour in certain undocumented situta- tions. Most noticably, they still prohibit ASCII control codes (bytes 0x01 through 0x1F) and '/' in field names. We also assume these dirfiles have native byte sex, even though some early GetData behaviour implied only little-ended data was acceptable. * Every Dirfile object now records its current Standards Version, which affects functions such as gd_add_spec(). The Version will start out as the value of the last /VERSION directive encountered by the parser, or else the latest compliant Standards Version. It can be changed (see below). * When writing metadata to disk, fragments will be written according to the current Standards Version of the dirfile object, rather than always using the latest version, as before. * The C library now sports an "ANSI C" mode, which allows compilation of GetData without a C99-compliant compiler. Some functionality may be lost, most prominently, but unsurprisingly, the default (C99) API. * The artificial maximum line length of 4096 bytes for format metadata has been removed. The maximum line length is now 2**31 bytes on 32-bit systems, and more on 64-bit systems. This also has the side-effect of removing the same length limit which had been applied to field names. * LINTERP tables are no longer required to be sorted. The library will sort them, if needed. As a side-effect of this, tables are no longer read twice when loading, leading to potential speed-up. * BUG FIX: The library wasn't properly checking that the second and higher input fields in LINCOM and MULTIPLY fields were, in fact, vectors, leading to possible segfaults. * BUG FIX: A memory leak associated with modifying LINCOM metadata has been fixed. * BUG FIX: Using a complex valued vector as the second input field in a MULTIPLY wouldn't result in the field being internally flagged as complex, leading to loss of the imaginary part in certain situtaitons. * BUG FIX: Trying to write to a LINTERP via a table which isn't monotonic now results in error. Previously, this was allowed, with arbitrary data stored to disk. * BUG FIX: On encountering a line longer than it was prepared to deal with, the parser used to get very confused, potentially resulting in bizarre behaviour. On the off chance such a line is encountered, GetData will now raise GD_E_LINE_TOO_LONG in these cases. (And, since the maxmium line length has been increased to at least 2**31 charac- ters, this should only occur in pathological situations.) * BUG FIX: Deleting a metafield was not being communicated to its parent, resulting in differing opinions within the library as to the deleted field's exsitence. API Changes * Due to namespace conflicts with the MacOS X System Library (which contains the C Standard Library), a wholesale renaming of public symbols has been performed. All public functions, and data types now begin with 'gd_'. All public preprocessor macros now begin with 'GD_'. Symbol renaming has occurred in the following manner: - functions which started with 'put' simply prefix 'gd_' to their name. So put_constant() becomes gd_put_constant(). - functions which started with 'get' replace 'get' with 'gd', except those functions with a corresponding 'put' function; these simply prefix 'gd_'. So, get_constants() becomes gd_constants(), but get_constant() becomes gd_get_constant(). - functions which started with 'dirfile' replace 'dirfile' with 'gd', except for dirfilename(), which becomes gd_dirfilename(). So, dirfile_alter_encoding() becomes gd_alter_encoding(). - macros which started with 'GETDATA_' now start with 'GD_'. Those that started with 'NO_GETDATA_' now start with 'GD_NO_'. So GETDATA_LEGACY_API becomes GD_LEGACY_API and NO_GETDATA_LEGACY_API becomes GD_NO_LEGACY_API. * The above renaming rules result in one gd_ namespace clash. As a result, get_reference() has been removed completely. Calls will have to be changed to use gd_reference(), formerly dirfile_reference(). * Furthermore, the function dirfile_protect() is now gd_alter_protection() to match the naming of other fragment metadata altering functions. * To ease transition to the new namespace, defining GD_FUNCTION_ALIASES before including getdata.h will create a bunch of preprocessor macros which map the old names to the new. * The meaning of the GD_PEDANTIC flag to gd_[cb]open() has changed. It now forces the parser to start off in pedantic mode (see above), following the latest Standards Version, rather than the default permissive mode. This is a subtle change, and in most cases the effects of GD_PEDANTIC will be the same as they were before. * A new dirfile flag, GD_PERMISSIVE, has been added. Passing this to gd_[cb]open() will prohibit the parser from switching into pedantic mode when it encounters a /VERSION directive. This flag is needed to read dirfiles which claim to adhere to the Standards via a /VERSION directive, but contain invalid syntax nonetheless. * The current Standards Version of an open dirfile can be set or queried by calling the new function gd_dirfile_standards(). NB: this only affects the open dirfile, not the metadata stored on disk. * A new function, gd_rewrite_fragment() will force GetData to write the specified fragment to disk, even if no metadata in the fragment has changed. * Two new functions, gd_bof() and gd_eof() can be used to find the sample number of the beginning- or end-of-field for a given field. Notably, these can be used to calculate the amount of raw data on disk for a given field. * The new gd_invalid_dirfile() function will return a newly created, invalid dirfile. Primarily useful to callers as a "null dirfile" placeholder. * GD_E_OPEN_INCLUDE has been renamed to GD_E_OPEN_FRAGMENT, but the former symbol remains as an alias. * Two new bitflags to gd_cbopen and gd_open: GD_ARM_ENDIAN and GD_NOT_ARM_ENDIAN allow specifying the default ordering of double pre- cision data. These flags may also be used with gd_alter_endianness() and will be returned by gd_endianness(). On all platforms except for middle-endian ARMs, GD_NOT_ARM_ENDIAN equals zero and may be omitted. * Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE on I/O error, they now raise the new GD_E_FLUSH. * All functions now raise GD_E_DIMENSION when encountering a scalar field when expecting a vector. In the past, the error value returned was different for different functions. * getdata.h now wraps itself in an extern "C" block if included by a C++ compiler. * If passed a NULL pointer, gd_error_string() will return a newly malloc'd buffer long enough to hold the entire string. It should be free'd by the caller. * The parser data passed to the callback function now includes the length of the buffer. The parser also permits the callback to assign a new pointer to the 'line' element of the parser data if the buffer passed in is too small. * gd_metaflush() now fails and raises GD_E_ACCMODE if called on a read-only dirfile. (Previously it would successfully do nothing.) Legacy API Changes * In the legacy format struct, DIVIDE fields are listed as MULTIPLYs and RECIP fields are listed as LINCOMs, with the dividend stored in m[0]. * BUG FIX: In previous versions, attempting to access an invalid dirfile (anything that would cause gd_open to fail) resulted in leaked memory. This leak has been plugged. * BUG FIX: A segfault involving the reporting of POLYNOM fields has been fixed in GetFormat(). Bindings * Bindings for the functionality introduced into 0.7.0 have been added. * F77: GDPROT has been renamed GDAPRT to mirror the renaming of gd_alter_protection(). * F77: GDGTCO and GDPTCO no longer return an indicator of success. * F77: The signatues of GDGSCA and GDASCA have changed to return/take the scalar index as well. * F95: For consistency sake, the Fortran 95 bindings have undergone the same renaming so they have the same name as their C counterparts. All functions are now preceded by 'fgd_'. * F95: The fgd_get_constant_* and fgd_put_constant_* procedures are now subroutines, not functions. * C++: Const member functions are now flagged as such. * C++: The len parameter to Dirfile::ErrorString is now ignored. * C++: dirfiles are now opened read-only by default. * IDL: The IDL bindings have also followed suit in the great renaming. The exception to this is GETDATA_CONSTANTS(), which is not renamed. * IDL: Various constants defined in getdata.h but not used by the IDL bindings have been removed from the structure returned by GETDATA_CONSTANTS(). * Python: dirfile.getdata() now raises ValueError if neither num_frames nor num_samples are specified. In the past, it would happily return nothing in this case. * Python: dirfiles are now opened read-only by default. * C++ BUG FIX: Entry::Scalar() no longer rejects valid values of index. * IDL BUG FIX: A memory impropriety involving keyword arguments. This bug manifested by rejecting valid keyword arguments on 64-bit systems, but may have had other, subtle effects on 32-bit systems as well. * Python BUG FIX: A non-literal phase shift is now properly reported. * Python BUG FIX: Calling Dirfile.discard() or Dirfile.close() no longer results in a segfault. Miscellaneous * The --disable-checkdirfile option has been removed from ./configure. It is now always installed. * A utility, dirfile2ascii, is now installed alongside checkdirfile. This utility converts all or part of a dirfile into ASCII text. dirfile2ascii was written by Matthew Truch. * The thoroughness of the checks done by checkdirfile have increased. It now reports format syntax errors, Dirfile Standards compliance, problems with field definitions (such as missing input fields), and the size of the dirfile. |=========================================================================| New in version 0.6.3: Bindings * A memory leak has been plugged in the Python bindings manifesting in calls to dirfile.getdata() returning a NumPy array. In previous versions, the memory used by the returned array to hold the data was not reclaimed by GC. |=========================================================================| New in version 0.6.2: Library Changes * Attempting to get the number of frames from an ASCII file no longer fails the second time. |=========================================================================| New in version 0.6.1: API Changes * The getdata.h header no longer includes complex.h explicitly. Legacy API Changes * A potential segfault relating to error reporting in the legacy API has been fixed. Bindings * C++ BUG FIX: Several bugs preventing compilation of the C++ test-suite under Fedora 13 have been fixed. * IDL BUG FIX: Several segfaults in the IDL bindings have been eradicated. Miscellaneous * Libtool has been upgraded to 2.2.6b, which provides proper support for Fortran-9x. The outdated, internal libltdl has been removed. Building modules now requires an installed libltdl. |=========================================================================| New in version 0.6.0: License * The GetData library and its bindings are now distributed under the GNU Lesser Public License, version 2.1 or later. Dirfile Changes * GetData now support Dirfile Standards Version 7. Standards Version 7 adds complex data types, a signed bitfield (SBIT), a polynomial derived field (POLYNOM), and other features detailed below. * Metafields can now be specified using a normal format specification line and their full (slashed) field code. * Field codes can now contain a "representation suffix", which allows specifying a complex norm used to convert complex valued data into purely real data. * The n_fields parameter in a LINCOM specification is now optional. * A new encoding scheme which supports LZMA compressed data using the .xz container format has been added. * Look-up tables may contain a complex y-value. This prohibits writing to the associated LINTERP field. Library Changes * The field parameters spf (RAW), bitnum and numbits (BIT and SBIT) are now restricted to 16-bit numbers, which should be more than enough. The public API uses gd_spf_t and gd_bit_t for these quantities. * The shift field parameter is now a 64-bit integer type, called gd_shift_t. * The parser callback has received a new, API breaking signature, which should hopefully reduce the amount of API breakage in the future. It is also now possible for the caller to pass data through GetData to the callback, if desired. * Computation of derived fields can now handle complex valued inputs, and computation will occur in the complex plane when required. * The computation of LINCOM fields has been re-written and is now ~20% faster for LINCOMs with 2 or 3 input fields. (No change for LINCOMs of 1 field.) * A new open flag, GD_PRETTY_PRINT, tells the library to attempt to write a nicer looking format file. What this specifically means, isn't part of the public API and shouldn't be relied on in portable code. * BUG FIX: dirfile_madd_spec() and dirfile_add_spec() didn't properly flag the fragments they modified as dirty, leading to possible loss of metadata. * BUG FIX: calling get_nframes on a bzip2 encoded dirfile would report the wrong dirfile length. * BUG FIX: LINTERP tables are now closed after loading, resolving a file descriptor leak of great age (ie. pre-0.3.0). * BUG FIX: When re-writing a format file fragment containing fields with CONST scalar field parameters, GetData no longer replaces the CONST field codes in the field specification lines with the value of the CONST field. * BUG FIX: when moving a field with dirfile_move(), the fragment index in the entry objects of metafields defined for the field were not updated. (The metafields were placed in the correct fragment when the metadata was flushed to disk, despite this.) * BUG FIX: Calling getdata() or putdata() on 64-bit architectures in certain situations involving a non-zero frameoffset no longer results in bizarrity. * BUG FIX: A memory leak associated with RAW field metadata has been fixed. * BUG FIX: 64-bit integer literals in the format file are no longer truncated to double precision when read. API Changes * This release breaks ABI compatibility and, to a lesser extent, API compatibility. The SOVERSION of the library has been incremented accordingly. * The dirfile flags, including encoding and endianness symbols are now explicitly long ints. Previously these quantities mixed long int with int arbitrarily. This affects the public API. * A C-89 API will be declared by getdata.h if GETDATA_C89_API is defined before inclusion. If this symbol is not defined, the C API defined will include C-99 conforming complex types, and getdata.h will include complex.h if `complex' has not been defined before inclusion. * Due to the new, simple way of specifying META fields in Standards Version 7, dirfile_add_spec() and dirfile_alter_spec() can be used to modify metafields. dirfile_madd_spec() and dirfile_malter_spec() remain as well. * An array containing the CONST scalar field codes used when non-literal parameters are used in the specification of various different fields has been added to the gd_entry_t object. As a side-effect of this, dirfile_add(), dirfile_alter_entry(), and dirfile_madd() can be used to manipulate non-literal field parameters. * A function, get_native_type(), now exists which returns the underlying data type of a specified field code. * A function, get_framenum(), is now available to perform a "reverse look-up" on a field: given a data value, it reports the frame number where the field has that value. The field must be monotonic. * A function, dirfile_validate(), now exists which can be used to check the validity of a field code before use. * Two new error codes have been added: GD_E_DOMAIN, potentially returned by get_framenum(), and GD_E_BAD_REPR, indicating an unrecognised representation suffix, or an attempt to write to a representation. * A new syntax error suberror code has been added: GD_E_FORMAT_LITERAL, which indicates a syntax error in a complex literal number. * BUG FIX: On success, dirfilename(), dirfile_reference(), and get_reference() didn't change the error code to GD_E_OK, resulting in spurious error codes from these functions. * BUG FIX: dirfile_madd_string() and dirfile_madd_const() now don't fail erroneously by reporting GD_E_BAD_CODE. * BUG FIX: error strings relating to GD_E_DELETE error codes now report the proper error information. * BUG FIX: the list returned by get_mstrings() is now properly NULL terminated. * BUG FIX: the entry->table member now reports the proper path to the LUT. (That is, the path stored in the format file.) Previously it incorrectly reported a path relative to the base dirfile directory. Legacy API Changes * Because they would otherwise be unreported, in the structure returned by GetFormat(), POLYNOM entries are reported as LINCOM entries, by discarding higher order terms. Similarly, SBIT entries are reported as BIT entries. Bindings * Bindings for Python and the Interactive Data Language (IDL) have been added. * Bindings for the functionality introduced into 0.6.0 have been added. * C++: The missing bindings for dirfilename(), get_nvectors(), and get_fragment_index() have been added. * C++: Empty entry class constructors have been added which allow delayed specification of field metadata. * C++: The dirfile.h header now includes all other C++ headers, and is now the only header required to be included in applications. (The other headers can still be included, with no ill effects.) * All bindings have a much expanded test suite, which has resulted in the discovery of many bugs (subsequently fixed). * F77: The callback function is now dirfile-specific, as it is in the C API. * C++ BUG FIX: Entry class constructors now properly set the field name for metafields. * C++ BUG FIX: Fragment::SetEncoding() now actually does what it adver- tises, instead of doing nothing. * C++ BUG FIX: The recode argument to various functions is now optional and defaults to zero, as the documentation already indicated. * C++ BUG FIX: dirfile_close() was not being called by the Dirifle destructor. * F77 BUG FIX: a NULL C string returned from the C API now returns an empty string, rather than causing a segfault. * F77 BUG FIX: attempting to call another F77 function before calling GDCOPN or GDOPEN no longer results in a segfault. * F77 BUG FIX: passing an out-of-range dirfile unit no longer results in undefined behaviour. * F77 BUG FIX: the last character of a string returned by the bindings is no longer deleted. * F77 BUG FIX: string lengths now report the correct length. * F77 BUG FIX: passing dirfile unit 0 to GDCLOS or GDDSCD no longer corrupts the bindings. * F77 BUG FIX: GDFLDN no longer accepts indices less than one. * F77 BUG FIX: GDESTR now space pads its output string, rather than filling the remainder of the string with garbage. * F77 BUG FIX: The get_entry() bindings, GDGExx no longer segfault on dirfile error. * F77 BUG FIX: GDGTST and GDPTST now report the FORTRAN string length, which is one less than the C API would report, due to the lack of a terminating null. * F95 BUG FIX: Attempting to retrieve a PHASE entry with fget_entry() now works. * F95 BUG FIX: Several routines which were named fdrifile_ are now properly spelled. Miscellaneous * All bindings can now be disabled by passing --disable-bindings to ./configure. |=========================================================================| New in version 0.5.0: Dirfile Changes * Support for two new encoding schemes has been added which handle bzip2 and gzip compression. Like the slim encoding, the bzip and gzip encod- ing schemes currently do not support writing, but do allow reading dirfile data compressed with the standard gzip and bzip2 utilities. Reading compressed data is unsurprisingly slow. Library Changes * Encoding schemes relying on external libraries (slim, gzip, bzip2) may now be built into stand-alone library modules which will be loaded, as needed, at runtime. GetData will fail gracefully if modules are missing. See the README for full details. * BUG FIX: Writing metadata to disc now preserves the permissions of the format file fragments which are changed. * BUG FIX: Format files without a line feed character at the end of the file no longer cause the parser to segfault. * BUG FIX: putdata() now reports the correct number of samples written for ASCII encoded files. * BUG FIX: GetData no longer inserts unnecessary "/./" elements into the paths it reports. API Changes * The caller can now register a callback function with a DIRFILE by opening the dirfile with dirfile_cbopen instead of dirfile_open. This callback function will be called by GetData whenever the format file parser encounters a syntax error. The callback function can be used by the caller to either correct the syntax error, or else tell GetData whether to ignore the line or not. The callback function may be later modified by calling dirfile_parser_callback. * A fragment may be removed from a dirfile by calling dirfile_uninclude. * The pathname of the dirfile may be retrieved by calling dirfilename. * The reference field for the dirfile may be set or retrieved by calling dirfile_reference. * Fragment metadata may be queried or modified by calling: - get_encoding, dirfile_alter_encoding - get_endianness, dirfile_alter_endianness - get_frameoffset, dirfile_alter_frameoffset - get_protection, dirfile_protect - get_parent_fragment * Various functions now exist to modify field metadata: - dirfile_alter_entry, dirfile_alter_, dirfile_alter_spec, dirfile_malter_spec * A field may be moved to a different format file fragment using dirfile_move. * A field may be renamed by using dirfile_rename. * A field may be removed from the dirfile by calling dirfile_delete. * The type or fragment index of a field may be retrieved by calling get_entry_type or get_fragment_index, respectively. * The pathname of a raw field may be obtained from a call to get_raw_filename. * A DIRFILE may be deallocated without saving modified metadata by calling dirfile_discard. * A new flag, GD_IGNORE_DUPS, may be passed to dirfile_open to tell the parser to ignore duplicate field specifications in the format files. This is really only useful identically duplicate specifications, since there is no indication of which of the duplicates is honoured. Explicit control can be obtained by handling this inside a caller supplied callback function. Bindings: * All functions in the Fortran 77 bindings have been completely renamed from GDFxxx to GDxxxx to provide a larger namespace for our use. * Fortran 77, Fortran 95, and C++ bindings have been updated for the latest API changes. * BUG FIX: Fortran 77 functions which return character strings no longer corrupt memory as a side-effect of operation. This also affected the Fortran 95 bindings. Miscellaneous: * BUG FIX: The dirfile_madd_bit(3) manual page has been corrected to show the correct order or parameters for all the dirfile_madd_ functions. |=========================================================================| New in version 0.4.2: Library Changes * BUG FIX: The default protection level of format file fragments is now properly set to "none". Reported by Brendan Crill. * BUG FIX: getdata() now reports the correct number of samples read for slim and ASCII encoded files. Reported by Adam Hincks. * BUG FIX: A segmentation fault only encountered when reading slim encoded data has been fixed in dirfile_flush(). Legacy API Changes * Several fixes have been made to better re-create the legacy API: - the return value of GetFormat is no longer marked const (although it should be considered so). - a symbolic link getdata_struct.h -> getdata.h is created when the headers are installed, but only if the legacy API is present in the library. - when included with a C++ compiler, the legacy function prototypes are wrapped in an extern "C" block. (The new API functions are not.) |=========================================================================| New in version 0.4.1: Library Changes * BUG FIX: Adding an ASCII encoded RAW field no longer creates an empty, unencoded binary file. * BUG FIX: A few minor memory leaks have been patched. Most of these were the result of insufficient clean up in dirfile_close(). * As an exception to the Standards, the full stop character '.' is once again permitted in field names. This is required by BLAST. Instead, field names are prohibited from ending with the known encoding exten- sions. The Standards still prohibit the full stop character in field names, and the GD_PEDANTIC flag will disable this exception. Further- more, fields may not be added via GetData which contain a full stop character. * Some minor speed improvements have been made to the format file parser resulting in a ~30% decrease in parsing time. |=========================================================================| New in version 0.4.0: Dirfile Changes * GetData now supports Dirfile Standards Version 6. Standards Version 6 adds numerical (CONST) and string (STRING) scalar fields to the dirfile, as well as other features outlined below. * CONST names can now appear as parameters in field specifications in certain places in lieu of a literal number. * The tokeniser has been re-written. Any sequence of non-NUL bytes can now form a valid token. Field codes may not have ASCII control charac- ters or the "reserved characters" &, /, ;, <, >, |, . but may contain any other characters (including whitespace). * Subordinate fields may now be attached to fields. These subfields are defined with the META directive, and referenced in most cases as "/". * Binary files in dirfiles may now be "encoded". In addition to raw (unencoded) files, two encodings are currently supported: - ASCII encoding (a simple proof-of-functionality encoding), and - Slimlib encoding (a compression library used by ACT). Encoding schemes are fragment-local, although they are inherited from parent fragments. * Endianness is now also fragment-local, meaning different endiannesses can co-exist in the same dirfile (so long as the fields are defined in different format file fragments), and GetData will do the Right Thing. * "FILEFRAM" is no-longer supported as an alias for "INDEX". This affects GetData's implementation of all Standards Versions. Code that made use of FILEFRAM will have to be updated to use INDEX instead. * The reference field, previously the first RAW field in the format file, may now be specified using the REFERENCE directive. The reference field is the field that is looked at when get_nframes() is called. This is important to programs like kst which support streaming dirfiles. * Portions (or all) of a dirfile's data and metadata can be protected from change by specifying the PROTECT directive. This protection is "advisory", ie. while GetData will respect it in all cases, don't count on the PROTECT directive to ensure data integrity. Library Changes * INDEX is now a normal field. It appears in the count/list functions. Attempts to write to INDEX will fail. * The GD_E_EMPTY error code has been removed: it is no longer an error to query a dirfile containing no RAW fields. * The presence of two fields in the dirfile with the same name is now detected, and will cause a syntax error when parsing the format file. Previously, such things were allowed, but only one of the synonym fields could ever be queried. (Which field was returned was arbitrary.) * Field code look-ups for input fields are now cached, which should result in slightly better performance from the library. API Changes * Fields may now be added to dirfiles in a number of different ways: - by passing an gd_entry_t to dirfile_add() - by passing a field specification line to dirfile_add_spec() - by passing field parameters to one of the dirfile_add_() functions. * Whole other format file fragments may also be added to the dirfile by calling dirfile_include(). * A function is now present (dirfile_metaflush()) to flush metadata changes to disk (by re-writing format file fragments). dirfile_flush() and dirfile_close() will also flush metadata, if needed. * STRING and CONST values can be retrieved/set by calling (get,put)_string() and (get,put)_constant(). (get,put)data() are only for vector type fields. * META fields can be queried/set like normal fields using the get/put functions and their full (slashed) field code. * In addition to get_nfields() and get_field_list(), there are now corresponding functions that provide lists/counts of vectors (get_vector_list()/get_nvectors()), particular field types (get_field_list_by_type()/get_nfields_by_type()), as well as functions that provide lists of string values (get_string_values()) and constant values (get_const_values()). * Analogous functions for the add, list, and counting functions exist for META fields, as well. * Extra flags have been added to dirfile_open() to permit indicating the encoding type, if not specified in the dirfile itself. * DIRFILE struct members and gd_entry_t private members are now com- pletely hidden from the public interface. Where previously callers could query dirfile->error to check for an error, they must now call get_error(dirfile). This change was made to reduce unintentional ABI breakage when modifying internal library properties. * GD_VERBOSE has been added to the list of available dirfile_open() flags. If this flag is specified, GetData will write errors to stderr as encountered. Legacy API Changes * Error codes which cannot be returned by the legacy API might not have a corresponding string in GD_ERROR_CODES[]. Instead, these entries will simply be the NULL pointer. * No facilities exist in the legacy API to set or query CONST or STRING fields. However, META fields of vector type can be queried/set using GetData() and PutData(), as in the new API. |=========================================================================| New in version 0.3.1: Legacy API Changes * BUG FIX: Dirfiles are now opened in read-only mode, unless instantiated via PutData(), allowing GetData() calls on read-only dirfiles. If PutData() is called on a dirfile previously opened read-only, it will be re-opened in read-write mode. Bindings * The C++ bindings, formerly called libdirfile, are now called libgetdata++ to be more explicit about what this library is. Miscellaneous * The package now includes pkg-config support for libgetdata. |=========================================================================| New in version 0.3.0: Dirfile Changes * GetData now supports Dirfile Standards Version 5 which includes support for signed 8-bit, and signed and unsigned 64-bit integer types. * As part of Standards Version 5, the restriction on field name length has been removed. (The filesystem will impose an effective limit on RAW fields of a few hundred characters, and format file lines are limited to several thousand, limiting derived field names.) * The library can now convert between big and little endiannesses. An optional directive, ENDIAN, added in Standards Version 5, is available to specify the byte-sex of a dirfile. API Changes * There is a new interface which fixes issues with thread safety and largefile support in the old interface. The old interface (referred to as the "legacy API") is still supported, but doesn't fully implement Dirfile Standards Version 5. See the README for full details. * putdata now respects FRAMEOFFSET. * putdata can now write to PHASE fields, and multi-bit BIT fields. * Some error codes have been renamed, and others removed or added, in order to regularise error codes between getdata and putdata in the sundry versions. Furthermore, the underlying values of some of these codes have changed (notably excluding GD_E_OK, which is guaranteed to be zero). Changes include: - GD_E_OPEN_FORMAT is now called GD_E_OPEN - GD_E_BAD_RETURN_TYPE is now called GD_E_BAD_TYPE - GD_E_NO_RAW_FIELDS is now called GD_E_EMPTY - PD_E_MULT_LINCOM is now called GD_E_BAD_PUT_FIELD - GD_E_OPEN_RAWFIELD and PD_E_OPEN RAWFIELD are now both represented by GD_E_RAW_IO - PD_E_BAD_CODE is now handled by GD_E_BAD_CODE - GD_E_FIELD, GD_E_SIZE_MISMATCH, ENDIAN_ERROR, CLOSE_ERROR are no longer applicable and have been removed - PD_E_CLOSE_RDONLY, PD_E_WRITE_LOCK, PD_E_FLOCK_ALLOC, which were were defined in the header but never used, have been removed - GD_E_TRUNC, GD_E_CREAT, GD_E_BAD_DIRFILE, GD_E_RANGE and GD_E_ACCMODE are new This affects the legacy API. Legacy API Changes * The legacy API has been marked deprecated. * Error codes have changed per the description above. * Only the public members of FormatType are now initialised by GetFormat. Bindings * Added bindings for C++ (libdirfile), Fortran 77 (libfgetdata), and Fortran 95 (libf95getdata) Miscellaneous * A rudimentary, but thorough, test-suite has been made. libgetdata-0.9.0/config.sub0000740000175000017500000010541212614323564015770 0ustar alastairalastair#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2013 Free Software Foundation, Inc. timestamp='2013-10-01' # 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 1992-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 | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 \ | or1k | 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 | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | 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=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -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 ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or1k-*) 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: libgetdata-0.9.0/man/0000740000175000017500000000000012614323564014555 5ustar alastairalastairlibgetdata-0.9.0/man/gd_eof64.30000640000175000017500000000270312614323564016242 0ustar alastairalastair.\" gd_eof64.3. The gd_eof64 man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_eof64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_eof64 \(em retrieve data from a dirfile database, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "gd_off64_t gd_eof64(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION This version of .BR gd_eof (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_eof (3). Otherwise, .BR gd_eof (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_eof (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_alter_bit.30000640000175000017500000002475212614323564017274 0ustar alastairalastair.\" gd_alter_bit.3. The gd_alter_bit man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_bit 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_alter_bit, gd_alter_carray, gd_alter_clincom, gd_alter_const, gd_alter_cpolynom, gd_alter_crecip, gd_alter_divide, gd_alter_lincom, gd_alter_linterp, gd_alter_multiply, gd_alter_phase, gd_alter_polynom, gd_alter_raw, gd_alter_recip, gd_alter_sbit \(em modify a field in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_bit(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", int " bitnum ", int " numbits ); .HP .BI "int gd_alter_carray(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " const_type ", size_t " array_len ); .HP .BI "int gd_alter_clincom(DIRFILE *" dirfile ", const char *" field_code , .BI "int " n_fields ", const char **" in_fields ", const double complex *" cm , .BI "const double complex *" cb ); .HP .BI "int gd_alter_const(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " const_type ); .HP .BI "int gd_alter_cpolynom(DIRFILE *" dirfile ", const char *" field_code , .BI "int " poly_ord ", const char *" in_field ", const double complex *" ca ); .HP .BI "int gd_alter_crecip(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", complex double " cdividend ); .HP .BI "int gd_alter_divide(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field1 ", const char *" in_field2 ); .HP .BI "int gd_alter_lincom(DIRFILE *" dirfile ", const char *" field_code , .BI "int " n_fields ", const char **" in_fields ", const double *" m , .BI "const double *" b ); .HP .BI "int gd_alter_linterp(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", const char *" table ", int " rename_table ); .HP .BI "int gd_alter_mplex(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", const char *" count_field , .BI "int " count_val ", int " period ); .HP .BI "int gd_alter_multiply(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field1 ", const char *" in_field2 ); .HP .BI "int gd_alter_phase(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", gd_shift_t " shift ); .HP .BI "int gd_alter_polynom(DIRFILE *" dirfile ", const char *" field_code , .BI "int " poly_ord ", const char *" in_field ", const double *" ca ); .HP .BI "int gd_alter_raw(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " data_type ", unsigned int " spf ", int " recode ); .HP .BI "int gd_alter_recip(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", double " dividend ); .HP .BI "int gd_alter_sbit(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", int " bitnum ", int " numbits ); .HP .BI "int gd_alter_window(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", const char *" check_field , .BI "gd_windop_t " windop ", gd_triplet_t " threshold ); .hy .ad n .SH DESCRIPTION These functions provide alternatives to using the .BR gd_alter_entry (3) function to modify a field of the indicated type in the dirfile specified by .IR dirfile . .PP In all of these calls, .I field_code indicates the the field to be modified, which may be a regular field, or a metafield specified by its full (slashed) field code, but should not contain a representation suffix. The meaning and valid types of other arguments may be obtained from the .BR get_entry (3) and .BR dirfile-format (5) manual pages. The .B gd_shift_t type is a signed 64-bit integer type. The .B gd_triplet_t type is defined as: .PP .in +4n .nf .fam C typedef union { gd_int64_t i; gd_uint64_t u; double r; } gd_triplet_t; .fam .fi .in .PP Which element of this .B gd_triplet_t union to set depends on the operator selected for the .B WINDOW field. See .BR gd_entry (3) for details. The .BR gd_alter_clincom () and .BR gd_alter_cpolynom () functions are identical to .BR gd_alter_lincom () and .BR gd_alter_polynom (), except they take complex scalar parameters, instead of purely real values. This only matters for the input of .I new parameters; if the scalar parameters are not changed (by passing NULL instead of a list of scalars), the functions can be used interchangeably, regardless of whether the altered field has complex scalar parameters or not. If the corresponding parameters are to be changed, the .BR gd_alter_lincom () and .BR gd_alter_clincom () functions take pointers to three arrays of length .I n_fields containing the input field names .RI ( in_fields ), the gain factors .RI ( m " or " cm ), and the offset terms .RI ( b " or " cb ). Similarly, .BR gd_alter_polynom () and .BR gd_alter_cpolynom () take an array of length .I poly_ord + 1 containing the polynomial co-efficients .RI ( a " or " ca ). Some field parameters have special values which indicate no change should be made to the parameter. These special values are: .TP .B NULL\fR: any of the string parameters, also .IR m ", " b ", " a ", " cm ", " cb ", or " ca ; .TP .B 0\fR: .IR spf ", " n_fields ", " numbits ", " cdividend ", " dividend ", or " array_len ; .TP .B -1\fR: .IR bitnum " or " period ; .TP .B GD_NULL\fR: .IR data_type " or " const_type ; .TP .B GD_WINDOP_UNK\fR: .IR windop . .PP All field parameters introduced with this interface must contain literal parameters. Field parameters which are scalar fields cannot be introduced with these functions. To do that, use .BR gd_alter_entry (3), .BR gd_alter_spec (3) or .BR gd_malter_spec (3), as appropriate. If .I rename_table is non-zero, the look-up table referenced by the .B LINTERP field will be renamed to the path given by .IR table . If .I recode is non-zero, the binary file associated with the .B RAW field will be re-encoded to reflect the new field parameters. In this case, the field's I/O pointer will be reset to the beginning-of-frame. If .BR gd_alter_carray () is used to increase the length of a .B CARRAY field, the added elements will be uninitialised. Use .BR gd_put_carray_slice (3) or equivalent to initialise them. See .B NOTES below for information on using .BR gd_alter_clincom "(), " gd_alter_crecip (), and .BR gd_alter_cpolynom () in the C89 GetData API. .SH RETURN VALUE On success, any of these functions returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found, or a supplied field code did not contain the appropriate prefix or suffix. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY One or more of the field parameters specified was invalid. .TP .B GD_E_BAD_FIELD_TYPE The field specified by .I field_code was of the wrong type for the function called. .TP .B GD_E_BAD_TYPE The .IR data_type " or " const_type argument was invalid. .TP .B GD_E_IO An I/O error occurred while translating the binary file associated with a modified .B RAW field, or an I/O error occurred while attempting to rename a .B LINTERP table file. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, a request to translate the binary file associated with a .B RAW field was attempted, but the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to translate the binary file be associated with a modified .B RAW field. .TP .B GD_E_UNSUPPORTED The encoding scheme of the indicated format specification fragment does not support translating the binary file associated with a modified .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES The C89 GetData API provides different prototypes for .BR gd_alter_clincom "(), " gd_alter_cpolynom (), and .BR gd_alter_crecip (): .PP .nf .B #define GD_C89_API .br .B #include .fi .HP .nh .ad l .BI "int gd_alter_clincom(DIRFILE *" dirfile ", const char *" field_code , .BI "int " n_fields ", const char **" in_fields ", const double *" cm , .BI "const double *" cb ); .HP .BI "int gd_alter_cpolynom(DIRFILE *" dirfile ", const char *" field_code , .BI "int " poly_ord ", const char *" in_fields ", const double *" ca ); .HP .BI "int gd_alter_crecip(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" in_field ", const double " cdividend\fR[2] ); .hy .ad n .PP In this case, the array pointers passed as .IR cm ", " cb or .IR ca should have twice as many (purely real) elements, consisting of alternating real and imaginary parts for the complex data. That is, for example, .IR ca [0] should be the real part of the first co-efficient, .IR ca [1] the imaginary part of the first co-efficient, .IR ca [2] the real part of the second co-efficient, .IR ca [3] the imaginary part of the second co-efficient, and so on. Similarly, the .I cdividend parameter becomes a double precision array of length two. .PP For .BR gd_alter_clincom () and .BR gd_alter_cpolynom (), these are simply different (but equivalent) declarations of the C99 function entry point. For .BR gd_alter_crecip (), however, a different entry point is needed (since the .I cdividend parameter is passed by reference instead of by value). In the interests of portability, the C89 version of .BR gd_alter_crecip () is always available, and may be accessed as .BR gd_alter_crecip89 (), with the C89 prototype, in both the C99 and C89 APIs. Passing NULL as .I cdividend is equivalent to specifying a dividend of zero: it indicates no change to the dividend parameter. .SH SEE ALSO .BR gd_alter_entry (3), .BR gd_alter_spec (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_malter_spec (3), .BR gd_metaflush (3), .BR gd_open (3), .BR gd_put_carray_slice (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_put_carray_slice.30000640000175000017500000001217212614323564020650 0ustar alastairalastair.\" gd_put_carray_slice.3. The gd_put_carray_slice man page. .\" .\" Copyright (C) 2010, 2011, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_put_carray_slice 3 "4 July 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_put_carray, gd_put_carray_slice, gd_put_constant \(em write CONST or CARRAY data to a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_put_carray_slice(DIRFILE *" dirfile ", const char *" field_code , .BI "unsigned int " start ", size_t " len ", gd_type_t " data_type , .BI "const void *" data_in ); .HP .BI "int gd_put_carray(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " data_type ", const void *" data_in ); .HP .BI "int gd_put_constant(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " data_type ", const void *" data_in ); .hy .ad n .SH DESCRIPTION The .BR gd_put_carray_slice () function writes data to a dirfile(5) database specified by .I dirfile into the .B CARRAY scalar array .IR field_code . The data in the field is converted from the data type specified by .IR data_type , and read from in the user-supplied buffer .IR data_in . The location of the first element of the field into which data is stored is given by .IR start , and the number of elements stored is given by .IR len . The .BR gd_put_carray () function behaves similarly, except the whole scalar array is written, as if .BR gd_put_carray_slice () were called with .I start equal zero and .I len equal to the value returned by .BR gd_carray_len (3). The .BR gd_put_constant () function is equivalent to calling .BR gd_put_carray_slice () with .I start equal to zero and .I len equal to one. None of these interfaces can write to field representations. The argument .I data_in must point to a valid memory location containing all the data to be written. The number of elements which will be stored by .BR gd_put_carray () may be obtained by calling .BR gd_carray_len (3). Unlike .BR gd_putdata (3), writing data past the end of the field is not permitted. To add data to a .BR CARRAY , first increase its length by calling .BR gd_alter_carray (3), or another equivalent function. The .I data_type argument should be one of the following symbols, which indicates the type of the data pointed to by .IR data_in : .RS .TP 11 .B GD_UINT8 unsigned 8-bit integer .TP .B GD_INT8 signed (two's complement) 8-bit integer .TP .B GD_UINT16 unsigned 16-bit integer .TP .B GD_INT16 signed (two's complement) 16-bit integer .TP .B GD_UINT32 unsigned 32-bit integer .TP .B GD_INT32 signed (two's complement) 32-bit integer .TP .B GD_UINT64 unsigned 64-bit integer .TP .B GD_INT64 signed (two's complement) 64-bit integer .TP .B GD_FLOAT32 IEEE-754 standard 32-bit single precision floating point number .TP .B GD_FLOAT64 IEEE-754 standard 64-bit double precision floating point number .TP .B GD_COMPLEX64 C99-conformant 64-bit single precision complex number .TP .B GD_COMPLEX128 C99-conformant 128-bit double precision complex number .RE The type of the input data need not be the same as the storage type of the field. Type conversion will be performed as necessary to return the requested type. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE On success, .BR gd_put_carray (), .BR gd_put_carray_slice () and .BR gd_put_constant () return zero. On error, they return -1 and set the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified .I dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE An invalid .I dirfile was supplied. .TP .B GD_E_BAD_FIELD_TYPE The supplied .I field_code was not a .B CONST nor a .BR CARRAY . The caller should use .BR gd_putdata (3), .BR gd_put_constant (3), or .BR gd_put_string (3) instead. .TP .B GD_E_BAD_TYPE An invalid .I data_type was specified. .TP .B GD_E_BOUNDS A request for data beyond the end of the field was made. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_PROTECTED The fragment containing the constant was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered may be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_carray_len (3), .BR gd_carrays (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_get_carray_slice (3), .BR gd_open (3), .BR gd_put_constant (3) libgetdata-0.9.0/man/dirfile2ascii.10000640000175000017500000001145012614323564017353 0ustar alastairalastair.\" dirfile2ascii.1. The dirfile2ascii man page. .\" .\" Copyright (C) 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH dirfile2ascii 1 "21 February 2012" "Version 0.8.0" "GETDATA" .SH NAME dirfile2ascii \(em output dirfile database vectors as ASCII text .SH SYNOPSIS .nh .ad l .HP \fBdirfile2ascii\fR [ \fIOPTION\fR ]... \fIDIRFILE\fR .RB "[ [ " \-a " | " \-A " | " \-e " | " \-E " | " \-F " | " \-g " | " \-G " |" .BR \-o " | " \-i " | " \-u " | " \-x " | " \-X " ]" .IR FIELD " ]..." .hy .ad n .SH DESCRIPTION Fetches data from a dirfile(5) database specified by .I DIRFILE and writes it as ASCII to standard output. Any number of vector .IR FIELD s may be specified. Each specified field is printed in a separate column. Mandatory arguments to long options are mandatory for short options too. .TP .BR \-d ", " \-\-delimeter =\fIdelim\fR separate columns by .IR delim . (Default: a single space.) .TP .BR \-f ", " \-\-first\-frame =\fIfirst_frame\fB\-\fIlast_frame\fR read from frame .I first_frame to frame .I last_frame (inclusive). .TP .BR \-f ", " \-\-first\-frame =\fIfirst_frame\fB:\fInframes\fR equivalent to \fB\-\-first\-frame\fR=\fIfirst_frame\fR \fB\-\-num-frames\fR=\fInframes\fR. .TP .BR \-f ", " \-\-first\-frame =\fIfirst_frame\fR If \fIfirst_frame\fR\~>=\~0, start reading at frame .IR first_frame . If .I first_frame is -1 and \fB\-\-num-frames\fR=\fInframes\fR is specified, read the last .I nframes frames. If .B \-\-first-frame is not specified, reading starts at frame zero. .TP .BR \-n ", " \-\-num\-frames =\fInframes\fR read at most .I nframes frames. If not specified, or if \fBnframes\fR\~=\~0, all frames to the end-of-field are read. .TP .BR \-p ", " \-\-precision =\fIformat\fR use .I format to format output. .I format may contain any of the flag characters, a field width, and/or a precision as specified in .BR printf (3). It may \fInot\fR contain a length modifier. .TP .BR \-q ", " \-\-quiet don't write diagnostic messages on standard error. (This is the default behaviour). .TP .BR \-s ", " \-\-skip =\fIframe_skip\fR if \fIframe_skip\fR\~>\~0, output only one sample for every .I frame_skip frames. .TP .BR \-v ", " \-\-verbose write diagnostic messages on standard error. .TP .BR \-z ", " \-\-fill =\fISTRING\fR Fill columns which go past the end of their corresponding field with the string .IR STRING . The default behaviour is to fill columns with floating-point conversions with .B NaN and columns with integer conversion with .BR 0 , which mirrors what occurs when an attempt is made to print data from before the start of a field. (Note: the default behaviour cannot be reproduced with this option, since .I STRING is applied to all columns, regardless of conversion type.) .P In addition to the above, each .I FIELD argument may be preceded by a short option, one of: .BR \-a ", " \-A ", " \-e ", " \-E ", " \-F ", " \-g ", " \-G ", " \-i , .BR \-o ", " \-u ", " \-x ", " \-X , indicating the conversion to be used. See .BR printf (3) for the meaning of these conversion specifiers. The output flags, width, and precision may be specified by using .BR \-\-precision . If no conversion specifier is given, .B %f is used. For conversion specifiers .BR %a ", " %A ", " %e ", " %E ", " %f ", " %F ", " %g ", " %G , data is read from the dirfile as double precision floats. For conversion specifier \fB%i\fR, data is read as 64-bit signed integers. For conversion specifiers .BR %o ", " %u ", " %x ", " %X , data is read as 64-bit unsigned integers. .SH LIMITATIONS No native support for printing complex data is provided. This may be worked around by using dirfile(5) representation suffixes. For example, the command .IP .B dirfile2ascii .I DIRFILE .IB FIELD .r .IB FIELD .i .P will print the real and imaginary parts of the complex valued field .I FIELD in the first and second columns, respectively. .SH AUTHOR dirfile2ascii was written by Matthew Truch and D. V. Wiebe. .SH REPORTING BUGS Please send reports of bugs to getdata\-devel@lists.sourceforge.net The GetData home page: .SH COPYRIGHT Copyright \(co 2010 Matthew Truch. dirfile2ascii is licenced under the GNU LPGL version 2.1 or later. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH SEE ALSO .BR defile (1), .BR dirfile (5), .BR printf (3) libgetdata-0.9.0/man/Makefile.in0000640000175000017500000006775512614323564016650 0ustar alastairalastair# Makefile.in generated by automake 1.14.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 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@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/gd_alter_encoding.3.in \ $(srcdir)/gd_alter_endianness.3.in \ $(srcdir)/gd_alter_frameoffset.3.in $(dist_man_MANS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/encoding.m4 \ $(top_srcdir)/m4/floatordering.m4 $(top_srcdir)/m4/idl.m4 \ $(top_srcdir)/m4/matlab.m4 $(top_srcdir)/m4/perl.m4 \ $(top_srcdir)/m4/php.m4 $(top_srcdir)/m4/python.m4 \ $(top_srcdir)/m4/win32.m4 $(top_srcdir)/m4/version.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/gd_config.h \ $(top_builddir)/src/getdata.h CONFIG_CLEAN_FILES = gd_alter_encoding.3 gd_alter_endianness.3 \ gd_alter_frameoffset.3 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)" \ "$(DESTDIR)$(man5dir)" man3dir = $(mandir)/man3 man5dir = $(mandir)/man5 NROFF = nroff MANS = $(dist_man_MANS) $(nodist_man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BUILDCC = @BUILDCC@ BZIP2_CPPFLAGS = @BZIP2_CPPFLAGS@ BZIP2_LDFLAGS = @BZIP2_LDFLAGS@ BZIP2_LIBS = @BZIP2_LIBS@ CC = @CC@ CCAS = @CCAS@ CCASDEPMODE = @CCASDEPMODE@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DATE = @DATE@ DEFINE_GD_GETDATA_INT_VERSION = @DEFINE_GD_GETDATA_INT_VERSION@ DEFINE_GD_GETDATA_VERSION = @DEFINE_GD_GETDATA_VERSION@ DEFINE_GD_LEGACY_API = @DEFINE_GD_LEGACY_API@ DEFINE_GD_NO_C99_API = @DEFINE_GD_NO_C99_API@ DEFINE_gd_int16_t = @DEFINE_gd_int16_t@ DEFINE_gd_int64_t = @DEFINE_gd_int64_t@ DEFINE_gd_uint16_t = @DEFINE_gd_uint16_t@ DEFINE_gd_uint64_t = @DEFINE_gd_uint64_t@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ DLLTOOL = @DLLTOOL@ DL_LIBRARY_PATH = @DL_LIBRARY_PATH@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ F77 = @F77@ F95GETDATA_VERSION = @F95GETDATA_VERSION@ FC = @FC@ FCFLAGS = @FCFLAGS@ FFLAGS = @FFLAGS@ FGETDATA_VERSION = @FGETDATA_VERSION@ FGREP = @FGREP@ FLAC_CPPFLAGS = @FLAC_CPPFLAGS@ FLAC_LDFLAGS = @FLAC_LDFLAGS@ FLAC_LIBS = @FLAC_LIBS@ FLIBS = @FLIBS@ GD_CC_WALL = @GD_CC_WALL@ GD_CC_WEXTRA = @GD_CC_WEXTRA@ GD_CXX_WALL = @GD_CXX_WALL@ GD_CXX_WEXTRA = @GD_CXX_WEXTRA@ GD_DIRSEP = @GD_DIRSEP@ GD_F77_WALL = @GD_F77_WALL@ GD_F77_WEXTRA = @GD_F77_WEXTRA@ GD_FC_WALL = @GD_FC_WALL@ GD_FC_WEXTRA = @GD_FC_WEXTRA@ GD_FDIRSEP = @GD_FDIRSEP@ GETDATAXX_VERSION = @GETDATAXX_VERSION@ GETDATA_DEBUG = @GETDATA_DEBUG@ GETDATA_IFACE_AGE = @GETDATA_IFACE_AGE@ GETDATA_IFACE_VERSION = @GETDATA_IFACE_VERSION@ GETDATA_IMPL_REVISION = @GETDATA_IMPL_REVISION@ GETDATA_MAJOR = @GETDATA_MAJOR@ GETDATA_MINOR = @GETDATA_MINOR@ GETDATA_REVISION = @GETDATA_REVISION@ GETDATA_VERSION_SUFFIX = @GETDATA_VERSION_SUFFIX@ GREP = @GREP@ GZIP_CPPFLAGS = @GZIP_CPPFLAGS@ GZIP_LDFLAGS = @GZIP_LDFLAGS@ GZIP_LIBS = @GZIP_LIBS@ IDL = @IDL@ IDL_CFLAGS = @IDL_CFLAGS@ IDL_LIBS = @IDL_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ JOT = @JOT@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBLTDL = @LIBLTDL@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTDLINCL = @LTDLINCL@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LZMA_CPPFLAGS = @LZMA_CPPFLAGS@ LZMA_LDFLAGS = @LZMA_LDFLAGS@ LZMA_LIBS = @LZMA_LIBS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATLAB = @MATLAB@ MATLABGETDATA_VERSION = @MATLABGETDATA_VERSION@ MATLAB_CPPFLAGS = @MATLAB_CPPFLAGS@ MEX = @MEX@ 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@ PERL = @PERL@ PERL_MAN3EXT = @PERL_MAN3EXT@ PHP = @PHP@ PHP_CONFIG = @PHP_CONFIG@ PHP_CPPFLAGS = @PHP_CPPFLAGS@ PHP_ldflags = @PHP_ldflags@ PHP_libs = @PHP_libs@ PRINTF = @PRINTF@ PRIVATE_LIBS = @PRIVATE_LIBS@ PYTHON = @PYTHON@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SEQ = @SEQ@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SLIM_CPPFLAGS = @SLIM_CPPFLAGS@ SLIM_LDFLAGS = @SLIM_LDFLAGS@ SLIM_LIBS = @SLIM_LIBS@ STRIP = @STRIP@ VERSION = @VERSION@ ZZIP_CPPFLAGS = @ZZIP_CPPFLAGS@ ZZIP_LDFLAGS = @ZZIP_LDFLAGS@ ZZIP_LIBS = @ZZIP_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ absolute_docdir = @absolute_docdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ ac_ct_F77 = @ac_ct_F77@ ac_ct_FC = @ac_ct_FC@ 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@ idldir = @idldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ matlabbasedir = @matlabbasedir@ mexext = @mexext@ mkdir_p = @mkdir_p@ moduledir = @moduledir@ oldincludedir = @oldincludedir@ path_bunzip2 = @path_bunzip2@ path_bzip2 = @path_bzip2@ path_flac = @path_flac@ path_gunzip = @path_gunzip@ path_gzip = @path_gzip@ path_slimdata = @path_slimdata@ path_unslim = @path_unslim@ path_unzip = @path_unzip@ path_xz = @path_xz@ path_zip = @path_zip@ pdfdir = @pdfdir@ perldir = @perldir@ perlmandir = @perlmandir@ phpdir = @phpdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pythondir = @pythondir@ 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@ # Copyright (C) 2008-2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign nodist_man_MANS = gd_alter_encoding.3 gd_alter_endianness.3 \ gd_alter_frameoffset.3 dist_man_MANS = checkdirfile.1 dirfile2ascii.1 gd_add.3 gd_add_alias.3 \ gd_add_bit.3 gd_add_spec.3 gd_alias_target.3 gd_aliases.3 \ gd_alter_affixes.3 gd_alter_bit.3 gd_alter_entry.3 \ gd_alter_protection.3 gd_alter_spec.3 gd_array_len.3 gd_bof.3 \ gd_bof64.3 gd_carrays.3 gd_cbopen.3 gd_close.3 gd_constants.3 \ gd_delete.3 gd_desync.3 gd_dirfile_standards.3 \ gd_dirfilename.3 gd_encoding.3 gd_encoding_support.3 \ gd_endianness.3 gd_entry.3 gd_entry_list.3 gd_entry_type.3 \ gd_eof.3 gd_eof64.3 gd_error.3 gd_error_count.3 \ gd_error_string.3 gd_flags.3 gd_flush.3 gd_fragment_affixes.3 \ gd_fragment_index.3 gd_fragmentname.3 gd_framenum_subset.3 \ gd_framenum_subset64.3 gd_frameoffset.3 gd_frameoffset64.3 \ gd_free_entry_strings.3 gd_get_carray_slice.3 gd_get_string.3 \ gd_getdata.3 gd_getdata64.3 gd_hidden.3 gd_hide.3 \ gd_include_affix.3 gd_invalid_dirfile.3 gd_linterp_tablename.3 \ gd_madd_bit.3 gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 \ gd_move.3 gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \ gd_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \ gd_nframes64.3 gd_parent_fragment.3 gd_parser_callback.3 \ gd_protection.3 gd_put_carray_slice.3 \ gd_put_string.3 gd_putdata.3 gd_putdata64.3 gd_raw_filename.3 \ gd_reference.3 gd_rename.3 gd_rewrite_fragment.3 gd_seek.3 \ gd_seek64.3 gd_spf.3 gd_strings.3 gd_strtok.3 gd_tell.3 \ gd_tell64.3 gd_uninclude.3 gd_validate.3 gd_verbose_prefix.3 \ GD_SIZE.3 dirfile.5 dirfile-encoding.5 dirfile-format.5 # these are real_file:alias MAN3ALIASES = gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \ gd_add_bit.3:gd_add_const.3 gd_add_bit.3:gd_add_cpolynom.3 \ gd_add_bit.3:gd_add_crecip.3 gd_add_bit.3:gd_add_divide.3 \ gd_add_bit.3:gd_add_lincom.3 gd_add_bit.3:gd_add_linterp.3 \ gd_add_bit.3:gd_add_mplex.3 gd_add_bit.3:gd_add_multiply.3 \ gd_add_bit.3:gd_add_polynom.3 gd_add_bit.3:gd_add_phase.3 \ gd_add_bit.3:gd_add_raw.3 gd_add_bit.3:gd_add_recip.3 \ gd_add_bit.3:gd_add_sbit.3 gd_add_bit.3:gd_add_string.3 \ gd_add_bit.3:gd_add_window.3 \ gd_madd_bit.3:gd_madd_carray.3 gd_madd_bit.3:gd_madd_clincom.3 \ gd_madd_bit.3:gd_madd_const.3 gd_madd_bit.3:gd_madd_cpolynom.3 \ gd_madd_bit.3:gd_madd_crecip.3 gd_madd_bit.3:gd_madd_divide.3 \ gd_madd_bit.3:gd_madd_lincom.3 gd_madd_bit.3:gd_madd_linterp.3 \ gd_madd_bit.3:gd_madd_mplex.3 gd_madd_bit.3:gd_madd_multiply.3 \ gd_madd_bit.3:gd_madd_phase.3 gd_madd_bit.3:gd_madd_polynom.3 \ gd_madd_bit.3:gd_madd_recip.3 gd_madd_bit.3:gd_madd_sbit.3 \ gd_madd_bit.3:gd_madd_string.3 gd_madd_bit.3:gd_madd_window.3 \ gd_add.3:gd_madd.3 \ gd_add_spec.3:gd_madd_spec.3 \ gd_cbopen.3:gd_open.3 \ gd_close.3:gd_discard.3 \ gd_include_affix.3:gd_include.3 \ gd_alter_bit.3:gd_alter_carray.3 gd_alter_bit.3:gd_alter_clincom.3 \ gd_alter_bit.3:gd_alter_const.3 gd_alter_bit.3:gd_alter_cpolynom.3 \ gd_alter_bit.3:gd_alter_crecip.3 gd_alter_bit.3:gd_alter_divide.3 \ gd_alter_bit.3:gd_alter_lincom.3 gd_alter_bit.3:gd_alter_linterp.3 \ gd_alter_bit.3:gd_alter_mplex.3 gd_alter_bit.3:gd_alter_multiply.3 \ gd_alter_bit.3:gd_alter_phase.3 gd_alter_bit.3:gd_alter_polynom.3 \ gd_alter_bit.3:gd_alter_recip.3 gd_alter_bit.3:gd_alter_raw.3 \ gd_alter_bit.3:gd_alter_sbit.3 gd_alter_bit.3:gd_alter_window.3 \ gd_alter_spec.3:gd_malter_spec.3 \ gd_framenum_subset.3:gd_framenum.3 \ gd_get_carray_slice.3:gd_get_carray.3 \ gd_get_carray_slice.3:gd_get_constant.3 \ gd_put_carray_slice.3:gd_put_carray.3 \ gd_put_carray_slice.3:gd_put_constant.3 \ gd_delete.3:gd_delete_alias.3 \ gd_hide.3:gd_unhide.3 \ gd_add_alias.3:gd_madd_alias.3 \ gd_flush.3:gd_sync.3 gd_flush.3:gd_raw_close.3 \ gd_nentries.3:gd_nfields.3 gd_nentries.3:gd_nfields_by_type.3 \ gd_nentries.3:gd_nmfields.3 gd_nentries.3:gd_nmfields_by_type.3 \ gd_nentries.3:gd_nmvectore.3 gd_nentries.3:gd_nvectors.3 \ gd_entry_list.3:gd_field_list.3 gd_entry_list.3:gd_field_list_by_type.3 \ gd_entry_list.3:gd_mfield_list.3 gd_entry_list.3:gd_mfield_list_by_type.3 \ gd_entry_list.3:gd_nmvectore.3 gd_entry_list.3:gd_vector_list.3 \ gd_frameoffset64.3:gd_alter_frameoffset64.3 \ gd_array_len.3:gd_carray_len.3 #man conversion HTMLMANS = $(addsuffix .html,${nodist_man_MANS}) \ $(addsuffix .html,${dist_man_MANS}) all: all-am .SUFFIXES: $(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 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: $(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): gd_alter_encoding.3: $(top_builddir)/config.status $(srcdir)/gd_alter_encoding.3.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gd_alter_endianness.3: $(top_builddir)/config.status $(srcdir)/gd_alter_endianness.3.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ gd_alter_frameoffset.3: $(top_builddir)/config.status $(srcdir)/gd_alter_frameoffset.3.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-man1: $(dist_man_MANS) $(nodist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS) $(nodist_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='$(dist_man_MANS) $(nodist_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-man3: $(dist_man_MANS) $(nodist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS) $(nodist_man_MANS)'; \ 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=''; test -n "$(man3dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.3[a-z]*$$/p'; \ } | 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) install-man5: $(dist_man_MANS) $(nodist_man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(dist_man_MANS) $(nodist_man_MANS)'; \ test -n "$(man5dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man5dir)" || 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 '/\.5[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,^[^5][0-9a-z]*$$,5,;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)$(man5dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$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)$(man5dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \ done; } uninstall-man5: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man5dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(dist_man_MANS) $(nodist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.5[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir) tags TAGS: 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 $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man3dir)" "$(DESTDIR)$(man5dir)"; 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 clean-local 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 @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook 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-man5 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 @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) uninstall-hook uninstall-man: uninstall-man1 uninstall-man3 uninstall-man5 .MAKE: install-am install-data-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am \ install-data-hook 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-man5 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 tags-am uninstall uninstall-am uninstall-hook \ uninstall-man uninstall-man1 uninstall-man3 uninstall-man5 %.html: % make_html.pl ./make_html.pl $< > $@ htmlman: $(HTMLMANS) for m in $(MAN3ALIASES); do \ ./make_html.pl `echo $$m | $(SED) -e 's/:\\(.*\\).3/ \\1/'` \ > `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \ done install-data-hook: cd $(DESTDIR)$(mandir)/man3 && \ for m in $(MAN3ALIASES); do \ rm -f `echo $$m | $(SED) -e 's/.*://'`; \ $(LN_S) `echo $$m | $(SED) -e 's/:/ /'`; \ done uninstall-hook: cd $(DESTDIR)$(mandir)/man3 && \ for m in $(MAN3ALIASES); do \ rm -f `echo $$m | $(SED) -e 's/.*://'`; \ done clean-local: rm -f *~ *.html rm -f $(nodist_man_MANS) # 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: libgetdata-0.9.0/man/gd_carrays.30000640000175000017500000000765012614323564016771 0ustar alastairalastair.\" gd_carrays.3. The gd_carrays man page. .\" .\" Copyright (C) 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_carrays 3 "17 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_carrays \(em retrieve a list of CARRAY values from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const gd_carray_t *gd_carrays(DIRFILE *" dirfile ", gd_type_t .IB return_type ); .hy .ad n .SH DESCRIPTION The .BR gd_carrays () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of values of the all .B CARRAY fields defined in the database, after type conversion to the data type specified by .IR return_type . Notably, this list does not include /META subfields. For a list of valid symbols to use for .IR return_type , see the .BR gd_get_carray (3) man page. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order, except that it is guaranteed to be in the same order as the list of .B CARRAY fields returned by .BR gd_field_list_by_type (3). The number of values in the array can be obtained from a call to .BR gd_nfields_by_type (3). The caller may not modify any values in the array, nor the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid only until .BR gd_carrays () is called again with the same arguments, or until the dirfile's metadata is modified (by adding, modifying or deleting an entry), or until the array is de-allocated by a call to .BR gd_close (3). A corresponding list of names for these fields may be obtained by calling .BR gd_field_list_by_type (3). .SH RETURN VALUE Upon successful completion, .BR gd_carrays () returns a pointer to an array of .B gd_carray_t objects containing the values of all the CARRAYs defined in the dirfile database. The .B gd_carray_t is defined as: .PP .in +4n .nf .fam C typedef struct { size_t n; /* array_len */ void *d; /* CARRAY data */ } gd_carray_t; .fam .fi .in .PP where .I n specifies the length of the .B CARRAY data, and .I d is an array of the data values themselves. The caller should cast the .B void pointer to a type appropriate for the .I return_type specified. The list is terminated by an end-of-list marker consisting of a .B gd_carray_t item with .I n set to zero. If no CARRAYs are defined in the database, a list containing only the end-of-list marker is returned. On error, .BR gd_carrays () returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_TYPE The .I return_type specified was invalid. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_field_list_by_type (3), .BR gd_get_carray (3), .BR gd_nfields_by_type (3) libgetdata-0.9.0/man/gd_endianness.30000640000175000017500000000447212614323564017453 0ustar alastairalastair.\" gd_endianness.3. The gd_endianness man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_endianness 3 "17 July 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_endianness \(em report the byte sex of fields in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "unsigned long gd_endianness(DIRFILE *" dirfile ", int " fragment_index ); .hy .ad n .SH DESCRIPTION The .BR gd_endianness () function queries a dirfile(5) database specified by .I dirfile and returns the byte sex for the fragment indexed by .IR fragment_index . The byte sex of a fragment indicate the endianness of data stored in binary files associated with .B RAW fields defined in the specified fragment. The endianness of a fragment containing no .B RAW fields is not meaningful. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_endianness () returns the byte sex of the specified fragment, which will be either .BR GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN , bitwise-or'd with either .B GD_ARM_ENDIAN or .BR GD_NOT_ARM_ENDIAN , indicating whether double-precision floating point data in this fragment are stored in the old ARM middle-endian format. On error, it returns zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_endianness (3), .BR gd_getdata (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_open (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_add_alias.30000640000175000017500000000522612614323564017223 0ustar alastairalastair.\" gd_add_alias.3. The gd_add_alias man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_add_alias 3 "26 July 2012" "Version 0.8.1" "GETDATA" .SH NAME gd_add_alias, gd_madd_alias \(em add a field to a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_add_alias(DIRFILE *" dirfile ", const char *" alias_name , .BI "const char *" target_code ", int " fragment_index ); .HP .BI "int gd_madd_alias(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" alias_name ", const char *" target_code ); .hy .ad n .SH DESCRIPTION The .BR gd_add_alias () function adds the alias named .I alias_name pointing to .I target_code to the fragment indexed by .I fragment_index in the dirfile specified by .IR dirfile . The .BR gd_madd_alias () function behaves similarly, but adds the field as a meta-entry under the field indicated by the field code .IR parent . .SH RETURN VALUE On success, .BR gd_add_alias () and .BR gd_madd_alias () return zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The .IR alias_name contained invalid characters; or it or an input field did not contain the affected fragment's prefix or suffix. Alternately, the .I parent field code was not found, or was already a metafield. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The .I fragment_index specified was out of range. .TP .B GD_E_DUPLICATE The .I alias_name parameter duplicated that of an already existing entry. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, the creation of a .B RAW field was attempted and the data of the fragment was protected. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_add (3), .BR gd_alias_target (3), .BR gd_entry (3), .BR gd_madd (3), .BR gd_metaflush (3), .BR gd_open (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_seek64.30000640000175000017500000000302412614323564016415 0ustar alastairalastair.\" gd_seek64.3. The gd_seek64 man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_seek64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_seek64 \(em retrieve data from a dirfile database, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "gd_off64_t gd_seek64(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_off64_t " frame_num ", gd_off64_t " sample_num ", int " flags ); .hy .ad n .SH DESCRIPTION This version of .BR gd_seek (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_seek (3). Otherwise, .BR gd_seek (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_seek (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_invalid_dirfile.30000640000175000017500000000404412614323564020443 0ustar alastairalastair.\" gd_invalid_dirfile.3. The gd_invalid_dirfile man page. .\" .\" Copyright (C) 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_invalid_dirfile 3 "17 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_invalid_dirfile \(em obtain an pointer to an invalid DIRFILE object .SH SYNOPSIS .B #include .HP .nh .ad l .BI "DIRFILE* gd_invalid_dirfile(void); .hy .ad n .SH DESCRIPTION The .BR gd_invalid_dirfile () returns a pointer to a newly allocated, invalid DIRFILE object. Like any other DIRFILE object, the invalid DIRFILE object should be de-allocated by calling .BR gd_close (3) or .BR gd_discard (3) when it is no longer needed. The DIRFILE object returned may be passed to any other GetData function which requires one, but doing so will inevitably result in that function failing with the .B GD_BAD_DIRFILE error. A similar effect can be achieved by making an invalid .BR gd_open (3) call, such as: .HP .in +2n .nf .fam C .BR gd_open( """""" ,\~ 0 ); .fam .fi .in .PP which also returns a pointer to an invalid DIRFILE object. The difference is that an invalid DIRFILE created in this way has a non-zero dirfile error (obtainable with .BR gd_error (3)), while the dirfile error of the invalid DIRFILE returned by .BR gd_invalid_dirfile (3) is zero (indicating success). .SH RETURN VALUE This function always returns a pointer to a newly allocated, invalid DIRFILE object, except when it is unable to allocate memory for the DIRFILE, in which case it returns NULL. .SH SEE ALSO .BR gd_close (3), .BR gd_discard (3), .BR gd_error (3), .BR gd_open (3) libgetdata-0.9.0/man/gd_bof64.30000640000175000017500000000270312614323564016237 0ustar alastairalastair.\" gd_bof64.3. The gd_bof64 man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_bof64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_bof64 \(em retrieve data from a dirfile database, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "gd_off64_t gd_bof64(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION This version of .BR gd_bof (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_bof (3). Otherwise, .BR gd_bof (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_bof (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_mcarrays.30000640000175000017500000001001312614323564017131 0ustar alastairalastair.\" gd_constants.3. The gd_constants man page. .\" .\" Copyright (C) 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_mcarrays 3 "19 August 2011" "Version 0.7.0" "GETDATA" .SH NAME gd_constants \(em retrieve a list of CARRAY values from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const gd_carray_t *gd_mcarrays(DIRFILE *" dirfile ", const char" .BI * parent ", gd_type_t " return_type ); .hy .ad n .SH DESCRIPTION The .BR gd_mcarrays () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of values of the all .B CARRAY metafields for the supplied .I parent field, after type conversion to the data type specified by .IR return_type . For a list of valid symbols to use for .IR return_type , see the .BR gd_get_carray (3) man page. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order, except that it is guaranteed to be in the same order as the list of .B CARRAY fields returned by .BR gd_mfield_list_by_type (3). The number of values in the array can be obtained from a call to .BR gd_nmfields_by_type (3). The caller may not modify any values in the array, nor the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid only until .BR gd_mcarrays () is called again, or until the dirfile's metadata is modified (by adding, modifying or deleting an entry), or until the array is de-allocated by a call to .BR gd_close (3). A corresponding list of names for these fields may be obtained by calling .BR gd_field_list_by_type (3). .SH RETURN VALUE Upon successful completion, .BR gd_mcarrays () returns a pointer to an array of .B gd_carray_t objects containing the values of all the CARRAYs defined in the dirfile database. The .B gd_carray_t is defined as: .PP .in +4n .nf .fam C typedef struct { size_t n; /* array_len */ void *d; /* CARRAY data */ } gd_carray_t; .fam .fi .in .PP where .I n specifies the length of the .B CARRAY data, and .I d is an array of the data values themselves. The caller should cast the .B void pointer to a type appropriate for the .I return_type specified. The list is terminated by an end-of-list marker consisting of a .B gd_carray_t item with .I n set to zero. If no CARRAYs are defined in the database, a list containing only the end-of-list marker is returned. On error, .BR gd_mcarrays () returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The supplied parent field code was not found, or referred to a metafield itself. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_TYPE The .I return_type specified was invalid. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_carrays (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_get_carray (3), .BR gd_mfield_list_by_type (3), .BR gd_nmfields_by_type (3), .BR gd_open (3) libgetdata-0.9.0/man/gd_fragment_index.30000640000175000017500000000425012614323564020310 0ustar alastairalastair.\" gd_fragment_index.3. The gd_fragment_index man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_fragment_index 3 "1 January 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_fragment_index \(em retrieve the fragment containing a dirfile field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_fragment_index(const DIRFILE *" dirfile ", const char" .BI * entry_name ); .hy .ad n .SH DESCRIPTION The .BR gd_fragment_index () function queries a dirfile(5) database specified by .I dirfile and returns the index number of the fragment defining the field or alias specified by .IR entry_name , which may not contain a representation suffix. This is one of the few GetData functions which does not resolve aliases: supplying the name of an alias as .I entry_name will return the index of the fragment containing the alias itself and not that of its target. .SH RETURN VALUE Upon successful completion, .BR gd_fragment_index () returns the requested fragment index. On error, .BR gd_fragment_index () returns -1 and sets the dirfile error a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The entry specified by .I entry_name was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_fragmentname (3), .BR gd_parent_fragment (3), .BR dirfile (5) libgetdata-0.9.0/man/gd_error.30000640000175000017500000000246412614323564016454 0ustar alastairalastair.\" gd_error.3. The gd_error man page. .\" .\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_error 3 "20 April 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_error \(em report a GetData library error .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_error(const DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_error () function returns the numeric dirfile error associated with the dirfile .I dirfile which is set by many GetData library functions. A textual description of the error may be obtained by calling .BR gd_error_string (3). .SH RETURN VALUE The .BR gd_error () function always returns the dirfile error corresponding to the error state of the last library call on the supplied DIRFILE object. .SH SEE ALSO .BR gd_error_count (3), .BR gd_error_string (3) libgetdata-0.9.0/man/gd_naliases.30000640000175000017500000000356212614323564017122 0ustar alastairalastair.\" gd_naliases.3. The gd_naliases man page. .\" .\" Copyright (C) 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_naliases 3 "1 October 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_naliases \(em report the number of aliases of a field in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "unsigned int gd_naliases(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_naliases () function queries a dirfile(5) database specified by .I dirfile and returns the number of aliases of the field specified by .IR field_code . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_naliases () returns the number of aliases of the specified field code in the dirfile. If successful, this count will be at least one. On error, it returns zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_CODE The supplied field code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_aliases (3), .BR gd_alias_target (3) libgetdata-0.9.0/man/gd_eof.30000640000175000017500000001035212614323564016067 0ustar alastairalastair.\" gd_eof.3. The gd_eof man page. .\" .\" Copyright (C) 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_eof 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_eof \(em report the number of samples in a dirfile field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "off_t gd_eof(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_eof () function queries a dirfile(5) database specified by .I dirfile and returns the sample number of the end-of-field marker for the vector field given by .IR field_code . This is effectively the total number of samples available for the field, including any frame offset. The caller should not assume that this is equivalent (when accounting for the samples-per-frame of the indicated field) to the number of frames in the database returned by .BR gd_nframes (3), nor even that the end-of-field marker falls on a frame boundary. For a .B RAW field, the end-of-field marker occurs immediately after the last datum in the data file associated with the field. For other field types, the end-of-field marker is equivalent to the end-of-field marker closest to the start of the dirfile of any of the field inputs. The special field .I INDEX has no end-of-field marker. The end-of-field marker for a field containing no data is in the same location as, or before, its beginning-of-field marker (see .BR gd_bof (3)). For a .B RAW field, the difference between the locations of the beginning- and end-of-field markers indicates the number of samples of data actually stored on disk. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_eof () returns the sample number of the end-of-field marker for the indicated field. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code or one of the fields it uses as input was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE The location of the non-existent end-of-field marker for the special field .I INDEX was requested, possibly as a result of the field specified by .I field_code using .I INDEX as one of its inputs. .TP .B GD_E_DIMENSION A scalar field was found where a vector field was expected in the definition of .I field_code or one of its inputs, or else .I field_code itself specified a scalar field. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .TP .B GD_E_IO An attempt to .BR stat (2) the file associated with the field, or one of its input fields, failed. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .TP .B GD_E_UNKNOWN_ENCODING The size of the decoded data file associated with the specified field or one of its inputs could not be determined, because its encoding scheme was not understood. .TP .B GD_E_UNSUPPORTED The size of the decoded data file associated with the specified field or one of its inputs could not be determined, because its encoding scheme was not supported. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR dirfile-encoding (5), .BR gd_open (3), .BR gd_bof (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_nframes (3) libgetdata-0.9.0/man/gd_strtok.30000640000175000017500000000557312614323564016655 0ustar alastairalastair.\" gd_strtok.3. The gd_strtok man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_strtok 3 "28 June 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_strtok \(em tokenise a string using the GetData parser .SH SYNOPSIS .B #include .HP .nh .ad l .BI "char *gd_strtok(DIRFILE *" dirfile ", const char *" string ); .hy .ad n .SH DESCRIPTION The .BR gd_strtok () function parses a string into a series of tokens according to the rules of the Dirfile metadata syntax (see dirfile-format(5)). The first time .BR gd_strtok () is called, the string to be parsed should be passed in .IR string . The first token will be returned. In subsequent calls to parse the same string, .I string should be NULL (as with .BR strtok (3)). Each time .BR gd_strtok () is called like this, the next token is returned. Operation of the Dirfile tokeniser varies between Dirfile Standards Versions. The Standards Version used is the current Version of the loaded DIRFILE .IR dirfile . Use .BR gd_dirfile_standards (3) to retrieve or change this value. Changing the Standards Version of .I dirfile while parsing a string will affect the parsing of subsequent tokens, but does not affect tokens already returned. A copy of the string is cached in the .I dirfile object. Calling .BR gd_strtok () with different .IR dirfile s will parse different strings. .SH RETURN VALUE Upon successful completion, .BR gd_strtok () returns a copy of the first token (if .I string is non-NULL), or the subsequent token. The token strings returned are each allocated with .BR malloc (3) and should be deallocated by the caller when no longer needed using .BR free (3). .PP If no more tokens are available, or if an error occurred, NULL is returned. If an error has occurred, it will also set the dirfile error a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC A memory allocation error occurred. .TP .B GD_E_ARGUMENT There was no string to parse (i.e. .I string was NULL, but no previous call specified a string to parse). .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_FORMAT A syntax error was found in the string. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_dirfile_standards (3), .BR gd_open (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_nfragments.30000640000175000017500000000346712614323564017473 0ustar alastairalastair.\" gd_nfragments.3. The gd_nfragments man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_nfragments 3 "21 July 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_nfragments \(em retrieve the number of format specification fragments in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_nfragments(const DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_nfragments () function queries a dirfile(5) database specified by .I dirfile and returns the total number of parsed format specification fragments in the database. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_nfragments () returns the total number of format specification fragments which are present in the dirfile. On error, .BR gd_nfragments () returns zero and sets the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_fragmentname (3), .BR gd_include (3), .BR gd_open (3), .BR gd_parent_fragment (3) libgetdata-0.9.0/man/gd_strings.30000640000175000017500000000572412614323564017016 0ustar alastairalastair.\" gd_strings.3. The gd_strings man page. .\" .\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_strings 3 "19 October 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_strings \(em retrieve a list of string values from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char **gd_strings(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_strings () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of values of the all .B STRING type fields defined in the database. Notably, this list does not include /META subfields. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order, although it is guaranteed to be in the same order as the list of .B STRING fields returned by .BR gd_field_list_by_type (3). The array is terminated by a NULL pointer. The number of strings in the array can be obtained from a call to .BR gd_nfields_by_type (3). The caller may not modify any strings in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid until .BR gd_strings () is called again with the same arguments, or until the array is de-allocated by a call to .BR gd_close (3). A corresponding list of names for these fields may be obtained by calling .BR gd_field_list_by_type (3). .SH RETURN VALUE Upon successful completion, .BR gd_strings () returns a pointer to an array of strings containing the values of all the .B STRING fields defined in the dirfile database. The array is terminated by a NULL pointer. If no strings are defined in the database, an array consisting of only the NULL pointer is returned. On error it returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_field_list_by_type (3), .BR gd_mstrings (3), .BR gd_nfields_by_type (3), .BR gd_string (3) libgetdata-0.9.0/man/gd_native_type.30000640000175000017500000000775412614323564017661 0ustar alastairalastair.\" gd_native_type.3. The gd_native_type man page. .\" .\" Copyright (C) 2009, 2010, 2011, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_native_type 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_native_type \(em returns the native data type of a field in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "gd_type_t gd_native_type(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_native_type () function queries a dirfile(5) database specified by .I dirfile and returns the native data type of the field .IR field_code , which may contain a representation suffix. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The native data type of a field of a given entry type is calculated as: .TP .BR BIT " or " INDEX " Entry:" .BR GD_UINT64 ; .TP .BR CONST " or " CARRAY " Entry:" the data type of the field; .TP .BR LINCOM " or " POLYNOM " Entry:" if any of the scalar parameters is complex valued, or if the native data type of any of the input fields is complex valued: .BR GD_COMPLEX128 , otherwise: .BR GD_FLOAT64 ; .TP .BR LINTERP " Entry:" if the look-up table is complex valued: .BR GD_COMPLEX128 , otherwise: .BR GD_FLOAT64 ; .TP .BR MPLEX " or " WINDOW " Entry:" the native data type of the data field; .TP .BR MULTIPLY " or " DIVIDE " Entry:" if either input field is complex valued: .BR GD_COMPLEX128 , otherwise: .BR GD_FLOAT64 ; .BR .TP .BR PHASE " Entry:" the native data type of the input field; .TP .BR RAW " Entry:" the data type of the raw data on disk; .TP .BR RECIP " Entry:" if the dividend or the native data type of the input field is complex valued: .BR GD_COMPLEX128 , otherwise: .BR GD_FLOAT64 ; .TP .BR SARRAY " or " STRING " Entry:" .BR GD_STRING ; .TP .BR SBIT " Entry:" .BR GD_INT64 . .PP Furthermore, if the supplied .I field_code contains a representation suffix, and the native data type of the field is complex valued, the native type returned will be the corresponding real valued type. .SH RETURN VALUE Upon successful completion, .BR gd_native_type () returns the native data type of the field code specified. This will be one of the symbols: .IP .nh .ad l .BR GD_UINT8 ", " GD_INT8 ", " GD_UINT16 ", " GD_INT16 ", " GD_UINT32 , .BR GD_INT32 ", " GD_FLOAT32 ", " GD_FLOAT64 ", " GD_COMPLEX64 , .BR GD_COMPLEX128 ", " GD_STRING . .ad n .hy .PP The meanings of these symbols are explained in the .BR gd_getdata (3) manual page. On error, it returns .B GD_UNKNOWN and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code or one of the fields it uses as input was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_DIMENSION A scalar field was found where a vector field was expected. .TP .B GD_E_IO An error occurred while trying to read a LINTERP table from disk. .TP .B GD_E_LUT A LINTERP table was malformed. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_getdata (3), .BR gd_error (3), .BR gd_error_string (3) libgetdata-0.9.0/man/gd_getdata64.30000640000175000017500000000322012614323564017075 0ustar alastairalastair.\" gd_getdata64.3. The gd_getdata64 man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_getdata64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_getdata64 \(em retrieve data from a dirfile database, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "size_t gd_getdata64(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_off64_t " first_frame ", gd_off64_t " first_sample ", size_t .IB num_frames ", size_t " num_samples ", gd_type_t " return_type , .BI "void *" data_out ); .hy .ad n .SH DESCRIPTION This version of .BR gd_getdata (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_getdata (3). Otherwise, .BR gd_getdata (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_getdata (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_framenum_subset.30000640000175000017500000001332712614323564020522 0ustar alastairalastair.\" gd_framenum_subset.3. The gd_framenum man page. .\" .\" Copyright (C) 2009, 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_framenum_subset 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_framenum_subset, gd_framenum \(em perform a reverse look-up on a monotonic dirfile field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "double gd_framenum_subset(DIRFILE *" dirfile ", const char *" field_code , .BI "double " value ", off_t " field_start ", off_t " field_end ); .HP .BI "double gd_framenum(DIRFILE *" dirfile ", const char *" field_code , .BI "double " value ); .hy .ad n .SH DESCRIPTION The .BR gd_framenum_subset () function queries a dirfile(5) database specified by .I dirfile and returns the fractional frame number at which the field specified by .IR field_code , which may contain a representation suffix, equals .IR value , by considering the field between the frame limits .I field_start and .IR field_end . If .I field_start is zero, the frame offset of the field is used as the lower limit instead (which may, in fact, be zero; see .BR gd_frameoffset (3)). If .I field_end is zero, the number of frames in the dirfile, as reported by .BR gd_nframes (3), is used instead as the upper limit. The .BR gd_framenum () function is equivalent to calling .BR gd_framenum_subset () with .I field_start and .I field_end equal to zero. The field must be monotonic (either increasing or decreasing) between the supplied limits. It is not required to be strictly monotonic. If the value searched for lies between two sample values, the frame number returned will be calculated by linear interpolation of the field between these two samples. If more than one consecutive sample is equal to the value searched for, the fractional frame number of one of these samples will be returned, without specifying which particular one will be used. If the value searched for is found to lie outside of the supplied limits, the first two or last two samples of the field will be used to linearly extrapolate the returned frame number. If these two samples happen to have the same value, positive or negative infinity will be returned. When extrapolating, this function will never consider data outside the supplied limits, even if such data exists. As a result, the extrapolated value may differ greatly from the value considering all the data. All computation is done in double precision. As a result, using this function on a 64-bit integer field with more precision than a double precision floating point number, may result in an inaccurate returned value. Attempting to use this function on a complex valued field will result in an error. If the field is constant across the entire range, an error results, even if the value to search for is equal to the constant value of the field. .SH RETURN VALUE On success, these functions return the fractional frame number at which the given function would attain the supplied value, based only on that portion of the field between the given limits. This might be any number, even values outside of the supplied limits, up to and including positive or negative infinity. On error, these functions return an IEEE-754 conforming not-a-number (NaN), and set the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_SCALAR A scalar field used in the definition of the field was not found, or was not of scalar type. .TP .B GD_E_DIMENSION The field specified by .I field_code was not a vector field. Or, a scalar field was found where a vector field was expected in the definition of the field or one of its inputs. .TP .B GD_E_DOMAIN The specified field was complex valued, or the supplied frame range was too small. This error may also arise if data is deleted from the field as the function is executing. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_IO An error occurred while trying to open or read from a file on disk containing a raw field or LINTERP table. .TP .B GD_E_LUT A LINTERP table was malformed. .TP .B GD_E_RANGE The specified field is constant between the supplied limits. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of a RAW field could not be determined. This may also indicate that the binary file associated with the RAW field could not be found. .TP .B GD_E_UNSUPPORTED Reading from dirfiles with the encoding scheme of the specified dirfile is not supported by the library. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_frameoffset (3), .BR gd_nframes (3) libgetdata-0.9.0/man/GD_SIZE.30000640000175000017500000000325312614323564015772 0ustar alastairalastair.\" GD_SIZE.3. The GD_SIZE man page. .\" .\" Copyright (C) 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH GD_SIZE 3 "20 February 2013" "Version 0.8.3" "GETDATA" .SH NAME GD_SIZE \(em report the size of a GetData data sample .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int GD_SIZE(gd_type_t " type ); .hy .ad n .SH DESCRIPTION The .BR GD_SIZE () preprocessor macro returns the size (in bytes) of a single sample of data of the type specified by .IR type , which should be one of the symbols .IP .nh .ad l .BR GD_NULL ", " GD_UINT8 ", " GD_INT8 ", " GD_UINT16 ", " GD_INT16 , .BR GD_UINT32 ", " GD_INT32 ", " GD_FLOAT32 ", " GD_FLOAT64 ", " GD_COMPLEX64 , .BR GD_COMPLEX128 ", " GD_UNKNOWN . .ad n .hy .PP Passing .B GD_NULL or .B GD_UNKNOWN to this macro will return zero. For the other types, the value returned is simply the bit-size encoded in the type symbol divided by eight, so, e.g., .B GD_SIZE(GD_COMPLEX64) will return 8. .PP No error checking is performed on .IR type : behaviour resulting from passing something other than the symbols listed above to this macro is unspecified. See .BR gd_getdata (3) for the meaning of the above symbols. .SH SEE ALSO .BR gd_getdata (3) libgetdata-0.9.0/man/gd_add_spec.30000640000175000017500000001044412614323564017062 0ustar alastairalastair.\" gd_add_spec.3. The gd_add_spec man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_add_spec 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_add_spec, gd_madd_spec \(em add a field to a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_add_spec(DIRFILE *" dirfile ", const char *" line , .BI "int " fragment_index ); .HP .BI "int gd_madd_spec(DIRFILE *" dirfile ", const char *" line , .BI "const char *" parent ); .hy .ad n .SH DESCRIPTION The .BR gd_add_spec () function adds the field described by the field specification line in .I line to the dirfile specified by .IR dirfile . The .BR gd_madd_spec () function behaves similarly, but adds the field as a metafield under the field indicated by the field .IR parent . Field specification lines are described in detail in .BR dirfile-format (5). Since Standards Version 7 (see dirfile(5)) permits specifying metafield without the use of the .B /META directive, .BR gd_add_spec () may also be used to add metafields, by specifying the metafield's full field code. See dirfile-format(5) for full details. When using .BR gd_madd_spec (), .I line should only contain a field specification, and not a .B /META directive. Passing these functions a directive line instead of a field specification line will result in a syntax error. These functions never call the registered parser callback function, even if .IR line contains a syntax error. .SH RETURN VALUE On success, .BR gd_add_spec () and .BR gd_madd_spec () return zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The .I parent field code was not found, or was already a metafield. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The .IR fragment_index argument was out of range. .TP .B GD_E_FORMAT A syntax error was encountered in .IR line . .TP .B GD_E_IO An I/O error occurred while creating an empty binary file to be associated with a newly added .B RAW field. .TP .B GD_E_LINE_TOO_LONG The supplied .I line was longer than the parser was able to deal with. Lines are limited by the storage size of .BR ssize_t . On 32-bit systems, this limits .I line to 2**31 bytes. The limit is larger on 64-bit systems. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, the creation of a .B RAW field was attempted and the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to create an empty binary file to be associated with a newly added .B RAW field. .TP .B GD_E_UNSUPPORTED The encoding scheme of the indicated format specification fragment does not support creating an empty binary file to be associated with a newly added .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_add (3), .BR gd_add_bit (3), .BR gd_add_carray (3), .BR gd_add_const (3), .BR gd_add_divide (3), .BR gd_add_lincom (3), .BR gd_add_linterp (3), .BR gd_add_multiply (3), .BR gd_add_phase (3), .BR gd_add_recip (3), .BR gd_add_raw (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_madd (3), .BR gd_madd_bit (3), .BR gd_madd_carray (3), .BR gd_madd_const (3), .BR gd_madd_divide (3), .BR gd_madd_lincom (3), .BR gd_madd_linterp (3), .BR gd_madd_multiply (3), .BR gd_madd_phase (3), .BR gd_madd_polynom (3), .BR gd_madd_recip (3), .BR gd_madd_string (3), .BR gd_metaflush (3), .BR gd_open (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_putdata.30000640000175000017500000001532612614323564016766 0ustar alastairalastair.\" gd_putdata.3. The gd_putdata man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_putdata 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_putdata \(em write data to a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "size_t gd_putdata(DIRFILE *" dirfile ", const char *" field_code ", off_t" .IB first_frame ", off_t " first_sample ", size_t " num_frames ", size_t" .IB num_samples ", gd_type_t " data_type ", const void *" data_in ); .hy .ad n .SH DESCRIPTION The .BR gd_putdata () function writes data to a dirfile(5) database specified by .I dirfile for the field .IR field_code , which may not contain a representation suffix. It writes .I num_frames frames plus .I num_samples samples to this field, starting .I first_sample samples past frame .IR first_frame . The data is read from the user-supplied buffer .IR data_in, which is has a data type specified by .IR data_type . This interface cannot write to field representations. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). Unless using .B GD_HERE (see below), the first sample written will be .RS .IR first_frame " * " samples_per_frame " + " first_sample .RE as measured from the start of the dirfile, where .I samples_per_frame is the number of samples per frame as returned by .BR gd_spf (3). The number of samples which .BR gd_putdata () attempts to write is, similarly, .RS .IR num_frames " * " samples_per_frame " + " num_samples . .RE Although calling .BR gd_putdata () using both samples and frames is possible, the function is typically called with either .IR num_samples " and " first_sample , or .IR num_frames " and " first_frames , equal to zero. Instead of explicitly specifying the origin of the write, the caller may pass the special symbol .B GD_HERE as .IR first_frame . This will result in the write occurring at the current position of the I/O pointer for the field (see .BR gd_getdata (3) for a discussion of I/O pointers). In this case, the value of .I first_sample is ignored. The .I data_type argument should be one of the following symbols, which indicates the type of the input data: .RS .TP 11 .B GD_UINT8 unsigned 8-bit integer .TP .B GD_INT8 signed (two's complement) 8-bit integer .TP .B GD_UINT16 unsigned 16-bit integer .TP .B GD_INT16 signed (two's complement) 16-bit integer .TP .B GD_UINT32 unsigned 32-bit integer .TP .B GD_INT32 signed (two's complement) 32-bit integer .TP .B GD_UINT64 unsigned 64-bit integer .TP .B GD_INT64 signed (two's complement) 64-bit integer .TP .B GD_FLOAT32 IEEE-754 standard 32-bit single precision floating point number .TP .B GD_FLOAT64 IEEE-754 standard 64-bit double precision floating point number .TP .B GD_COMPLEX64 C99-conformant 64-bit single precision complex number .TP .B GD_COMPLEX128 C99-conformant 128-bit double precision complex number .RE The type of the input data need not be the same as the type of the data stored in the database. Type conversion will be performed as necessary to write the appropriate type. The argument .I data_in must point to a valid memory location of containing all the data to be written. Upon successful completion, the I/O pointer of the field will be on the sample immediately following the last sample written, if possible. On error, the position of the I/O pointer is not specified. .SH RETURN VALUE In all cases, .BR gd_putdata () returns the number of samples (not bytes) successfully written to the database, which may be zero if an error has occurred. If an error has occurred, the dirfile error will be set to a non-zero value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified .I dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .IR field_code , or one of the fields it uses for input, was not found in the database. .TP .B GD_E_BAD_DIRFILE An invalid .I dirfile was supplied. .TP .B GD_E_BAD_FIELD_TYPE Either the field specified by .IR field_code , or one of the fields it uses for input, was of .B MULTIPLY or .B DIVIDE type, or .B LINCOM type with more than one input fields. In this case, GetData has no knowledge on how to partition the input data. Alternately, the caller may have attempted to write to the implicit INDEX field, which is not possible. .TP .B GD_E_BAD_TYPE An invalid .I data_type was specified. .TP .B GD_E_DIMENSION The field specified by .I field_code was not a vector field. The caller should use .BR gd_put_carray (3), .BR gd_put_constant (3), or .BR gd_put_string (3) instead. Or, a scalar field was found where a vector field was expected in the definition of .IR field_code . .TP .B GD_E_DOMAIN An attempt was made to write to a .B LINTERP field with a look-up table which was not monotonic or not purely real. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_IO An error occurred while trying to open, read from, or write to a file on disk containing a raw field or .B LINTERP table. .TP .B GD_E_LUT A .B LINTERP table was malformed. .TP .B GD_E_PROTECTED The data of the .B RAW field backing .I field_code was protected from change by a /PROTECT directive. .TP .B GD_E_RANGE An attempt was made to write data before the beginning-of-frame marker for .IR field_code , or the raw field it depends on. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .TP .B GD_E_UNSUPPORTED Reading from dirfiles with the encoding scheme of the specified dirfile is not supported by the library. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR dirfile-encoding (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_getdata (3), .BR gd_put_carray (3), .BR gd_put_constant (3), .BR gd_seek (3), .BR gd_spf (3), .BR GD_SIZE (3) libgetdata-0.9.0/man/gd_mstrings.30000640000175000017500000000607612614323564017174 0ustar alastairalastair.\" gd_mstrings.3. The gd_mstrings man page. .\" .\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_mstrings 3 "19 October 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_mstrings \(em retrieve a list of string values from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char **gd_mstrings(DIRFILE *" dirfile ", const char *" parent ); .hy .ad n .SH DESCRIPTION The .BR gd_mstrings () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of values of the all .B STRING type metafields for the supplied .I parent field. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order, although it is guaranteed to be in the same order as the list of .B STRING fields returned by .BR gd_mfield_list_by_type (3). The array is terminated by a NULL pointer. The number of strings in the array can be obtained from a call to .BR gd_nmfields_by_type (3). The caller may not modify any strings in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid until .BR gd_mstrings () is called again with the same arguments, or until the array is de-allocated by a call to .BR gd_close (3). A corresponding list of names for these fields may be obtained by calling .BR gd_mfield_list_by_type (3). .SH RETURN VALUE Upon successful completion, .BR gd_mstrings () returns a pointer to an array of strings containing the values of all the .B STRING metafields for the specified parent field. The array is terminated by a NULL pointer. If no strings are defined in the database for the specified parent, an array consisting of only the NULL pointer is returned. On error it returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The supplied parent field code was not found, or referred to a metafield itself. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_mfield_list_by_type (3), .BR gd_nmfields_by_type (3), .BR gd_strings (3) libgetdata-0.9.0/man/gd_uninclude.30000640000175000017500000000744712614323564017317 0ustar alastairalastair.\" gd_uninclude.3. The gd_uninclude man page. .\" .\" Copyright (C) 2008, 2010, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_uninclude 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_uninclude \(em remove a format specification fragment from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_uninclude(DIRFILE *" dirfile ", int " fragment_index , .BI "int " del ); .hy .ad n .SH DESCRIPTION The .BR gd_uninclude () removes the format specification fragment indexed by .I fragment_index from the specified dirfile, as well as any fragments the indicated fragment INCLUDEs. Fields defined in the removed fragments will be removed from the dirfile. Before removing the specified fragment, all pending writes are flushed to .B RAW fields defined the the removed fragments. If .I del is zero, metadata changes will also be written to the removed fragments. If .I del is non-zero, the format specification fragments will be deleted from disk, if possible. Regardless of the value of .IR del , binary data files associated with .B RAW fields defined in the removed fragments will not be deleted. To delete these binary files, use .BR gd_delete (3) before calling this function. The primary format specification (the fragment indexed by zero) cannot be removed from the dirfile. .SH RETURN VALUE On success, .BR gd_uninclude () returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The supplied dirfile was opened in read-only mode. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied fragment index was out of range, or an attempt was made to remove the primary format specification. .TP .B GD_E_IO An I/O error occurred while trying to write modified data or metadata to disk. .TP .B GD_E_PROTECTED The metadata of the fragment which included the removed fragment was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). When finished with it, the DIRFILE object may be de-allocated with a call to .BR gd_close (3), even if the open failed. .SH NOTES This function re-arranges the remaining format specification fragments in some unspecified way, except for the primary fragment, which is guaranteed to remain at index zero. Callers which cache format specification fragment indices must re-initialise their cache after calling this function. Unlike .BR gd_delete (3), fields which depend on fields removed by this function are not automatically updated, nor is any check made to ensure that this function does not leave fields with missing input fields. Because of this, a fragment inclusion may be easily moved from one fragment to another with a combination of .BR gd_uninclude () and .BR gd_include (3). However, if such checks are required, use .BR gd_delete (3) to delete the fields defined in the removed fragments first. .SH SEE ALSO .BR gd_delete (3), .BR gd_include (3), .BR gd_open (3), .BR gd_reference (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_fragmentname (3), .BR gd_nfragments (3), .BR dirfile (5), .BR dirfile-encoding (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_nframes.30000640000175000017500000000526412614323564016757 0ustar alastairalastair.\" gd_nframes.3. The gd_nframes man page. .\" .\" Copyright (C) 2008, 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_nframes 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_nframes \(em report the size of a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "off_t gd_nframes(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_nframes () function queries a dirfile(5) database specified by .I dirfile and returns the number of frames in the database. Since different fields may have differing number of frames, the Dirfile Standards (see .BR dirfile (5)) dictate that the number of frames in the database is defined to be equal to the number of frames in the reference field defined by the .B /REFERENCE directive (see .BR dirfile-format (5)) or, if no such reference field is defined, by the first raw field specified in the format specification. If no vector fields are defined in the database, .BR gd_nframes () returns zero and succeeds. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_nframes () returns the number of frames in the dirfile. On error, it returns zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_IO An attempt to determine the (unencoded) size of the data file associated with the reference field failed. .TP .B GD_E_UNKNOWN_ENCODING The size of the decoded data file associated with the reference field could not be not be determined because its encoding was not understood. .TP .B GD_E_UNSUPPORTED The size of the decoded data file associated with the reference field could not be not be determined because its encoding was not supported. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR dirfile-encoding (5), .BR gd_open (3), .BR gd_bof (3), .BR gd_eof (3), .BR gd_error (3), .BR gd_error_string (3) libgetdata-0.9.0/man/gd_alter_affixes.30000640000175000017500000000635712614323564020144 0ustar alastairalastair.\" gd_alter_affixes.3. The gd_alter_affixes man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_affixes 3 "1 January 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_alter_affixes \(em modify the field affixes of a fragments in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_affixes(DIRFILE *" dirfile ", int " fragment_index , .BI "const char *" prefix ", const char *" suffix ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_affixes () function sets the field prefix and suffix of fields defined in the format specification fragment given by .I fragment_index to .I prefix and .I suffix in the dirfile(5) database specified by .IR dirfile . The field prefix and suffix are appended to all field codes found in the specified fragment. If the parent fragment to the modified fragment contains field affixes themselves, they should be included in the affixes passed to .BR gd_alter_affixes (). See EXAMPLES below for further details. If .I prefix or .I suffix is NULL, the corresponding affix will be unchanged. To remove an affix, set it to the parent fragment's corresponding affix, which may be the empty string (""). It is not possible to set affixes on the root format file (i.e. .I fragment_index may not be zero). The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_alter_affixes () returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The supplied .I prefix or .I suffix contained invalid characters. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .TP .B GD_E_DUPLICATE The supplied affixes would result in one or more field codes duplicating an existing field code. .TP .B GD_E_PROTECTED The metadata of the given fragment's parent fragment was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH EXAMPLES Dealing with affixes of parent fragments is relatively straightforward. Say, for instance, fragment #1 has a prefix "A" and a suffix "B" and fragment #2 is included from fragment #1. In this case any prefix for fragment #2 must end with "A" and any suffix for fragment #2 must begin with "B". .SH SEE ALSO .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_fragment_affixes (3), .BR gd_include_affix (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_raw_filename.30000640000175000017500000000443712614323564017756 0ustar alastairalastair.\" gd_raw_filename.3. The gd_raw_filename man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_raw_filename 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_raw_filename \(em retrieve the pathname of a binary file in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "char *gd_raw_filename(DIRFILE *" dirfile ", const char" .BI * field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_raw_filename () function reports the pathname of the file backing the .B RAW field specified by .I field_code in the dirfile specified by .IR dirfile . If .I field_code contains a valid representation suffix, it will be ignored. .SH RETURN VALUE On success, .BR gd_raw_filename () returns the full pathname of the binary file associated with the specified field in buffer allocated by .BR malloc (3). The returned pointer should be passed to .BR free (3) once the caller no longer needs it. On error, NULL is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE The field specified by .I field_code was not a .B RAW field. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the specified field could not be determined or was not understood by GetData. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-encoding (5), .BR dirfile-format (5), .BR free (3), .BR malloc (3) libgetdata-0.9.0/man/gd_desync.30000640000175000017500000001016412614323564016604 0ustar alastairalastair.\" gd_desync.3. The gd_desync man page. .\" .\" Copyright (C) 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_desync 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_desync \(em check for a change of metadata on disk .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_desync(DIRFILE *" dirfile ", unsigned int " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_desync () function reports whether the metadata of the loaded .I dirfile has become desynchronised from the format specification fragments on disk, due to a third party modifying the Dirfile metadata on disk after GetData opened it. If .I dirfile has become desynchronised, this function can, optionally, reload the dirfile. The .I flags argument influences how the function works. It should be zero, or else one or more of the following flags, bitwise or'd together: .TP 8 .B GD_DESYNC_PATHCHECK Ignore GetData's internal directory cache, and use the format specification fragments' full path when checking for modifications. This flag is of particular importance when the .I dirfilename passed to .BR gd_cbopen (3), or directory paths used in included fragments, contain symbolic links: with this flag, these symbolic links will be re-evaluated. Without it, the target of the symbolic links in effect when the dirfile was first opened will be considered instead. .TP .B GD_DESYNC_REOPEN If this flag is specified, and .BR gd_desync () detects desynchronisation, the Dirfile will be re-opened in place using the exiting .I dirfile pointer. In this case, upon a positive result from this function, the caller must discard all cached information about the dirfile, even the assumption that .I dirfile has been successfully opened. Re-opening the dirfile is equivalent to calling .BR gd_discard (3), and then .BR gd_cbopen (3) with the same arguments used when originally creating .IR dirfile , except that the .I dirfile pointer doesn't change its value. As a result, this function may invoke the registered parser callback function (see .BR gd_cbopen (3) and .BR gd_parser_callback (3)). .SH RETURN VALUE On successful deletion, zero is returned if the loaded dirfile has not desynchronised, or 1 if it has. On error, -1 is returned, regardless of desynchronisation and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_IO An error occurred while trying to obtain the modification time of a fragment. .PP Additionally, if .B GD_DESYNC_REOPEN is used, this function may fail for any of the reasons listed in the .BR gd_discard (3) and .BR gd_cbopen (3) manual pages. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH LIMITATIONS The current implementation uses file modification times as reported by .BR stat (2) to detect changes. These times have a granularity of, at best, one second. As a result, desynchronisation will not be detected in the case when a fragment is modified, then GetData reads it, then the fragment is modified again, all within one second. The caller may wish to perform its own monitoring using the pathnames returned by .BR gd_fragmentname (3). .PP On systems lacking a POSIX.1-2008 conformant .BR fstatat (2) (q.v.), this function may always operate as if .B GD_DESYNC_PATHCHECK had been specified, regardless of the actual .IR flags . .SH SEE ALSO .BR fstatat (2), .BR gd_cbopen (3), .BR gd_discard (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_parser_callback (3) libgetdata-0.9.0/man/gd_putdata64.30000640000175000017500000000322012614323564017126 0ustar alastairalastair.\" gd_putdata64.3. The gd_putdata64 man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_putdata64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_putdata64 \(em write data to a dirfile database, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "size_t gd_putdata64(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_off64_t " first_frame ", gd_off64_t " first_sample ", size_t .IB num_frames ", size_t " num_samples ", gd_type_t " data_type , .BI "const void *" data_out ); .hy .ad n .SH DESCRIPTION This version of .BR gd_putdata (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_putdata (3). Otherwise, .BR gd_putdata (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_putdata (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_nframes64.30000640000175000017500000000271612614323564017130 0ustar alastairalastair.\" gd_nframes64.3. The gd_nframes64 man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_nframes64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_nframes64 \(em report the size of a dirfile, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "gd_off64_t gd_nframes64(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION This version of .BR gd_nframes (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_nframes (3). Otherwise, .BR gd_nframes (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_nframes (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_entry.30000640000175000017500000005251712614323564016470 0ustar alastairalastair.\" gd_entry.3. The gd_entry man page. .\" .\" Copyright (C) 2008-2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_entry 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_entry \(em retrieve a dirfile field's metadata .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_entry(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_entry_t *" entry ); .hy .ad n .SH DESCRIPTION The .BR gd_entry () function queries a dirfile(5) database specified by .I dirfile and returns the metadata associated with the field specified by .IR field_code . If .I field_code contains a valid representation suffix, the suffix will be ignored. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The entry will be stored in the gd_entry_t structure indicated by the .I entry argument, which must be allocated by the caller. Members available in this structure depend on the field type of the field queried. See below for a complete description of this data type. Strings members in .I entry filled by this function (variously, depending on field type: .IR field ", the elements of the " in_fields "[] array, " table ; see below) will by dynamically allocated by .BR gd_entry () and should not point to allocated memory locations before calling this function. Only strings provided by the gd_entry_t for the particular field type described will be allocated. These strings should be de-allocated with .BR free (3) by the caller once they are no longer needed. The .BR gd_free_entry_strings (3) function is provided as a convenience to do this. If the entry's metadata contains scalar field codes which cannot be dereferenced, the associated numerical field parameter will be initialised to zero. In this case, the .B GD_EN_CALC flag in the returned entry object will .I NOT be set. The returned .I entry structure, including strings and their pointers may be freely modified by the caller. .SH RETURN VALUE Upon successful completion, .BR gd_entry () returns zero, and writes the field metadata in the supplied gd_entry_t buffer. On error, the supplied gd_entry_t buffer is not modified. In this case, .BR gd_entry () returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH THE ENTRY TYPE Members available in the gd_entry_t structure depend on the field type described. All gd_entry_t objects are guaranteed to have at least: .PP .in +4n .nf .fam C typedef struct { ... const char *field; /* field code */ gd_entype_t field_type; /* field type */ int fragment_index; /* format fragment index */ unsigned flags; /* entry flags */ ... } gd_entry_t; .fam .fi .in .PP The .I field member is the field code of the entry (i.e. its string name). If the call to .BR gd_entry (3) is successful, this will be the field name specified as part of the .I field_code argument. .PP The .I field_type member indicates the field type of the entry. This is an integer type equal to one of the following symbols: .IP .nh .ad l .BR GD_BIT_ENTRY , .BR GD_CARRAY_ENTRY , .BR GD_CONST_ENTRY , .BR GD_DIVIDE_ENTRY , .BR GD_INDEX_ENTRY , .BR GD_LINCOM_ENTRY , .BR GD_LINTERP_ENTRY , .BR GD_MPLEX_ENTRY , .BR GD_MULTIPLY_ENTRY , .BR GD_PHASE_ENTRY , .BR GD_POLYNOM_ENTRY , .BR GD_RAW_ENTRY , .BR GD_RECIP_ENTRY , .BR GD_SBIT_ENTRY , .BR GD_STRING_ENTRY , .BR GD_WINDOW_ENTRY . .ad n .hy .PP .B GD_INDEX_ENTRY is a special field type used only for the implicit .I INDEX field. The other entry types are explained in detail in dirfile-format(5). .PP The .I fragment_index member indicates the format specification fragment in which this field is defined. This is an integer index to the Dirfile's list of parsed format specification fragments. The name of the file corresponding to .I fragment_index may be obtained by calling .BR gd_fragmentname (3). A value of zero for this field indicates that the field is defined in the primary fragment, the file called .B format in the root dirfile directory (see .IR dirfile (5)). .PP The .I flags member is a bitwise or'd collection of the following entry flags: .TP .B GD_EN_CALC This bit is set only when the non-literal scalar parameter field codes specified in the .I scalar member have been resolved, and the corresponding numerical parameter have been initialised with these data. When one or more field code does not exist, or is invalid (ie. when .BR gd_validate (3) would fail on the specified .I field_code with the error .BR GD_E_BAD_SCALAR ), then the unresolved numerical parameters are initialised to zero, and this flag is not be set. If the requested field does not allow non-literal scalar parameters .RB ( CARRAY , .BR CONST , .BR DIVIDE , .BR INDEX , .BR LINTERP , .BR MULTIPLY , .BR STRING ), the value of this bit is unspecified. .TP .B GD_EN_COMPSCAL For fields which permit complex valued parameters .RB ( LINCOM , .BR POLYNOM , .BR RECIP ), this bit is set only when at least one parameter is complex valued. For other field types, the value of this bit is unspecified. .TP .B GD_EN_HIDDEN This bit is set only when the field has been hidden by the .B /HIDDEN directive (see .BR gd_hidden (3)). .PP Remaining fields in the gd_entry_t structure depend on the value of .IR field_type . Callers are advised to check .I field_type before attempting to access the remaining members. Members for different field types may be stored in the same physical location in core. Accordingly, attempting to access a member not declared for the appropriate field type will have unspecified results. .SS Scalar Parameter Members A gd_entry_t describing any field type which permits non-literal scalar field parameters .RB ( BIT ", " LINCOM ", " MPLEX ", " PHASE ", " POLYNOM ", " RAW ", " RECIP , .BR SBIT ", or " WINDOW ) will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *scalar[GD_MAX_POLY_ORD + 1]; /* param. fields */ int scalar_ind[GD_MAX_POLY_ORD + 1]; /* CARRAY indices */ ... } gd_entry_t; .fam .fi .in .PP Only certain elements of these arrays will be initialised: .IP \(bu For .B BIT and .B SBIT fields, the first element corresponds to .I bitnum and the second to .IR numbits . The remainder are uninitialised. .IP \(bu For .B LINCOM fields, the first .B GD_MAX_LINCOM elements correspond to the slopes .RI ( cm ) and the next .B GD_MAX_LINCOM elements correspond to the offsets .RI ( cb ). Only the first .I n_fields elements of these two sets are initialised. Notably, this means for .I n_fields < GD_MAX_LINCOM, there will be uninitialised elements in the middle of these arrays between the element corresponding to .IR cm [ n_fields - 1] and the element corresponding to .IR cb [0]. .IP \(bu For .B MPLEX fields, the first element corresponds to .I count_val and the second to .IR period . The remainder are uninitialised. .IP \(bu For .B PHASE fields, the first element corresponds to .IR shift . The remainder are uninitialised. .IP \(bu For .B POLYNOM fields, these arrays correspond with the co-efficients .IR ca . Only the first .I poly_ord + 1 elements are initialised. .IP \(bu For .B RAW fields, the first element corresponds to .IR spf . The remainder are uninitialised. .IP \(bu For .B RECIP fields, the first element corresponds to .IR cdividend . The remainder are uninitialised. .IP \(bu For .B WINDOW fields, the first element corresponds to .IR threshold . The remainder are uninitialised. .PP The .I scalar parameters are NULL if a literal parameter was used, or else a field code specifying the scalar parameters. .PP If an element of .I scalar specifies a .B CARRAY field, the corresponding .I scalar_ind will indicate the element of the .B CARRAY used. For .B CONST fields, .I scalar_ind will be -1. .SS BIT and SBIT Members A gd_entry_t describing a .B BIT or .B SBIT entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *in_fields[1]; /* input field code */ int bitnum; /* first bit */ int numbits; /* bit length */ ... } gd_entry_t; .fam .fi .in .PP The .I in_fields member is an array of length one containing the input field code. .PP The .I bitnum member indicates the number of the first bit (counted from zero) extracted from the input. If this value was specified as a scalar field code, this will be the numerical value of that field, and .IR scalar [0] will contain the field code itself, otherwise .IR scalar [0] will be NULL. .PP The .I numbits member indicates the number of bits which are extracted from the input. If this value was specified as a scalar field code, this will be the numerical value of that field, and .IR scalar [1] will contain the field code itself, otherwise .IR scalar [1] will be NULL. .SS CARRAY Members A gd_entry_t describing a .B CARRAY entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... gd_type_t const_type; /* data type in format specification */ size_t array_len; /* length of array data */ ... } gd_entry_t; .fam .fi .in .PP The .I const_type member indicates the data type of the constant value stored in the format file metadata. See .BR gd_getdata (3) for a list of valid values that a variable of type .B gd_type_t may take. .PP The .I array_len member gives the number of elements in the array. .SS CONST Members A gd_entry_t describing a .B CONST entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... gd_type_t const_type; /* data type in format specification */ ... } gd_entry_t; .fam .fi .in .PP The .I const_type member indicates the data type of the constant value stored in the format file metadata. See .BR gd_getdata (3) for a list of valid values that a variable of type .B gd_type_t may take. .SS INDEX Members A gd_entry_t describing an .B INDEX entry, which is used only for the implicit .I INDEX field, provides no additional data. .SS LINCOM Members A gd_entry_t describing a .B LINCOM entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... int n_fields; /* # of input fields */ const char *in_fields[GD_MAX_LINCOM]; /* input field code(s) */ double complex cm[GD_MAX_LINCOM]; /* scale factor(s) */ double m[GD_MAX_LINCOM]; /* scale factor(s) */ double complex cb[GD_MAX_LINCOM]; /* offset terms(s) */ double b[GD_MAX_LINCOM]; /* offset terms(s) */ ... } gd_entry_t; .fam .fi .in .PP The .I n_fields member indicates the number of input fields. It will be between one and .B GD_MAX_LINCOM inclusive. .B GD_MAX_LINCOM is defined in getdata.h as the maximum number of input fields permitted by a .BR LINCOM . .PP The .I in_fields member is an array of length .B GD_MAX_LINCOM containing the input field code(s). Only the first .I n_fields elements of this array are initialised. The remaining elements contain uninitialised data. .PP The .I cm and .I cb members are arrays of the scale factor(s) and offset term(s) for the .BR LINCOM . Only the first .I n_fields elements of these array contain meaningful data. If any of these values were specified as a scalar field code, this will be the numerical value of that field. The field code corresponding to .IR cm [ i ] will be stored in .IR scalar [ i ] and the field code associated with .IR cb [ i ] will be stored in .IR scalar [ i + .BR GD_MAX_LINCOM ]. Otherwise the corresponding .I scalar member will be NULL. See .B NOTES below on changes to the declaration of .I cm and .I cb when using the C89 GetData API. .PP The elements of .I m and .I b are the real parts of the corresponding elements of .I cm and .IR cb . .SS LINTERP Members A gd_entry_t describing a .B LINTERP entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *table /* linterp table filename */ const char *in_fields[1]; /* input field code */ ... } gd_entry_t; .fam .fi .in .PP The .I table member is the pathname to the look up table on disk. This the path as it appars in the format specification. It may be a path relative to the fragment directory. For an canonicalised, absolute version of this path, see .BR gd_linterp_tablename (3). .PP The .I in_fields member is an array of length one containing the input field code. .SS MPLEX Members A gd_entry_t describing a .B MPLEX entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *in_fields[2]; /* input field codes */ int count_val; /* value of the multiplex index */ int period; /* samples between successive count_vals */ ... } gd_entry_t; .fam .fi .in .PP The .I in_fields member contains the field codes of the input field (element 0) and the multiplex index field (element 1). .PP The .I count_val member is the value of the multiplex index field when the output field is stored in the input field. .PP The .I period member is the number of samples between successive occurrances of .I count_val in the index vector, or zero, if this is not known or constant. This is only used to determine how far to look back for a starting value for the output field; see .BR gd_mplex_lookback (3). .SS MULTIPLY and DIVIDE Members A gd_entry_t describing a .B MULTIPLY or .B DIVIDE entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *in_fields[2]; /* input field codes */ ... } gd_entry_t; .fam .fi .in .PP The .I in_fields member is an array of length two containing the input field codes. .SS PHASE Members A gd_entry_t describing a .B PHASE entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *in_fields[1]; /* input field code */ gd_shift_t shift; /* phase shift */ ... } gd_entry_t; .fam .fi .in .PP The .I in_fields member is an array of length one containing the input field code. .PP The .I shift member indicates the shift in samples. The .I gd_shift_t type is a 64-bit signed integer type. A positive value indicates a shift forward in time (towards larger frame numbers). If this value was specified as a scalar field code, this will be the numerical value of that field, and .IR scalar [0] will contain the field code itself, otherwise .IR scalar [0] will be NULL. .SS POLYNOM Members A gd_entry_t describing a .B POLYNOM entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... int poly_ord; /* polynomial order */ const char *in_fields[1]; /* input field code(s) */ double complex ca[GD_MAX_POLY_ORD + 1]; /* co-efficients(s) */ double a[GD_MAX_POLY_ORD + 1]; /* co-efficients(s) */ ... } gd_entry_t; .fam .fi .in .PP The .I poly_ord member indicates the order of the polynomial. It will be between one and .B GD_MAX_POLY_ORD inclusive. .B GD_MAX_POLY_ORD is defined in getdata.h as the maximum order of polynomial permitted by a .BR POLYNOM . .PP The .I in_fields member is an array of length one containing the input field code. .PP The .I ca members are arrays of the co-efficient(s) for the .BR POLYNOM . Only the first .I poly_ord + 1 elements of this array contains meaningful data. If any of these values were specified as a scalar field code, this will be the numerical value of that field. The field code corresponding to .IR ca [ i ] will be stored in .IR scalar [ i ]. Otherwise the corresponding .I scalar member will be NULL. See .B NOTES below on changes to the declaration of .I ca when using the C89 GetData API. .PP The elements of .I a are the real parts of the corresponding elements of .IR ca . .SS RAW Members A gd_entry_t describing a .B RAW entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... unsigned int spf; /* samples per frame on disk */ gd_type_t data_type; /* data type on disk */ ... } gd_entry_t; .fam .fi .in .PP The .I spf member contains the samples per frame of the binary data on disk. If this value was specified as a scalar field code, this will be the numerical value of that field, and .IR scalar [0] will contain the field code itself, otherwise .IR scalar [0] will be NULL. .PP The .I data_type member indicates the data type of the binary data on disk. See .BR gd_getdata (3) for a list of valid values that a variable of type .B gd_type_t may take. .SS RECIP Members A gd_entry_t describing a .B RECIP entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *in_fields[1]; /* input field code */ double complex cdividend; /* scalar dividend */ double dividend; /* scalar dividend */ ... } gd_entry_t; .fam .fi .in .PP The .I in_fields member is an array of length one containing the input field code. .PP The .I cdividend member provides the constant dividend of the computed division. If this value was specified as a scalar field code, this will be the numerical value of that field, and .IR scalar [0] will contain the field code itself, otherwise .IR scalar [0] will be NULL. The .I dividend member contains the real part of .IR cdividend . .SS STRING Members A gd_entry_t describing a .B STRING entry provides no additional data. .SS WINDOW Members A gd_entry_t describing a .B WINDOW entry, will also provide: .PP .in +4n .nf .fam C typedef struct { ... const char *in_fields[2]; /* input field codes */ gd_windop_t windop; /* comparison operator */ gd_triplet_t threshold; /* the value compared against */ ... } gd_entry_t; .fam .fi .in .PP The .I in_fields member contains the field codes of the input field (element 0) and the check field (element 1). .PP The .I windop member equals one of the following symbols, indicating the particular comparison performed on the check field: .TP .B GD_WINDOP_EQ data are extracted when the check field equals .IR threshold ; .TP .B GD_WINDOP_GE data are extracted when the check field is greater than or equal to .IR threshold ; .TP .B GD_WINDOP_GT data are extracted when the check field is strictly greater than .IR threshold ; .TP .B GD_WINDOP_LE data are extracted when the check field is less than or equal to .IR threshold ; .TP .B GD_WINDOP_LT data are extracted when the check field is strictly less than .IR threshold ; .TP .B GD_WINDOP_NE data are extracted when the check field is not equal to .IR threshold ; .TP .B GD_WINDOP_SET data are extracted when at least one bit in .I threshold is also set in the check field; .TP .B GD_WINDOP_CLR data are extracted when at least one bit in .I threshold is not set in the check field. .PP The .I threshold is the value against the check field is compared. The .B gd_triplet_t type is defined as: .PP .in +4n .nf .fam C typedef union { gd_int64_t i; gd_uint64_t u; double r; } gd_triplet_t; .fam .fi .in .PP The particular element of the union to use depends on the value of .I windop: .IP \(bu For .B GD_WINDOP_EQ and .BR GD_WINDOP_NE , the signed integer element, .IB threshold . i is set; .IP \(bu For .B GD_WINDOP_SET and .BR GD_WINDOP_CLR , the unsigned integer element, .IB threshold . u is set; .IP \(bu For all other values of .IR windop , the floating point element, .IB threshold . r is set. .SH NOTES When using the C89 GetData API (by defining .B GD_C89_API before including getdata.h), the data types and names of several of the entry parameters are different. The following table lists the correspondences between members in the C99 and C89 APIs. .TS center tab(|); cbscbs rlrl. C99 API|C89 API int|bitnum|int|u.bit.bitnum int|numbits|int|u.bit.numbits int|n_fields|int|u.lincom.n_fields double complex|cm[3]|double|u.lincom.cm[3][2] double|m[3]|double|u.lincom.m[3] double complex|cb[3]|double|u.lincom.cb[3][2] double|b[3]|double|u.lincom.b[3] const char*|table|const char*|u.linterp.table int|count_val|int|u.mplex.count_val int|period|int|u.mplex.period gd_shift_t|shift|gd_shift_t|u.phase.shift int|poly_ord|int|u.polynom.poly_ord double complex|ca[3]|double|u.polynom.ca[3][2] double|a[3]|double|u.polynom.a[3] unsigned int|spf|unsigned int|u.raw.spf gd_type_t|data_type|gd_type_t|u.raw.data_type double complex|cdividend|double|u.recip.cdividend[2] double|dividend|double|u.recip.dividend gd_type_t|const_type|gd_type_t|u.scalar.const_type size_t|array_len|size_t|u.scalar.array_len gd_windop_t|windop|gd_windop_t|u.window.windop gd_triplet_t|threshold|gd_triplet_t|u.window.threshold .TE .PP In the case of complex valued data in the C89 API, the first element of the two-element array is the real part of the complex number, and the second element is the imaginary part. .SH SEE ALSO .BR dirfile (5), .BR gd_free_entry_strings (3), .BR gd_cbopen (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_field_list (3), .BR gd_fragmentname (3), .BR gd_linterp_tablename (3) .BR gd_mplex_lookback (3), .BR gd_raw_filename (3), .BR gd_validate (3) libgetdata-0.9.0/man/gd_alter_endianness.3.in0000640000175000017500000001176312614323564021250 0ustar alastairalastair.\" gd_alter_endianness.3. The gd_alter_endianness man page. .\" .\" @configure_input@ .\" .\" Copyright (C) 2008, 2010, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_endianness 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_alter_endianness \(em modify the byte sex of fields in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_endianness(DIRFILE *" dirfile ", unsigned long" .IB byte_sex ", int " fragment_index ", int " recode ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_endianness () function sets the byte sex of the format specification fragment given by .I fragment_index to .I byte_sex in the dirfile(5) database specified by .IR dirfile . The byte sex of a fragment indicate the endianness of data stored in binary files associated with .B RAW fields defined in the specified fragment. The byte sex of a fragment containing no .B RAW fields is ignored. The .I byte_sex argument should be one of the following: .TP .BR 0 " (zero)" Indicating that the byte sex should be the native endianness of the host, whichever that may be. .TP .B GD_BIG_ENDIAN Indicating that the byte sex should be big endian. .TP .B GD_LITTLE_ENDIAN Indicating that the byte sex should be little endian. .TP .RB ( GD_BIG_ENDIAN " | " GD_LITTLE_ENDIAN ) Indicating that the byte sex should be the opposite of the native endianness of the host, whichever that may be. .PP Furthermore, any of these may be bitwise or'd with .B GD_ARM_ENDIAN or .B GD_NOT_ARM_ENDIAN indicating that the floating point data are stored in the ARM middle-endian format. .PP In addition to being simply a valid fragment index, .I fragment_index may also be the special value .BR GD_ALL_FRAGMENTS , which indicates that the byte sex of all fragments in the database should be changed. If the .I recode argument is non-zero, this call will byte swap the binary data of affected .B RAW fields to account for the change in byte sex. If the encoding of the fragment is endianness insensitive, or if the data type is only one byte in size, no change is made. The I/O pointer of all affected .B RAW fields is reset to the beginning-of-frame. If .I recode is zero, affected binary files are left untouched. .SH RETURN VALUE Upon successful completion, .BR gd_alter_endianness () returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_ARGUMENT The supplied .I byte_sex was invalid. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .TP .B GD_E_IO An I/O error occurred while attempting to byte swap a binary file. .TP .B GD_E_PROTECTED The metadata of the indicated format specification fragment was protected from change, or the binary data of the fragment was protected from change and binary file byte swapping was requested. .TP .B GD_E_UNCLEAN_DB An error occurred while moving the byte-swapped file into place. As a result, the database may be in an unclean state. See the .B NOTES section below for recovery instructions. In this case, the dirfile will be flagged as invalid, to prevent further database corruption. It should be immediately closed. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the fragment is unknown. .TP .B GD_E_UNSUPPORTED The encoding scheme of the fragment does not support binary file byte swapping. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES A binary file byte swap occurs out-of-place. As a result, sufficient space must be present on the filesystem for the binary files of all .B RAW fields in the fragment both before and after translation. If all fragments are updated by specifying .BR GD_ALL_FRAGMENTS , the byte swapping occurs one fragment at a time. An error code of .B GD_E_UNCLEAN_DB indicates a system error occurred while moving the byte-swapped binary data into place or when deleting the old data. If this happens, the database may be left in an unclean state. The caller should check the filesystem directly to ascertain the state of the dirfile data before continuing. For recovery instructions, see the file @absolute_docdir@/unclean_database_recovery.txt. .SH SEE ALSO .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_endianness (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_fragmentname.30000640000175000017500000000436612614323564017772 0ustar alastairalastair.\" gd_fragmentname.3. The gd_fragmentname man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_fragmentname 3 "21 July 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_fragmentname \(em retrieve a dirfile format specification fragment name .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char* gd_fragmentname(const DIRFILE *" dirfile ", int " index ); .hy .ad n .SH DESCRIPTION The .BR gd_fragmentname () function queries a dirfile(5) database specified by .I dirfile and returns the filename of the format specification fragment indexed by the non-negative .IR index . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The fragment with .I index equal to zero is always the primary fragment for the database (the file called .B format in the root dirfile directory). The largest valid value of .I index is one less than the total number of fragments, which may be obtained from a call to .BR gd_nfragments (3). .SH RETURN VALUE Upon successful completion, .BR gd_fragmentname () returns a pointer to a read-only character string containing the file name of the specified fragment. On error, .BR gd_fragmentname () returns NULL and sets the dirfile error a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_error (3), .BR gd_error_string (3), .BR gd_include (3), .BR gd_nfragments (3), .BR gd_open (3), .BR gd_parent_fragment (3) libgetdata-0.9.0/man/gd_get_string.30000640000175000017500000000565112614323564017471 0ustar alastairalastair.\" gd_get_string.3. The gd_get_string man page. .\" .\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_get_string 3 "25 May 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_get_string \(em retrieve a string from a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "size_t gd_get_string(DIRFILE *" dirfile ", const char *" field_code , .BI "size_t " len ", char *" data_out ); .hy .ad n .SH DESCRIPTION The .BR gd_get_string () function queries a dirfile(5) database specified by .I dirfile for the string scalar .IR field_code , which should not contain a representation suffix. The first .I len characters of the string scalar are stored in the user-supplied buffer .IR data_out . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). If .I len equals zero, or if .I data_out equals NULL, no data will be copied to .IR data_out , but the length of the string scalar will still be returned by .BR gd_get_string (). Otherwise, the argument .I data_out must point to a valid memory location of sufficient size to hold at least .I len characters. If the length of the string scalar is greater than .IR len ", " data_out will not be NULL-terminated. .SH RETURN VALUE On success, .BR gd_get_string () returns the actual length of the specified string scalar, including the trailing NULL character. A return value greater than .I len indicates that the output string is not null terminated. On error, it returns 0 and sets the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE An invalid .I dirfile was supplied. .TP .B GD_E_BAD_FIELD_TYPE The supplied .I field_code referred to a field of type other than .BR STRING . The caller should use .BR gd_getdata (3), or .BR gd_get_constant (3) instead. .TP .B GD_E_BAD_TYPE An invalid .I return_type was specified. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered may be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_put_string (3) libgetdata-0.9.0/man/gd_alter_frameoffset.3.in0000640000175000017500000001114312614323564021412 0ustar alastairalastair.\" gd_alter_frameoffset.3. The gd_alter_frameoffset man page. .\" .\" @configure_input@ .\" .\" Copyright (C) 2008, 2010, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_frameoffset 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_alter_frameoffset \(em modify the starting frame of fields in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_frameoffset(DIRFILE *" dirfile ", off_t " offset , .BI "int " fragment_index ", int " recode ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_frameoffset () function sets the frame offset of the format specification fragment given by .I fragment_index to .I offset in the dirfile(5) database specified by .IR dirfile . The frame offset of a fragment indicate the frame number of the first sample of data stored in binary files associated with .B RAW fields defined in the specified fragment. The frame offset of a fragment containing no .B RAW fields is ignored. The frame offset may not be negative. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). In addition to being simply a valid fragment index, .I fragment_index may also be the special value .BR GD_ALL_FRAGMENTS , which indicates that the frame offset of all fragments in the database should be changed. If the .I recode argument is non-zero, this call will shift the binary data of affected .B RAW fields to account for the change in frame offset. If the new frame offset is larger than the old frame offset, this will result in permanent deletion of data from the database. If the new frame offset is smaller than the old frame offset, the binary file will be padded at the front with zeroes. The I/O pointer of all affected .B RAW fields is reset to the beginning-of-frame. If .I recode is zero, affected binary files are left untouched. .SH RETURN VALUE Upon successful completion, .BR gd_alter_frameoffset () returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .TP .B GD_E_IO An I/O error occurred while attempting to shift a binary file. .TP .B GD_E_PROTECTED The metadata of the given format specification fragment was protected from change, or the binary data of the fragment was protected from change and binary file shifting was requested. .TP .B GD_E_RANGE The supplied offset was less than zero. .TP .B GD_E_UNCLEAN_DB An error occurred while moving the shifted file into place. As a result, the database may be in an unclean state. See the .B NOTES section below for recovery instructions. In this case, the dirfile will be flagged as invalid, to prevent further database corruption. It should be immediately closed. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the fragment is unknown. .TP .B GD_E_UNSUPPORTED The encoding scheme of the fragment does not support binary file shifting. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES A binary file shift occurs out-of-place. As a result, sufficient space must be present on the filesystem for the binary files of all .B RAW fields in the fragment both before and after translation. If all fragments are updated by specifying .BR GD_ALL_FRAGMENTS , the shifting occurs one fragment at a time. An error code of .B GD_E_UNCLEAN_DB indicates a system error occurred while moving the shifted binary data into place or when deleting the old data. If this happens, the database may be left in an unclean state. The caller should check the filesystem directly to ascertain the state of the dirfile data before continuing. For recovery instructions, see the file @absolute_docdir@/unclean_database_recovery.txt. .SH SEE ALSO .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_frameoffset (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_free_entry_strings.30000640000175000017500000000434112614323564021232 0ustar alastairalastair.\" gd_free_entry_strings.3. The gd_free_entry_strings man page. .\" .\" Copyright (C) 2008, 2010, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_free_entry_strings 3 "7 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_free_entry_strings \(em free strings in a GetData gd_entry_t object .SH SYNOPSIS .B #include .HP .nh .ad l .BI "gd_entry_t *gd_free_entry_strings(gd_entry_t *" entry ); .hy .ad n .SH DESCRIPTION The .BR gd_free_entry_strings () function frees the character strings found in the gd_entry_t object .I entry which were previously allocated by a call to .BR gd_entry (3). After freeing a string, the associated pointer is set to NULL. If .I entry is NULL, this function does nothing. If non-NULL, .I entry must point to a valid and properly initialised gd_entry_t object, such as that returned by .BR gd_entry (3). As well, the caller may construct a properly initialised gd_entry_t object by first setting all bits to zero, then setting the field_type parameter to the desired gd_entype_t symbol, and finally initialising only the members defined for that type. The results of calling this function are undefined if the character strings pointed to by the string members of .I entry have not been allocated with .BR malloc (3), unless these pointer members are equal to NULL. See .BR gd_entry (3) for a description of the gd_entry_t data type. .SH RETURN VALUE The function .BR gd_free_entry_strings () always returns its input, .IR entry . .SH NOTES This function is provided as a convenience only. Callers may free strings allocated by .BR gd_entry (3) themselves by simply calling .BR free (3) on the appropriate members for the given entry type, if they prefer to do so. .SH SEE ALSO .BR gd_entry (3), .BR free (3) libgetdata-0.9.0/man/gd_bof.30000640000175000017500000000647312614323564016075 0ustar alastairalastair.\" gd_bof.3. The gd_bof man page. .\" .\" Copyright (C) 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_bof 3 "17 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_bof \(em report the start of data in a field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "off_t gd_bof(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_bof () function queries a dirfile(5) database specified by .I dirfile and returns the sample number of the beginning-of-field marker for the vector field given by .IR field_code . The caller should not assume that the beginning-of-field marker falls on a frame boundary. The beginning-of-field marker is never negative. For a .B RAW field, the beginning-of-field corresponds to the frame offset of that field (see .BR gd_frameoffset (3)). The beginning-of-field for all other vector field type is the same as the beginning-of-field of whichever of its input fields that starts latest. The beginning-of-field marker for the special field .I INDEX is always zero. The beginning-of-field marker for a field containing no data is in the same location as, or after, its end-of-field marker (see .BR gd_eof (3)). For a .B RAW field, the difference between the locations of the beginning- and end-of-field markers indicates the number of samples of data actually stored on disk. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_bof () returns the sample number of the end-of-field marker for the indicated field. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code or one of the fields it uses as input was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_DIMENSION A scalar field was found where a vector field was expected in the definition of .I field_code or one of its inputs, or else .I field_code itself specified a scalar field. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR dirfile-encoding (5), .BR gd_open (3), .BR gd_eof (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_nframes (3) libgetdata-0.9.0/man/gd_alter_entry.30000640000175000017500000002025012614323564017644 0ustar alastairalastair.\" gd_alter_entry.3. The gd_alter_entry man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_entry 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_alter_entry \(em modify the metadata of a dirfile field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_entry(DIRFILE *" dirfile ", const char *" field_code , .BI "const gd_entry_t *" entry ", int " recode ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_entry () function modifies the field specified by .I field_code in the dirfile specified by .I dirfile to correspond to the new parameters specified by .IR entry . In addition to specifying a regular field, .I field_code may also refer to a metafield by specifying it using its full (slashed) field code. However, .I field_code should never contain a representation suffix. The form of .I entry is described in detail in the .BR get_entry (3) man page. The .IR entry -> field and .IR entry -> fragment_index members are ignored by this function and need not be initialised. All other members appropriate to the field type of .I field_code should be initialised, except as noted below. To change the fragment index of a field, use .BR gd_move (3). To change the name of a field, use .BR gd_rename (3). The only flags in the .IR entry -> flags member which are honoured are .BR GD_EN_HIDDEN , which should be set or cleared to set the hiddenness of the entry (see .BR gd_hidden (3)), and .BR GD_EN_COMPSCAL , which indicates whether scalar parameters are initialised from the complex valued or purely real member, which both are present .RB ( LINCOM , .BR POLYNOM , .BR RECIP ). If .I field_code specifies a .B RAW field and the .I recode argument is non-zero, the binary file associated with the field will be converted for changes in data type and samples-per-frame. In this case, the field's I/O pointer will be reset to the beginning-of-frame. If .I recode is zero, no binary file conversion will take place. If .I field_code specifies a .B LINTERP field and the .I recode argument is non-zero, the look-up table file will be moved if .IR entry -> table specifies a different path. If a file with the new pathname already exists, it will be overwritten. If the field specified by .I field_code is of type other than .B RAW or .BR LINTERP , the .I recode argument is ignored. If .I field_code specified a .B LINCOM or .B POLYNOM field, the value of .IR entry -> comp_scal indicates whether the purely real scalar lists .RI ( entry -> a ", or " entry -> b " and " entry -> m ) or the complex valued lists .RI ( entry -> ca ", or " entry -> cb " and " entry -> cm ) will be used. The unused counterparts need not be initialised. The .IR entry -> field_type member must correspond to the field type of .IR field_code . This interface cannot be used to change the type of a given field. To do so, delete the old field first with .BR gd_delete (3), and then create a new field of the desired type with .BR gd_add (3). Some entry members have special values which indicate no change should be made to the member. These special values are: .TP .B NULL\fR: any of the string members, also .IR m ", " b ", " a ", " cm ", " cb ", or " ca ; .TP .B 0\fR: .IR spf ", " n_fields ", " numbits ", " cdividend ", " dividend ", or " array_len ; .TP .B -1\fR: .IR bitnum " or " period ; .TP .B GD_NULL\fR: .IR data_type " or " const_type ; .TP .B GD_WINDOP_UNK\fR: .IR windop . .PP All .IR entry -> scalar elements relevant for the given field type must be initialised to one of the following values: .IP \(bu 4 a pointer to a field code indicating a new scalar field to be used for the corresponding field parameter. If the parameter was previously a literal number, it will be replaced by the specified field code. If the parameter was previously a field code, the new field code will replace the old one. If the field code specifies a .B CARRAY field, the corresponding .IR entry -> scalar_ind element should also be set. .IP \(bu 4 a pointer to the empty string (""). In this case, no change is made to the field code for the corresponding field parameter: if one already existed, it is kept, otherwise the corresponding literal numerical parameter is used. If the value of the corresponding numerical .I entry member is the special value listed above indicating no change, no change is made to the field parameter at all. .IP \(bu 4 the NULL pointer. If the corresponding field parameter was previously a field code, the field code will be deleted and a literal number used instead. In the special case when a scalar element is NULL and the corresponding numerical .I entry member contains a special value indicating no change listed above, GetData will de-reference the previous field code value and convert it into a literal number before removing the field code from the entry. .PP If this function is used to increase the length of a .B CARRAY field, the added elements will be uninitialised. Use .BR gd_put_carray_slice (3) or equivalent to initialise them. .SH RETURN VALUE On success, .BR gd_alter_entry () returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found or a supplied field code did not contain the appropriate prefix or suffix. This error may also result from attempting to dereference a scalar field code which indicates a non-existent field. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY One or more of the parameters specified in .I entry was invalid. .TP .B GD_E_BAD_FIELD_TYPE The .IR entry -> field_type parameter did not correspond to the type of the field specified by .IR field_code , or an attempt was made to modify the immutable .I INDEX field. This error may also result from attempting to dereference a scalar field code which does not indicate a .B CONST or .B CARRAY field. .TP .B GD_E_BAD_TYPE The .IR entry -> data_type parameter provided with a .BR RAW entry, or the .IR entry -> const_type parameter provided with a .BR CONST or .BR CARRAY entry, was invalid. .TP .B GD_E_IO An I/O error occurred while translating the binary file associated with a modified .B RAW field, or an I/O error occurred while attempting to rename a .B LINTERP table file. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, a request to translate the binary file associated with a .B RAW field was attempted, but the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to translate the binary file be associated with a modified .B RAW field. .TP .B GD_E_UNSUPPORTED The encoding scheme of the indicated format specification fragment does not support translating the binary file associated with a modified .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_bit (3), .BR gd_alter_carray (3), .BR gd_alter_const (3), .BR gd_alter_divide (3), .BR gd_alter_lincom (3), .BR gd_alter_linterp (3), .BR gd_alter_multiply (3), .BR gd_alter_phase (3), .BR gd_alter_polynom (3), .BR gd_alter_raw (3), .BR gd_alter_recip (3), .BR gd_alter_spec (3), .BR gd_delete (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_hidden (3), .BR gd_malter_spec (3), .BR gd_metaflush (3), .BR gd_move (3), .BR gd_open (3), .BR gd_put_carray_slice (3), .BR gd_rename (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_entry_type.30000640000175000017500000000461212614323564017522 0ustar alastairalastair.\" gd_entry_type.3. The gd_entry_type man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_entry_type 3 "21 August 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_entry_type \(em retrieve the type of a dirfile field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "gd_entype_t gd_entry_type(const DIRFILE *" dirfile ", const char" .BI * field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_entry_type () function queries a dirfile(5) database specified by .I dirfile and returns the field type of the field specified by .IR field_code . If .I field_code contains a valid representation suffix, it will be ignored. The .B gd_entype_t type is an enumerated type which may take any of the following values: .IP .nh .ad l .BR GD_BIT_ENTRY , .BR GD_CARRAY_ENTRY , .BR GD_CONST_ENTRY , .BR GD_DIVIDE_ENTRY , .BR GD_INDEX_ENTRY , .BR GD_LINCOM_ENTRY , .BR GD_LINTERP_ENTRY , .BR GD_MPLEX_ENTRY , .BR GD_MULTIPLY_ENTRY , .BR GD_PHASE_ENTRY , .BR GD_POLYNOM_ENTRY , .BR GD_RAW_ENTRY , .BR GD_RECIP_ENTRY , .BR GD_SBIT_ENTRY , .BR GD_STRING_ENTRY , .BR GD_WINDOW_ENTRY . .ad n .hy .SH RETURN VALUE Upon successful completion, .BR gd_entry_type () returns the field type of the specified field. On error, .BR gd_entry_type () returns .B GD_NO_ENTRY and sets the dirfile error a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_cbopen (3), .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_fragmentname (3), .BR gd_parent_fragment (3), .BR dirfile (5) libgetdata-0.9.0/man/gd_tell.30000640000175000017500000000620412614323564016257 0ustar alastairalastair.\" gd_getdata.3. The gd_getdata man page. .\" .\" Copyright (C) 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_tell 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_tell \(em reposition a dirfile field pointer .SH SYNOPSIS .B #include .HP .nh .ad l .BI "off_t gd_tell(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_tell () function reports the current position of the I/O pointer of the field .I field_code in the dirfile(5) database specified by .IR dirfile . .P Only .B RAW fields (and the implicit .I INDEX field) have field pointers associated with them. Calling .BR gd_tell () on a derived field will report the position of the I/O pointer of the derived field only if all of it's inputs are positioned the same. Otherwise, an error results. .SH RETURN VALUE Upon successful completion, .BR gd_tell () returns the I/O position of the specified field in samples. On error, it returns -1 and set the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .IR field_code , or one of the fields it uses for input, was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_DIMENSION The specified field or one of its inputs wasn't of vector type. .TP .B GD_E_DOMAIN The I/O position of a derived field wasn't well defined because its input fields simultaneously read from different places in the same .B RAW field. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_IO An error occurred while trying to open or read from a file on disk containing a raw field. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of a RAW field could not be determined. This may also indicate that the binary file associated with the RAW field could not be found. .TP .B GD_E_UNSUPPORTED Reading from dirfiles with the encoding scheme of the specified dirfile is not supported by the library. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_getdata (3), .BR gd_putdata (3), .BR gd_seek (3). libgetdata-0.9.0/man/gd_add.30000640000175000017500000001401112614323564016042 0ustar alastairalastair.\" gd_add.3. The gd_add man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_add 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_add, gd_madd \(em add a field to a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_add(DIRFILE *" dirfile ", const gd_entry_t *" entry ); .HP .BI "int gd_madd(DIRFILE *" dirfile ", const gd_entry_t *" entry , .BI "const char *" parent ); .hy .ad n .SH DESCRIPTION The .BR gd_add () function adds the field described by .I entry to the dirfile specified by .IR dirfile . The .BR gd_madd () function behaves similarly, but adds the field as a metafield under the field indicated by the field code .IR parent . The form of .I entry is described in detail on the .BR gd_entry (3) man page. All relevant members of .I entry for the field type specified must be properly initialised. If .I entry specifies a .B CONST or .B CARRAY field, the field's data will be set to zero. If .I entry specifies a .B STRING field, the field data will be set to the empty string. The only flags in the .IR entry -> flags member which are honoured are .BR GD_EN_HIDDEN , which should be set or cleared to set the hiddenness of the entry (see .BR gd_hidden (3)), and .BR GD_EN_COMPSCAL , which indicates whether scalar parameters are initialised from the complex valued or purely real member, which both are present .RB ( LINCOM , .BR POLYNOM , .BR RECIP ). A metafield may be added either by calling .BR gd_madd () with .IR entry -> field containing only the metafield's name, or else by calling .BR gd_add () with the fully formed .IB / field code in .IR entry -> field . Regardless of which interface is used, when adding a metafield the value of .IR entry -> fragment_index is ignored and GetData will add the new metafield to the same format specification fragment in which the parent field is defined. If the specified parent field name is an alias, the canonical name of the field will be substituted. Fields added with this interface may contain either literal parameters or parameters based on scalar fields. If an element of the .IR entry -> scalar array defined for the specified field type is non-NULL, this element will be used as the scalar field code, and the corresponding numerical member will be ignored, and need not be initialised. Conversely, if numerical parameters are intended, the corresponding .IR entry -> scalar elements should be set to NULL. If using an element of a .B CARRAY field, .IR entry -> scalar_ind should also be set. .SH RETURN VALUE On success, .BR gd_add () and .BR gd_madd () return zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field name provided in .IR entry -> field contained invalid characters; or it or an input field did not contain the affected fragment's prefix or suffix. Alternately, the .I parent field code was not found, or was already a metafield. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY There was an error in the specification of the field described by .IR entry , or the caller attempted to add a field of type .B RAW as a metafield. .TP .B GD_E_BAD_INDEX The .IR entry -> fragment_index parameter was out of range. .TP .B GD_E_BAD_TYPE The .IR entry -> data_type parameter provided with a .BR RAW entry, or the .IR entry -> const_type parameter provided with a .B CONST or .B CARRAY entry, was invalid. .TP .B GD_E_DUPLICATE The field name provided in .IR entry -> field duplicated that of an already existing field. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .TP .B GD_E_IO An I/O error occurred while creating an empty binary file to be associated with a newly added .B RAW field. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, the creation of a .B RAW field was attempted and the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to create an empty binary file to be associated with a newly added .B RAW field. .TP .B GD_E_UNSUPPORTED The encoding scheme of the indicated format specification fragment does not support creating an empty binary file to be associated with a newly added .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_add_bit (3), .BR gd_add_carray (3), .BR gd_add_const (3), .BR gd_add_divide (3), .BR gd_add_lincom (3), .BR gd_add_linterp (3), .BR gd_add_multiply (3), .BR gd_add_phase (3), .BR gd_add_polynom (3), .BR gd_add_raw (3), .BR gd_add_recip (3), .BR gd_add_sbit (3), .BR gd_add_spec (3), .BR gd_add_string (3), .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_madd_bit (3), .BR gd_madd_carray (3), .BR gd_madd_const (3), .BR gd_madd_divide (3), .BR gd_madd_lincom (3), .BR gd_madd_linterp (3), .BR gd_madd_multiply (3), .BR gd_madd_phase (3), .BR gd_madd_polynom (3), .BR gd_madd_recip (3), .BR gd_madd_sbit (3), .BR gd_madd_spec (3), .BR gd_madd_string (3), .BR gd_metaflush (3), .BR gd_open (3), .BR dirfile-format (5) libgetdata-0.9.0/man/dirfile-format.50000640000175000017500000012220512614323564017553 0ustar alastairalastair.\" dirfile-format.5. The dirfile format specification man page. .\" .\" Copyright (C) 2005, 2006, 2008, 2009, 2010, 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH dirfile\-format 5 "3 April 2013" "Standards Version 9" "DATA FORMATS" .SH NAME dirfile\-format \(em the dirfile database format specification file .SH DESCRIPTION The .I dirfile format specification fully specifies the raw and derived time streams and auxiliary information for a .BR dirfile (5) database. The format specification is contained in one or more case-sensitive text files located in the dirfile tree. Each file is known as a .IR fragment . The primary fragment is the file called .B format located in the base dirfile directory. This file may contain only part of the format specification, and may reference other fragments (using the .B /INCLUDE directive) containing further format specification. This inclusion mechanism may be nested arbitrarily deep. The explicit text encoding of these files is not specified by these Standards, but it must be 7\-bit ASCII compatible. Examples of acceptable character encodings include all the ISO\~8859 character sets .RI ( i.e. Latin-1 through Latin-10, among others), as well as the UTF-8 encoding of Unicode and UCS. This document primarily describes the latest version of the Standards (Version 9); differences with previous versions are noted where relevant. A complete list of changes between versions is given in the .B HISTORY section below. .SH SYNTAX The format specification is composed of field specification lines and directive lines, optionally separated by blank lines or lines containing only whitespace. Lines are separated by the line-feed character (0x0A). Unless escaped (see below), the hash mark .RB ( # ) is the comment delimiter; the comment delimiter, and any text following it to the end of the line, is ignored. .SS Tokens Both field specification lines and directive lines consist of several tokens separated by whitespace. Whitespace consists of one or more whitespace characters. These are: space (0x20), horizontal tab (0x09), vertical tab (0x0B), form-feed (0x0C), and carriage return (0x0D). The first token of a directive line is always a .IR "reserved word" . The first token of a field specification line is never a reserved word. Any amount of whitespace may precede the first token on a line. Since tokens are separated by whitespace, to include a whitespace character in a token, it must either escaped by preceding it by a backslash character .RB ( \e ), or be replaced by a .I character escape sequence (see below), or else the token must be enclosed in quotation marks .RB ( """" ). The quotation marks themselves are stripped from the token. The .I null-token (that is, the token consisting of zero characters) may be specified by a pair of quotation marks with nothing between them .RB ( """""" ). To include a literal quotation mark in a token, it must be escaped .RB ( \e" ). Similarly, a hash mark may be included in a token by including it in a quoted token or else by escaping it .RB ( \e# ), otherwise the hash mark is understood as the comment delimiter. It is a syntax error to have a line which contains unmatched quotation marks, or in which the last character is the backslash character. Several characters when escaped by a preceding backslash character are interpreted as special characters in tokens. The character escape sequences are: .RS .TP .B \ea an alert (bell) character (ASCII 0x07 / U+0007) .TP .B \eb a backspace character (ASCII 0x08 / U+0008) .TP .B \ee an escape character (ASCII 0x1B / U+001B) .TP .B \ef a form-feed character (ASCII 0x0C / U+000C) .TP .B \en a line-feed character (ASCII 0x0A / U+000A) .TP .B \er a carriage return character (ASCII 0x0D / U+000D) .TP .B \et a horizontal tab character (ASCII 0x09 / U+0009) .TP .B \ev a vertical tab character (ASCII 0x0B / U+000B) .TP .B \e\e a backslash character (ASCII 0x5C / U+005C) .TP .BI \e ooo the single byte given by the octal number .I ooo (1 to 3 octal digits). .TP .BI \ex hh the single byte given by the hexadecimal number .I hh (1 or 2 hexadecimal digits). .TP .BI \eu hhhhhhh the UTF-8 byte sequence encoding the Unicode code point given by the hexadecimal number .I hhhhhhh (1 to 7 hexadecimal digits). .RE Any other character which is escaped is interpreted as the character itself. .RI ( i.e. .B \ec is interpreted as .BR c ; also, as pointed out above, .B \e" and .B \e# are interpreted as simply .B """" and .BR # , without their special meanings). No token may contain the NULL character (ASCII 0x00 / U+0000). Furthermore, although support is present to create UTF-8 byte sequences, tokens are not required to be valid UTF-8 sequences. Any byte sequence not containing the NULL character forms a valid token. However, there may be further restrictions on allowed characters for a token in a particular situation, (for example, when used as a field name). Standards Version 5 and earlier do not recognise the character escape sequences, nor allow quoting of tokens. As a result, they prohibit both whitespace and the comment delimiter from being used in tokens. .SH DIRECTIVES There are ten .IR directives , each specified by a different .IR "reserved word", which cannot be used as field names in the dirfile. As of Standards Version 8, all reserved words start with an initial forward slash .RB ( / ), to distinguish them from field names. Standards Versions 5, 6, and 7 permitted the omission of the initial forward slash, while in Standards Version 4 and earlier, reserved words may not have an initial forward slash. Like the rest of the format specification, directives are case sensitive. A number of the directives have .IR "fragment scope" . A directive with fragment scope only applies to the fragment in which it is present, plus any sub-fragments indicated by the .B /INCLUDE directive, but only if those sub-fragments don't have their own corresponding directive. Directives which have fragment scope are: .BR /ENCODING ", " /ENDIAN ", " /FRAMEOFFSET ", and " /PROTECT . Because of these scoping rules, different portions of the dirfile may have different encodings, endiannesses, frame offsets, or protection levels. If a directive with fragment scope appears more than once in a fragment, only the last such directive is honoured, with the exception that the effect of a directive is not propagated to sub-fragments if the directive line appears after the sub-fragment is included. The scoping rules of the remaining directives are discussed below. .TP .B /ALIAS The /ALIAS directive defines an alternate name for a field defined elsewhere in the format specification (called the "target"). Aliases may not be used as the parent field in a .B /META directive, but are in most other ways indistinguishable from the target's original, canonical name. Aliases may be chained (that is, the target name appearing in an /ALIAS directive may itself be an alias). In this case, the new alias is another name for the target's own target. Just as there is no requirement that the input fields of a derived field exist, it is not an error for the target of an alias to not exist. Syntax is: .IP .RS .B /ALIAS .I .RE .IP A metafield alias may defined using the .IR / syntax for .I name in the /ALIAS directive. No restriction is placed on .IR target ; specifically, a metafield alias may target a top-level field, or a metafield of with a different parent; conversely, a top-level alias may target a metafield. .IP A metafield alias may never appear as the parent part of a metafield field code, even if it refers to a top-level field. That is, given the valid format: .IP .RS field1 \fBRAW UINT8\fR 1 .br field1/meta \fBCONST FLOAT64\fR 0.0 .br field2 \fBRAW UINT8\fR 1 .br \fB/ALIAS\fR field2/alias field1 .RE .IP the metafield .I field1/meta may not be referred to as .IR field2/alias/meta , even though .I field2/alias is a valid field code referring to .IR field1 . .IP The /ALIAS directive has no scope: it is processed immediately. It appeared in Standards Version 9. .TP .B /ENCODING The /ENCODING directive specifies the encoding scheme used to encode binary files in the dirfile. The encoding scheme may be one of the predefined names listed below, which are described in more detail in .BR dirfile\-encoding (5), or any other site-specific encoding scheme. The predefined scheme names are: .RS .TP .B none The dirfile is unencoded. .TP .B bzip2 The dirfile is compressed using the bzip2 compression scheme. .TP .B gzip The dirfile is compressed using the gzip compression scheme. .TP .B lzma The dirfile is compressed using the LZMA compression scheme. .TP .B slim The dirfile is compressed using the slim compression scheme. .TP .B sie The dirfile is sample-index encoded (a variant of run-length encoding). .TP .B text The dirfile is text encoded. .TP .B zzip The dirfile is compressed and encapsulated using the zzip compression scheme. .TP .B zzslim The dirfile is compressed and encapsulated using a combination of the zzip and slim compression schemes. .PP Implementations should fail gracefully when encountering an unknown encoding scheme. If no encoding scheme is specified, behaviour is implementation dependent. Syntax is: .IP .B /ENCODING \fI \fR[\fI\fR] .PP The .I enc-datum token provides additional data for certain encoding schemes; see .BR dirfile-encoding (5) for details. The form of enc-datum is not specified. .PP The /ENCODING directive has .IR "fragment scope" . It appeared in Standards Version 6. The predefined schemes .nh .BR sie ", " zzip ", and " zzslim , .hy and the optional .I enc-datum token, appeared in Standards Version 9; the predefined scheme .B lzma appeared in Standards Version 7; all other predefined schemes appeared in Standards Version 6. .RE .TP .B /ENDIAN The /ENDIAN directive specifies the endianness of the raw data in the database. The assumed endianness of raw data in dirfiles which omit this directive is implementation dependent. Syntax is: .RS .IP .B /ENDIAN .RB "( " big " | " little " ) [ " arm " ]" .PP where the "arm" token should be included if double precision floating point data are stored in the ARM middle-endian format. The /ENDIAN directive has .IR "fragment scope" . It appeared in Standards Version 5. The optional .B arm token appeared in Standards Version 8. .RE .TP .B /FRAMEOFFSET The /FRAMEOFFSET directive specifies the frame number of the first frame for which data exists in binary files associated with .B RAW fields. Syntax is: .RS .IP .BI /FRAMEOFFSET\~ .PP The /FRAMEOFFSET directive has .IR "fragment scope" . It appeared in Standards Version 1. .RE .TP .B /HIDDEN The /HIDDEN directive indicates that the specified field name is .IR hidden . The difference (if any) between a field name which is .I hidden and one that is not is implementation dependent. Hiddenness is not inherited by metafields of the specified field. Hiddenness applies to the name, not the field itself; it does not hide all aliases of the field-name, and if field-name an alias, the alias is hidden, not its target. Syntax is: .RS .IP .BR /HIDDEN\~ .PP A /HIDDEN directive must appear after the specification of .IR field-name , (which occurs either in a field specification line, or an .B /ALIAS directive, or a .B /META directive) in the same fragment. .PP The /HIDDEN directive has no scope: it is processed immediately. It appeared in Standards Version 9. .RE .TP .B /INCLUDE The /INCLUDE directive specifies another file (called a .IR "fragment" ) to parse for additional format specification for the dirfile. The inclusion is processed immediately, before the fragment containing the /INCLUDE directive (the .IR "parent fragment" ) is parsed further. RAW fields specified in the included fragment are located in the directory containing the fragment file, and not in the directory containing the parent fragment, and the binary file encoding may be different for each fragment. The fragment may be specified either with an absolute path, or else a path relative to the directory containing the parent fragment. .IP The /INCLUDE directive may optionally specify a .I prefix and/or .I suffix to apply to field names defined in the included fragment. If present, affixes are applied to all field-names (including aliases) defined in the included fragment and any fragments it further includes. Affixes nest, with the affixes of the deepest inclusion innermost. Affixes are not applied to the names of binary files associated with .B RAW fields. Syntax is: .RS .IP .B /INCLUDE \fI \fR[\fI \fR[\fI\fR]] .PP To specify only a suffix, use the null-token .RB ( """""" ) as .IR prefix . The /INCLUDE directive has no scope: it is processed immediately. It appeared in Standards Version 3. The optional .I prefix and .I suffix appeared in Standards Version 9. .RE .TP .B /META The /META directive specifies a metafield attached to a particular parent field. The field metadata may be of any allowed type except .BR RAW . Metafields are retrieved in exactly the same way as regular field data, but the .I field code specified consists of the parent and metafield names joined with a forward slash: .RS .IP .IB / .PP META fields may not be specified before their parent field has been. Syntax is: .IP .B /META .I {field specification line} .PP The .I code may not be an alias. As an illustration of this concept, .IP .B /META pfield meta .B CONST FLOAT64 3.291882 .PP provides a scalar metadatum called .I meta with value 3.291882 attached to the field .IR pfield . This particular metafield may be referred to by the .I field code "pfield/meta". Note that different parent fields may have metafields with the same name, since all references to metafields must include the parent field name. Metafields may not themselves have further sub-metafields. .PP As an alternative to the /META directive, starting with Standards Version 7, a metafield may be specified by a standard field specification line, using .IP .IB / .PP as the field name. That is, the above example metafield could have also been specified as: .IP pfield/meta .B CONST FLOAT64 3.291882 .PP The /META directive has no scope: it is processed immediately. It appeared in Standards Version 6. .RE .TP .B /PROTECT The /PROTECT directive specifies the advisory protection level of the current fragment and of the .B RAW fields defined therein. The protection level indicates whether writing to the fragment, or the binary data on disk is permitted. Syntax is: .RS .IP .BI /PROTECT\~ .PP Four advisory protection levels are defined: .TP .I none No protection at all: data and metadata may be freely changed. This is the default, if no /PROTECT directive is present. .TP .I format The dirfile metadata is protected from change, but .B RAW data on disk may be modified. .TP .I data The .B RAW data on disk is protected from change, but metadata may be modified. .TP .I all Both metadata and data on disk are protected from change. .PP The /PROTECT directive has .IR "fragment scope" . It appeared in Standards Version 6. .RE .TP .B /REFERENCE The /REFERENCE directive specifies the name of the field to use as the dirfile's reference field (see .BR dirfile (5)). If no /REFERENCE directive is specified, the first .B RAW field encountered is used as the reference field. The /REFERENCE directive must specify a .B RAW field. Syntax is: .RS .IP .BI /REFERENCE\~ .PP The /REFERENCE directive has .IR "global scope" : if multiple /REFERENCE directives appear in the dirfile metadata, only the last such is honoured. It appeared in Standards Version 6. .RE .TP .B /VERSION The /VERSION directive specifies the particular version of the Dirfile Standards to which the dirfile format specification conforms. This directive should occur before any version dependent syntax is encountered. As of Standards Version 6, no such syntax exists, and this directive is provided primarily to ease forward compatibility. Syntax is: .RS .IP .BI /VERSION\~ .PP The /VERSION directive has .IR "immediate scope" : its effect is immediate, and it applies only to metadata below it, including and propagating downwards to sub-fragments after the directive. .PP In Standards Version 8 and earlier, its effect also propagates upwards back to the parent fragment, and affects subsequent metadata. Starting with Standards Version 9, this no longer happens. As a result, a /VERSION directive which indicates a version of 9 or later never propagates upwards; additionally, /VERSION directives found in subfragments included in a Version 9 or later fragment aren't propagated upwards into that fragment, regardless of the Version of the subfragments. The /VERSION directive appeared in Standards Version 5. .RE .SH FIELD SPECIFICATION LINES Any line which does not start with a .I reserved word is assumed to be a field specification line. A field specification line consists of at least two tokens. The first token is the .IR "field name" . The second token is the .IR "field type" . Subsequent tokens are field parameters. The meaning and number these parameters depends on the field type specified. .SS Field Names The first token in a field specification line is the field name. The field name consists of one or more characters, excluding both ASCII control characters (the bytes 0x01 through 0x1F), and the characters .IP .B &\t/\t;\t<\t>\t|\t. .PP which are reserved (but see below for the use of .B / to specify metafields). The full stop .RB ( . ) is allowed in Standards Version 5 and earlier. The ampersand, semicolon, less than, greater than, and vertical line .RB ( "& ; < > |" ) are allowed in Standards Version 4 and earlier. Furthermore, due to the lack of an escape or quoting mechanism (see .B Tokens above), Standards Version 5 and earlier also prohibit whitespace and the comment delimiter .RB ( # ) in field names. .PP The field name may not be .IR INDEX , which is a special, implicit field which contains the integer frame index. Standards Version 5 and earlier also prohibit .IR FILEFRAM , which was an alias for .IR INDEX . Field names are case sensitive. Standards Version 3 and 4 restrict field names to 50 characters. Standards Version 2 and earlier restrict field names to 16 characters. Additionally, the filesystem may put restrictions on the length and acceptable characters of a .B RAW field name, regardless of Standards Version. Starting in Standards Version 7, if the field name beginning a field specification line contains exactly one .B / character, the line is assumed to specify a metafield. See the .B /META directive above for further details. A field name may not contain more than one .BR / . .SS Field Types There are fifteen field types. Of these, twelve are of vector type .RB ( BIT ", " DIVIDE ", " LINCOM ", " LINTERP ", " MPLEX ", " MULTIPLY , .BR PHASE ", " POLYNOM ", " RAW ", " RECIP ", " SBIT ", and " WINDOW ) and three are of scalar type .RB ( CONST ", " CARRAY ", and " STRING ). The eleven vector field types other than .B RAW fields are also called .IR "derived fields" , since they derive their value from one or more input fields. .PP Five of these derived fields .RB ( DIVIDE ", " LINCOM ", " MPLEX ", " MULTIPLY ", and " WINDOW ) may have more than one input field. In situations where these input fields have differing sample rates, the sample rate of the derived field is the same as the sample rate of the first (left-most) input field specified. Furthermore, the input fields are synchronised by aligning them on frame boundaries, assuming equally-spaced sampling throughout a frame, and using the last sample of each input field which did not occur after the sample of the derived field being computed. That is, if the first and second input fields have sample rates .I s1 and .IR s2 , the derived field also has sample rate .I s1 and, for every sample of the derived field, .IR n , the .IR n 'th sample of the first field is used (since they have the same sample rate by definition), and the sample number used of the second field, .IR m , is computed as: .IP \fIm\fR = \fBfloor\fR((\fIn\fR * \fIs2\fR) / \fIs1\fR). .PP Starting in Standards Version 6, certain scalar field parameters in the field specifications may be specified using .B CONST or .B CARRAY fields, instead of literal values. A list of parameters for which this is allowed is given below in the .B Field Parameters section. .PP The possible fields types are: .TP .B BIT The BIT vector field type extracts one or more bits out of an input vector field as an unsigned number. Syntax is: .RS .IP .I .B BIT .I \fR[\fI\fR] .PP which specifies .I fieldname to be the value of bits .I first-bit through .IR first-bit + num-bits -1 of the input vector field .IR input , when .I input is converted from its native type to an (endianness corrected) unsigned 64-bit integer. If .I num-bits is omitted, it is assumed to be 1. The .B SBIT field type is a signed version of this field type. The optional .I num-bits parameter appeared in Standards Version 1. .RE .TP .B CARRAY The CARRAY scalar field type is a list of constants fully specified in the format specification metadata. Syntax is: .RS .IP .I .B CARRAY .I ... .PP where .I type may be any supported native data type (see the description of the .B RAW field type below), and .IR value0 ", " value1 , &c. are the values of successive elements in the scalar list interpreted as indicated by .IR type . No limit is placed on the number of elements in a .BR CARRAY . (Note: despite being multivalued, this is not considered a vector field since the elements of the .B CARRAY are not indexed by frames.) It appeared in Standards Version 8. .RE .TP .B CONST The CONST scalar field type is a constant fully specified in the format specification metadata. Syntax is: .RS .IP .I .B CONST .I .PP where .I type may be any supported native data type (see the description of the .B RAW field type below), and .I value is the numerical value of the constant interpreted as indicated by .IR type . It appeared in Standards Version 6. .RE .TP .B DIVIDE The DIVIDE vector field type is the quotient of two vector fields. Syntax is: .RS .IP .I .B DIVIDE .I .PP The derived field is computed as: .IP fieldname = field1 / field2. .PP It was introduced in Standards Version 8. .RE .TP .B LINCOM The LINCOM vector field type is the linear combination of one, two or three input vector fields. Syntax is: .RS .IP .I .B LINCOM .RI [ "] " " " [ " " [ " " .IR ]] .PP where .IR n , if present, indicates the number of input vector fields (1, 2, or 3). The derived field is computed as: .IP fieldname = (a1 * field1 + b1) + (a2 * field2 + b2) + (a3 * field3 + b3) .PP with the .I field2 and .I field3 terms included only if specified. If .I n is not specified, the number of fields is determined by looking at the supplied parameters. Since it is possible to create a field code which is identical to a literal number, the third token on the line is assumed to be .I n if it the entire token can be parsed as a literal number using the rules outlined in .BR strtod (3). That is, if the field code specifying .I field1 could be mistaken for a literal number, .I n must be specified to prevent ambiguity. In standards Version 6 and earlier, .I n is mandatory. .RE .TP .B LINTERP The LINTERP vector field type specifies a table look up based on another vector field. Syntax is: .RS .IP .I .B LINTERP .I .PP where .I input is the input vector field for the table lookup, and .I table is the path to the lookup table file for the field. If this path is relative, it is assumed to be relative to the directory containing the fragment defining this field. The lookup table file is an ASCII text file with two whitespace separated columns of .I x and .I y values. Values are linearly interpolated between the points specified in the lookup table. .RE .TP .B MPLEX The MPLEX vector field type permits the multiplexing of several low sample rate fields into a single data field of higher sample rate. Syntax is: .RS .IP .I .B MPLEX .I \fR[\fI\fR] .PP where .I input is the input vector containing the multiplexed fields, .I index is the vector containing the mutliplex index, .I count is the value of the multiplex index when the computed field is stored in .IR input , and .IR period , if present and non-zero, is the number of samples between successive occurrances of the value .I count in the index vector. A .I period of zero (or, equivalently, it's omission) indicates that either the value .I count is not equally spaced in the index vector, or else that the spacing is unknown. Both .I count and .I period are integers, and .I period may not be negative. .PP At every sample .IR n , the derived field is computed as: .IP fieldname[n] = (index == count) ? input[n] : fieldname[n - 1] .PP The .I index vector is converted to an integer type for comparison. The value of the derived field before the first sample where .I index equals .I count is implementation dependent. .PP The values of .I count and .I period place no restrictions on values contained in .IR index . Specifically, particular values of .I index (including .IR count ) need not be equally spaced (neither by .I period nor any other spacing); .I index need not ever take on the value .I count (in which case the value of the entirety of the derived field is implementation dependent). Different MPLEX field definitions which use the same index vector may specify different .IR period s. MPLEX appeared in Standards Version 9. .RE .TP .B MULTIPLY The MULTIPLY vector field type is the product of two vector fields. Syntax is: .RS .IP .I .B MULTIPLY .I .PP The derived field is computed as: .IP fieldname = field1 * field2. .PP It appeared in Standards Version 2. .RE .TP .B PHASE The PHASE vector field type shifts an input vector field by the specified number of samples. Syntax is: .RS .IP .I .B PHASE .I .PP which specifies .I fieldname to be the input vector field, .IR input , shifted by .I shift samples. A positive .I shift indicates a forward shift, towards the end-of-field. Results of shifting past the beginning- or end-of-field is implementation dependent. PHASE appeared in Standards Version 4. .RE .TP .B POLYNOM The POLYNOM vector field type specifies a polynomial function of a single input vector field. Syntax is: .RS .IP .I .B POLYNOM .I .RI [ " [" " [" " [" ]]]] .PP where .I is the input field code, and the order of the computed polynomial is determined by how many co-efficients are present in the specification. The derived field is computed as: .IP fieldname = a0 + a1 * input + a2 * input**2 + a3 * input**3 + a4 * input**4 + a5 * input**5 .PP where .I ** is the element-wise exponentiation operator, and the higher order terms are computed only if the corresponding co-efficients .RI a i are specified. POLYNOM appeared in Standards Version 7. .RE .TP .B RAW The RAW vector field type specifies raw time streams on disk. In this case, the field name should correspond to the name of the file containing the time stream. Syntax is: .RS .IP .I .B RAW .I .PP where .I sample-rate is the number of samples per dirfile frame for the time stream and .I type is a token specifying the native data format type: .RS .TP .I UINT8 unsigned 8-bit integer .TP .I INT8 signed (two's complement) 8-bit integer .TP .I UINT16 unsigned 16-bit integer .TP .I INT16 signed (two's complement) 16-bit integer .TP .I UINT32 unsigned 32-bit integer .TP .I INT32 signed (two's complement) 32-bit integer .TP .I UINT64 unsigned 64-bit integer .TP .I INT64 signed (two's complement) 64-bit integer .TP .I FLOAT32 IEEE-754 standard 32-bit single precision floating point number .TP .I FLOAT64 IEEE-754 standard 64-bit double precision floating point number .TP .I COMPLEX64 a 64-bit complex number consisting of two IEEE-754 standard 32-bit single precision floating point numbers representing the real and imaginary parts of the complex number (Standards Version 7 and later) .TP .I COMPLEX128 a 128-bit complex number consisting of two IEEE-754 standard 64-bit double precision floating point numbers representing the real and imaginary parts of the complex number (Standards Version 7 and later). .RE For more information on the storage of complex valued data, see dirfile(5). Two additional type names exist: .I FLOAT is equivalent to .IR FLOAT32 , and .I DOUBLE is equivalent to .IR FLOAT64 . Standards Version 9 deprecates these two aliases, but still allows them. All these type names (except those for complex data, which came later) were introduced in Standards Version 5. Earlier Standards Versions specified data types with single character type aliases: .RS .TP .I c UINT8 .TP .I u UINT16 .TP .I s INT16 .TP .I U UINT32 .TP .IR i ", " S INT32 .TP .I f FLOAT32 .TP .I d FLOAT64 .RE Types .IR INT8 ", " UINT64 ", " INT64 ", " COMPLEX64 , and .I COMPLEX128 are not supported before Standards Version 5, so no single character type aliases exist for these types. These single character type aliases were deprecated in Standards Version 5 and removed in Standards Version 8. .RE .TP .B RECIP The RECIP vector field type computes the reciprocal of a single input vector field. Syntax is: .RS .IP .I .B RECIP .I .PP where .I is the input field code and .I is a scalar quantity. The derived field is computed as: .IP fieldname = dividend / input. .PP RECIP appeared in Standards Version 8. .RE .TP .B SBIT The SBIT vector field type extracts one or more bits out of an input vector field as a signed number. Syntax is: .RS .IP .I .B SBIT .I \fR[\fI\fR] .PP which specifies .I fieldname to be the value of bits .I first-bit through .IR first-bit + bits -1 of the input vector field .IR input , when .I input is converted from its native type to a (endianness corrected) signed 64-bit integer. If .I bits is omitted, it is assumed to be 1. The .B BIT field type is an unsigned version of this field type. SBIT appeared in Standards Version 7. .RE .TP .B STRING The STRING scalar field type is a character string fully specified in the format file metadata. Syntax is: .RS .IP .I .B STRING .I .PP where .I value is the string value of the field. Note that .I value is a single token. To include whitespace in the string, enclose .I value in quotation marks .RB ( """" ), or else escape the whitespace with the backslash character .RB ( \e ). STRING appeared in Standards Version 6. .RE .TP .B WINDOW The WINDOW vector field type isolates a portion of an input vector based on a comparison. Syntax is: .RS .IP .I .B WINDOW .I .PP where .I input is the vector containing the data to extract, .I check is the vector on which to test the comparison, .I threshold is the value against which .I check is compared, and .I op is one of the following tokens indicating the particular comparison performed: .RS .TP .I EQ data are extracted where .IR check , converted to a 64-bit signed integer, equals .IR threshold , .TP .I GE data are extracted where .IR check , converted to a 64-bit floating-point number, is greater than or equal to .IR threshold , .TP .I GT data are extracted where .IR check , converted to a 64-bit floating-point number, is strictly greater than .IR threshold , .TP .I LE data are extracted where .IR check , converted to a 64-bit floating-point number, is less than or equal to .IR threshold , .TP .I LT data are extracted where .IR check , converted to a 64-bit floating-point number, is strictly less than .IR threshold , .TP .I NE data are extracted where .IR check , converted to a 64-bit signed integer, is not equal to .IR threshold , .TP .I SET data are extracted where at least one bit set in .IR threshold is also set in .IR check , when converted to a 64-bit unsigned integer, .TP .I CLR data are extracted where at least one bit set in .IR threshold is not set in .IR check , when converted to a 64-bit unsigned integer, .RE .PP The storage type of .I threshold depends on the operator, and follows the interpretation of .IR check . It may never be complex valued. .PP Outside the region extracted, the value of the derived field is implementation dependent. .PP Note: with the .B EQ operator, this derived field type is very similar to the MPLEX field type above. The primary difference is that MPLEX mandates the value of the derived field outside the extracted region, while WINDOW does not. WINDOW appeared in Standards Version 9. .RE .SS Field Parameters All input vector field parameters should be .I field codes (see below). Additionally, the scalar field parameters listed may be either literal numbers or else the .I field code of a .B CONST field containing the value, or the .I field code of a .B CARRAY followed by a left angle bracket .RI ( < ), then an non-negative integer used as the .B CARRAY element index, then a right angle bracket .RI ( > ), that is: .IP .IB fieldcode < n > .PP If the angle brackets and element index are omitted from a .B CARRAY field code used as a parameter, the first element in the field (index zero) is assumed. .PP Field parameters which may be specified using a scalar field code are: .RS .TP .BR BIT ", " SBIT .IR bitnum ", " numbits .TP .B LINCOM any of the .IR m "i, or " b i .TP .B MPLEX .IR count ", " max .TP .B PHASE .I shift .TP .B POLYNOM any of the .IR a i .TP .B RAW .I spf .TP .B RECIP .I dividend .TP .B WINDOW .I threshold .RE .PP Since it is possible to create a field code which is identical to a literal number, a parameter is assumed to be the field code of a scalar field only if the entire token cannot be parsed as a literal number using the rules outlined in .BR strtod (3). For example, a .B CONST field whose field code consists solely of digits can never be used as a parameter in a field specification line. Starting in Standards Version 7, literal complex number is specified as two real (floating point) numbers separated by a semicolon .RB ( ; ) with no intervening whitespace. So, for example, the tokens .IP 1;0 \t 0;1 \t 4;0 \t 0;5 \t 9.313e2;74.1 .PP represent, respectively, the real unit, the imaginary unit, the real number four, the imaginary number .RI 5 i , and the complex number .RI "931.3 + 74.1" i . Because the semicolon character cannot be used in field names, a complex valued literal can never be mistaken for a field code. This allows, among other things, the composition of complex valued fields from purely real input fields. For example, a complex valued field, .IR z , may be created from a real valued field .IR re , representing the real part of the complex number, and the real valued field .IR im , representing the imaginary part of the complex number, with the following .B LINCOM specification: .IP .I z .B LINCOM .I re 1 0 .I im 0;1 0 .PP Starting in Standards Version 9, in additional to decimal notation, literal integer parameters may be specified as hexadecimal numbers, by prefixing the number (after an optional .RB ' + ' or .RB ' - ' sign) with .B 0x or .BR 0X , or as octal numbers, by prefixing the number with .BR 0 , as described in .BR strtol (3). Similarly, floating point literal numbers (both purely real ones and components of complex literals) may be specified in hexadecimal by prefixing them with .B 0x or .BR 0X , and using .B p or .B P as the binary exponent prefix, as described in the C99 standard. Both uppercase and lowercase hexadecimal digits may be used. In cases where a literal floating point number may apear, the tokens .B INF or .BR INFINITY , optionally preceded by a .RB ' + ' or .RB ' - ' sign, and .BR NAN , optionally immediately followed by .RB ' ( ', then a sequence of characters, then .RB ' ) ', and all disregarding case, will be interpreted as the special floating point values explained in .BR strtod (3). .SS Field Codes When specifying the input to a field, either as a scalar parameter, or as an input vector field to a .RB non- RAW vector field, .I field codes are used. A .I field code is one of: .IP \(bu 4 a simple field name, possibly an alias, indicating a vector or scalar field .IP \(bu 4 a parent field name, followed by a forward slash, followed by a metafield name, indicating a metafield. See the description of the .B /META directive above for further details. .IP \(bu 4 either of the above, followed by a period, followed by a .IR "representation suffix" , but only if the field or metafield specified is not a .B STRING type field. .PP A .IR "representation suffix" may be used used to extract a real number from a complex value. The available suffixes and their meanings are: .TP .B .a This representation indicates the angle (in radians) between the positive real axis and the value (ie. the complex argument). The argument is in the range [-pi, pi], and a branch cut exists along the negative real axis. At the branch cut, -pi is returned if the imaginary part is -0, and pi is returned if the imaginary part is +0. If .IR z =0, zero is returned. .TP .B .i This representation indicates the projection of the value onto the imaginary axis (ie. the imaginary part of the number). .TP .B .m This representation indicates the modulus of the value (ie. its absolute value). .TP .B .r This representation indicates the projection of the value onto the real axis (ie. the real part of the number). .PP If the specified field is purely real, the representations are calculated as if the imaginary part was equal to +0. For example, given a complex valued vector, .IR z , a vector containing the real part of .IR z ", " re_z , could be produced with: .IP .I re_z .B PHASE .I z.r 0 .PP and similarly for the complex field's imaginary part, argument, and absolute value. (Although it should be pointed out this simplistic an example isn't strictly necessary, since .I z.r could be used wherever .I re_z would be.) .SH HISTORY This document describes Versions 9 and earlier of the Dirfile Standards. Version 9 of the Standards (April 2012) added the .B MPLEX and .B WINDOW field types, the .B /ALIAS and .B /HIDDEN directives, the affixes to .BR /INCLUDE , the .BR sie ", " zzip , and .B zzslim encoding schemes, along with the optional .I enc_datum token to .BR /ENCODING . It permitted specification of integer literals in octal and hexadecimal. Finally, it deprecated the type aliases .I FLOAT and .IR DOUBLE . Version 8 of the Standards (November 2010) added the .BR DIVIDE ", " RECIP , and .B CARRAY field types, made the forward slash on reserved words mandatory, and prohibited using the single character data type aliases in the specification of .B RAW fields. It also introduced the optional second .RI ( arm ) token to the .B /ENDIAN directive. Version 7 of the Standards (October 2009) added the .B SBIT and .B POLYNOM field types, and the directive-less method of specifying metafields. It also introduced the data types .I COMPLEX128 and .IR COMPLEX64 , along with the notion of .IR representations , and the .B lzma encoding scheme. Finally, it made the number of fields parameter for .I LINCOM optional. Version 6 of the Standards (October 2008) added the .BR /ENCODING ", " /META ", " /PROTECT ", and " /REFERENCE directives, and the .B CONST and .B STRING field types. It permitted whitespace in tokens and introduced the character escape sequences. It allowed .B CONST fields to be used as parameters in field specification lines. It also removed .I FILEFRAM as an alias for .IR INDEX , and prohibited .BR . but allowed .B # and .B \e in field names. Version 5 of the Standards (August 2008) added .B VERSION and .BR ENDIAN , slash demarcation of reserved words, and removed the restriction on field name length. It introduced the data types .IR INT8 ", " INT64 , and .IR UINT64 , the new-style type specifiers, and increased the range of the .B BIT field type from 32 to 64 bits. It also prohibited the characters .B &;<>\e| in field names. Version 4 of the Standards (October 2006) added the .B PHASE field type. Version 3 of the Standards (January 2006) added .B INCLUDE and increased the allowed length of a field name from 16 to 50 characters. Version 2 of the Standards (September 2005) added the .B MULTIPLY field type. Version 1 of the Standards (November 2004) added .B FRAMEOFFSET and the optional fourth argument to the .B BIT field type. Version 0 of the Standards (before March 2003) refers to the dirfile standards supported by the .BR getdata (3) library originally introduced into the .BR kst (1) sources, which contained support for all other features covered by this document. .SH AUTHORS The dirfile specification was developed by C. B. Netterfield .nh . .hy 1 Since Standards Version 3, the dirfile specification has been maintained by D. V. Wiebe .nh . .hy 1 .SH SEE ALSO .BR dirfile (5), .BR dirfile\-encoding (5) libgetdata-0.9.0/man/gd_madd_bit.30000640000175000017500000002277312614323564017073 0ustar alastairalastair.\" gd_madd_bit.3. The gd_madd_bit man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_madd_bit 3 "30 September 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_madd_bit, gd_madd_carray, gd_madd_clincom, gd_madd_const, gd_madd_cpolynom, gd_madd_crecip, gd_madd_divide, gd_madd_lincom, gd_madd_linterp, gd_madd_multiply, gd_madd_phase, gd_madd_polynom, gd_madd_recip, gd_madd_sbit, gd_madd_string \(em add a field to a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_madd_bit(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "const char *" in_field ", int " bitnum ", int " numbits ); .HP .BI "int gd_madd_carray(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "gd_type_t " const_type ", size_t " array_len ", gd_type_t " data_type , .BI "void *" value ); .HP .BI "int gd_madd_clincom(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", int " n_fields ", const char **" in_fields , .BI "const double complex *" cm ", const double complex *" cb ); .HP .BI "int gd_madd_const(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "gd_type_t " const_type ", gd_type_t " data_type ", void *" value ); .HP .BI "int gd_madd_cpolynom(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", int " poly_ord ", const char *" in_field , .BI "const double complex *" ca ); .HP .BI "int gd_madd_crecip(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", const char *" in_field , .BI "double complex " cdividend ", int " fragment_index ); .HP .BI "int gd_madd_divide(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI " const char *" in_field1 ", const char *" in_field2 ); .HP .BI "int gd_madd_lincom(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", int " n_fields ", const char **" in_fields , .BI "const double *" m ", const double *" b ); .HP .BI "int gd_madd_linterp(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "const char *" in_field ", const char *" table ); .HP .BI "int gd_madd_mplex(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "const char *" in_field ", const char *" count_field , .BI "int " count_val ", int " period ); .HP .BI "int gd_madd_multiply(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI " const char *" in_field1 ", const char *" in_field2 ); .HP .BI "int gd_madd_polynom(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", int " poly_ord ", const char *" in_field , .BI "const double *" a ); .HP .BI "int gd_madd_phase(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "const char *" in_field ", gd_shift_t " shift ); .HP .BI "int gd_madd_recip(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", const char *" in_field , .BI "double " dividend ", int " fragment_index ); .HP .BI "int gd_madd_sbit(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "const char *" in_field ", int " bitnum ", int " numbits ); .HP .BI "int gd_madd_string(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", const char *" value ); .HP .BI "int gd_madd_window(DIRFILE *" dirfile , .BI "const char *" parent ", const char *" field_name , .BI "const char *" in_field ", const char *" check_field ", gd_windop_t" .IB windop ", gd_triplet_t " threshold ); .hy .ad n .SH DESCRIPTION These functions add a new metafield of the indicated type under the parent field given by .I parent in the dirfile specified by .IR dirfile . .PP In all of these calls, .I field_name indicates the name of the field to be added. It should not be the full .IB / field code. The meaning and valid types of other arguments may be obtained from the .BR gd_entry (3) and .BR dirfile-format (5) manual pages. The .BR gd_madd_clincom () and .BR gd_madd_cpolynom () functions are identical to .BR gd_madd_lincom () and .BR gd_madd_polynom (), except they take complex scalar parameters, instead of purely real values. The .BR gd_madd_lincom () and .BR gd_madd_clincom () functions take pointers to three arrays of length .I n_fields containing the input field names .RI ( in_fields ), the gain factors .RI ( m " or " cm ), and the offset terms .RI ( b " or " cb ). Similarly, .BR gd_madd_polynom () and .BR gd_madd_cpolynom () take an array of length .I poly_ord + 1 containing the polynomial co-efficients .RI ( a " or " ca ). The .BR gd_madd_string (),\~ gd_madd_carray , and .BR gd_madd_const () functions both add the field and set the value of the field to .IR value . For .BR gd_madd_const () and .BR gd_madd_carray (), the .I const_type argument specifies the storage type for the const, while .I data_type specifies the data type of the value pointed to by .IR value . The .B gd_shift_t type is a signed 64-bit integer type. The .B gd_triplet_t type is defined as: .PP .in +4n .nf .fam C typedef union { gd_int64_t i; gd_uint64_t u; double r; } gd_triplet_t; .fam .fi .in .PP Which element of this .B gd_triplet_t union to set depends on the operator selected for the .B WINDOW field. See .BR gd_entry (3) for details. .PP All fields added with this interface must contain numerical parameters. Fields with scalar fields as parameters cannot be added with these functions. Those fields must be added with .BR gd_madd (3) or .BR gd_madd_spec (3). See .BR gd_add_bit (3), &c. for an alternate way of adding metafields with explicit parameters. See .B NOTES below for information on using .BR gd_madd_clincom "(), " gd_madd_cpolynom (), and .BR gd_madd_crecip () in the C89 GetData API. .SH RETURN VALUE On success, any of these functions returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The .IR field_name argument contained invalid characters. Alternately, the .I parent field code was not found, or was already a metafield. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY One or more of the field parameters specified was invalid. .TP .B GD_E_BAD_TYPE The .IR data_type " or " const_type argument provided to .BR gd_madd_const () or .BR gd_madd_carray () was invalid. .TP .B GD_E_DUPLICATE The .IR field_name provided duplicated that of an already existing field. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES The C89 GetData API provides different prototypes for .BR gd_madd_clincom (),\~ gd_madd_cpolynom (), and .BR gd_madd_crecip (): .PP .B #define GD_C89_API .br .B #include .HP .nh .ad l .BI "int gd_madd_clincom(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", int " n_fields ", const char **" in_fields , .BI "const double *" cm ", const double *" cb ); .HP .BI "int gd_madd_cpolynom(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", int " poly_ord ", const char *" in_field , .BI "const double *" ca ); .HP .BI "int gd_madd_crecip(DIRFILE *" dirfile ", const char *" parent , .BI "const char *" field_name ", const char *" in_field , .BI "double " cdividend\fR[2] ", int " fragment_index ); .hy .ad n .PP In this case, the array pointers passed as .IR cm ", " cb or .IR ca should have twice as many (purely real) elements, consisting of alternating real and imaginary parts for the complex data. That is, for example, .IR ca [0] should be the real part of the first co-efficient, .IR ca [1] the imaginary part of the first co-efficient, .IR ca [2] the real part of the second co-efficient, .IR ca [3] the imaginary part of the second co-efficient, and so on. Similarly, the .I cdividend parameter becomes a double precision array of length two. .PP For .BR gd_madd_clincom () and .BR gd_madd_cpolynom (), these are simply different (but equivalent) declarations of the C99 function entry point. For .BR gd_madd_crecip (), however, a different entry point is needed (since the .I cdividend parameter is passed by reference instead of by value). In the interests of portability, the C89 version of .BR gd_madd_crecip () is always available, and may be accessed as .BR gd_madd_crecip89 (), with the C89 prototype, in both the C99 and C89 APIs. .SH SEE ALSO .BR gd_add_bit (3), .BR gd_add_const (3), .BR gd_add_divide (3), .BR gd_add_lincom (3), .BR gd_add_linterp (3), .BR gd_add_mplex (3), .BR gd_add_multiply (3), .BR gd_add_phase (3), .BR gd_add_polynom (3), .BR gd_add_recip (3), .BR gd_add_string (3), .BR gd_add_windop (3), .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_madd (3), .BR gd_madd_spec (3), .BR gd_metaflush (3), .BR gd_open (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_spf.30000640000175000017500000000461512614323564016113 0ustar alastairalastair.\" gd_spf.3. The gd_spf man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_spf 3 "1 April 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_spf \(em returns the samples per frame for a field in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "unsigned int gd_spf(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_spf () function queries a dirfile(5) database specified by .I dirfile and returns the number of samples per frame for the field .IR field_code . If .I field_code contains a valid representation suffix, it will be ignored. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_spf () returns the number of samples per frame for the field specified. On error, it returns zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_DIMENSION A scalar field was found where a vector field was expected. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3) libgetdata-0.9.0/man/gd_dirfile_standards.30000640000175000017500000000751412614323564021005 0ustar alastairalastair.\" gd_dirfile_standards.3. The gd_dirfile_standards man page. .\" .\" Copyright (C) 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_dirfile_standards 3 "29 June 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_dirfile_standards \(em change or report the current Dirfile Standards Version for a DirFile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_dirfile_standards(DIRFILE *" dirfile ", int " version ); .hy .ad n .SH DESCRIPTION The .BR gd_dirfile_standards () function updates the current Standards Version for the open dirfile .I dirfile to the value specified by .IR version , if possible, and then reports the current Standards Version. Metadata written to disk for .I dirfile will conform to the current Standards Version. The Standards Version of the loaded dirfile also affects the operation of functions which add fields, such as .BR dirfile_add (3) or .BR dirfile_add_spec (3); and functions which modify field metadata, such as .BR dirfile_alter_entry (3) or .BR dirfile_alter_spec (3). For specific behaviour see the manual page of the appropriate function. The .I version parameter should be between zero and the value of the symbol .BR GD_DIRFILE_STANDARDS_VERSION , which is the newest Standards Version understood by GetData, inclusive or else one of the following special symbols: .TP .B GD_VERSION_EARLIEST Specifies the current Standards Version should be set to the earliest version to which the loaded dirfile conforms. .TP .B GD_VERSION_CURRENT Specifies that the current Standards Version should not be changed. In this case, this function simply reports the current Standards Version. .TP .B GD_VERSION_LATEST Specifies the current Standards Version should be set to the latest version to which the loaded dirfile conforms. .PP If the loaded dirfile does not conform to the specified .IR version , this function fails, and the current Standards Version is unchanged. If the loaded dirfile conforms to no known Standards Version, this function will fail regardless of the value of .I version (even if .B GD_VERSION_CURRENT is used). The caller should not assume that the loaded dirfile conforms to every Standards Version between the values reported by .B GD_VERSION_EARLIEST and .BR GD_VERSION_LATEST . .SH RETURN VALUE On success, .BR gd_dirfile_standards () returns the current Standards Version of the loaded dirfile, after possibly having been updated by the call. This will be a number between zero and .BR GD_DIRFILE_STANDARDS_VERSION inclusive. On error, -1 is returned and the dirfile error is set to a non-zero error value, and the current Standards Version is not changed. Possible error values are: .TP 8 .B GD_E_ARGUMENT The loaded dirfile did not conform to the specified version. Or the dirfile conforms to no known Standards Version. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES This function only changes the current Standards Version of the loaded dirfile. It does not update the any format specification fragments on disk to conform to the specified Standards Version. To do that, use .BR gd_metaflush (3) or .BR gd_rewrite_fragment (3). .SH SEE ALSO .BR gd_open (3), .BR gd_metaflush (3), .BR gd_rewrite_fragment (3) libgetdata-0.9.0/man/gd_aliases.30000640000175000017500000000521512614323564016741 0ustar alastairalastair.\" gd_aliases.3. The gd_aliases man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_aliases 3 "1 January 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_aliases \(em retrieve a list of aliases for a field in a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char **gd_aliases(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_aliases () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of aliases of the field specified by .IR field_code . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order. The array is terminated by a NULL pointer. The number of strings in the array can be obtained from a call to .BR gd_naliases (3). The caller may not modify any strings in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid until .BR gd_aliases () is called again with the same arguments, or until the array is de-allocated by a call to .BR gd_close (3). .SH RETURN VALUE Upon successful completion, .BR gd_aliases () returns a pointer to an array of strings containing the values of all the aliases for the specified field. The array is terminated by a NULL pointer. If successful, this list will always contain at least one entry, to wit: .IR field_code . On error it returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The specified field code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_alias_target (3), .BR gd_naliases (3) libgetdata-0.9.0/man/gd_entry_list.30000640000175000017500000001337712614323564017524 0ustar alastairalastair.\" gd_entry_list.3. The gd_entry_list man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_entry_list 3 "28 June 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_entry_list, gd_field_list, gd_field_list_by_type gd_mfield_list, gd_mfield_list_by_type, gd_mvector_list, gd_vector_list \(em list field entries in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char **gd_entry_list(DIRFILE *" dirfile ", const char *" parent , .BI "unsigned int " type ", unsigned int " flags ); .HP .BI "const char **gd_field_list(DIRFILE *" dirfile ); .HP .BI "const char **gd_field_list_by_type(DIRFILE *" dirfile ", gd_entype_t " type ); .HP .BI "const char **gd_mfield_list(DIRFILE *" dirfile ", const char *" parent ); .HP .BI "const char **gd_mfield_list_by_type(DIRFILE *" dirfile , .BI "const char *" parent ", gd_entype_t " type ); .HP .BI "const char **gd_mvector_list(DIRFILE *" dirfile ", const char *" parent ); .HP .BI "const char **gd_vector_list(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_entry_list () function queries a dirfile(5) database specified by .I dirfile and returns a list of names of field entries satisfying the supplied criteria. If .I parent is non-NULL, metafields under the field specified by .I parent are considered; otherwise, top-level fields are considered, and metafields ignored. The .I type argument should be one of the following symbols indicating an explicit entry type to list: .IP .nh .ad l .BR GD_BIT_ENTRY ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY , .BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY , .BR GD_MPLEX_ENTRY ", " GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY , .BR GD_POLYNOM_ENTRY ", " GD_RAW_ENTRY ", " GD_RECIP_ENTRY , .BR GD_SBIT_ENTRY ", " GD_STRING_ENTRY ", " GD_WINDOW_ENTRY . .ad n .hy .PP .RB ( GD_INDEX_ENTRY is a special field type for the implicit .I INDEX field) or else one of the following special symbols: .TP .B GD_ALL_ENTRIES \fR(= 0) List entries of all types. .TP .B GD_ALIAS_ENTRIES List only aliases. This is the only way to get a list including aliases which do not point to valid field codes. .TP .B GD_SCALAR_ENTRIES List only scalar field types .RB ( CONST ", " CARRAY ", " STRING ). .TP .B GD_VECTOR_ENTRIES List only vector field types (all field types except the scalar field types listed above). .PP The .I flags argument should be zero or more of the following flags, bitwise or'd together: .TP .B GD_ENTRIES_HIDDEN Include hidden entries (see .BR gd_hidden (3)) in the list: normally hidden entries are skipped; .TP .B GD_ENTRIES_NOALIAS Exclude aliases from the list: normally aliases are considered the same as their target (that is: if a field satisfies the criteria, both its canonical name and all its aliases will appear in the list). .PP The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order. The array is terminated by a NULL pointer. The number of elements in the array, excluding the terminating NULL, can be obtained from an equivalent call to .BR gd_nentries (3). The caller may not modify any strings in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid at least until .BR gd_entry_list () is called again on the same DIRFILE object, or until the array is de-allocated by a call to .BR gd_close (3). (Although the data may have become obsolete, if metadata have been modified in the interrim.) .SS Special Cases The call .RS .BI gd_field_list( dirfile ); .RE .PP is equivalent to .RS .BI gd_entry_list( dirfile ", NULL, GD_ALL_ENTRIES, 0); .RE .PP The call .RS .BI gd_field_list_by_type( dirfile ", " type ); .RE .PP is equivalent to .RS .BI gd_entry_list( dirfile ", NULL, " type ", 0);" .RE .PP The call .RS .BI gd_mfield_list( dirfile ", " parent ); .RE .PP is equivalent to .RS .BI gd_entry_list( dirfile ", " parent ", GD_ALL_ENTRIES, 0);" .RE .PP The call .RS .BI gd_mfield_list_by_type( dirfile ", " parent ", " type ); .RE .PP is equivalent to .RS .BI gd_entry_list( dirfile ", " parent ", " type ", 0);" .RE .PP The call .RS .BI gd_mvector_list( dirfile ", " parent ); .RE .PP is equivalent to .RS .BI gd_entry_list( dirfile ", " parent ", GD_VECTOR_ENTRIES, 0);" .RE .PP The call .RS .BI gd_vector_list( dirfile ); .RE .PP is equivalent to .RS .BI gd_entry_list( dirfile ", NULL, GD_VECTOR_ENTRIES, 0);" .RE .SH RETURN VALUE Upon successful completion, these functions returns a pointer to an array of strings containing the names of all the entries in the database satisfying the supplied criteria. On error, they return zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_CODE The supplied parent field code was not found, or referred to a metafield itself. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY The .I type parameter supplied was not one of the symbols listed above. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_hidden (3), .BR gd_nentries (3) libgetdata-0.9.0/man/gd_frameoffset64.30000640000175000017500000000347712614323564020003 0ustar alastairalastair.\" gd_frameoffset64.3. The gd_frameoffset64 man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_frameoffset64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_frameoffset64, gd_alter_frameoffset64 \(em report or change the frame offset of fields in a dirfile, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "gd_off64_t gd_frameoffset(DIRFILE *" dirfile ", int " fragment_index ); .HP .BI "int gd_alter_frameoffset64(DIRFILE *" dirfile ", gd_off64_t " offset , .BI "int " fragment_index ", int " move ); .hy .ad n .SH DESCRIPTION These versions of .BR gd_frameoffset (3) and .BR gd_alter_frameoffset (3) use a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . They are only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), these functions will the same as .BR gd_framenum_subset (3) and .BR gd_alter_frameoffset (3). Otherwise, .BR gd_framenum_subset (3) and .BR gd_alter_frameoffset (3) will be versions of these function which use a 32-bit .IR off_t . .SH SEE ALSO .BR gd_alter_frameoffset (3), .BR gd_frameoffset (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/gd_include_affix.30000640000175000017500000002600312614323564020116 0ustar alastairalastair.\" gd_include_affix.3. The gd_include_affix man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_include_affix 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_include_affix, gd_include \(em add a format specification fragment to a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_include_affix(DIRFILE *" dirfile ", const char *" include_file , .BI "int " parent_fragment ", const char *" prefix ", const char *" suffix , .BI "unsigned long " flags ); .HP .BI "int gd_include(DIRFILE *" dirfile ", const char *" include_file , .BI "int " parent_fragment ", unsigned long " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_include_affix () function adds the format specification fragment given by the path .I include_file to the specified dirfile, possibly creating the fragment, using the affixes specified. This occurs as if, in the existing fragment indexed by .IR parent_fragment , the following directive were present: .IP .B /INCLUDE .I .PP (see .BR dirfile-format (5)). If a parser callback function had been specified when the dirfile was opened using .BR gd_cbopen (3), or added later with .BR gd_parser_callback (3), this callback function will be called if a syntax error is encountered while parsing the included fragment. Passing NULL as .I prefix or .I suffix is the same as using the empty string (ie. the corresponding affix is empty). The function .BR gd_include () is equivalent to calling .BR gd_include_affix () with both .I prefix and .I suffix equal to NULL. The .I flags argument should be a bitwise-or'd collection of zero or more of the following flags: .PP .PD 0 .B GD_ARM_ENDIAN .TP .PD .B GD_NOT_ARM_ENDIAN Specifies that double precision floating point raw data on disk are, or are not, stored in the middle-endian format used by older ARM processors. These flag only set the default endianness, and will be overridden when an .B /ENDIAN directive specifies the byte sex of .B RAW fields, unless .B GD_FORCE_ENDIAN is also specified. On every platform, one of these flags .RB ( GD_NOT_ARM_ENDIAN on all but middle-ended ARM systems) indicates the native behaviour of the platform. That symbol will equal zero, and may be omitted. .PP .PD 0 .B GD_BIG_ENDIAN .TP .PD .B GD_LITTLE_ENDIAN Specifies the default byte sex of raw data stored on disk to be either big-endian (most significant byte first) or little-endian (least significant byte first). Omitting both flags indicates the default should be the native endianness of the platform. Unlike the ARM endianness flags above, neither of these symbols is ever zero. Specifying both these flags together will cause the library to assume that the endianness of the data is opposite to that of the native architecture, whatever that might be. These flag only set the default endianness, and will be overridden when an .B /ENDIAN directive specifies the byte sex of .B RAW fields, unless .B GD_FORCE_ENDIAN is also specified. .TP .B GD_CREAT An empty fragment will be created, if one does not already exist. The fragment will have mode .BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH (0666), modified by the caller's umask value (see .BR umask (2)). .TP .B GD_EXCL Ensure that this call creates a new fragment: when specified along with .BR GD_CREAT , the call will fail if the file specified by .I include_file already exists. If .B GD_CREAT is not specified, this flag is ignord. This flag suffers from all the limitations of the .B O_EXCL flag as indicated in .BR open (2). .TP .B GD_FORCE_ENCODING Specifies that .B /ENCODING directives (see .BR dirfile-format (5)) found in the fragment should be ignored. The encoding scheme specified in .I flags will be used instead (see below). .TP .B GD_FORCE_ENDIAN Specifies that .B /ENDIAN directives (see .BR dirfile-format (5)) found in the fragment should be ignored. When specified with one of .BR GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN , the indicated endianness will be assumed. If this flag is specified with neither of those flags, the fragment will be assumed to have the endianness of the native architecture. .TP .B GD_IGNORE_DUPS If the fragment specifies more than one field with the same name, or a field with the same name as an existing field, all but one of them will be ignored by the parser. Without this flag, parsing would fail with the .B GD_E_FORMAT error, possibly resulting in invocation of the registered callback function. Which of the duplicate fields is kept is not specified, nor whether an existing field takes precedence over a new one or not. As a result, this flag is typically only useful in the case where identical copies of a field specification line are present. No indication is provided to indicate whether a duplicate field has been discarded. If finer grained control is required, the caller should handle .B GD_E_FORMAT_DUPLICATE suberrors itself with an appropriate callback function. .TP .B GD_IGNORE_REFS If the dirfile currently has a reference field (either because one was specified explicitly, or else because the first .B RAW field was used), .B /REFERENCE directives in the included fragment will be ignored. Otherwise, a .B /REFERENCE directive in the included fragment will replace the current reference field in the dirfile. .TP .B GD_PEDANTIC Specifies that unrecognised lines found during the parsing of the fragment should always cause a fatal error. Without this flag, if a .B VERSION directive (see .BR dirfile-format (5)) indicates that the fragment being opened conforms Standards Version newer than the version understood by the library, unrecognised lines will be silently ignored. .TP .B GD_TRUNC If .I include_file already exists, it will be truncated before opening. If the file does not exist, this flag is ignored. .PP The .I flags argument may also be bitwise or'd with one of the following symbols indicating the default encoding scheme of the fragment. Like the endianness flags, the choice of encoding here is ignored if the encoding is specified in the fragment itself, unless .B GD_FORCE_ENCODED is also specified. If none of these symbols is present, .B GD_AUTO_ENCODED is assumed, unless this call results in creation or truncation of the fragment. In that case, .B GD_UNENCODED is assumed. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .TP .B GD_AUTO_ENCODED Specifies that the encoding type is not known in advance, but should be detected by the GetData library. Detection is accomplished by searching for raw data files with extensions appropriate to the encoding scheme. This method will notably fail if the the library is called via .BR gd_putdata (3) to create a previously non-existent raw field unless a read is first successfully performed on the dirfile. Once the library has determined the encoding scheme for the first time, it remembers it for subsequent calls. .TP .B GD_BZIP2_ENCODED Specifies that raw data files are compressed using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding, as implemented in the bzip2 format. .TP .B GD_GZIP_ENCODED Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77) as implemented in the gzip format. .TP .B GD_LZMA_ENCODED Specifies that raw data files are compressed using the Lempel-Ziv Markov Chain Algorithm (LZMA) as implemented in the xz container format. .TP .B GD_SIE_ENCODED Specified that raw data files are sample-index encoded, similar to run-length encoding, suitable for data that change rarely. .TP .B GD_SLIM_ENCODED Specifies that raw data files are compressed using the slimlib library. .TP .B GD_TEXT_ENCODED Specifies that raw data files are encoded as text files containing one data sample per line. .TP .B GD_UNENCODED Specifies that raw data files are not encoded, but written verbatim to disk. .TP .B GD_ZZIP_ENCODED Specifies that raw data files are compressed using the DEFLATE algorithm. All raw data files for a given fragment are collected together and stored in a PKZIP archive called raw.zip. .TP .B GD_ZZSLIM_ENCODED Specifies that raw data files are compressed using a combinations of compression schemes: first files are slim-compressed, as with the .B GD_SLIM_ENCODED scheme, and then they are collected together and compressed (again) into a PKZIP archive called raw.zip, as in the .B GD_ZZIP_ENCODED scheme. .SH RETURN VALUE On success, these functions return the format specification index of the newly added fragment. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The supplied dirfile was opened in read-only mode. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied parent fragment index was out of range. .TP .B GD_E_BAD_REFERENCE The reference field specified by a .B /REFERENCE directive in the fragment (see .BR dirfile-format (5)) was not found, or was not a .B RAW field. In this case, the included fragment will still be added to the dirfile, but the .B /REFERENCE directive will be ignored. See also the .B BUGS section below. .TP .B GD_E_CALLBACK The registered callback function returned an unrecognised response. .TP .B GD_E_FORMAT A syntax error occurred in the fragment. .TP .B GD_E_LINE_TOO_LONG The parser encountered a line in the format specification longer than it was able to deal with. Lines are limited by the storage size of .BR ssize_t . On 32-bit systems, this limits format specification lines to 2**31 characters. The limit is larger on 64-bit systems. .TP .B GD_E_IO An I/O error occured while trying to read or create the fragment. .TP .B GD_E_PROTECTED The metadata of the parent fragment was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH BUGS If this function fails with the error .BR GD_E_BAD_REFERENCE , it typically results in no reference field being defined for the dirfile, even if the dirfile contains .B RAW fields. As a result, functions which rely on the reference field, such as .BR gd_nframes (3), will operate incorrectly. Callers should explicitly set the reference field with .BR gd_reference (3) in this case. .SH SEE ALSO .BR gd_open (3), .BR gd_alter_affixes (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_fragmentname (3), .BR gd_nfragments (3), .BR gd_parser_callback (3), .BR gd_reference (3), .BR gd_uninclude (3), .BR dirfile (5), .BR dirfile-encoding (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_validate.30000640000175000017500000000467512614323564017122 0ustar alastairalastair.\" gd_validate.3. The gd_validate man page. .\" .\" Copyright (C) 2009, 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_validate 3 "19 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_validate \(em check a dirfile field code for validity .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_validate(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_validate () function queries a dirfile(5) database specified by .I dirfile and checks whether .IR field_code , which may contain a representation suffix, specifies a valid field. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). This function checks whether the field and its input fields (if any) are found, whether the representation suffix (if any) is valid, and also that all non-literal parameters specify valid scalar fields. .SH RETURN VALUE If all checks pass, .BR gd_validate () returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_CODE The field specified by .I field_code or one of the fields it uses as input was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_SCALAR A non-literal scalar used in the definition of the field or one of its inputs was not found, or was not a .B CONST or .B CARRAY field. .TP .B GD_E_DIMENSION A scalar field was found where a vector field was expected. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES It is not necessary to call this function before passing a field code to another GetData function: all functions which accept field codes perform these checks themselves. .SH SEE ALSO .BR dirfile (5), .BR gd_getdata (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_open (3) libgetdata-0.9.0/man/checkdirfile.10000640000175000017500000000346712614323564017267 0ustar alastairalastair.\" checkdirfile.1. The checkdirfile man page. .\" .\" Copyright (C) 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH checkdirfile 1 "21 February 2012" "Version 0.8.0" "GETDATA" .SH NAME checkdirfile \(em verify Dirfile database metadata .SH SYNOPSIS .nh .ad l .P .B checkdirfile .I DIRFILE .P .B checkdirfile .RB "[\| " \-\-help " | " \-\-version " \|]" .hy .ad n .SH DESCRIPTION Report errors in metadata of the dirfile(5) database specified by .IR DIRFILE . Three separate checks are performed. First, the format specification metadata is scanned for syntax errors (see dirfile-format(5)) and Dirfile Standards compliance. Second, fields defined in the database are checked for self-consistency. Finally, the database is queried for its length. .P .B --help .PD 0 .TP .PD .B --version Show usage and version information and exit. .SH AUTHOR checkdirfile was written by D. V. Wiebe. .SH REPORTING BUGS Please send reports of bugs to getdata\-devel@lists.sourceforge.net The GetData home page: .SH COPYRIGHT Copyright \(co 2010 D. V. Wiebe checkdirfile is licenced under the GNU LPGL version 2.1 or later. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. .SH SEE ALSO .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_array_len.30000640000175000017500000000444712614323564017302 0ustar alastairalastair.\" gd_array_len.3. The gd_array_len man page. .\" .\" Copyright (C) 2010, 2011, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_array_len 3 "27 May 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_array_len \(em returns the length of a CARRAY or SARRAY field in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "size_t gd_array_len(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_array_len () function queries a dirfile(5) database specified by .I dirfile and returns the number of length of the .BR CARRAY ", " CONST ", " STRING , or .B SARRAY field called .IR field_code . If .I field_code contains a valid representation suffix, it will be ignored. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_array_len () returns the array length of the field specified. (The length of a .B CONST or a .B STRING field is always 1.) On error, it returns zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE The field specified by .I field_code was not of one of the field types listed above. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES This function used to be called .BR gd_carray_len (). This name can still be used, but it has been marked deprecated. .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3) libgetdata-0.9.0/man/gd_protection.30000640000175000017500000000375212614323564017512 0ustar alastairalastair.\" gd_protection.3. The gd_protection man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_protection 3 "16 July 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_protection \(em report the protection level of a dirfile fragment .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_protection(DIRFILE *" dirfile ", int " fragment_index ); .hy .ad n .SH DESCRIPTION The .BR gd_protection () function queries a dirfile(5) database specified by .I dirfile and returns the advisory protection level for the fragment indexed by .IR fragment_index . .SH RETURN VALUE Upon successful completion, .BR gd_protection () returns the advisory protection level of the specified fragment, which will be one of the following symbols. .IP .nh .ad l .BR GD_PROTECT_NONE ,\~ GD_PROTECT_FORMAT ,\~ GD_PROTECT_DATA ,\~ .BR GD_PROTECT_ALL . .ad n .hy .PP The meaning of these symbols are explained in the .BR gd_alter_protection (3) man page. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_alter_protection (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_flags.30000640000175000017500000000564612614323564016424 0ustar alastairalastair.\" gd_flags.3. The gd_flags man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_flags 3 "1 April 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_flags \(em alter GetData operational flags .SH SYNOPSIS .B #include .HP .nh .ad l .BI "unsigned long gd_flags(DIRFILE *" dirfile ", unsigned long " set , .BI "unsigned long " reset ); .hy .ad n .SH DESCRIPTION The .BR gd_flags () function modifies the operational flags of the dirfile(5) database specified by .IR dirfile , and returns the new value of the flags register. The flags which may be queried or modified with this interface are a subset of the open flags (see .BR gd_cbopen (3)). These are: .TP .B GD_PRETTY_PRINT When dirfile metadata are flushed to disk (either explicitly via .BR gd_metaflush "(3), " gd_rewrite_fragment (3), or .BR gd_flush (3) or implicitly by closing the dirfile), an attempt will be made to create a nicer looking format specification (from a human-readable standpoint). What this explicitly means is not part of the API, and any particular behaviour should not be relied on. If the dirfile has been opened read-only, this flag is ignored. .TP .B GD_VERBOSE Specifies that whenever an error is triggered by the library when working on this dirfile, the corresponding error string, which can be retrieved by calling .BR gd_error_string (3), should be written on the caller's standard error stream .RB ( stderr (3)) by GetData. The error string may be prefixed by a string specified by the caller; see .BR gd_verbose_prefix (3). Without this flag, GetData writes nothing to standard error. (GetData never writes to standard output.) .PP Flags which appear only in .I set will be turned on (enabled); flags which appear only in .I reset will be turned off (disabled); flags which appear in both .I set and .I reset will be toggled. Flags which appear in neither of these are left unchanged. Accordingly, to simply query the current flags, both .I set and .I reset should be zero, and to explicitly specify all the flags, ignoring their old values, the new flags register should be given in .IR set , and it's bitwise complement in .IR reset . .SH RETURN VALUE The .BR gd_flags () function returns a bitwise or'd collection those of the above flags which are enabled after performing the modifications specified (if any). This function does not fail. .SH SEE ALSO .BR dirfile (5), .BR gd_cbopen (3), .BR gd_verbose_prefix (3), .BR stderr (3). libgetdata-0.9.0/man/gd_alter_spec.30000640000175000017500000001113212614323564017434 0ustar alastairalastair.\" gd_alter_spec.3. The gd_alter_spec man page. .\" .\" Copyright (C) 2008, 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_spec 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_alter_spec, gd_malter_spec \(em modify a field in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_spec(DIRFILE *" dirfile ", const char *" line , .BI "int " recode ); .HP .BI "int gd_malter_spec(DIRFILE *" dirfile ", const char *" line , .BI "const char *" parent ", int " recode ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_spec () function modifies the field described by the field specification line in .I line to the dirfile specified by .IR dirfile . The .BR gd_malter_spec () function behaves similarly, but modifies the metafield under the field indicated by the field code .IR parent . Field specification lines are described in detail in .BR dirfile-format (5). The name of the field to be modified, which must already exist, will be obtained from the field specification line. When adding a metafield, .I line should only contain a field specification, and not a .B /META directive. If the modified field is of type .B RAW and the .I recode argument is non-zero, the binary file associated with the field will be converted for changes in data type and samples-per-frame. In this case, the field's I/O pointer will be reset to the beginning-of-frame. If .I recode is zero, no binary file conversion will take place. If the modified field is of type .B LINTERP and the .I recode argument is non-zero, the look-up table file will be moved if .I line specifies a different path, overwriting an existing file with the new pathname, if present. If the field specified by .I field_code is of type other than .B RAW or .BR LINTERP , the .I recode argument is ignored. Passing these functions a directive line instead of a field specification line will result in a syntax error. These functions never call the registered parser callback function, even if .IR line contains a syntax error. .SH RETURN VALUE On success, .BR gd_alter_spec () and .BR gd_malter_spec () return zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified in .I line was not found, or the .I parent field code was not found. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_FORMAT A syntax error was encountered in .IR line . .TP .B GD_E_IO An I/O error occurred while translating the binary file associated with a modified .B RAW field, or an I/O error occurred while attempting to rename a .B LINTERP table file. .TP .B GD_E_LINE_TOO_LONG The supplied .I line was longer than the parser was able to deal with. Lines are limited by the storage size of .BR ssize_t . On 32-bit systems, this limits .I line to 2**31 bytes. The limit is larger on 64-bit systems. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, a request to translate the binary file associated with a .B RAW field was attempted, but the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to translate the binary file be associated with a modified .B RAW field. .TP .B GD_E_UNSUPPORTED The encoding scheme of the indicated format specification fragment does not support translating the empty binary file associated with a modified .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_bit (3), .BR gd_alter_const (3), .BR gd_alter_entry (3), .BR gd_alter_lincom (3), .BR gd_alter_linterp (3), .BR gd_alter_multiply (3), .BR gd_alter_phase (3), .BR gd_alter_raw (3), .BR gd_alter_spec (3), .BR gd_metaflush (3), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_mplex_lookback.30000640000175000017500000000660012614323564020311 0ustar alastairalastair.\" gd_mplex_lookback.3. The gd_mplex_lookback man page. .\" .\" Copyright (C) 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_mplex_lookback 3 "3 April 2013" "Version 0.8.4" "GETDATA" .SH NAME gd_mplex_lookback \(em set the GetData lookback length for MPLEX fields. .SH SYNOPSIS .B #include .HP .nh .ad l .BI "void gd_mplex_lookback(DIRFILE *" dirfile ", int " lookback ); .hy .ad n .SH DESCRIPTION The .BR gd_mplex_lookback () function controls how far GetData searches backwards for the initial value of a field when reading a .B MPLEX field from the dirfile(5) database specified by .IR dirfile . If the first sample returned of a .B MPLEX field does not contain the value of the field, because the index field does not take on the specified multiplex index value, GetData must search the field backwards to find the last time the field was updated, in order to propagate that value into the initial portion of the returned data. (See .BR gd_getdata (3) for further discussion on the data returned for a .B MPLEX field). This function sets the amount of data GetData searches before giving up according to the value of .IR lookback . If .I lookback is zero, this search is disabled completely, and the start of the returned data will be padded (with zero or IEEE-754-conformant not-a-number) unless the first sample returned happens to contain the value of the field. If .I lookback is the special symbol .BR GD_LOOKBACK_ALL , GetData will exhaustively search all available data before the returned portion for an initial value. Otherwise, .I lookback should be a positive number specifying the number of .B MPLEX periods to search. Each .B MPLEX field has its own period, measured in samples of the index field, which is defined as follows: .IP \(bu if the .B MPLEX field in question specifies an optional .I period positive parameter (see the .B MPLEX definition in .BR dirfile-format (5)), its period is that many samples; .IP \(bu otherwise, if the .B MPLEX field's .I count_val is at least five, its period is one more sample than twice that value; .IP \(bu otherwise, the period is ten samples. .PP So, given the following .B MPLEX definitions: .IP field1 \fBMPLEX\fR data_field index_field 7 12 .br field2 \fBMPLEX\fR data_field index_field 2 6 .br field3 \fBMPLEX\fR data_field index_field 7 .br field4 \fBMPLEX\fR data_field index_field 2 .PP .I field1 has a period of 12 samples and .I field2 a period of 6 samples (both the value of their .I period parameters); .I field3 has a period of 15 samples (one more than twice it's .IR count_val ), and .I field4 has a period of 10 samples (the default value, since its .I count_val is less than five). .PP The initial value of the .B MPLEX lookback is ten periods. This value is provided in getdata.h as .BR GD_DEFAULT_LOOKBACK . This function always succeeds and returns no value. .SH SEE ALSO .BR dirfile (5), .BR dirfile-format (5), .BR gd_getdata (3). libgetdata-0.9.0/man/gd_add_bit.30000640000175000017500000002620412614323564016707 0ustar alastairalastair.\" gd_add_bit.3. The gd_add_bit man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_add_bit 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_add_bit, gd_add_carray gd_add_clincom, gd_add_const, gd_add_cpolynom, gd_add_crecip, gd_add_divide, gd_add_lincom, gd_add_linterp, gd_add_multiply, gd_add_phase, gd_add_polynom, gd_add_raw, gd_add_recip, gd_add_sbit, gd_add_string \(em add a field to a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_add_bit(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", int " bitnum ", int " numbits , .BI "int " fragment_index ); .HP .BI "int gd_add_carray(DIRFILE *" dirfile ", const char *" field_name , .BI "gd_type_t " const_type ", size_t " array_len ", gd_type_t " data_type , .BI "void *" value ", int " fragment_index ); .HP .BI "int gd_add_clincom(DIRFILE *" dirfile ", const char *" field_name , .BI "int " n_fields ", const char **" in_fields ", const double complex *" cm , .BI "const double complex *" cb ", int " fragment_index ); .HP .BI "int gd_add_const(DIRFILE *" dirfile ", const char *" field_name , .BI "gd_type_t " const_type ", gd_type_t " data_type ", void *" value , .BI "int " fragment_index ); .HP .BI "int gd_add_cpolynom(DIRFILE *" dirfile ", const char *" field_name , .BI "int " poly_ord ", const char *" in_fields ", const double complex *" ca , .BI "int " fragment_index ); .HP .BI "int gd_add_crecip(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", double complex " cdividend , .BI "int " fragment_index ); .HP .BI "int gd_add_divide(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field1 ", const char *" in_field2 , .BI "int " fragment_index ); .HP .BI "int gd_add_lincom(DIRFILE *" dirfile ", const char *" field_name , .BI "int " n_fields ", const char **" in_fields ", const double *" m , .BI "const double *" b ", int " fragment_index ); .HP .BI "int gd_add_linterp(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", const char *" table ", int " fragment_index ); .HP .BI "int gd_add_mplex(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", const char *" count_field , .BI "int " count_val ", int " period ", int " fragment_index ); .HP .BI "int gd_add_multiply(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field1 ", const char *" in_field2 , .BI "int " fragment_index ); .HP .BI "int gd_add_phase(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", gd_shift_t " shift ", int " fragment_index ); .HP .BI "int gd_add_polynom(DIRFILE *" dirfile ", const char *" field_name , .BI "int " poly_ord ", const char *" in_fields ", const double *" a , .BI int " fragment_index ); .HP .BI "int gd_add_raw(DIRFILE *" dirfile ", const char *" field_name , .BI "gd_type_t " data_type ", unsigned int " spf ", int " fragment_index ); .HP .BI "int gd_add_recip(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", double " dividend ", int " fragment_index ); .HP .BI "int gd_add_sbit(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", int " bitnum ", int " numbits , .BI "int " fragment_index ); .HP .BI "int gd_add_string(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" value ", int " fragment_index ); .HP .BI "int gd_add_window(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", const char *" check_field ", gd_windop_t" .IB windop ", gd_triplet_t " threshold ", int " fragment_index ); .hy .ad n .SH DESCRIPTION These functions provide alternatives to using the .BR gd_add (3) or .BR gd_add_spec (3) functions to add a new field of the indicated type to the dirfile specified by .IR dirfile . .PP In all of these calls, .I field_name indicates the name of the field to be added. Further, .I fragment_index is the index of the format specification fragment into which the field should be added. (To convert a fragment index to its file name, see .BR gd_fragmentname (3).) The meaning and valid types of other arguments may be obtained from the .BR gd_entry (3) and .BR dirfile-format (5) manual pages. The .BR gd_add_clincom () and .BR gd_add_cpolynom () functions are identical to .BR gd_add_lincom () and .BR gd_add_polynom (), except they take complex scalar parameters, instead of purely real values. The .BR gd_add_lincom () and .BR gd_add_clincom () functions takes pointers to three arrays of length .I n_fields containing the input field names .RI ( in_fields ), the gain factors .RI ( m " or " cm ), and the offset terms .RI ( b " or " cb ). Similarly, .BR gd_add_polynom () and .BR gd_add_cpolynom () take an array of length .I poly_ord + 1 containing the polynomial co-efficients .RI ( a " or " ca ). The .BR gd_add_string (), .BR gd_add_carry (), and .BR gd_add_const () functions add the field and set the value of the field to .IR value . For .BR gd_add_const () and .BR gd_add_carray (), the .I const_type argument specifies the storage type for the const, while .I data_type specifies the data type of the value pointed to by .IR value . The .B gd_shift_t type is a signed 64-bit integer type. The .B gd_triplet_t type is defined as: .PP .in +4n .nf .fam C typedef union { gd_int64_t i; gd_uint64_t u; double r; } gd_triplet_t; .fam .fi .in .PP Which element of this .B gd_triplet_t union to set depends on the operator selected for the .B WINDOW field. See .BR gd_entry (3) for details. .PP A metafield may be added to the dirfile either by calling these functions with .I field_name containing the fully formed .IB / field code, or else by using the corresponding .BR gd_madd_ ...() function (see .BR gd_madd_bit (3), &c.) When adding a metafield with these functions, .I fragment_index is ignored and GetData will add the new metafield to the same format specification fragment in which the parent field is defined. If the specified parent field name is an alias, the canonical name of the field will be substituted. All fields added with this interface must contain literal parameters. Fields with scalar fields as parameters cannot be added with these functions. Those fields must be added with .BR gd_add (3) or .BR gd_add_spec (3). See .B NOTES below for information on using .BR gd_add_clincom ()", " gd_add_cpolynom (), and .BR gd_add_crecip () in the C89 GetData API. .SH RETURN VALUE On success, any of these functions returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The .IR field_name contained invalid characters; or it or an input field did not contain the affected fragment's prefix or suffix. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY One or more of the field parameters specified was invalid. .TP .B GD_E_BAD_INDEX The .IR fragment_index argument was out of range. .TP .B GD_E_BAD_TYPE The .IR data_type " or " const_type argument provided to .BR gd_add_raw "() or " gd_add_const (), was invalid. .TP .B GD_E_DUPLICATE The .IR field_name provided duplicated that of an already existing field. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .TP .B GD_E_IO .RB ( gd_add_raw () only) An I/O error occurred while creating an empty binary file to be associated with a newly added .B RAW field. .TP .B GD_E_PROTECTED The metadata of the fragment was protected from change. Or, the creation of a .B RAW field was attempted and the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING .RB ( gd_add_raw () only) The encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to create an empty binary file to be associated with a newly added .B RAW field. .TP .B GD_E_UNSUPPORTED .RB ( gd_add_raw () only) The encoding scheme of the indicated format specification fragment does not support creating an empty binary file to be associated with a newly added .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES The C89 GetData API provides different prototypes for .BR gd_add_clincom "(), " gd_add_cpolynom (), and .BR gd_add_crecip (): .PP .nf .B #define GD_C89_API .br .B #include .fi .HP .nh .ad l .BI "int gd_add_clincom(DIRFILE *" dirfile ", const char *" field_name , .BI "int " n_fields ", const char **" in_fields ", const double *" cm , .BI "const double *" cb ", int " fragment_index ); .HP .BI "int gd_add_cpolynom(DIRFILE *" dirfile ", const char *" field_name , .BI "int " poly_ord ", const char *" in_fields ", const double *" ca , .BI "int " fragment_index ); .HP .BI "int gd_add_crecip(DIRFILE *" dirfile ", const char *" field_name , .BI "const char *" in_field ", const double " cdividend\fR[2] , .BI "int " fragment_index ); .hy .ad n .PP In this case, the array pointers passed as .IR cm ", " cb or .IR ca should have twice as many (purely real) elements, consisting of alternating real and imaginary parts for the complex data. That is, for example, .IR ca [0] should be the real part of the first co-efficient, .IR ca [1] the imaginary part of the first co-efficient, .IR ca [2] the real part of the second co-efficient, .IR ca [3] the imaginary part of the second co-efficient, and so on. Similarly, the .I cdividend parameter becomes a double precision array of length two. .PP For .BR gd_add_clincom () and .BR gd_add_cpolynom (), these are simply different (but equivalent) declarations of the C99 function entry point. For .BR gd_add_crecip (), however, a different entry point is needed (since the .I cdividend parameter is passed by reference instead of by value). In the interests of portability, the C89 version of .BR gd_add_crecip () is always available, and may be accessed as .BR gd_add_crecip89 (), with the C89 prototype, in both the C99 and C89 APIs. .SH SEE ALSO .BR gd_add (3), .BR gd_add_spec (3), .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_madd_bit (3), .BR gd_madd_carray (3), .BR gd_madd_const (3), .BR gd_madd_divide (3), .BR gd_madd_lincom (3), .BR gd_madd_linterp (3), .BR gd_madd_mplex (3), .BR gd_madd_multiply (3), .BR gd_madd_phase (3), .BR gd_madd_polynom (3), .BR gd_madd_recip (3), .BR gd_madd_sbit (3), .BR gd_madd_string (3), .BR gd_madd_window (3), .BR gd_metaflush (3), .BR gd_open (3), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_cbopen.30000640000175000017500000005544012614323564016573 0ustar alastairalastair.\" gd_cbopen.3. The gd_cbopen man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_cbopen 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_cbopen, gd_open \(em open or create a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "DIRFILE* gd_cbopen(const char *" dirfilename ", unsigned long" .IB flags ", gd_parser_callback_t " sehandler ", void *" extra ); .HP .BI "DIRFILE* gd_open(const char *" dirfilename ", unsigned long " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_cbopen () function opens or creates the dirfile specified by .IR dirfilename , returning a DIRFILE object associated with it. Opening a dirfile will cause the library to read and parse the dirfile's format specification (see .BR dirfile-format (5)). If not NULL, .I sehandler should be a pointer to a function which will be called whenever a syntax error is encountered during parsing the format specification. Specify NULL for this parameter if no callback function is to be used. The caller may use this function to correct the error or modify the error handling of the format specification parser. See .B The Callback Function section below for details on this function. The .I extra argument allows the caller to pass data to the callback function. The pointer will be passed to the callback function verbatim. The .BR gd_open () function is equivalent to .BR gd_cbopen (), with .I sehandler and .I extra set to NULL. The .I flags argument should include one of the .IR "access modes" : .B GD_RDONLY (read-only) or .BR GD_RDWR (read-write), and may also contain zero or more of the following flags, bitwise-or'd together: .PP .PD 0 .B GD_ARM_ENDIAN .TP .PD .B GD_NOT_ARM_ENDIAN Specifies that double precision floating point raw data on disk are, or are not, stored in the middle-endian format used by older ARM processors. These flag only set the default endianness, and will be overridden when an .B /ENDIAN directive specifies the byte sex of .B RAW fields, unless .B GD_FORCE_ENDIAN is also specified. On every platform, one of these flags .RB ( GD_NOT_ARM_ENDIAN on all but middle-ended ARM systems) indicates the native behaviour of the platform. That symbol will equal zero, and may be omitted. .PP .PD 0 .B GD_BIG_ENDIAN .TP .PD .B GD_LITTLE_ENDIAN Specifies the default byte sex of raw data stored on disk to be either big-endian (most significant byte first) or little-endian (least significant byte first). Omitting both flags indicates the default should be the native endianness of the platform. Unlike the ARM endianness flags above, neither of these symbols is ever zero. Specifying both these flags together will cause the library to assume that the endianness of the data is opposite to that of the native architecture, whatever that might be. These flag only set the default endianness, and will be overridden when an .B /ENDIAN directive specifies the byte sex of .B RAW fields, unless .B GD_FORCE_ENDIAN is also specified. .TP .B GD_CREAT An empty dirfile will be created, if one does not already exist. This will create both the dirfile directory and an empty format specification file called .IR format . If the call creates a dirfile, then the specified access mode is ignored: a newly-created DIRFILE is always opened with access mode .BR GD_RDWR , even if .B GD_RDONLY had been specified. The directory will have have mode .BR S_IRWXU " | " S_IRWXG " | " S_IRWXO (0777), modified by the caller's umask value (see .BR umask (2)). The .I format file will have mode .BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH (0666), also modified by the caller's umask. The owner of the dirfile directory and .I format file will be the effective user ID of the caller. Group ownership follows the rules outlined in .BR mkdir (2). .TP .B GD_EXCL Ensure that this call creates a dirfile: when specified along with .BR GD_CREAT , the call will fail if the dirfile specified by .I dirfilename already exists. If .B GD_CREAT is not specified, this flag is ignored. This flag suffers from all the limitations of the .B O_EXCL flag as indicated in .BR open (2). .TP .B GD_FORCE_ENCODING Specifies that .B /ENCODING directives (see .BR dirfile-format (5)) found in the dirfile format specification should be ignored. The encoding scheme specified in .I flags will be used instead (see below). .TP .B GD_FORCE_ENDIAN Specifies that .B /ENDIAN directives (see .BR dirfile-format (5)) found in the dirfile format specification should be ignored. All raw data will be assumed to have the byte sex indicated through the presence or absence of the .BR GD_ARM_ENDIAN ", " GD_BIG_ENDIAN ", " GD_LITTLE_ENDIAN , and .B GD_NOT_ARM_ENDIAN flags. .TP .B GD_IGNORE_DUPS If the dirfile format metadata specifies more than one field with the same name, all but one of them will be ignored by the parser. Without this flag, parsing would fail with the .B GD_E_FORMAT error, possibly resulting in invocation of the registered callback function. Which of the duplicate fields is kept is not specified. As a result, this flag is typically only useful in the case where identical copies of a field specification line are present. No indication is provided to indicate whether a duplicate field has been discarded. If finer grained control is required, the caller should handle .B GD_E_FORMAT_DUPLICATE suberrors itself with an appropriate callback function. .TP .B GD_PEDANTIC Reject dirfiles which don't conform to the Dirfile Standards. See the .B Standards Compliance section below for full details. .TP .B GD_PERMISSIVE Allow non-compliant format specification syntax, even when given along with a conflicting .B /VERSION directive. See the .B Standards Compliance section below for full details. .TP .B GD_PRETTY_PRINT When dirfile metadata are flushed to disk (either explicitly via .BR gd_metaflush "(3), " gd_rewrite_fragment (3), or .BR gd_flush (3) or implicitly by closing the dirfile), an attempt will be made to create a nicer looking format specification (from a human-readable standpoint). What this explicitly means is not part of the API, and any particular behaviour should not be relied on. If the dirfile is opened read-only, this flag is ignored. .TP .B GD_TRUNC If .I dirfilename specifies an already existing dirfile, it will be truncated before opening. Since .BR gd_cbopen () decides whether .I dirfilename specifies an existing dirfile before attempting to parse the dirfile, .I dirfilename is considered to specify an existing dirfile if it refers to a directory containing a regular file called .BR format , regardless of the content or form of that file. Truncation occurs by deleting every regular file and symlink in the specified directory, whether the files were referred to by the dirfile before truncation or not. Accordingly, this flag should be used with caution. Unless .B GD_TRUNCSUB is also specified, subdirectories are left untouched. Notably, this operation does not consider directories used in .B /INCLUDE directives. If the dirfile does not exist, this flag is ignored. .TP .B GD_TRUNCSUB If specified along with .BR GD_TRUNC , truncation will descend into subdirectories, deleting all regular files and symlinks recursively. It does not descend into directories pointed to by symbolic links: in these cases, just the symlink itself is deleted. If specified without an accompanying .BR GD_TRUNC , this flag is ignored. .TP .B GD_VERBOSE Specifies that whenever an error is triggered by the library when working on this dirfile, the corresponding error string, which can be retrieved by calling .BR gd_error_string (3), should be written on the caller's standard error stream .RB ( stderr (3)) by GetData. The error string may be prefixed by a string specified by the caller; see .BR gd_verbose_prefix (3). Without this flag, GetData writes nothing to standard error. (GetData never writes to standard output.) .PP Those flags which affect the operation of the library beyond this call itself may be modified later using the .BR gd_flags (3) function. .PP The .I flags argument may also be bitwise or'd with one of the following symbols indicating the default encoding scheme of the dirfile. Like the endianness flags, the choice of encoding here is ignored if the encoding is specified in the dirfile itself, unless .B GD_FORCE_ENCODED is also specified. If none of these symbols is present, .B GD_AUTO_ENCODED is assumed, unless the .BR gd_cbopen () call results in creation or truncation of the dirfile. In that case, .B GD_UNENCODED is assumed. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .TP .B GD_AUTO_ENCODED Specifies that the encoding type is not known in advance, but should be detected by the GetData library. Detection is accomplished by searching for raw data files with extensions appropriate to the encoding scheme. This method will notably fail if the the library is called via .BR putdata (3) to create a previously non-existent raw field unless a read is first successfully performed on the dirfile. Once the library has determined the encoding scheme for the first time, it remembers it for subsequent calls. .TP .B GD_BZIP2_ENCODED Specifies that raw data files are compressed using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding, as implemented in the bzip2 format. .TP .B GD_GZIP_ENCODED Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77) as implemented in the gzip format. .TP .B GD_LZMA_ENCODED Specifies that raw data files are compressed using the Lempel-Ziv Markov Chain Algorithm (LZMA) as implemented in the xz container format. .TP .B GD_SLIM_ENCODED Specifies that raw data files are compressed using the slimlib library. .TP .B GD_SIE_ENCODED Specified that raw data files are sample-index encoded, similar to run-length encoding, suitable for data that change rarely. .TP .B GD_TEXT_ENCODED Specifies that raw data files are encoded as text files containing one data sample per line. .TP .B GD_UNENCODED Specifies that raw data files are not encoded, but written as simply binary data to disk. .TP .B GD_ZZIP_ENCODED Specifies that raw data files are compressed using the DEFLATE algorithm. All raw data files for a given fragment are collected together and stored in a PKZIP archive called raw.zip. .TP .B GD_ZZSLIM_ENCODED Specifies that raw data files are compressed using a combinations of compression schemes: first files are slim-compressed, as with the .B GD_SLIM_ENCODED scheme, and then they are collected together and compressed (again) into a PKZIP archive called raw.zip, as in the .B GD_ZZIP_ENCODED scheme. .SS Standards Compliance The latest Dirfile Standards Version which this release of GetData understands is provided in the preprocessor macro .B GD_DIRFILE_STANDARDS_VERSION defined in getdata.h. GetData is able to open and parse any dirfile which conforms to this Standards Version, or to any earlier Version. The .BR dirfile-format (5) manual page lists the changes between Standards Versions. The GetData parser can operate in two modes: a .I permissive mode, in which much non-Standards-compliant syntax is allowed, and a .I pedantic mode, in which the parser adheres strictly to the Standards. The mode made change during the parsing of a dirfile. If .B GD_PEDANTIC is passed to .BR gd_cbopen (), the parser will start parsing the format specification in .I pedantic mode, otherwise it will start in .I permissive mode. .I Permissive mode is provided primarily to allow GetData to be used on dirfiles which conform to no single Standard, but which were accepted by the GetData parser in previous versions. It is notably lax regarding reserved field names, and field name characters, the mixing of old and new data type specifiers, and generally ignores the presence of .B /VERSION directives. In read-write mode, .I permissive mode should be used with caution, as it can cause unintentional corruption of dirfile metadata on write, if the heuristics in the parser incorrectly guessed the intention of non-compliant syntax. In .I permissive mode, actual syntax errors are still reported as such. In .I pedantic mode, the parser conforms to one specific Standards Version. This target version may change any number of times in the course of scanning a single format specification. If invoked using the .B GD_PEDANTIC flag, the parser will start in .I pedantic mode with a target version equal to .BR GD_DIRFILE_STANDARDS_VERSION . Whenever a .B /VERSION directive is encountered in the format specification, the target version is changed to the Standards Version specified. When encountering a .B /VERSION directive in .I permissive mode, the parser will switch to .I pedantic mode, unless the .B GD_PERMISSIVE flag was passed to .BR gd_cbopen (), in which case no mode switch will take place. Independent of the mode of the parser when parsing the format specification, GetData will calculate a list of Standards Versions to which the parsed metadata conform to. The .BR gd_dirfile_standards (3) function can provide this information, and also specify the desired Standards Version for writing format metadata back to disk. .SS The Callback Function The caller-supplied .I sehandler function is called whenever the format specification parser encounters a syntax error .RI ( i.e. whenever it would return the .B GD_E_FORMAT error). This callback may be used to correct the error, or to tell the parser how to recover from it. This function should take two pointers as arguments, and return an .BR int : .RS .HP .nh .ad l .BI "int " sehandler "(gd_parser_data_t *" pdata ", void *" extra ); .hy .ad n .RE .PP The .I extra parameter is the pointer supplied to .BR gd_cbopen (), passed verbatim to this function. It can be used to pass caller data to the callback. GetData does not inspect this pointer, not even to check its validity. If the caller needs to pass no data to the callback, it may be NULL. The .B gd_parser_data_t type is a structure with at least the following members: .in +4n .fam C .nf typedef struct { const DIRFILE* dirfile; int suberror; int linenum; const char* filename; char* line; size_t buflen; ... } gd_parser_data_t; .fi .fam .in .PP The .IR pdata -> dirfile member will be a pointer to a DIRFILE object suitable only for passing to .BR gd_error_string (). Notably, the caller should not assume this pointer will be the same as the pointer eventually returned by .BR gd_cbopen (), nor that it will be valid after the callback function returns. The .IR pdata -> suberror parameter will be one of the following symbols indicating the type of syntax error encountered: .TP .B GD_E_FORMAT_ALIAS The parent specified for a meta field was an alias. .TP .B GD_E_FORMAT_BAD_LINE The line was indecipherable. Typically this means that the line contained neither a reserved word, nor a field type. .TP .B GD_E_FORMAT_BAD_NAME The specified field name was invalid. .TP .B GD_E_FORMAT_BAD_SPF The samples-per-frame of a RAW field was out-of-range. .TP .B GD_E_FORMAT_BAD_TYPE The data type of a RAW field was unrecognised. .TP .B GD_E_FORMAT_BITNUM The first bit of a BIT field was out-of-range. .TP .B GD_E_FORMAT_BITSIZE The last bit of a BIT field was out-of-range. .TP .B GD_E_FORMAT_CHARACTER An invalid character was found in the line, or a character escape sequence was malformed. .TP .B GD_E_FORMAT_DUPLICATE The specified field name already exists. .TP .B GD_E_FORMAT_ENDIAN The byte sex specified by an .B /ENDIAN directive was unrecognised. .TP .B GD_E_FORMAT_LITERAL An unexpected character was encountered in a complex literal. .TP .B GD_E_FORMAT_LOCATION The parent of a metafield was defined in another fragment. .TP .B GD_E_FORMAT_META_META An attempt was made to use a metafield as the parent to a new metafield. .TP .B GD_E_FORMAT_METARAW An attempt was made to add a RAW metafield. .TP .B GD_E_FORMAT_MPLEXVAL A MPLEX specification has a negative period. .TP .B GD_E_FORMAT_N_FIELDS The number of fields of a LINCOM field was out-of-range. .TP .B GD_E_FORMAT_N_TOK An insufficient number of tokens was found on the line. .TP .B GD_E_FORMAT_NO_FIELD The parent of a metafield was not found. .TP .B GD_E_FORMAT_NUMBITS The number of bits of a BIT field was out-of-range. .TP .B GD_E_FORMAT_PROTECT The protection level specified by a .B /PROTECT directive was unrecognised. .TP .B GD_E_FORMAT_RES_NAME A field was specified with the reserved name .IR INDEX (or with the reserved name .IR FILEFRAM in a dirfile conforming to Standards Version 5 or earlier). .TP .B GD_E_FORMAT_UNTERM The last token of the line was unterminated. .TP .B GD_E_FORMAT_WINDOP The operation in a WINDOW field was not recognised. .PP .IR pdata -> filename and .IR pdata -> linenum members contains the pathname of the fragment and line number where the syntax error was encountered. The first line in a fragment is line one. .PP The .IR pdata -> line member contains a copy of the line containing the syntax error. This line may be freely modified by the callback function. It will then be reparsed if the callback function returns the symbol .B GD_SYNTAX_RESCAN (see below). The size of the memory buffer (which may be greater than the length of the actual string) is provided in .IR pdata -> buflen , and space is available for at least GD_MAX_LINE_LENGTH bytes. A larger buffer may be used if desired, by assigning a pointer to the new buffer of the desired length to .IR pdata -> line . The new buffer should be allocated with .BR malloc (3). It will be freed by the parser. Do not call .BR free (3) or .BR realloc (3) on the original pointer passed to the callback as .IR pdata -> line : it, too, will be freed by the parser. The callback function should return one of the following symbols, which tells the parser how to subsequently handle the error: .TP .B GD_SYNTAX_ABORT The parser should immediately abort parsing the format specification and fail with the error .BR GD_E_FORMAT . This is the default behaviour, if no callback function is provided (or if the parser is invoked by calling .BR gd_open ()). .TP .B GD_SYNTAX_CONTINUE The parser should continue parsing the format specification. However, once parsing has finished, the parser will fail with the error .BR GD_E_FORMAT , even if no further syntax errors are encountered. This behaviour may be used by the caller to identify all lines containing syntax errors in the format specification, instead of just the first one. .TP .B GD_SYNTAX_IGNORE The parser should ignore the line containing the syntax error completely, and carry on parsing the format specification. If no further errors are encountered, the dirfile will be successfully opened. .TP .B GD_SYNTAX_RESCAN The parser should rescan the .I line argument, which replaces the line which originally contained the syntax error. The line is assumed to have been corrected by the callback function. If the line still contains a syntax error, the callback function will be called again. Note: the line is not corrected on disk; however, the caller may subsequently correct the fragment on disk by calling .BR gd_rewrite_fragment (3). .PP The callback function handles only syntax errors. The parser may still abort early, if a different kind of library error is encountered. Furthermore, although a line may contain more than one syntax error, the parser will only ever report one syntax error per line, even if the callback function returns .BR GD_SYNTAX_CONTINUE . .SH RETURN VALUE A call to .BR gd_cbopen () or .BR gd_open () always returns a pointer to a newly allocated DIRFILE object, except in instances when it is unable to allocate memory for the DIRFILE object itself, in which case it will return NULL. The DIRFILE object is an opaque structure containing the parsed dirfile metadata. If an error occurred, the dirfile error will be set to a non-zero error value. The DIRFILE object will also be internally flagged as invalid. Possible error values are: .TP 8 .B GD_E_ACCMODE The library was asked to truncate a dirfile opened read-only (i.e. .B GD_TRUNC was specified in .I flags along with .BR GD_RDONLY ). .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_REFERENCE The reference field specified by a .B /REFERENCE directive in the format specification (see .BR dirfile-format (5)) was not found, or was not a .B RAW field. .TP .B GD_E_CALLBACK The registered callback function, .IR sehandler , returned an unrecognised response. .TP .B GD_E_CREAT The library was unable to create the dirfile. .TP .B GD_E_EXISTS The dirfile already exists and both .BR GD_CREAT " and " GD_EXCL were specified. .TP .B GD_E_FORMAT A syntax error occurred in the format specification. See also .B The Callback Function section above. .TP .B GD_E_IO The dirfile format file, or another file that it includes, could not be opened, or .I dirfilename does not specify a valid dirfile. .TP .B GD_E_LINE_TOO_LONG The parser encountered a line in the format specification longer than it was able to deal with. Lines are limited by the storage size of .BR ssize_t . On 32-bit systems, this limits format specification lines to 2**31 bytes. The limit is larger on 64-bit systems. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). When finished with it, a caller should de-allocate the DIRFILE object by calling .BR gd_close (3), or .BR gd_discard (3), even if the open failed. .SH BUGS When working with dirfiles conforming to Standards Versions 4 and earlier (before the introduction of the .B /ENDIAN directive), GetData assumes the dirfile has native byte sex, even though, officially, these early Standards stipulated data to be little-endian. This is necessary since, in the absence of an explicit .B /VERSION directive, it is often impossible to determine the intended Standards Version of a dirfile, and the current behaviour is to assume native byte sex for modern dirfiles lacking .BR /ENDIAN . To read an old, little-ended dirfile on a big-ended platform, an .B /ENDIAN directive should be added to the format specification, or else .B GD_LITTLE_ENDIAN should be specified by the caller. GetData's parser assumes it is running on an ASCII-compatible platform. Format specification parsing will fail gloriously on an EBCDIC platform. .SH SEE ALSO .BR dirfile (5), .BR dirfile-encoding (5), .BR dirfile-format (5), .BR gd_close (3), .BR gd_dirfile_standards (3), .BR gd_discard (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_flags (3), .BR gd_getdata (3), .BR gd_include (3), .BR gd_parser_callback (3), .BR gd_verbose_prefix (3) libgetdata-0.9.0/man/Makefile.am0000640000175000017500000001362312614323564016620 0ustar alastairalastair# Copyright (C) 2008-2014 D. V. Wiebe # ########################################################################## # # This file is part of the GetData project. # # GetData 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. # # GetData is distributed in the hope that 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 GetData; if not, write to the Free Software Foundation, Inc., # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # AUTOMAKE_OPTIONS = foreign nodist_man_MANS = gd_alter_encoding.3 gd_alter_endianness.3 \ gd_alter_frameoffset.3 dist_man_MANS = checkdirfile.1 dirfile2ascii.1 gd_add.3 gd_add_alias.3 \ gd_add_bit.3 gd_add_spec.3 gd_alias_target.3 gd_aliases.3 \ gd_alter_affixes.3 gd_alter_bit.3 gd_alter_entry.3 \ gd_alter_protection.3 gd_alter_spec.3 gd_array_len.3 gd_bof.3 \ gd_bof64.3 gd_carrays.3 gd_cbopen.3 gd_close.3 gd_constants.3 \ gd_delete.3 gd_desync.3 gd_dirfile_standards.3 \ gd_dirfilename.3 gd_encoding.3 gd_encoding_support.3 \ gd_endianness.3 gd_entry.3 gd_entry_list.3 gd_entry_type.3 \ gd_eof.3 gd_eof64.3 gd_error.3 gd_error_count.3 \ gd_error_string.3 gd_flags.3 gd_flush.3 gd_fragment_affixes.3 \ gd_fragment_index.3 gd_fragmentname.3 gd_framenum_subset.3 \ gd_framenum_subset64.3 gd_frameoffset.3 gd_frameoffset64.3 \ gd_free_entry_strings.3 gd_get_carray_slice.3 gd_get_string.3 \ gd_getdata.3 gd_getdata64.3 gd_hidden.3 gd_hide.3 \ gd_include_affix.3 gd_invalid_dirfile.3 gd_linterp_tablename.3 \ gd_madd_bit.3 gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 \ gd_move.3 gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \ gd_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \ gd_nframes64.3 gd_parent_fragment.3 gd_parser_callback.3 \ gd_protection.3 gd_put_carray_slice.3 \ gd_put_string.3 gd_putdata.3 gd_putdata64.3 gd_raw_filename.3 \ gd_reference.3 gd_rename.3 gd_rewrite_fragment.3 gd_seek.3 \ gd_seek64.3 gd_spf.3 gd_strings.3 gd_strtok.3 gd_tell.3 \ gd_tell64.3 gd_uninclude.3 gd_validate.3 gd_verbose_prefix.3 \ GD_SIZE.3 dirfile.5 dirfile-encoding.5 dirfile-format.5 # these are real_file:alias MAN3ALIASES=gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \ gd_add_bit.3:gd_add_const.3 gd_add_bit.3:gd_add_cpolynom.3 \ gd_add_bit.3:gd_add_crecip.3 gd_add_bit.3:gd_add_divide.3 \ gd_add_bit.3:gd_add_lincom.3 gd_add_bit.3:gd_add_linterp.3 \ gd_add_bit.3:gd_add_mplex.3 gd_add_bit.3:gd_add_multiply.3 \ gd_add_bit.3:gd_add_polynom.3 gd_add_bit.3:gd_add_phase.3 \ gd_add_bit.3:gd_add_raw.3 gd_add_bit.3:gd_add_recip.3 \ gd_add_bit.3:gd_add_sbit.3 gd_add_bit.3:gd_add_string.3 \ gd_add_bit.3:gd_add_window.3 \ gd_madd_bit.3:gd_madd_carray.3 gd_madd_bit.3:gd_madd_clincom.3 \ gd_madd_bit.3:gd_madd_const.3 gd_madd_bit.3:gd_madd_cpolynom.3 \ gd_madd_bit.3:gd_madd_crecip.3 gd_madd_bit.3:gd_madd_divide.3 \ gd_madd_bit.3:gd_madd_lincom.3 gd_madd_bit.3:gd_madd_linterp.3 \ gd_madd_bit.3:gd_madd_mplex.3 gd_madd_bit.3:gd_madd_multiply.3 \ gd_madd_bit.3:gd_madd_phase.3 gd_madd_bit.3:gd_madd_polynom.3 \ gd_madd_bit.3:gd_madd_recip.3 gd_madd_bit.3:gd_madd_sbit.3 \ gd_madd_bit.3:gd_madd_string.3 gd_madd_bit.3:gd_madd_window.3 \ gd_add.3:gd_madd.3 \ gd_add_spec.3:gd_madd_spec.3 \ gd_cbopen.3:gd_open.3 \ gd_close.3:gd_discard.3 \ gd_include_affix.3:gd_include.3 \ gd_alter_bit.3:gd_alter_carray.3 gd_alter_bit.3:gd_alter_clincom.3 \ gd_alter_bit.3:gd_alter_const.3 gd_alter_bit.3:gd_alter_cpolynom.3 \ gd_alter_bit.3:gd_alter_crecip.3 gd_alter_bit.3:gd_alter_divide.3 \ gd_alter_bit.3:gd_alter_lincom.3 gd_alter_bit.3:gd_alter_linterp.3 \ gd_alter_bit.3:gd_alter_mplex.3 gd_alter_bit.3:gd_alter_multiply.3 \ gd_alter_bit.3:gd_alter_phase.3 gd_alter_bit.3:gd_alter_polynom.3 \ gd_alter_bit.3:gd_alter_recip.3 gd_alter_bit.3:gd_alter_raw.3 \ gd_alter_bit.3:gd_alter_sbit.3 gd_alter_bit.3:gd_alter_window.3 \ gd_alter_spec.3:gd_malter_spec.3 \ gd_framenum_subset.3:gd_framenum.3 \ gd_get_carray_slice.3:gd_get_carray.3 \ gd_get_carray_slice.3:gd_get_constant.3 \ gd_put_carray_slice.3:gd_put_carray.3 \ gd_put_carray_slice.3:gd_put_constant.3 \ gd_delete.3:gd_delete_alias.3 \ gd_hide.3:gd_unhide.3 \ gd_add_alias.3:gd_madd_alias.3 \ gd_flush.3:gd_sync.3 gd_flush.3:gd_raw_close.3 \ gd_nentries.3:gd_nfields.3 gd_nentries.3:gd_nfields_by_type.3 \ gd_nentries.3:gd_nmfields.3 gd_nentries.3:gd_nmfields_by_type.3 \ gd_nentries.3:gd_nmvectore.3 gd_nentries.3:gd_nvectors.3 \ gd_entry_list.3:gd_field_list.3 gd_entry_list.3:gd_field_list_by_type.3 \ gd_entry_list.3:gd_mfield_list.3 gd_entry_list.3:gd_mfield_list_by_type.3 \ gd_entry_list.3:gd_nmvectore.3 gd_entry_list.3:gd_vector_list.3 \ gd_frameoffset64.3:gd_alter_frameoffset64.3 \ gd_array_len.3:gd_carray_len.3 #man conversion HTMLMANS=$(addsuffix .html,${nodist_man_MANS}) \ $(addsuffix .html,${dist_man_MANS}) %.html: % make_html.pl ./make_html.pl $< > $@ htmlman: $(HTMLMANS) for m in $(MAN3ALIASES); do \ ./make_html.pl `echo $$m | $(SED) -e 's/:\\(.*\\).3/ \\1/'` \ > `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \ done install-data-hook: cd $(DESTDIR)$(mandir)/man3 && \ for m in $(MAN3ALIASES); do \ rm -f `echo $$m | $(SED) -e 's/.*://'`; \ $(LN_S) `echo $$m | $(SED) -e 's/:/ /'`; \ done uninstall-hook: cd $(DESTDIR)$(mandir)/man3 && \ for m in $(MAN3ALIASES); do \ rm -f `echo $$m | $(SED) -e 's/.*://'`; \ done clean-local: rm -f *~ *.html rm -f $(nodist_man_MANS) libgetdata-0.9.0/man/gd_getdata.30000640000175000017500000003564712614323564016745 0ustar alastairalastair.\" gd_getdata.3. The gd_getdata man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_getdata 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_getdata \(em retrieve data from a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "size_t gd_getdata(DIRFILE *" dirfile ", const char *" field_code ", off_t" .IB first_frame ", off_t " first_sample ", size_t " num_frames ", size_t" .IB num_samples ", gd_type_t " return_type ", void *" data_out ); .hy .ad n .SH DESCRIPTION The .BR gd_getdata () function queries a dirfile(5) database specified by .I dirfile for the field .IR field_code . It fetches .I num_frames frames plus .I num_samples samples from this field, starting .I first_sample samples past frame .IR first_frame . The data is converted to the data type specified by .IR return_type , and stored in the user-supplied buffer .IR data_out . The .I field_code may contain one of the representation suffixes listed in dirfile-format(5). If it does, .BR gd_getdata () will compute the appropriate complex norm before returning the data. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The argument .I data_out must point to a valid memory location of sufficient size to hold all data requested. Unless using .B GD_HERE (see below), the first sample returned will be .IP .IR first_frame " * " samples_per_frame " + " first_sample .PP as measured from the start of the dirfile, where .I samples_per_frame is the number of samples per frame as returned by .BR gd_spf (3). The number of samples fetched is, similarly, .IP .IR num_frames " * " samples_per_frame " + " num_samples . .PP Although calling .BR gd_getdata () using both samples and frames is possible, the function is typically called with either .IR num_samples " and " first_sample , or .IR num_frames " and " first_frames , equal to zero. Instead of explicitly specifying the origin of the read, the caller may pass the special symbol .B GD_HERE as .IR first_frame . This will result in the read occurring at the current position of the I/O pointer for the field (see .B GetData I/O Pointers below for a discussion of field I/O pointers). In this case, the value of .I first_sample is ignored. The .I return_type argument should be one of the following symbols, which indicates the desired return type of the data: .RS .TP 11 .B GD_UINT8 unsigned 8-bit integer .TP .B GD_INT8 signed (two's complement) 8-bit integer .TP .B GD_UINT16 unsigned 16-bit integer .TP .B GD_INT16 signed (two's complement) 16-bit integer .TP .B GD_UINT32 unsigned 32-bit integer .TP .B GD_INT32 signed (two's complement) 32-bit integer .TP .B GD_UINT64 unsigned 64-bit integer .TP .B GD_INT64 signed (two's complement) 64-bit integer .TP .B GD_FLOAT32 IEEE-754 standard 32-bit single precision floating point number .TP .B GD_FLOAT64 IEEE-754 standard 64-bit double precision floating point number .TP .B GD_COMPLEX64 C99-conformant 64-bit single precision complex number .TP .B GD_COMPLEX128 C99-conformant 128-bit double precision complex number .TP .B GD_NULL the null type: the database is queried as usual, but no data is returned. In this case, .I data_out is ignored and may be NULL. .RE The return type of the data need not be the same as the type of the data stored in the database. Type conversion will be performed as necessary to return the requested type. If the .I field_code does not indicate a representation, but conversion from a complex value to a purely real one is required, only the real portion of the requested vector will be returned. Upon successful completion, the I/O pointer of the field will be on the sample immediately following the last sample returned, if possible. On error, the position of the I/O pointer is not specified, and may not even be well defined. .SS Behaviour While Reading Specific Field Types .TP .BR PHASE : A forward-shifted .B PHASE field will always encounter the end-of-field marker before its input field does. This has ramifications when reading streaming data with .BR gd_getdata () and using .BR gd_nframes (3) to gauge field lengths (that is: a forward-shifted .B PHASE field always has less data in it than .BR gd_nframes (3) implies that it does). As with any other field, .BR gd_getdata () will return a short count whenever a read from a .B PHASE field encounters the end-of-field marker. Backward-shifted .B PHASE fields do not suffer from this problem, since .BR gd_getdata () pads reads past the beginning-of-field marker with NaN or zero as appropriate. Database creators who wish to use the .B PHASE field type with streaming data are encouraged to work around this limitation by only using backward-shifted .B PHASE fields, by writing .B RAW data at the maximal frame lag, and then back-shifting all data which should have been written earlier. Another possible work-around is to write systematically less data to the reference .B RAW field in proportion to the maximal forward phase shift. This method will work with applications which respect the database size reported by .BR gd_nframes (3) resulting in these applications effectively ignoring all frames past the frame containing the maximally forward-shifted .B PHASE field's end-of-field marker. .TP .BR MPLEX : Reading an .B MPLEX field typically requires GetData to read data before the range returned in order to determine the value of the first sample returned. This can become expensive if the encoding of the underlying RAW data does not support seeking backwards (which is true of most compression encodings). How much preceding data GetData searches for the initial value of the returned data can be adjusted, or the lookback disabled completely, using .BR gd_mplex_lookback (3). If the initial value of the field is not found in the data searched, GetData will fill the returned vector, up to the next available sample of the mulitplexed field, with zero for integer return types, or IEEE-754-conforming NaN (not-a-number) for floating point return types, as it does when providing data before the beginning-of-field. GetData caches the value of the last sample from every .B MPLEX it reads so that a subsequent read of the field starting from the following sample (either through an explicit starting sample given by the caller or else implicitly using .BR GD_HERE ) will not need to scan the field backwards. This cache is invalidated if a different return type is used, or if an intervening operation moves the field's I/O pointer. .TP .BR WINDOW : The samples of a .B WINDOW for which the field conditional is false will be filled with either zero for integer return types, or IEEE-754-conforming NaN (not-a-number) for floating point return types. .SH RETURN VALUE In all cases, .BR gd_getdata () returns the number of samples (not bytes) successfully read from the database. If the end-of-field is encountered before the requested number of samples have been read, a short count will result. The library does not consider this an error. Requests for data before the beginning-of-field marker, which may have been shifted from frame zero by the presence of a .B FRAMEOFFSET directive, will result in the the data being padded at the front by NaN or zero depending on whether the return type is of floating point or integral type. If an error has occurred, zero is returned and the dirfile error will be set to a non-zero value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .IR field_code , or one of the fields it uses for input, was not found in the database. .TP .B GD_E_BAD_DIRFILE An invalid .I dirfile was supplied. .TP .B GD_E_BAD_SCALAR A scalar field used in the definition of the field was not found, or was not of scalar type. .TP .B GD_E_BAD_TYPE An invalid .I return_type was specified. .TP .B GD_E_DIMENSION The supplied .I field_code referred to a .BR CONST ,\~ CARRAY , or .B STRING field. The caller should use .BR gd_get_constant (3),\~ gd_get_carray (3) , or .BR gd_get_string (3) instead. Or, a scalar field was found where a vector field was expected in the definition of .I field_code or one of its inputs. .TP .B GD_E_DOMAIN An immediate read was attempted using .BR GD_HERE , but the I/O pointer of the field was not well defined because two or more of the field's inputs did not agree as to the location of the I/O pointer. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_IO An error occurred while trying to open or read from a file on disk containing a raw field or LINTERP table. .TP .B GD_E_LUT A LINTERP table was malformed. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of a RAW field could not be determined. This may also indicate that the binary file associated with the RAW field could not be found. .TP .B GD_E_UNSUPPORTED Reading from dirfiles with the encoding scheme of the specified dirfile is not supported by the library. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES To save memory, .BR gd_getdata () uses the memory pointed to by .I data_out as scratch space while computing derived fields. As a result, if an error is encountered during the computation, the contents of this memory buffer are unspecified, and may have been modified by this call, even though .BR gd_getdata () will report zero samples returned on error. Reading slim-compressed data (see defile-encoding(5)), may cause unexpected memory usage. This is because slimlib internally caches open decompressed files as they are read, and GetData doesn't close data files between .BR gd_getdata () calls for efficiency's sake. Memory used by this internal slimlib buffer can be reclaimed by calling .BR gd_raw_close (3) on fields when finished reading them. .SH GETDATA I/O POINTERs This is a general discussion of field I/O pointers in the GetData library, and contains information not directly applicable to .BR gd_getdata (). Every .B RAW field in an open Dirfile has an .I I/O pointer which indicates the library's current read and write poisition in the field. These I/O pointers are useful when performing sequential reads or writes on Dirfile fields (see .B GD_HERE in the description above). The value of the I/O pointer of a field is reported by .BR gd_tell (3). Derived fields have virtual I/O pointers arising from the I/O pointers of their input fields. These virtual I/O pointers may be valid (when all input fields agree on their position in the dirfile) or invalid (when the input fields are not in agreement). The I/O pointer of some derived fields is .I always invalid. The usual reason for this is the derived field simultaneously reading from two different places in the same .B RAW field. For example, given the following Dirfile metadata specification: .RS a \fBRAW UINT8\fR 1 .br b \fBPHASE\fR a 1 .br c \fBLINCOM\fR 2 a 1 0 b 1 0 .RE the derived field .I c never has a valid I/O pointer, since any particular sample of .I c ultimately involves reading from more than one place in the .B RAW field .IR a . Attempting to perform sequential reads or writes (with .BR GD_HERE ) on a derived field when its I/O pointer is invalid will result in an error (specifically, .BR GD_E_DOMAIN ). The implicit .I INDEX field has an effective I/O pointer than mostly behaves like a true .B RAW field I/O pointer, except that it permits simultaneous reads from multiple locations. So, given the following metadata specification: .RS d \fBPHASE\fR INDEX 1 .br e \fBLINCOM\fR 2 INDEX 1 0 d 1 0 .RE the I/O pointer of the derived field .I e will always be valid, unlike the similarly defined .I c above. The virtual I/O pointer of a derived field will change in response to movement of the .B RAW I/O pointers underlying the derived fields inputs, and vice versa: moving the I/O pointer of a derived field will move the I/O pointer of the .B RAW fields from which it ultimately derives. As a result, the I/O pointer of any particular field may move in unexpected ways if multiple fields are manipulated at the same time. When a Dirfile is first opened, the I/O pointer of every .B RAW field is set to the beginning-of-frame (the value returned by .BR gd_bof (3)), as is the I/O pointer of any newly-created .B RAW field. The following library calls cause I/O pointers to move: .TP .BR gd_getdata "() and " gd_putdata (3) These functions move the I/O pointer of affected fields to the sample immediately following the last sample read or written, both when performed at an absolutely specified position and when called for a sequential read or write using .BR GD_HERE . When reading a derived field which simultaneously reads from more than one place in a .B RAW field (such as .I c above), the position of that .B RAW field's I/O pointer is unspecified (that is: it is not specified which input field is read first). .TP .BR gd_seek (3) This function is used to manipulate I/O pointers directly. .TP .BR gd_flush "(3) and " gd_raw_close (3) These functions set the I/O pointer of any .B RAW field which is closed back to the beginning-of-field. .TP .I calls which result in modifications to raw data files: this may happen when calling any of: .BR gd_alter_encoding "(3), " gd_alter_endianness (3), .BR gd_alter_frameoffset "(3), " gd_alter_entry (3), .BR gd_alter_raw "(3), " gd_alter_spec "(3), " gd_malter_spec (3), .BR gd_move (3), or .BR gd_rename (3); these functions close affected .B RAW fields before making changes to the raw data files, and so reset the corresponding I/O pointers to the beginning-of-field. .PP In general, when these calls fail, the I/O pointers of affected fields may be anything, even out-of-bounds or invalid. After an error, the caller should issue an explicit .BR gd_seek (3) to repoisition I/O pointers before attempting further sequential operations. .SH SEE ALSO .BR dirfile (5), .BR dirfile-encoding (5), .BR gd_get_constant (3), .BR gd_get_string (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_mplex_lookback (3), .BR gd_nframes (3), .BR gd_open (3), .BR gd_raw_close (3), .BR gd_seek (3), .BR gd_spf (3), .BR gd_putdata (3), .BR GD_SIZE (3) libgetdata-0.9.0/man/gd_frameoffset.30000640000175000017500000000413612614323564017622 0ustar alastairalastair.\" gd_frameoffset.3. The gd_frameoffset man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_frameoffset 3 "15 July 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_frameoffset \(em report the starting frame of fields in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "off_t gd_frameoffset(DIRFILE *" dirfile ", int " fragment_index ); .hy .ad n .SH DESCRIPTION The .BR gd_frameoffset () function queries a dirfile(5) database specified by .I dirfile and returns the frame offset (see dirfile-format(5)) for the fragment indexed by .IR fragment_index . The frame offset of a fragment indicate the frame number of the first sample of data stored in binary files associated with .B RAW fields defined in the specified fragment. The frame offset of a fragment containing no .B RAW fields is ignored. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_frameoffset () returns the frame offset of the specified fragment. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_frameoffset (3), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_parent_fragment.30000640000175000017500000000371312614323564020475 0ustar alastairalastair.\" gd_parent_fragment.3. The gd_parent_fragment man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_parent_fragment 3 "21 April 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_parent_fragment \(em retrieve the parent fragment of a fragment in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_parent_fragment(DIRFILE *" dirfile ", int " fragment_index ); .hy .ad n .SH DESCRIPTION The .BR gd_parent_fragment () function queries a dirfile(5) database specified by .I dirfile and returns the index of the fragment which contains the .B INCLUDE directive for the fragment indexed by .IR fragment_index . Since the primary format specification fragment is not included in any other fragment, passing zero for .I fragment_index will result in an error. .SH RETURN VALUE On success, .BR gd_parent_fragment () returns the index of the specified fragment's parent. On error, .BR gd_parent_fragment () returns -1 and sets the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range, or was equal to zero. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_include (3), .BR gd_open (3), .BR gd_fragmentname (3), .BR gd_nfragments (3) libgetdata-0.9.0/man/gd_delete.30000640000175000017500000001035412614323564016562 0ustar alastairalastair.\" gd_delete.3. The gd_delete man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_delete 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_delete \(em remove an entry from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_delete(DIRFILE *" dirfile ", const char *" field_code , .BI "unsigned int " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_delete () function attempts to delete the field or alias specified by .I field_code in the dirfile specified by .IR dirfile . The .I field_code should not contain a representation suffix. The .I flags argument influences how the deletion attempt occurs. It may be zero, for the default behaviour, or else one or more of the following flags, bitwise or'd together: .TP 8 .B GD_DEL_DATA If the field to be deleted is a .B RAW field, also delete the binary data file associated with it. If .I field_code specified a .B RAW field and this flag is not specified, the field will still be deleted but the binary file will be left untouched. .TP .B GD_DEL_DEREF If the field to be deleted is a .B CONST or .B CARRAY field which is used as a parameter in the specification of other fields, resolve these other fields dependence on the deleted field by replacing instances of .I field_code in their field specifications with the value of the scalar field. .TP .B GD_DEL_FORCE Delete the indicated entry, even if it is used in the specification of other fields, either as a input for a derived vector field or as a scalar parameter in a field specification, or if it has aliases pointing to it. .TP .B GD_DEL_META If the field to be deleted has metafields attached to it, attempt to delete those, too. If the field has metafields and this flag is not specified, the call will fail with the .B GD_E_DELETE error. .SH RETURN VALUE On successful deletion, zero is returned. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_DELETE The attempt to delete the field failed. Either the specified field is used in the specification of other fields and .B GD_DEL_FORCE or .B GD_DEL_DEREF was not specified, or it has metafields and .B GD_DEL_META was not specified. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .TP .B GD_E_IO An error occurred while trying to close or delete the binary file associated with a .B RAW field. .TP .B GD_E_PROTECTED The metadata of the fragment containing the field was protected from change. Or, the deletion of the binary data file associated with a .B RAW field was attempted and the data of the fragment was protected. .TP .B GD_E_UNKNOWN_ENCODING The .B GD_DEL_DATA flag was given but the encoding scheme of the indicated format specification fragment is not known to the library. As a result, the library was unable to delete the binary file associated with a .B RAW field. .TP .B GD_E_UNSUPPORTED The .B GD_DEL_DATA flag was given but the encoding scheme of the indicated format specification fragment does not support deleting the binary file associated with a .B RAW field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_close (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_metaflush (3) libgetdata-0.9.0/man/gd_rewrite_fragment.30000640000175000017500000000557512614323564020675 0ustar alastairalastair.\" gd_rewrite_fragment.3. The gd_rewrite_fragment man page. .\" .\" Copyright (C) 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_rewrite_fragment 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_rewrite_fragment \(em re-write a dirfile format specification fragment .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_rewrite_fragment(DIRFILE *" dirfile ", int " fragment ); .hy .ad n .SH DESCRIPTION The .BR gd_rewrite_fragment () writes the format specification fragment specified by .I fragment to disk, regardless of whether it has changed or not, overwriting the existing file. .PP In addition to being simply a valid fragment index, .I fragment may also be the special value .BR GD_ALL_FRAGMENTS , which indicates that all fragments should be rewritten. .PP Metadata is written to disk using the current Standards Version as stored in the .I dirfile object. See .BR gd_dirfile_standards (3) to change or report the current Standards Version. If the dirfile metadata conforms to no known Standards Version, a Standards non-compliant fragment will be written. .SH RETURN VALUE On success, zero is returned. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The supplied dirfile was opened in read-only mode. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied fragment index was out of range. .TP .B GD_E_IO An I/O error occurred while trying to write modified metadata to disk. .TP .B GD_E_LINE_TOO_LONG While attempting to flush modified metadata to disk, a field specification line exceeded the maximum allowed length. On most platforms, the maximum length is at least 2**31 bytes, so this typically indicates something pathological happening. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH BUGS When writing metadata using Standards Version 4 or earlier, the reference field may change, owing to the lack of a .B /REFERENCE directive. A work-around is to upgrade to Standards Version 5 or later. .SH SEE ALSO .BR gd_open (3), .BR gd_close (3), .BR gd_dirfile_standards (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_flush (3), .BR gd_metaflush (3) libgetdata-0.9.0/man/gd_alter_encoding.3.in0000640000175000017500000001122112614323564020674 0ustar alastairalastair.\" gd_alter_encoding.3.in. The gd_alter_encoding man page. .\" .\" @configure_input@ .\" .\" Copyright (C) 2008, 2009, 2010, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_encoding 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_alter_encoding \(em modify the binary encoding of data in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_encoding(DIRFILE *" dirfile ", unsigned int " encoding , .BI "int " fragment_index ", int " recode ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_encoding () function sets the binary encoding of the format specification fragment given by .I fragment_index to the encoding specified by .I encoding in the dirfile(5) database specified by .IR dirfile . The binary encoding of a fragment indicate the encoding of data stored in binary files associated with .B RAW fields defined in the specified fragment. The binary encoding of a fragment containing no .B RAW fields is ignored. The .I encoding argument should be one of the following: .IP .nh .ad l .BR GD_UNENCODED ,\~ GD_BZIP2_ENCODED ,\~ GD_GZIP_ENCODED ,\~ .BR GD_LZMA_ENCODED ,\~ GD_SLIM_ENCODED ,\~ GD_SIE_ENCODED ,\~ .BR GD_TEXT_ENCODED . .ad n .hy .PP See .BR gd_cbopen (3) and dirfile-encoding(5) for the meanings of these symbols and details on the supported encoding schemes. .PP In addition to being simply a valid fragment index, .I fragment_index may also be the special value .BR GD_ALL_FRAGMENTS , which indicates that the encoding of all fragments in the database should be changed. If the .I recode argument is non-zero, this call will recode the binary data of affected .B RAW fields to account for the change in binary encoding. If the encoding of the fragment is encoding insensitive, or if the data type is only one byte in size, no change is made. The I/O pointer of all affected .B RAW fields is reset to the beginning-of-frame. If .I recode is zero, affected binary files are left untouched. .SH RETURN VALUE Upon successful completion, .BR gd_alter_encoding () returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .TP .B GD_E_IO An I/O error occurred while attempting to recode a binary file. .TP .B GD_E_PROTECTED The metadata of the given format specification fragment was protected from change, or the binary data of the fragment was protected from change and binary file recoding was requested. .TP .B GD_E_UNCLEAN_DB An error occurred while moving the recoded file into place. As a result, the database may be in an unclean state. See the .B NOTES section below for recovery instructions. In this case, the dirfile will be flagged as invalid, to prevent further database corruption. It should be immediately closed. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the fragment is unknown. .TP .B GD_E_UNSUPPORTED The encoding scheme of the fragment does not support binary file recoding. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES A binary file recoding occurs out-of-place. As a result, sufficient space must be present on the filesystem for the binary files of all .B RAW fields in the fragment both before and after translation. If all fragments are updated by specifying .BR GD_ALL_FRAGMENTS , the recoding occurs one fragment at a time. An error code of .B GD_E_UNCLEAN_DB indicates a system error occurred while moving the re-encoded binary data into place or when deleting the old data. If this happens, the database may be left in an unclean state. The caller should check the filesystem directly to ascertain the state of the dirfile data before continuing. For recovery instructions, see the file @absolute_docdir@/unclean_database_recovery.txt. .SH SEE ALSO .BR gd_cbopen (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_encoding (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_close.30000640000175000017500000000636712614323564016436 0ustar alastairalastair.\" gd_close.3. The gd_close man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_close 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_close, gd_discard \(em close a dirfile and free associated memory .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_close(DIRFILE *" dirfile ); .HP .BI "int gd_discard(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_close () function first calls .BR gd_flush (3) (with .I field_code set to NULL) to flush all metadata changes to disk and to close all file handles associated with .IR dirfile . It then frees memory associated with the DIRFILE object. If .I dirfile is NULL, nothing happens, and the call succeeds. The .BR gd_discard () function behaves similarly, except modified metadata is not written to disk, but simply discarded. In order to ensure that modified data files associated with .B RAW fields are properly terminated, changes to .B RAW data files are still flushed to disk by this function. If .I dirfile was opened in read-only mode, .BR gd_discard () and .BR gd_close () behave identically. One of these functions should be called on all pointers returned by .BR gd_cbopen (3), .BR gd_open (3), and .BR gd_invalid_dirfile (3), even if the call to those function failed. After .BR gd_close () or .BR gd_discard () returns successfully, the pointer .I dirfile should be considered invalid. .PP Metadata is written to disk using the current Standards Version as stored in the .I dirfile object. See .BR gd_dirfile_standards (3) to change or report the current Standards Version. If the dirfile metadata conforms to no known Standards Version, Standards non-compliant metadata will be written. .SH RETURN VALUE .BR gd_close () and .BR gd_discard () return zero on success. On error, they do not de-allocate .I dirfile and set the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_LINE_TOO_LONG While attempting to flush modified metadata to disk, a field specification line exceeded the maximum allowed length. On most platforms, the maximum length is at least 2**31 bytes, so this typically indicates something pathological happening. .TP .B GD_E_IO An I/O error occurred while trying to write modified data or metadata to disk. In this case, another call to .BR gd_close () or .BR gd_discard () may be attempted. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_cbopen (3), .BR gd_dirfile_standards (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_flush (3), .BR gd_invalid_dirfile (3), .BR gd_open (3) libgetdata-0.9.0/man/gd_error_count.30000640000175000017500000000346112614323564017662 0ustar alastairalastair.\" gd_error_count.3. The gd_error_count man page. .\" .\" Copyright (C) 2011, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_error_count 3 "17 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_error_count \(em report the number of errors encountered by the GetData library .SH SYNOPSIS .B #inlcude .HP .nh .ad l .BI "int gd_error_count(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The first time .BR gd_error_count () is called with the DIRFILE object .IR dirfile , it returns the number of errors encountered by the GetData library while operating on .I dirfile since its creation. Calling this function resets the internal count, so that subsequent calls to .BR gd_error_count () return the number of errors encountered only since the previous call to this function, for the specified DIRFILE. The errors themselves are not cached by the library. The error status of the .I last library call on .I dirfile (which might be .BR GD_E_OK , indicating no error) can be obtained by calling .BR gd_error (3). .SH RETURN VALUE The .BR gd_error_count () function always returns the number of GetData errors encountered since the last time it was called, or since the dirfile was created. This will be zero, if no error has occurred over the given time. .SH SEE ALSO .BR gd_error (3), .BR gd_error_string (3) libgetdata-0.9.0/man/gd_move.30000640000175000017500000001203612614323564016265 0ustar alastairalastair.\" gd_move.3. The gd_move man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_move 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_move \(em move a dirfile entry between format specification fragments .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_move(DIRFILE *" dirfile ", const char" .BI * field_code ", int " new_fragment ", unsigned int " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_move () function transfers the field or alias specified by .IR field_code , which should not have a representation suffix, defined in the dirfile specified by .IR dirfile from it's current format specification fragment to the fragment indexed by .IR new_fragment . If the field is already defined in the fragment index by .IR new_fragment , this function does nothing and returns no error. If the new fragment has different affixes, the field will be renamed as part of the move. See .BR gd_rename (3) for details on field renaming. The field is closed before moving, resulting in it's I/O pointer being reset to the beginning-of-field. The .I flags parameter should be zero or more of the following flags, bitwise or'd together: .TP .B GD_REN_DANGLE By default, if the move results in a change of name for the field due to differing fragment affixes, .B ALIAS entries pointing to this field will be updated with the field's new name. Specifying this flag prohibits this behaviour, turning these aliases into dangling aliases. If moving the field doesn't rename it, this flag is ignored. .TP .B GD_REN_DATA If .I field_code specifies a .B RAW field, the binary file associated with the field will be translated to account for the possibly different encoding, endianness, and frame offset of the new format specification fragment. It will also be moved to a new directory, if necessary. If this flag is not specified, no changes will be made to the binary file. If .I field_code specifies a field of type other than .BR RAW , this flag is ignored. If the binary file is translated, and the frame offset of the destination fragment is larger than that of the source fragment, this will result in permanent deletion of data from the database. If the new frame offset is smaller than the old frame offset, the binary file will be padded at the front with zeroes. .TP .B GD_REN_FORCE Skip updating entries which would be invalid (see .BR gd_rename (3) for details). By default, an invalid field causes the move to fail. If moving the field doesn't rename it, this flag is ignored. .TP .B GD_REN_UPDB If moving the field renames it, update entries which use this field as an input to account for the new name (see .BR gd_rename (3)). If moving the field doesn't rename it, this flag is ignored. .SH RETURN VALUE On success, .BR gd_move () returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found, or else the move resulted in the field being renamed and the resultant metadata update tried to change a field code into something prohibited by a fragment's affixes. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE An attempt was made to move the immutable .I INDEX field. .TP .B GD_E_BAD_INDEX The .I new_fragment argument did not index a valid format specification fragment. .TP .B GD_E_IO An I/O error occurred while attempting to translate a binary file. .TP .B GD_E_PROTECTED The metadata of the source or destination format specification fragments was protected from change, or the binary data of the source or destination fragments was protected from change and binary file translation was requested. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the source or destination fragment is unknown. .TP .B GD_E_UNSUPPORTED The encoding scheme of the source or destination fragment does not support binary file translation. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES A binary file translation occurs out-of-place. As a result, sufficient space must be present on the filesystem for both the binary file before translation and the binary file after translation. .SH SEE ALSO .BR gd_metaflush (3), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_parser_callback.30000640000175000017500000000367212614323564020435 0ustar alastairalastair.\" gd_parser_callback.3. The gd_parser_callback man page. .\" .\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_parser_callback 3 "17 September 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_parser_callback \(em set the syntax error callback handler for a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "void gd_parser_callback(DIRFILE *" dirfile ", gd_parser_callback_t" .IB sehandler ", void *" extra ); .hy .ad n .SH DESCRIPTION The .BR gd_parser_callback () function updates the syntax error callback function of the DIRFILE object .I dirfile to be .IR sehandler , and the caller supplied extra pointer passed to the handler to be .IR extra , discarding any syntax error handler and extra pointer which were previously registered for this DIRFILE. If .I sehandler is NULL, the existing handler will be removed and the default behaviour (abort on error) restored. See .BR gd_cbopen (3) for a discussion on the requirements for the syntax handler. Since parsing of an existing format specification occurs when the DIRFILE object is created, before this function can be called, this function is only useful to set or modify a callback function or its caller data before calling .BR gd_include (3), which will invoke the callback function if syntax errors are found in the included fragment. This function always succeeds, and has no return value. .SH SEE ALSO .BR gd_cbopen (3), .BR gd_include (3), .BR dirfile (5) libgetdata-0.9.0/man/gd_linterp_tablename.30000640000175000017500000000472612614323564021013 0ustar alastairalastair.\" gd_linterp_tablename.3. The gd_linterp_tablename man page. .\" .\" Copyright (C) 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_linterp_tablename 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_linterp_tablename \(em retrieve the pathname of a look-up table in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "char *gd_linterp_tablename(DIRFILE *" dirfile ", const char" .BI * field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_linterp_tablename () function retrieves the pathname of the look-up table (LUT) used by the .B LINTERP field specified by .I field_code in the dirfile specified by .IR dirfile . If .I field_code contains a valid representation suffix, it will be ignored. Note: this function returns a fully canonicalised, absolute path. The value of the .I table member in a .B gd_entry_t object (see .BR gd_entry (3)) is the path which appears in the format specification on disk, which may be a path relative to the fragment directory. .SH RETURN VALUE On success, .BR gd_linterp_tablename () returns the full pathname of the LUT associated with the specified field in a buffer allocated by .BR malloc (3). Once no longer needed, the returned pointer should be passed to .BR free (3) to deallocate the associated memory. On error, NULL is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE The field specified by .I field_code was not a .B LINTERP field. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_entry (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-format (5), .BR free (3), .BR malloc (3) libgetdata-0.9.0/man/gd_seek.30000640000175000017500000001364212614323564016252 0ustar alastairalastair.\" gd_getdata.3. The gd_getdata man page. .\" .\" Copyright (C) 2011, 2012, 2013, 2014, 2015 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_seek 3 "25 September 2015" "Version 0.9.0" "GETDATA" .SH NAME gd_seek \(em reposition a dirfile field pointer .SH SYNOPSIS .B #include .HP .nh .ad l .BI "off_t gd_seek(DIRFILE *" dirfile ", const char *" field_code ", off_t" .IB frame_num ", off_t " sample_num ", int " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_seek () function changes the position of the I/O pointer associated with the field .I field_code in the dirfile(5) database specified by .IR dirfile . In normal operation, .BR gd_seek () advances the field I/O pointer .I frame_num frames plus .I sample_num samples from the origin point specified in .IR flags , which should contain one of .BR GD_SEEK_SET ", " GD_SEEK_CUR , or .BR GD_SEEK_END , indicating, respectively, sample zero, the current position of the field pointer, and the location of the end-of-field marker (see .BR gd_eof (3)). In addition to one of the symbols above, the .I flags parameter may also, optionally, be bitwise or'd with .BR GD_SEEK_WRITE , which will result in the field being padded (with zero for integer types, or a IEEE-754 conforming not-a-number otherwise) in the event of seeking past the end-of-field marker. The effect of attempting to seek past the end-of-field is encoding specific. Some encodings don't actually add the padding requested by .B GD_SEEK_WRITE unless a subsequent .BR gd_putdata (3) call is used to add more data to the field at the new end-of-field. Other encodings add the padding, advancing the end-of-field, regardless of subsequent writes. Similarly, attempting to seek past the end-of-field marker in read mode (without specifying .BR GD_SEEK_WRITE ) is also encoding specific: in some encodings the field pointer will be moved past the end-of-field marker, while in others, it will be repositioned to the end of field. Check the return value to determine the result. In general, .B GD_SEEK_WRITE should be used on .BR gd_seek () calls before a write via .BR gd_putdata (3), while calls before a read via .BR gd_getdata (3) should omit the .B GD_SEEK_WRITE flag. So the following: .IP .nh .ad l .BI "gd_seek(" dirfile ", " field_code ", " a ", " b , .B GD_SEEK_SET | GD_SEEK_WRITE); .br .BI "gd_putdata(" dirfile ", "field_code ", GD_HERE, 0, " c ", " d ", " type , .IB data ); .ad n .hy .P is equivalent to: .IP .nh .ad l .BI "gd_putdata(" dirfile ", "field_code ", " a ", " b ", " c ", " d ", " type , .IB data ); .P and, similarly, .IP .nh .ad l .BI "gd_seek(" dirfile ", " field_code ", " a ", " b ", GD_SEEK_SET);" .br .BI "gd_getdata(" dirfile ", "field_code ", GD_HERE, 0, " c ", " d ", " type , .IB data ); .ad n .hy .P is equivalent to: .IP .nh .ad l .BI "gd_getdata(" dirfile ", "field_code ", " a ", " b ", " c ", " d ", " type , .IB data ); .P Only .B RAW fields (and the implicit .I INDEX field) have field I/O pointers associated with them. Calling .BR gd_seek () on a derived field will move the field pointers of all of the field's inputs. It is possible to create derived fields which simultaneously read from different places of the same input field. Calling .BR gd_seek () on such a field will result in an error. .SH RETURN VALUE Upon successful completion, .BR gd_seek () returns the field position of the specified field in samples. On error, it returns -1 and set the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_ARGUMENT The .I flags parameter didn't contain exactly one of .BR GD_SEEK_SET ", " GD_SEEK_CUR , or .BR GD_SEEK_END . .TP .B GD_E_BAD_CODE The field specified by .IR field_code , or one of the fields it uses for input, was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE An attempt was made to seek relative to .B GD_SEEK_END on the .I INDEX field, which has no end-of-field marker. .TP .B GD_E_DIMENSION The specified field or one of its inputs wasn't of vector type. .TP .B GD_E_DOMAIN The field position couldn't be set due to a derived field reading simultaneously from more than one place in a .B RAW field. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_IO An error occurred while trying to open or read from a file on disk containing a raw field. .TP .B GD_E_RANGE The request resulted an attempt to move the I/O pointer of the specified field or one of its inputs to a negative sample number. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of a RAW field could not be determined. This may also indicate that the binary file associated with the RAW field could not be found. .TP .B GD_E_UNSUPPORTED Reading from dirfiles with the encoding scheme of the specified dirfile is not supported by the library. See .BR dirfile-encoding (5) for details on dirfile encoding schemes. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_getdata (3), .BR gd_putdata (3), .BR gd_tell (3). libgetdata-0.9.0/man/gd_alias_target.30000640000175000017500000000433712614323564017763 0ustar alastairalastair.\" gd_alias_target.3. The gd_alias_target man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alias_target 3 "1 January 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_alias_target \(em return the target of an alias defined in a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char *gd_alias_target(DIRFILE *" dirfile , .BI "const char *" alias_name ); .hy .ad n .SH DESCRIPTION The .BR gd_alias_target () function queries a dirfile(5) database specified by .I dirfile and returns the target field code of the alias specified by .IR alias_name . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). Note: the target may itself be the an alias, which will have its own target. To obtain the canonical name of the field ultimately referenced by .IR alias_name , pass it to .BR gd_entry (3) and inspect the .I field member of the gd_entry_t structure returned. .SH RETURN VALUE Upon successful completion, .BR gd_alias_target () returns a pointer to a read-only character string containing the name of the target of the specified alias. On error, .BR gd_alias_target () returns NULL and sets the dirfile error a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_CODE The name .I alias_name was not found in the dirfile. .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE The entry specified by .I alias_name was not an alias. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_aliases (3), .BR gd_entry (3), .BR gd_open (3), .BR dirfile (5) libgetdata-0.9.0/man/gd_encoding.30000640000175000017500000000477212614323564017115 0ustar alastairalastair.\" gd_encoding.3. The gd_encoding man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_encoding 3 "21 April 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_encoding \(em report the binary encoding of data in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "unsigned long gd_encoding(DIRFILE *" dirfile ", int " fragment_index ); .hy .ad n .SH DESCRIPTION The .BR gd_encoding () function queries a dirfile(5) database specified by .I dirfile and returns the binary encoding for the fragment indexed by .IR fragment_index . The binary encoding of a fragment indicate the encoding of data stored in binary files associated with .B RAW fields defined in the specified fragment. The encoding of a fragment containing no .B RAW fields is ignored. .SH RETURN VALUE Upon successful completion, .BR gd_encoding () returns the binary encoding of the specified fragment, which will one of the following symbols: .IP .nh .ad l .BR GD_UNENCODED , .BR GD_BZIP2_ENCODED , .BR GD_GZIP_ENCODED , .BR GD_LZMA_ENCODED , .BR GD_SIE_ENCODED , .BR GD_SLIM_ENCODED , .BR GD_TEXT_ENCODED , .BR GD_ZZIP_ENCODED , .BR GD_ZZSLIM_ENCODED , .BR GD_ENC_UNSUPPORTED . .ad n .hy .PP If the encoding scheme specified in the dirfile metadata is unknown to GetData, .B GD_ENC_UNSUPPORTED will be returned. See .BR gd_cbopen (3) and dirfile-encoding(5) for the meanings of the other symbols and details on the supported encoding schemes. .PP On error, it returns zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_encoding (3), .BR gd_cbopen (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_getdata (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_tell64.30000640000175000017500000000271412614323564016433 0ustar alastairalastair.\" gd_tell64.3. The gd_tell64 man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_tell64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_tell64 \(em retrieve data from a dirfile database, with largefile support .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "gd_off64_t gd_tell64(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION This version of .BR gd_tell (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_tell (3). Otherwise, .BR gd_tell (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_tell (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/dirfile.50000640000175000017500000001235112614323564016265 0ustar alastairalastair.\" dirfile.5. The dirfile man page. .\" .\" Copyright (C) 2005, 2006, 2008, 2009, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH dirfile 5 "15 July 2014" "Standards Version 9" "DATA FORMATS" .SH NAME dirfile \(em a filesystem-based database format for time-ordered binary data .SH DESCRIPTION The .I dirfile database format is designed to provide a fast, simple format for storing and reading binary time-ordered data. Dirfiles can be read using the GetData library. The dirfile database is centred around one or more time-ordered data streams (a .IR "time stream" ). Each time stream is written to disk in a separate file, in its native binary format. The name of these binary files correspond to the time stream's .IR "field name" . Two time streams may have different constant sampling frequencies and mechanisms exist within the dirfile format to ensure these time streams remain properly sequenced in time. To do this, the time streams in the dirfile are subdivided into .IR frames . Each frame contains an integer number of samples of each time stream. When synchronous retrieval of data from more than one time stream is required, position in the dirfile can be specified in frames, which will ensure synchronicity. The binary files are all located in a central directory, known as the .IR "dirfile directory" . The dirfile as a whole may be referred to by its dirfile directory path. Included in the dirfile along with the time streams is the .IR "dirfile format specification" , which is an ASCII text file called .B format located in the dirfile directory. This file fully specifies the dirfile's metadata. For the syntax of this file, see .BR dirfile\-format (5). Version 3 of the Dirfile Standards introduced the .I "large dirfile" extension. This extension added the ability to distribute the dirfile metadata among multiple files (called .IR fragments ) in addition to the .B format file, as well as the ability to house portions of the database in .IR subdirfiles . These subdirfiles may be fully fledged dirfiles in their own right, but may also be contained within a larger, parent dirfile. See .BR dirfile\-format (5) for information on specifying these subdirfiles. In addition to the raw fields on disk, the dirfile format specification may also specify .I derived fields which are calculated from one or more raw or derived time streams. Derived fields behave identically to raw fields when read via GetData. See .BR dirfile\-format (5) for a complete list of derived field types. Dirfiles may also contain both numerical and character string constant .IR "scalar fields" , also further outlined in .BR dirfile\-format (5). Dirfiles are designed to be written to and read simultaneously. The dirfile specification dictates that one particular raw field (specified either explicitly or implicitly by the format specification) is to be used as the .IR "reference field" : all other vector fields are assumed to have at least as many frames as the reference field has, and the size (in frames) of the reference field is used as the size of the dirfile as a whole. Version 6 of the Dirfile Standards added the ability to encode the binary files on disk. Each .I fragment may have its own encoding scheme. Notably this can be used to compress these files. See .BR dirfile\-encoding (5) for information on encoding schemes. .SS Complex Number Storage Format Version 7 of the Dirfile Standards added support for complex valued data. Two types of complex valued data are supported by the Dirfile Standards: .IP \(bu 4 A 64-bit complex number consisting of a IEEE-754 standard 32-bit single precision floating point real part and a IEEE-754 standard 32-bit single precision floating point imaginary part, and .IP \(bu 4 A 128-bit complex number consisting of a IEEE-754 standard 64-bit double precision floating point real part and a IEEE-754 standard 64-bit double precision floating point imaginary part. .PP No integer-type complex numbers are supported. Unencoded complex numbers are stored on disk in "Fortran order", that is with the IEEE-754 real part followed by the IEEE-754 imaginary part. The specified endianness of the two components follows that of purely real floating point numbers. Endianness does not affect the ordering of the real and imaginary parts. This format also conforms to the C99 and C++11 standards. To aid in using complex valued data, dirfile field codes may contain a .I representation suffix which specifies a function to apply to the complex valued data to map it into purely real data. See .BR dirfile\-format (5). .SH AUTHORS The Dirfile format was developed by C. B. Netterfield .nh . .hy 1 It is now maintained by D. V. Wiebe .nh . .hy 1 .SH SEE ALSO .BR dirfile\-encoding (5), .BR dirfile\-format (5) libgetdata-0.9.0/man/gd_fragment_affixes.30000640000175000017500000000501312614323564020624 0ustar alastairalastair.\" gd_fragment_affix.3. The gd_fragment_affix man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_fragment_affix 3 "2 August 2012" "Version 0.8.1" "GETDATA" .SH NAME gd_fragment_affix \(em report the field affixes of a fragment of a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_fragment_affix(DIRFILE *" dirfile ", int " fragment_index , .BI "char **" prefix ", char **" suffix ); .hy .ad n .SH DESCRIPTION The .BR gd_fragment_affix () function queries a dirfile(5) database specified by .I dirfile and returns the field affixes for the fragment indexed by .IR fragment_index . The field prefix and suffix are appended to all field codes found in the specified fragment. The .I prefix and .I suffix parameters point to memory locations in which store the addresses of the returned strings. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_fragment_affix () returns zero. If non-empty, the prefix and suffix are reported in .BR malloc (3)'d buffers whose addresses are returned in .BI * prefix and .BI * suffix\fR. They should be deallocated by the caller when no longer needed by calling .BR free (3). If the fragment prefix or suffix is the empty string, NULL is returned in the corresponding pointer. On error, -1 is returned and sets the dirfile error to a non-zero error value. In this case, the values of .BI * prefix and .BI * suffix are unspecified, but will NOT be pointers to valid allocated memory. Possible dirfile error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_frameoffset (3), .BR gd_include_affixes (3), .BR gd_open (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_put_string.30000640000175000017500000000540212614323564017514 0ustar alastairalastair.\" gd_put_string.3. The gd_put_string man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_put_string 3 "19 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_put_string \(em retrieve a string from a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_put_string(DIRFILE *" dirfile ", const char *" field_code , .BI "const char *" data_in ); .hy .ad n .SH DESCRIPTION The .BR gd_put_string () function queries a dirfile(5) database specified by .I dirfile and sets the .B STRING .I field_code , which should not contain a representation suffix, to the value specified in .IR data_in . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). Because string values are stored in the dirfile metadata, the new value of .I field_code won't be written to disk until the dirfile metadata is flushed with .BR gd_metaflush (3), or until the dirfile is closed. .SH RETURN VALUE On success, .BR gd_put_string () returns the length of the string stored, including the trailing NUL character. On error, it returns 0 and sets the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified .I dirfile was opened read-only. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE An invalid .I dirfile was supplied. .TP .B GD_E_BAD_FIELD_TYPE The supplied .I field_code referred to a field of type other than .BR STRING . The caller should use .BR gd_putdata (3), .BR gd_put_carray (3), or .BR gd_put_constant (3) instead. .TP .B GD_E_BAD_TYPE An invalid .I data_type was specified. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .TP .B GD_E_PROTECTED The fragment containing the string was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered may be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_metaflush (3), .BR gd_open (3), .BR gd_get_string (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_putdata (3) libgetdata-0.9.0/man/gd_nentries.30000640000175000017500000001155212614323564017150 0ustar alastairalastair.\" gd_nentries.3. The gd_nentries man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_nentries 3 "28 June 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_nentries, gd_nfields, gd_nfields_by_type gd_nmfields, gd_nmfields_by_type, gd_nmvectors, gd_nvectors \(em count field entries in a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "unsigned int gd_nentries(DIRFILE *" dirfile ", const char *" parent , .BI "unsigned int " type ", unsigned int " flags ); .HP .BI "unsigned int gd_nfields(DIRFILE *" dirfile ); .HP .BI "unsigned int gd_nfields_by_type(DIRFILE *" dirfile ", gd_entype_t " type ); .HP .BI "unsigned int gd_nmfields(DIRFILE *" dirfile ", const char *" parent ); .HP .BI "unsigned int gd_nmfields_by_type(DIRFILE *" dirfile , .BI "const char *" parent ", gd_entype_t " type ); .HP .BI "unsigned int gd_nmvectors(DIRFILE *" dirfile ", const char *" parent ); .HP .BI "unsigned int gd_nvectors(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_nentries () function queries a dirfile(5) database specified by .I dirfile and returns a count of metadata entries satisfying the supplied criteria. If .I parent is non-NULL, metafields under the field specified by .I parent are considered; otherwise, top-level fields are considered, and metafields ignored. The .I type argument should be one of the following symbols indicating an explicit entry type to count: .IP .nh .ad l .BR GD_BIT_ENTRY ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY , .BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY , .BR GD_MPLEX_ENTRY ", " GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY , .BR GD_POLYNOM_ENTRY ", " GD_RAW_ENTRY ", " GD_RECIP_ENTRY , .BR GD_SBIT_ENTRY ", " GD_STRING_ENTRY ", " GD_WINDOW_ENTRY . .ad n .hy .PP .RB ( GD_INDEX_ENTRY is a special field type for the implicit .I INDEX field) or else one of the following special symbols: .TP .B GD_ALL_ENTRIES \fR(= 0) Count entries of all types. .TP .B GD_ALIAS_ENTRIES Count only aliases. This is the only way to get a count including aliases which do not point to valid field codes. .TP .B GD_SCALAR_ENTRIES Count only scalar field types .RB ( CONST ", " CARRAY ", " STRING ). .TP .B GD_VECTOR_ENTRIES Count only vector field types (all field types except the scalar field types listed above). .PP The .I flags argument should be zero or more of the following flags, bitwise or'd together: .TP .B GD_ENTRIES_HIDDEN Include hidden entries (see .BR gd_hidden (3)) in the count: normally hidden entries are skipped; .TP .B GD_ENTRIES_NOALIAS Exclude aliases from the count: normally aliases are considered the same as their target (that is: a field with .I n aliases, plus its canonical name, will be counted .IR n +1 times). .SS Special Cases The call .RS .BI gd_nfields( dirfile ); .RE .PP is equivalent to .RS .BI gd_nentries( dirfile ", NULL, GD_ALL_ENTRIES, 0); .RE .PP The call .RS .BI gd_nfields_by_type( dirfile ", " type ); .RE .PP is equivalent to .RS .BI gd_nentries( dirfile ", NULL, " type ", 0);" .RE .PP The call .RS .BI gd_nmfields( dirfile ", " parent ); .RE .PP is equivalent to .RS .BI gd_nentries( dirfile ", " parent ", GD_ALL_ENTRIES, 0);" .RE .PP The call .RS .BI gd_nmfields_by_type( dirfile ", " parent ", " type ); .RE .PP is equivalent to .RS .BI gd_nentries( dirfile ", " parent ", " type ", 0);" .RE .PP The call .RS .BI gd_nmvectors( dirfile ", " parent ); .RE .PP is equivalent to .RS .BI gd_nentries( dirfile ", " parent ", GD_VECTOR_ENTRIES, 0);" .RE .PP The call .RS .BI gd_nvectors( dirfile ); .RE .PP is equivalent to .RS .BI gd_nentries( dirfile ", NULL, GD_VECTOR_ENTRIES, 0);" .RE .SH RETURN VALUE Upon successful completion, these functions return the number of entries in the database satisfying the supplied criteria. On error, they return zero and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_BAD_CODE The supplied parent field code was not found, or referred to a metafield itself. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_ENTRY The .I type parameter supplied was not one of the symbols listed above. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_entry_list (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_hidden (3) libgetdata-0.9.0/man/gd_mconstants.30000640000175000017500000000643412614323564017515 0ustar alastairalastair.\" gd_mconstants.3. The gd_mconstants man page. .\" .\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_mconstants 3 "17 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_mconstants \(em retrieve a list of constant values from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const void *gd_mconstants(DIRFILE *" dirfile ", const char" .BI * parent ", gd_type_t " return_type ); .hy .ad n .SH DESCRIPTION The .BR gd_mconstants () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of values of the all .B CONST type metafields for the supplied .I parent field after type conversion to the data type specified by .IR return_type . The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order, although it is guaranteed to be in the same order as the list of .B CONST fields returned by .BR gd_mfield_list_by_type (3). The array is unterminated. The number of values in the array can be obtained from a call to .BR gd_nmfields_by_type (3). The caller may not modify any values in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid until .BR gd_mconstants () is called again, or until the array is de-allocated by a call to .BR gd_close (3). A corresponding list of names for these fields may be obtained by calling .BR gd_mfield_list_by_type (3). .SH RETURN VALUE Upon successful completion, .BR gd_mconstants () returns a pointer to an array of values containing the values of all the .B CONST metafields for the supplied parent field. If the parent field has no constant metafields, NULL is returned. On error it returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The supplied parent field code was not found, or referred to a metafield itself. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_TYPE The .I return_type specified was invalid. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_error (3), .BR gd_error_string (3), .BR gd_field_list_by_type (3), .BR gd_nfields_by_type (3), .BR gd_mcarrays (3), .BR gd_open (3) libgetdata-0.9.0/man/gd_constants.30000640000175000017500000000661412614323564017340 0ustar alastairalastair.\" gd_constants.3. The gd_constants man page. .\" .\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_constants 3 "18 August 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_constants \(em retrieve a list of constant values from a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const void *gd_constants(DIRFILE *" dirfile ", gd_type_t .IB return_type ); .hy .ad n .SH DESCRIPTION The .BR gd_constants () function queries a dirfile(5) database specified by .I dirfile and returns a read-only list of values of the all .B CONST type fields defined in the database after type conversion to the data type specified by .IR return_type . Notably, this list does not include /META subfields. For a list of valid symbols to use for .IR return_type , see the .BR gd_get_constant (3) man page. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The array returned will be de-allocated by a call to .BR gd_close (3) and should not be de-allocated by the caller. The list returned should not be assumed to be in any particular order, although it is guaranteed to be in the same order as the list of .B CONST fields returned by .BR gd_field_list_by_type (3). The array is unterminated. The number of values in the array can be obtained from a call to .BR gd_nfields_by_type (3). The caller may not modify any values in the array, or the array itself. Doing so may cause database corruption. The pointer returned is guaranteed to be valid only until .BR gd_constants () is called again with the same arguments, or until the dirfile's metadata is modified (by adding, modifying or deleting an entry), or until the array is de-allocated by a call to .BR gd_close (3). A corresponding list of names for these fields may be obtained by calling .BR gd_field_list_by_type (3). .SH RETURN VALUE Upon successful completion, .BR gd_constants () returns a pointer to an array of values containing the values of all the constants defined in the dirfile database. If no constants are defined in the database, NULL is returned. On error it returns NULL and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_TYPE The .I return_type specified was invalid. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the GetData developers. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_field_list_by_type (3), .BR gd_get_constant (3), .BR gd_nfields_by_type (3) libgetdata-0.9.0/man/gd_metaflush.30000640000175000017500000000550612614323564017313 0ustar alastairalastair.\" gd_metaflush.3. The gd_metaflush man page. .\" .\" Copyright (C) 2008, 2010, 2011, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_metaflush 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_metaflush \(em write modified dirfile metadata to disk .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_metaflush(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_metaflush () function flushes all pending metadata changes in the dirfile specified by .I dirfile to disk. This is accomplished by re-writing the format specification fragments containing modified metadata, overwriting the existing files. Format file fragments which are unchanged are not touched. .PP Metadata is written to disk using the current Standards Version as stored in the .I dirfile object. See .BR gd_dirfile_standards (3) to change or report the current Standards Version. If the dirfile metadata conforms to no known Standards Version, a Standards non-compliant fragment will be written. .PP This function flushes only metadata. To flush the field data as well, call .BR gd_sync (3) instead. .SH RETURN VALUE On success, zero is returned. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The supplied dirfile was opened in read-only mode. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_IO An I/O error occurred while trying to write modified metadata to disk. .TP .B GD_E_LINE_TOO_LONG While attempting to flush modified metadata to disk, a field specification line exceeded the maximum allowed length. On most platforms, the maximum length is at least 2**31 bytes, so this typically indicates something pathological happening. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH BUGS When writing metadata using Standards Version 4 or earlier, the reference field may change, owing to the lack of a .B /REFERENCE directive. A work-around is to upgrade to Standards Version 5 or later. .SH SEE ALSO .BR gd_open (3), .BR gd_close (3), .BR gd_dirfile_standards (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_rewrite_fragment (3), .BR gd_sync (3) libgetdata-0.9.0/man/gd_hidden.30000640000175000017500000000443312614323564016554 0ustar alastairalastair.\" gd_hidden.3. The gd_hidden man page. .\" .\" Copyright (C) 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_hidden 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_hidden \(em retrieve the fragment containing a dirfile field .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_hidden(const DIRFILE *" dirfile ", const char" .BI * entry_name ); .hy .ad n .SH DESCRIPTION The .BR gd_hidden () function queries a dirfile(5) database specified by .I dirfile and indicates whether the field or alias called .IR entry_name is hidden or not. This information is also available in the entry object proved by .BR gd_entry (3). A hidden entry does not appear in the field lists returned by the functions .BR gd_field_list (3), .BR gd_field_list_by_type (3), .BR gd_vectors (3), .BR gd_constants (3), and .BR gd_strings (3). These omissions are also reflected in the counts returned by the corresponding field counting functions .RB ( gd_nfields (3), &c.). .SH RETURN VALUE Upon successful completion, .BR gd_hidden () returns one if the field or alias is hidden, or zero if the entry is not hidden. On error it returns -1 and sets the dirfile error a non-zero error value. (As a result, the caller checking simply whether the return value of this function is non-zero is usually an error.) Possible error values are: .TP 8 .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_entry (3), .BR gd_field_list (3), .BR gd_hide (3), .BR gd_nfields (3), .BR gd_open (3), .BR gd_unhide (3), .BR dirfile (5) libgetdata-0.9.0/man/gd_rename.30000640000175000017500000001105612614323564016567 0ustar alastairalastair.\" gd_rename.3. The gd_rename man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_rename 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_rename \(em change the name of a dirfile field or alias .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_rename(DIRFILE *" dirfile ", const char" .BI * old_code ", const char *" new_name ", unsigned int " flags ); .hy .ad n .SH DESCRIPTION The .BR gd_rename () function changes the name of the field or alias specified by .IR old_code , which should not contain a representation suffix, defined in the dirfile specified by .IR dirfile to .IR new_name . If the new name is the same as the old name, this function does nothing and returns no error. When renaming a metafield, the metafield should be specified in .I old_code by its full (slashed) field code, while .I new_name should only contain the new name (without slash). If .I old_code specifies a top-level field with meta subfields, the subfields will be renamed, too. By default, this function also updates .B ALIAS entries whose target contains .I old_code to point to the new field. Similarly, specifying the .B GD_REN_UPDB flag will cause this function to modify any field entry containing .IR old_code . As a result, this function may cause more than one metadata fragment to be modified. The .I flags parameter should be zero or more of the following flags, bitwise or'd together: .TP .B GD_REN_DANGLE Don't update .B ALIAS entries, instead turning them into dangling aliases. .TP .B GD_REN_DATA if .I old_code specifies a .B RAW field, the binary file associated with the field will be renamed as well. Without this flag, no changes are made to the binary file. In this case, the field's I/O pointer will be reset to the beginning-of-frame. If .I field_code specifies a field of type other than .BR RAW , this flag is ignored. .TP .B GD_REN_FORCE When updating field metadata (either the target of an alias, or else when specified along with .BR GD_REN_UPDB ), skip updating field codes which would be invalid (due to .B /INCLUDE affixes). Without this flag, such invalid field codes causes this function to fail with the error .BR GD_E_BAD_CODE . .TP .B GD_REN_UPDB Rename the field in any other field specifications which use this field as an input (either as a vector input field to a derived field, or else as a scalar field parameter). Without this flag, fields which depend on the old name of this field are left unmodified. .SH RETURN VALUE On success, .BR gd_rename () returns zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I old_code was not found. Or else the resultant metadata update tried to change a field code into something prohibited by a fragment's affixes. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE An attempt was made to rename the immutable .I INDEX field. .TP .B GD_E_DUPLICATE The new name specified is already in use by another entry. .TP .B GD_E_IO An I/O error occurred while attempting to rename the binary file. .TP .B GD_E_PROTECTED The metadata of the format specification fragment containing the renamed entry, or another entry affected by this change, was protected from change, or the binary data of the fragment was protected from change and a binary file move was requested. .TP .B GD_E_UNKNOWN_ENCODING The encoding scheme of the specified field could not be determined or was not understood by GetData. .TP .B GD_E_UNSUPPORTED The encoding scheme of the field does not support binary file renaming. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_metaflush (3), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_error_string.30000640000175000017500000000377412614323564020047 0ustar alastairalastair.\" gd_error_string.3. The gd_error_string man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_error_string 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_error_string \(em report a GetData library error .SH SYNOPSIS .B #include .HP .nh .ad l .BI "char *gd_error_string(const DIRFILE *" dirfile ", char *" buffer ", size_t .IB buflen ); .hy .ad n .SH DESCRIPTION The .BR gd_error_string () function returns a string describing the last dirfile error encountered while operating on .IR dirfile . If .I buffer is not NULL, the string is written to this memory location. At most .I buflen characters will be written. This always includes a terminating null byte, even if the error string was truncated. The numeric dirfile error itself may be obtained by calling .BR gd_error (3). If .I buffer is NULL, .BR gd_error_string () will allocate a string of sufficient length using .BR malloc (3), and .I buflen is ignored. In this case, the caller should deallocate the returned string using .BR free (3) when it is no longer needed. .SH RETURN VALUE If .I buffer is non-NULL, the .BR gd_error_string () function returns .IR buffer , or NULL if buflen is less than one. If .I buffer is NULL, this function returns a newly malloc'd string of sufficient length which should be deallocated by the caller, or NULL, if memory allocation failed. In all cases, the error state of .I dirfile is unchanged. .SH SEE ALSO .BR gd_error (3), .BR gd_error_count (3) libgetdata-0.9.0/man/gd_verbose_prefix.30000640000175000017500000000471212614323564020343 0ustar alastairalastair.\" gd_verbose_prefix.3. The gd_verbose_prefix man page. .\" .\" Copyright (C) 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_verbose_prefix 3 "1 April 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_verbose_prefix \(em set the prefix on error messages printed by GetData .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_verbose_prefix(DIRFILE *" dirfile ", const char *" prefix ); .hy .ad n .SH DESCRIPTION The .BR gd_verbose_prefix () sets the prefix printed before error messages output by the GetData library for the dirfile(5) database specified by .IR dirfile . If .I prefix is NULL, the current prefix (if any) is deleted and no new prefix is saved. GetData only prints error messages for a given Dirfile if opened along with the .B GD_VERBOSE flag, or if the flag has been subsequently set on the dirfile using .BR gd_flags (3). If this flag is not set, this function still updates the prefix, but GetData does not use it. .PP If .B GD_VERBOSE is set, when the library encounters an error, it prints the supplied prefix (if any), followed immediately by the error message (which is the message returned by .BR gd_error_string (3)), followed by a newline. All output goes to the standard error I/O stream .RB ( stderr (3)) of the caller. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_verbose_prefix () returns the zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_flags (3), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR stderr (3). libgetdata-0.9.0/man/gd_alter_protection.30000640000175000017500000000553312614323564020700 0ustar alastairalastair.\" gd_alter_protection.3. The gd_alter_protection man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_alter_protection 3 "1 January 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_alter_protection \(em modify the protection level of a dirfile fragment .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_alter_protection(DIRFILE *" dirfile ", int" .IB protection_level ", int " fragment_index ); .hy .ad n .SH DESCRIPTION The .BR gd_alter_protection () function sets the advisory protection level of the format specification fragment given by .I fragment_index to .I protection_level in the dirfile(5) database specified by .IR dirfile . The .I protection_level argument should be one of the following: .TP .BR GD_PROTECT_NONE Indicating that the fragment should not be protected at all. .TP .B GD_PROTECT_FORMAT Indicating that the fragment's metadata should be protected. .TP .B GD_PROTECT_DATA Indicating that the fragment's binary data should be protected. .TP .B GD_PROTECT_ALL Indicating that both the fragment's metadata and its binary data should be protected. This symbol is equivalent to the bitwise or of .B GD_PROTECT_FORMAT and .BR GD_PROTECT_DATA . .PP In addition to being simply a valid fragment index, .I fragment_index may also be the special value .BR GD_ALL_FRAGMENTS , which indicates that the protection level of all fragments in the database should be changed. .SH RETURN VALUE Upon successful completion, .BR gd_alter_protection () returns zero. On error, it returns -1 and sets the dirfile error to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ARGUMENT The supplied .I protection_level was invalid. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_INDEX The supplied index was out of range. .TP .B GD_E_BAD_PROTECTION The supplied protection level was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH NOTES This is the only GetData function which ignores the (existing) protection level of a format specification fragment. .SH SEE ALSO .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_protection (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_framenum_subset64.30000640000175000017500000000323112614323564020665 0ustar alastairalastair.\" gd_framenum_subset64.3. The gd_framenum_subset64 man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_framenum_subset64 3 "25 May 2012" "Version 0.8.0" "GETDATA" .SH NAME gd_framenum_subset64 \(em perform a reverse look-up on a monotonic dirfile field, with largefile support. .SH SYNOPSIS .B #define GD_64BIT_API .br .B #include .HP .nh .ad l .BI "double gd_framenum_subset64(DIRFILE *" dirfile , .BI "const char *" field_code ", double " value ", gd_off64_t " field_start , .BI "gd_off64_t " field_end ); .hy .ad n .SH DESCRIPTION This version of .BR gd_framenum_subset (3) uses a 64-bit offset type .RB ( gd_off64_t ), where one is available, regardless of the size of .BR off_t . It is only available if one defines .IR GD_64BIT_API or .IR _LARGEFILE64_SOURCE before including getdata.h. If .I off_t is a 64-bit type (possibly because .I _FILE_OFFSET_BITS has been defined to 64), this function will the same as .BR gd_framenum_subset (3). Otherwise, .BR gd_framenum_subset (3) will be a version of this function which uses a 32-bit .IR off_t . .SH SEE ALSO .BR gd_framenum_subset (3), .BR feature_test_macros (7) libgetdata-0.9.0/man/dirfile-encoding.50000640000175000017500000003041512614323564020052 0ustar alastairalastair.\" dirfile-encoding.5. The dirfile-encoding man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2012, 2013, 2014, 2015 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH dirfile-encoding 5 "15 October 2015" "Standards Version 9" "DATA FORMATS" .SH NAME dirfile-encoding \(em dirfile database encoding schemes .SH DESCRIPTION The .I Dirfile Standards indicate that .B RAW fields defined in the database are accompanied by binary files containing the field data in the specified simple data type. In certain situations, it may be advantageous to convert the binary files in the database into a more convenient form. This is accomplished by .I encoding the binary file into the alternate form. A common use-case for encoding a binary file is to compress it to save disk space. Only data is modified by an encoding scheme. Database metadata is never encoded. Support for encoding schemes is optional. An implementation need not support any particular encoding scheme, or may only support certain operations with it, but should expect to encounter unknown encoding schemes and fail gracefully in such situations. Additionally, how a particular encoding is implemented is not specified by the Dirfile Standards, but, for purposes of interoperability, all dirfile implementations are encouraged to support the encoding implementation used by the GetData dirfile reference implementation, elaborated below. An encoding scheme is local to the particular .I format specification fragment in which it is indicated. This allows a single dirfile to have binary files which are stored using multiple encodings, by having them defined in multiple fragments. The rest of this manual page discusses specifics of the encoding framework implemented in the GetData library, and does not constitute part of the Dirfile Standards. .SH THE GETDATA ENCODING FRAMEWORK The GetData library provides an encoding framework which abstracts binary file I/O, allowing for generic support for a wide variety of encoding schemes. Functions which may make use of the encoding framework are: .IP .BR gd_add "(3), " gd_add_raw "(3), " gd_add_spec (3), .BR gd_alter_encoding "(3), " gd_alter_endianness (3), .BR gd_alter_frameoffset "(3), " gd_alter_entry (3), .BR gd_alter_raw "(3), " gd_alter_spec "(3), " gd_flush (3), .BR gd_getdata "(3), " gd_malter_spec "(3), " gd_move (3), .BR gd_nframes "(3), " gd_putdata "(3), " gd_raw_close (3), .BR gd_rename (3), and .BR gd_sync (3). .P Most of the encodings supported by GetData are implemented through external libraries which handle the actual file I/O and data translation. All such libraries are optional; a build of the library which omits an external library will lack support for the associated encoding scheme. In this case, GetData will still properly identify the encoding scheme, but attempts to use GetData for file I/O via the encoding will fail with the .B GD_E_UNSUPPORTED error code. GetData discovers the encoding scheme of a particular RAW field by noting the filename extension of files associated with the field. Binary files which form an unencoded dirfile have no file extension. The file extension used by the other encodings are noted below. Encoding discovery proceeds by searching for files with the known list of file extensions (in an unspecified order) and stopping when the first successful match is made. Because of this, when the a field has multiple data files with different, supported file extensions which could legitimately be associated with it, the encoding scheme discovered by GetData is not well defined. In addition to raw (unencoded) data, GetData supports nine other encoding schemes: .I text encoding, .I bzip2 encoding, .I flac encoding, .I gzip encoding, .I lzma encoding, .I sie (sample-index encoding), .I slim encoding, .I zzip encoding, and .I zzslim encoding, all discussed below. .PP The text encoding and the sample-index encoding are implemented by GetData natively and need no external library. As a result, they are always present in the library. .SS Out-of-place writes Some of the encodings listed below only support writing via out-of-place writes; that is, raw files are written in a temporary location and only moved into place when closed. As a result, writing to these encodings requires making a copy of the whole binary data file. A further side effect of this is that a third-party trying to concurrently read a Dirfile which is being written to using one of these encodings usually doesn't work. Within GetData, reading from a field so encoded after writing to it will cause writing to the temporary file to be finished and then the file moved into place before the read occurs, which may take some time to do. Encodings which perform out-of-place writes are: .IR bzip2 ", " flac ", " gzip ", and " lzma . .SS BZip2 Encoding The BZip2 Encoding reads compressed raw binary files using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding, as implemented in the bzip2 format. GetData's BZip2 Encoding scheme is implemented through the .I bzip2 compression library written by Julian Seward. All operations are supported by the BZip2 Encoding, but writing occurs out-of-place. See the .B Out-of-place writes section above for details. GetData caches an uncompressed megabyte of data at a time to speed access times. A call to .BR gd_nframes (3) requires decompression of the entire binary file to determine its uncompressed size, and may take some time to complete. The file extension of the BZip2 Encoding is .BR .bz2 . .SS FLAC Encoding The FLAC Encoding compresses raw binary files using the Free Lossless Audio Codec. GetData's FLAC Encoding scheme is implemented through the libFLAC reference implementation developed by Josh Coalson and the Xiph.Org Foundation. All operations are supported by the FLAC Encdoing, but writing occurs out-of-place. See the .B Out-of-place writes section above for details. The FLAC format only permits samples up to 32-bits, but the libFLAC reference codec can only handle samples up to 24-bits. GetData gets around this by slicing data that is wider than 16-bits into multiple channels (2, 4, or 8, depending on width). For big-ended data, the most-significant 16-bits are in channel 0, the second 16-bits in channel 1, &c. For little-ended data, this is reversed, with the least significant word in channel 0. The sample rate specified in the FLAC header is ignored and may be any valid value. FLAC files written by GetData use a sample rate of 1 Hz. The file extension of the FLAC Encoding is .BR .flac . The Ogg container format is not supported. .SS GZip Encoding The GZip Encoding compresses raw binary files using Lempel-Ziv coding (LZ77) as implemented in the gzip format. GetData's GZip Encoding scheme is implemented through the .I zlib compression library written by Jean-loup Gailly and Mark Adler. All operations are supported by the GZip Encoding, but writing occurs out-of-place. See the .B Out-of-place writes section above for details. To speed the operation of .BR gd_nframes (3), the GZip Encoding takes the uncompressed size of the file the gzip footer, which contains the file's uncompressed size in bytes, modulo 2**32. As a result, using a field with an (uncompressed) binary file size larger than 4\~GiB as the reference field will result in the wrong number of frames being reported. The file extension of the GZip Encoding is .BR .gz . .SS LZMA Encoding The LZMA Encoding reads compressed raw binary files using the Lempel-Ziv Markov Chain Algorithm (LZMA) as implemented in the xz container format. GetData's LZMA Encoding scheme is implemented through the .IR "lzma library" , part of the .I XZ Utils suite written by Lasse Collin, Ville Koskinen, and Igor Pavlov. All operations are supported by the LZMA Encoding, but writing occurs out-of-place. See the .B Out-of-place writes section above for details. Writing is supported only for the .xz container format, and not for the obsolete .lzma format, which can still be read. GetData caches an uncompressed megabyte of data at a time to speed access times. A call to .BR gd_nframes (3) requires decompression of the entire binary file to determine its uncompressed size, and may take some time to complete. The file extension of the LZMA Encoding is .BR .xz , or .BR .lzma . .SS Sample-Index Encoding The Sample-Index Encoding (SIE) compresses raw binary data by replacing runs of repeated data, similar to run-length encoding. SIE files contain binary records consisting of a 64-bit sample number followed by a datum (the size and format of which is determined by the RAW field's data type in the format metadata). The sample number indicates the last sample of the field which has the specified value. The first sample with the value is the sample immediately following the data in the previous record, or sample number zero, for the first record. Sample numbers are relative to any .B /FRAMEOFFSET specified in the Dirfile metadata. All operations are supported by the Sample-Index Encoding. The file extension of the Sample-Index Encoding is .BR .sie . .SS Slim Encoding The Slim Encoding reads compressed raw binary files using the slimlib compression library written by Joseph Fowler. The slimlib library was developed at Princeton University to compress dirfile-like data. GetData's Slim Encoding framework currently lacks write capabilities; as a result, the Slim Encoding does not support function which modify binary files. The file extension of the Slim Encoding is .BR .slm . Using the Slim Encoding with GetData may result in unexpected, but manageable, memory usage. See the .BR gd_getdata (3) manual page for details. .SS Text Encoding The Text Encoding replaces the binary data files with 7-bit ASCII files containing a decimal text encoding of the data, one sample per line. All operations are supported by the Text Encoding. The file extension of the Text Encoding is .BR .txt . .SS ZZip Encoding The ZZip Encoding reads compressed raw binary files using the DEFLATE algorithm as implemented in the PKWARE ZIP archive container format. GetData's ZZip Encoding scheme is implemented through the .I zzip library written by Tomi Ollila and Guido Draheim. The ZZip Encoding framework currently lacks write capabilities; as a result the ZZip Encoding does not support functions which modify binary data. .PP Unlike most encoding schemes, the ZZip encoding merges all binary data files defined in a given fragment into a single ZIP archive. The name of this archive is .I raw.zip by default, but a different name may be specified using the second parameter to the .B /ENCODING directive. For example, .IP .B /ENCODING zzip archive .PP indicates that the ZIP archive is called .IR archive.zip . The file extension of the ZZip Encoding is .BR .zip . .SS ZZSlim Encoding The ZZSlim Encoding is a convolution of the Slim Encoding and the ZZip Encoding. To create ZZSlim Encoded files, first the raw data are compressed using the slim library, and then these slim-compressed files are archived (and compressed again) into a ZIP archive. As with the ZZip Encoding, the ZIP archive is .I raw.zip by default, but a different name may be specified with the .B /ENCODING directive. .PP Notably, since the archives have the same name as ZZip Encoded data, automatic encoding detection on ZZSlim Encoded data always fails: they are incorrectly identified as simply ZZip Encoded. As a result, an .B /ENCODING directive in the format file or else a .B GD_ZZSLIM_ENCODED flag passed to .BR gd_open (3) is required to read ZZSlim encoded data. The file extension of the ZZSlim Encoding is .BR .zip . Using the ZZSlim Encoding with GetData may result in unexpected, but manageable, memory usage. See the .BR gd_getdata (3) manual page for details. .SH AUTHOR This manual page was written by D. V. Wiebe .nh . .hy 1 .SH SEE ALSO .BR dirfile (5), .BR dirfile\-format (5), .BR bzip2 (1), .BR gzip (1), .BR xz (1), .BR zlib (3). libgetdata-0.9.0/man/gd_dirfilename.30000640000175000017500000000335512614323564017602 0ustar alastairalastair.\" gd_dirfilename.3. The dirfilename man page. .\" .\" Copyright (C) 2008, 2010, 2012 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_dirfilename 3 "1 August 2012" "Version 0.8.1" "GETDATA" .SH NAME gd_dirfilename \(em retrieve the name of a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char *gd_dirfilename(DIRFILE *" dirfile ); .hy .ad n .SH DESCRIPTION The .BR gd_dirfilename () function queries a dirfile(5) database specified by .I dirfile and returns its name. The name of a dirfile is an absolute pathname which refers to the dirfile base directory. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). .SH RETURN VALUE Upon successful completion, .BR gd_dirfilename () returns a pointer to a constant string containing the pathname of the dirfile. On error, .BR gd_dirfilename () returns NULL and sets the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_cbopen (3), .BR path_resolution (7) libgetdata-0.9.0/man/gd_reference.30000640000175000017500000000500212614323564017250 0ustar alastairalastair.\" gd_reference.3. The gd_reference man page. .\" .\" Copyright (C) 2008, 2010 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_reference 3 "20 July 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_reference \(em retrieve or set the reference field for a dirfile .SH SYNOPSIS .B #include .HP .nh .ad l .BI "const char *gd_reference(DIRFILE *" dirfile ", const char" .BI * field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_reference () function sets or retrieves the reference field (see .BR dirfile (5)) associated with the dirfile specified by .IR dirfile . If the .I field_code argument is non-NULL, the reference field for the dirfile will be set to the field specified. If .I field_code is NULL, the reference field is not modified. The field code should refer to a RAW field, and may not contain a representation suffix. .SH RETURN VALUE On success, .BR gd_reference () returns the field code of the dirfile's reference field, which will be .IR field_code , if .I field_code is non-NULL. If no .B RAW fields are defined in the dirfile, this function will return NULL, without raising an error. On error, NULL is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_BAD_FIELD_TYPE The field specified by .I field_code was not a .B RAW field. .TP .B GD_E_PROTECTED The metadata of the primary format specification fragment (the file named .I format in the root dirfile directory) was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_metaflush (3), .BR gd_open (3), .BR gd_error (3), .BR gd_error_string (3), .BR dirfile (5), .BR dirfile-format (5) libgetdata-0.9.0/man/gd_encoding_support.30000640000175000017500000000513112614323564020677 0ustar alastairalastair.\" gd_encoding_support.3. The gd_encoding_support man page. .\" .\" Copyright (C) 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_encoding_support 3 "5 May 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_encoding_support \(em determine GetData library support for data encodings .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_encoding_support(unsigned long " encoding ); .hy .ad n .SH DESCRIPTION The .BR gd_encoding_support () function reports whether the Dirfile encoding specified by .I encoding is supported by the GetData library. The .I encoding argument should be one of the following symbols, indicating the encoding type: .IP .nh .ad l .BR GD_UNENCODED ", " GD_BZIP2_ENCODED ", " GD_GZIP_ENCODED , .BR GD_LZMA_ENCODED ", " GD_SIE_ENCODED ", " GD_SLIM_ENCODED , .BR GD_TEXT_ENCODED ", " GD_ZZIP_ENCODED ", " GD_ZZSLIM_ENCODED . .ad n .hy .PP See .BR gd_cbopen (3) and dirfile-encoding(5) for the meanings of these symbols and details on the known encoding schemes. .SH RETURN VALUE The function .BR gd_encoding_support () returns .B GD_RDWR if the GetData library can read from and write to the specified encoding, .B GD_RDONLY if the GetData library can only read from the specified encoding, or -1 if neither reading nor writing is supported, or if .I encoding was not one of the symbols listed above. .SH NOTES GetData's encoding support framework is more finely grained than the three-way system reported by this function. It is possible for the library to have partial support for reading or writing a particular encoding. This function will only report positive support if .I all functions of a given class (read-only or read-write) are supported. Furthermore, encoding types can have multiple subtypes with different degrees of support. This function reports the support of the .I most supported subtype. For example, the LZMA encoding framework can read both the .lzma and .xz container formats, but only write .xz files. If LZMA support is available, this function will return .B GD_RDWR when passed .BR GD_LZMA_ENCODED . .SH SEE ALSO dirfile-encoding(5), .BR gd_cbopen (3), .BR gd_encoding (3) libgetdata-0.9.0/man/gd_flush.30000640000175000017500000000667612614323564016455 0ustar alastairalastair.\" gd_flush.3. The gd_flush man page. .\" .\" Copyright (C) 2008, 2009, 2010, 2011, 2012, 2014 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_flush 3 "16 October 2014" "Version 0.9.0" "GETDATA" .SH NAME gd_flush gd_raw_close gd_sync \(em write all pending dirfile changes to disk or close open raw fields .SH SYNOPSIS .B #include .HP .nh .ad l .HP .BI "int gd_flush(DIRFILE *" dirfile ", const char *" field_code ); .HP .BI "int gd_raw_close(DIRFILE *" dirfile ", const char *" field_code ); .HP .BI "int gd_sync(DIRFILE *" dirfile ", const char *" field_code ); .hy .ad n .SH DESCRIPTION The .BR gd_sync () function flushes all pending writes to disk of raw data files associated with .IR field_code , or its input(s), in the dirfile specified by .IR dirfile . If the .I field_code contains a valid representation suffix, it will be ignored. As a special case, if .I field_code is NULL, all fields in .I dirfile will be flushed. In this special case, modified metadata will also be flushed to disk as if .BR gd_metaflush (3) had been called. If the dirfile has been opened read-only, this function does nothing. Additionally, some encoding schemes may implement this as a NOP. .PP The .BR gd_raw_close () function closes any raw data files which GetData has opened associated with .IR field_code , or its input(s). Again, if .I field_code is NULL, all open data files are closed. The I/O pointer of any .B RAW field which is closed is reset to the beginning-of-field. .PP Calling .BR gd_flush () is essentially equivalent to calling first .BR gd_sync () and then .BR gd_raw_close () (ie. it does both tasks), although, if .I field_code is NULL, the order of operations if may be different than making the two explicit calls. .SH RETURN VALUE On success, these functions return zero. On error, -1 is returned and the dirfile error is set to a non-zero error value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_IO An I/O error occurred while trying to write modified data or metadata to disk. .TP .B GD_E_LINE_TOO_LONG While attempting to flush modified metadata to disk, a field specification line exceeded the maximum allowed length. On most platforms, the maximum length is at least 2**31 bytes, so this typically indicates something pathological happening. .TP .B GD_E_RECURSE_LEVEL Too many levels of recursion were encountered while trying to resolve .IR field_code . This usually indicates a circular dependency in field specification in the dirfile. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_open (3), .BR gd_close (3), .BR gd_dirfile_standards (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_metaflush (3) libgetdata-0.9.0/man/gd_hide.30000640000175000017500000000477512614323564016243 0ustar alastairalastair.\" gd_hide.3. The gd_hidden man page. .\" .\" Copyright (C) 2012, 2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_hide 3 "10 December 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_hide, gd_unhide \(em hide or unhide a dirfile database entry .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_hide(const DIRFILE *" dirfile ", const char" .BI * entry_name ); .HP .BI "int gd_unhide(const DIRFILE *" dirfile ", const char" .BI * entry_name ); .hy .ad n .SH DESCRIPTION The .BR gd_hide () function hides the field or alias called .IR entry_name in the dirfile(5) database specified by .I dirfile and indicates whether the field or alias called is hidden or not. Similarly, the .BR gd_unhide () function unhides the specified entry. An entry can also be hidden or unhidden using .BR gd_alter_entry (3). A hidden entry does not appear in the field lists returned by the functions .BR gd_field_list (3), .BR gd_field_list_by_type (3), .BR gd_vectors (3), .BR gd_constants (3), and .BR gd_strings (3). These omissions are also reflected in the counts returned by the corresponding field counting functions .RB ( gd_nfields (3), &c.). A hidden field is otherwise no different than an unhidden field. .SH RETURN VALUE Upon successful completion, .BR gd_hide () and .BR gd_unhide () return zero. On error they returns -1 and sets the dirfile error a non-zero error value. Possible error values are: .TP 8 .B GD_E_ACCMODE The specified dirfile was opened read-only. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE The supplied dirfile was invalid. .TP .B GD_E_PROTECTED The metadata of the affected format specification fragments was protected from change. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR gd_alter_entry (3), .BR gd_field_list (3), .BR gd_hidden (3), .BR gd_nfields (3), .BR gd_open (3), .BR dirfile (5) libgetdata-0.9.0/man/gd_get_carray_slice.30000640000175000017500000001235512614323564020622 0ustar alastairalastair.\" gd_get_carray_slice.3. The gd_get_carray_slice man page. .\" .\" Copyright (C) 2010-2013 D. V. Wiebe .\" .\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .\" .\" This file is part of the GetData project. .\" .\" Permission is granted to copy, distribute and/or modify this document .\" under the terms of the GNU Free Documentation License, Version 1.2 or .\" any later version published by the Free Software Foundation; with no .\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" .TH gd_get_carray_slice 3 "1 October 2013" "Version 0.9.0" "GETDATA" .SH NAME gd_get_carray, gd_get_carray_slice, gd_get_constant \(em retrieve CONST or CARRAY data from a dirfile database .SH SYNOPSIS .B #include .HP .nh .ad l .BI "int gd_get_carray_slice(DIRFILE *" dirfile ", const char *" field_code , .BI "unsigned int " start ", size_t " len ", gd_type_t " return_type , .BI "void *" data_out ); .HP .BI "int gd_get_carray(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " return_type ", void *" data_out ); .HP .BI "int gd_get_constant(DIRFILE *" dirfile ", const char *" field_code , .BI "gd_type_t " return_type ", void *" data_out ); .hy .ad n .SH DESCRIPTION The .BR gd_get_carray_slice () function queries a dirfile(5) database specified by .I dirfile for the .B CONST or .B CARRAY scalar array .IR field_code , which may contain a representation suffix. The data in the field is converted to the data type specified by .IR return_type , and stored in the user-supplied buffer .IR data_out . The first element of the field stored is given by .IR start , and the number of elements stored is given by .IR len . The .BR gd_get_carray () function behaves similarly, except it returns the entire field, as if .BR gd_get_carray_slice () were called with .I start equal to zero and .I len equal to the value returned by .BR gd_carray_len (3). The .BR gd_get_constant () function is equivalent to calling .BR gd_get_carray_slice () with .I start equal to zero and .I len equal to one. The .I dirfile argument must point to a valid DIRFILE object previously created by a call to .BR gd_open (3). The argument .I data_out must point to a valid memory location of sufficient size to hold all the requested data of the return type specified. The number of elements returned by .BR gd_get_carray () may be obtained by calling .BR gd_carray_len (3). Unlike .BR gd_getdata (3), calling .BR gd_get_carray_slice () never results in a short read; attempting to read past the end of the field will result in an error, and no data will be returned. The .I return_type argument should be one of the following symbols, which indicates the desired return type of the data: .RS .TP 11 .B GD_UINT8 unsigned 8-bit integer .TP .B GD_INT8 signed (two's complement) 8-bit integer .TP .B GD_UINT16 unsigned 16-bit integer .TP .B GD_INT16 signed (two's complement) 16-bit integer .TP .B GD_UINT32 unsigned 32-bit integer .TP .B GD_INT32 signed (two's complement) 32-bit integer .TP .B GD_UINT64 unsigned 64-bit integer .TP .B GD_INT64 signed (two's complement) 64-bit integer .TP .B GD_FLOAT32 IEEE-754 standard 32-bit single precision floating point number .TP .B GD_FLOAT64 IEEE-754 standard 64-bit double precision floating point number .TP .B GD_COMPLEX64 C99-conformant 64-bit single precision complex number .TP .B GD_COMPLEX128 C99-conformant 128-bit double precision complex number .TP .B GD_NULL the null type: the database is queried as usual, but no data is returned. In this case, .I data_out is ignored and may be NULL. .RE The return type of the field need not be the same as the type of the data stored in the database. Type conversion will be performed as necessary to return the requested type. If the .I field_code does not indicate a representation, but conversion from a complex value to a purely real one is required, only the real portion of the requested vector will be returned. .SH RETURN VALUE On success, .BR gd_get_carray (), .BR gd_get_carray_slice (), and .BR gd_get_constant () return zero. On error, they return -1 and set the dirfile error to a non-zero value. Possible error values are: .TP 8 .B GD_E_ALLOC The library was unable to allocate memory. .TP .B GD_E_BAD_CODE The field specified by .I field_code was not found in the database. .TP .B GD_E_BAD_DIRFILE An invalid .I dirfile was supplied. .TP .B GD_E_BAD_FIELD_TYPE The supplied .I field_code was not a .BR CONST nor .BR CARRAY . The caller should use .BR gd_getdata (3) or .BR gd_get_string (3) instead. .TP .B GD_E_BAD_TYPE An invalid .I return_type was specified. .TP .B GD_E_BOUNDS A request for data beyond the end of the field was made. .TP .B GD_E_INTERNAL_ERROR An internal error occurred in the library while trying to perform the task. This indicates a bug in the library. Please report the incident to the maintainer. .PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered may be obtained from a call to .BR gd_error_string (3). .SH SEE ALSO .BR dirfile (5), .BR gd_carray_len (3), .BR gd_carrays (3), .BR gd_error (3), .BR gd_error_string (3), .BR gd_get_constant (3), .BR gd_open (3), .BR gd_put_carray_slice (3) libgetdata-0.9.0/INSTALL0000640000175000017500000002254712614323564015047 0ustar alastairalastairInstallation 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'. To create the configure script, and the rest of the build environment which are not part of a plain checkout from sourceforge, execute: autoreconf -vifs 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.